-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstall_vim_plugins
executable file
·89 lines (78 loc) · 2.69 KB
/
install_vim_plugins
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#! /bin/sh
die() {
echo $@
exit 1
}
which git > /dev/null || die "It requires git"
which yarn > /dev/null || die "Coc plugin requires yarn"
if [ ! -d ~/.vim/pack/git-plugins/start ]; then
mkdir -p ~/.vim/pack/git-plugins/start
fi
cd ~/.vim/pack/git-plugins/start
for repo in \
https://github.com/rafi/awesome-vim-colorschemes \
https://github.com/neoclide/coc.nvim \
https://github.com/sheerun/vim-polyglot \
https://github.com/dense-analysis/ale \
https://github.com/mattn/emmet-vim \
https://github.com/preservim/nerdcommenter \
https://github.com/ctrlpvim/ctrlp.vim \
https://github.com/vim-airline/vim-airline-themes \
https://github.com/vim-airline/vim-airline \
https://github.com/ryanoasis/vim-devicons \
https://github.com/preservim/nerdtree \
https://github.com/Yggdroot/indentLine \
https://github.com/tomasiser/vim-code-dark \
https://github.com/mhinz/vim-startify \
https://github.com/fatih/vim-go
do
reponame=$(basename $repo)
if [ -d $reponame ]; then
echo "Repository $repo already exists. Just updating."
cd $reponame
git pull -f
cd -
else
git clone $repo
fi
done
cd ~/.vim/pack/git-plugins/start/coc.nvim
yarn install --frozen-lockfile
cd ~/.vim
if [ ! -f vimrc ]; then
curl -O https://raw.githubusercontent.com/fberbert/vimrc/master/vimrc
sed -i "33 s/2/4/g;s/coc.nvimrc/coc.vimrc/" vimrc
sed -i "/^colo / s/materialbox/space-vim-dark/" vimrc
fi
if [ ! -f coc.vimrc ]; then
curl -O https://raw.githubusercontent.com/fberbert/vimrc/master/coc.vimrc
fi
if [ ! -f coc-settings.json ]; then
curl -O https://raw.githubusercontent.com/fberbert/vimrc/master/coc-settings.json
fi
cat <<EOF > coc_vimrc.patch
--- coc.vimrc.orig 2022-01-11 09:40:01.852404205 +0100
+++ coc.vimrc 2022-04-01 18:32:31.941971935 +0200
@@ -27,11 +27,17 @@
" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
+"inoremap <silent><expr> <TAB>
+" pumvisible() ? "<C-n>" :
+" <SID>check_back_space() ? "<TAB>" :
+" coc#refresh()
+"inoremap <expr><S-TAB> pumvisible() ? "<C-p>" : "<C-h>"
+
inoremap <silent><expr> <TAB>
- pumvisible() ? "<C-n>" :
- <SID>check_back_space() ? "<TAB>" :
- coc#refresh()
-inoremap <expr><S-TAB> pumvisible() ? "<C-p>" : "<C-h>"
+ \ pumvisible() ? "\<C-n>" :
+ \ <SID>check_back_space() ? "\<TAB>" :
+ \ coc#refresh()
+inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
EOF
patch -p0 < coc_vimrc.patch