diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-11-14 15:40:53 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-11-14 15:40:53 +0800 |
| commit | effe141a61e1b48adf0b4472a58f716f97a32b7b (patch) | |
| tree | cd2edde21c96613496c9c63270298e80e5ace28c /vim | |
| parent | b22c7def1e38b8dc9c1f619329567c45a72e052a (diff) | |
Update
Diffstat (limited to 'vim')
| l---------[-rw-r--r--] | vim/init.vim | 38 | ||||
| -rw-r--r-- | vim/vimrc | 37 |
2 files changed, 38 insertions, 37 deletions
diff --git a/vim/init.vim b/vim/init.vim index aed0c41..c9a3c9c 100644..120000 --- a/vim/init.vim +++ b/vim/init.vim | |||
| @@ -1,37 +1 @@ | |||
| 1 | " Avoid load this script twice | vimrc \ No newline at end of file | |
| 2 | if get(s:, 'loaded', 0) != 0 | ||
| 3 | finish | ||
| 4 | else | ||
| 5 | let s:loaded = 1 | ||
| 6 | endif | ||
| 7 | |||
| 8 | " Get current dir | ||
| 9 | " let s:home = fnamemodify(resolve(expand('<sfile>:p')), ':h') | ||
| 10 | let s:home = '~/helper/vim' | ||
| 11 | |||
| 12 | " Add current dir into runtimepath | ||
| 13 | execute 'set runtimepath+='.s:home | ||
| 14 | |||
| 15 | " Load scripts in home | ||
| 16 | command! -nargs=1 LoadScript exec 'source '.s:home.'/'.'<args>' | ||
| 17 | |||
| 18 | if $fullrc == 'false' | ||
| 19 | finish | ||
| 20 | endif | ||
| 21 | |||
| 22 | " Gerneral scripts | ||
| 23 | LoadScript init/basic.vim " Basic configuration | ||
| 24 | LoadScript init/keymaps.vim " Key mappings | ||
| 25 | LoadScript init/config.vim " Extra config for different contexts | ||
| 26 | |||
| 27 | " Different scripts for nvim and vim | ||
| 28 | if has('nvim') | ||
| 29 | LoadScript mini.lua | ||
| 30 | else | ||
| 31 | LoadScript init/plugins.vim | ||
| 32 | LoadScript init/style.vim | ||
| 33 | endif | ||
| 34 | |||
| 35 | LoadScript init/highlight.vim | ||
| 36 | |||
| 37 | silent! source ~/.projects.vim | ||
diff --git a/vim/vimrc b/vim/vimrc new file mode 100644 index 0000000..7a76ec6 --- /dev/null +++ b/vim/vimrc | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | " Avoid load this script twice | ||
| 2 | if get(s:, 'loaded', 0) != 0 | ||
| 3 | finish | ||
| 4 | else | ||
| 5 | let s:loaded = 1 | ||
| 6 | endif | ||
| 7 | |||
| 8 | " Get current dir | ||
| 9 | " let s:home = fnamemodify(resolve(expand('<sfile>:p')), ':h') | ||
| 10 | let s:home = '~/helper/vim' | ||
| 11 | |||
| 12 | " Add current dir into runtimepath | ||
| 13 | execute 'set runtimepath+='.s:home | ||
| 14 | |||
| 15 | " Load scripts in home | ||
| 16 | command! -nargs=1 LoadScript exec 'source '.s:home.'/'.'<args>' | ||
| 17 | |||
| 18 | " Gerneral scripts | ||
| 19 | LoadScript init/basic.vim " Basic configuration | ||
| 20 | LoadScript init/keymaps.vim " Key mappings | ||
| 21 | LoadScript init/config.vim " Extra config for different contexts | ||
| 22 | |||
| 23 | if $fullrc == 'false' | ||
| 24 | finish | ||
| 25 | endif | ||
| 26 | |||
| 27 | " Different scripts for nvim and vim | ||
| 28 | if has('nvim') | ||
| 29 | LoadScript mini.lua | ||
| 30 | else | ||
| 31 | LoadScript init/plugins.vim | ||
| 32 | LoadScript init/style.vim | ||
| 33 | endif | ||
| 34 | |||
| 35 | LoadScript init/highlight.vim | ||
| 36 | |||
| 37 | silent! source ~/.projects.vim | ||