3 function __init_vim_lastplace() {
7 mkdir -p "$HOME/.vim/pack/plugins/start"
8 rm -rf "$HOME/.vim/pack/plugins/start/vim-lastplace"
9 git clone --depth=1 https://github.com/farmergreg/vim-lastplace.git "$HOME/.vim/pack/plugins/start/vim-lastplace"
11 if [ ! -f "$HOME/.vimrc" ]; then
15 mkdir -p ~/.vim/plugins
16 if ! [ -f "$HOME/.vim/plugins/lastplace.vim" ]; then
17 WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"}
18 curl -fsSL -o ~/.vim/plugins/lastplace.vim "$WEBI_HOST/packages/vim-lastplace/lastplace.vim"
21 if ! grep 'source.*plugins.lastplace.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then
23 mkdir -p ~/.vim/plugins
24 printf '\n" lastplace: explicit defaults from webinstall.dev/vim-lastplace\n' >> ~/.vimrc
25 printf 'source ~/.vim/plugins/lastplace.vim\n' >> ~/.vimrc
28 echo "add ~/.vim/plugins/lastplace.vim"
29 echo "updated ~/.vimrc with 'source ~/.vim/plugins/lastplace.vim'"
33 echo "vim-lastplace enabled with explicit defaults"