aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile16
l---------[-rw-r--r--]vim/init.vim38
-rw-r--r--vim/vimrc37
3 files changed, 46 insertions, 45 deletions
diff --git a/Makefile b/Makefile
index 3736fd0..efd290e 100644
--- a/Makefile
+++ b/Makefile
@@ -18,9 +18,9 @@ tig:
18 ln -sf `pwd`/tigrc ~/.tigrc 18 ln -sf `pwd`/tigrc ~/.tigrc
19 19
20vim: 20vim:
21 ln -sf `pwd`/vim/init.vim ~/.vimrc 21 ln -sfT `pwd`/vim ~/.config/num
22 sudo ln -sf `pwd`/vim/init.vim /usr/local/share/vim/vimrc 22 ln -sfT `pwd`/vim ~/.config/nvim
23 ln -sf `pwd`/vim ~/.config/nvim 23 sudo ln -sfT `pwd`/vim /usr/local/share/vim
24 # vim-plug 24 # vim-plug
25 # curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 25 # curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
26 26
@@ -34,15 +34,15 @@ zsh:
34 ln -sf `pwd`/zsh/zshrc ~/.config/zsh/.zshrc 34 ln -sf `pwd`/zsh/zshrc ~/.config/zsh/.zshrc
35 35
36fzf: 36fzf:
37 if [ ! -d "$(HOME)/.fzf" ]; then 37 if [ ! -d "$(HOME)/.fzf" ]; then
38 git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf; 38 git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf;
39 ~/.fzf/install; 39 ~/.fzf/install;
40 fi 40 fi
41 41
42log: 42log:
43 # vimwiki 43 # vimwiki
44 if [ ! -d "$(HOME)/.vimwiki" ]; then 44 if [ ! -d "$(HOME)/.vimwiki" ]; then
45 git clone vps:~/log ~/log; 45 git clone vps:~/log ~/log;
46 fi 46 fi
47 47
48pass: 48pass:
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
2if get(s:, 'loaded', 0) != 0
3 finish
4else
5 let s:loaded = 1
6endif
7
8" Get current dir
9" let s:home = fnamemodify(resolve(expand('<sfile>:p')), ':h')
10let s:home = '~/helper/vim'
11
12" Add current dir into runtimepath
13execute 'set runtimepath+='.s:home
14
15" Load scripts in home
16command! -nargs=1 LoadScript exec 'source '.s:home.'/'.'<args>'
17
18if $fullrc == 'false'
19 finish
20endif
21
22" Gerneral scripts
23LoadScript init/basic.vim " Basic configuration
24LoadScript init/keymaps.vim " Key mappings
25LoadScript init/config.vim " Extra config for different contexts
26
27" Different scripts for nvim and vim
28if has('nvim')
29 LoadScript mini.lua
30else
31 LoadScript init/plugins.vim
32 LoadScript init/style.vim
33endif
34
35LoadScript init/highlight.vim
36
37silent! 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
2if get(s:, 'loaded', 0) != 0
3 finish
4else
5 let s:loaded = 1
6endif
7
8" Get current dir
9" let s:home = fnamemodify(resolve(expand('<sfile>:p')), ':h')
10let s:home = '~/helper/vim'
11
12" Add current dir into runtimepath
13execute 'set runtimepath+='.s:home
14
15" Load scripts in home
16command! -nargs=1 LoadScript exec 'source '.s:home.'/'.'<args>'
17
18" Gerneral scripts
19LoadScript init/basic.vim " Basic configuration
20LoadScript init/keymaps.vim " Key mappings
21LoadScript init/config.vim " Extra config for different contexts
22
23if $fullrc == 'false'
24 finish
25endif
26
27" Different scripts for nvim and vim
28if has('nvim')
29 LoadScript mini.lua
30else
31 LoadScript init/plugins.vim
32 LoadScript init/style.vim
33endif
34
35LoadScript init/highlight.vim
36
37silent! source ~/.projects.vim