check if a file exist to determine if full_feature

This commit is contained in:
leafee98 2023-05-23 10:49:39 +08:00
parent 80b82caf95
commit 12b66a5eda
3 changed files with 14 additions and 1 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
/lazy-lock.json
/_full_feature

View file

@ -9,3 +9,11 @@ Just clone this repository into directory `~/.config/nvim/` and start neovim. [l
```
git clone <url of this repo> ~/.config/nvim
```
By default, this config will only include a few plugins, which suit for mataining other than editing frequently.
If you want to use the full feature this config provided, create a file named `_full_feature` under the root of this repo (usually `~/.config/nvim`.
```
touch ~/.config/nvim/_full_feature
```

View file

@ -24,7 +24,11 @@ vim.keymap.set("n", "<F3>", "<cmd>bdelete<CR>", { silent = true })
vim.g.mapleader = " "
vim.g.maplocalleader = " "
full_feature = false
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
full_feature = file_exists(vim.fn.stdpath("config") .. "/_full_feature")
-- Use lazy.nvim as plugin manager, and load plugin's config
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"