-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·100 lines (79 loc) · 2.49 KB
/
update.sh
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
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/env bash
set -euo pipefail
function retry() {
"$@"
if test $? -ne 0 ; then
sleep 1
"$@"
fi
if test $? -ne 0 ; then
sleep 1
"$@"
fi
}
function git-plugin() {
local src=$1
local dst=$2
local branch="$3"
if [ -n "$branch" ] ; then
local branch="--branch $branch"
fi
if test ! -d "$dst" ; then
mkdir -p "$dst"
retry git clone $branch "$src" "$dst" > /dev/null 2> /dev/null && \
echo "installed ($?) $src ($3)" || \
echo "install failed ($?) $1"
else
retry git -C "$dst" pull > /dev/null 2> /dev/null && \
echo "updated ($?) $1" || \
echo "update failed ($?) $1"
fi
}
function plugin() {
local type=$1
local dst; dst="$PREFIX/plugins/$type/$(cut -d/ -f 2 <(echo "$2"))"
local src="https://www.github.com/$2"
git-plugin "$src" "$dst" "${3:-}" &
}
readonly PREFIX="$HOME/.usr"
# zsh plugins -----------------------------------------------------------------
plugin zsh zsh-users/zsh-syntax-highlighting
plugin zsh zsh-users/zsh-completions
# tmux plugins ----------------------------------------------------------------
plugin tmux tmux-plugins/tmux-yank
# gdb plugins -----------------------------------------------------------------
plugin gdb hq6/GdbShellPipe
# vim plugins -----------------------------------------------------------------
### file and buffer access
plugin vim scrooloose/nerdtree
plugin vim ctrlpvim/ctrlp.vim
plugin vim christoomey/vim-tmux-navigator
### programming languages
plugin vim neoclide/coc.nvim release
plugin vim majutsushi/tagbar
plugin vim tpope/vim-endwise # automatically close code blocks in ruby
plugin vim github/copilot.vim
plugin vim nvim-lua/plenary.nvim
plugin vim CopilotC-Nvim/CopilotChat.nvim canary
### editing
plugin vim Raimondi/delimitMate # Automatic closing of quotes, parentheses, ...
plugin vim tpope/vim-surround
plugin vim tpope/vim-repeat
plugin vim tomtom/tcomment_vim
plugin vim vim-utils/vim-husk # Historic key bindings in command line
plugin vim henrik/vim-indexed-search # shows the number of search matches
plugin vim SirVer/ultisnips # snippets
# Wait for background processes -----------------------------------------------
for job in $(jobs -p) ; do
wait "$job"
done
# Install Node modules
if command -v npm > /dev/null 2> /dev/null ; then
npm install -g neovim
npm update -g neovim
fi
# Initialize Vim helptags -----------------------------------------------------
if command -v vim > /dev/null 2> /dev/null ; then
vim +CocUpdate
vim "+helptags ALL" +qall
fi