-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathellipsis.sh
79 lines (57 loc) · 2.18 KB
/
ellipsis.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
##############################################################################
# Minimal ellipsis version
ELLIPSIS_VERSION_DEP='1.9.0'
# Package dependencies (informational/not used!)
ELLIPSIS_PKG_DEPS=''
##############################################################################
pkg.install() {
# Create vim folders
mkdir -p "$PKG_PATH"/{undo,swap,spell,autoload,plugged}
# Install vim-plug
curl -fLo "$PKG_PATH/autoload/plug.vim" https://raw.github.com/junegunn/vim-plug/master/plug.vim
# Run vim and install plugins
PKG_PATH="$PKG_PATH"\
vim +PlugInstall +qall -u "$PKG_PATH/install.vim"
}
##############################################################################
pkg.link() {
# Link vimrc
fs.link_file vimrc
# Link package into ~/.config/vim
mkdir -p "$ELLIPSIS_HOME/.config"
fs.link_file "$PKG_PATH" "$ELLIPSIS_HOME/.config/vim"
fs.link_file "$PKG_PATH" "$ELLIPSIS_HOME/.config/nvim"
}
##############################################################################
pkg.links() {
local files="$ELLIPSIS_HOME/.config/vim $ELLIPSIS_HOME/.config/nvim $ELLIPSIS_HOME/.vimrc"
msg.bold "${1:-$PKG_NAME}"
for file in $files; do
local link="$(readlink "$file")"
echo "$(path.relative_to_packages "$link") -> $(path.relative_to_home "$file")";
done
}
##############################################################################
pkg.pull() {
# Update dot-vim repo
git.pull
# Update plugins (clean than install and update)
PKG_PATH="$PKG_PATH"\
vim +PlugUpgrade +PlugClean! +PlugInstall! +PlugUpdate! +qall -u "$PKG_PATH/install.vim"
# Upgrade Coc packages
PKG_PATH="$PKG_PATH"\
vim +CocUpdate! +qall -u "$PKG_PATH/install.vim"
}
##############################################################################
pkg.unlink() {
# Remove config dir
rm "$ELLIPSIS_HOME/.config/vim"
rm "$ELLIPSIS_HOME/.config/nvim"
# Remove all links in the home folder
hooks.unlink
}
##############################################################################
pkg.uninstall() {
: # No action
}
##############################################################################