From: AJ ONeal Date: Mon, 15 Mar 2021 19:41:36 +0000 (+0000) Subject: add vim-lastplace X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=541bf110df267071ca3faa41daef5e855c35d160;p=webi-installers%2F.git add vim-lastplace --- diff --git a/vim-lastplace/README.md b/vim-lastplace/README.md new file mode 100644 index 0000000..192f58c --- /dev/null +++ b/vim-lastplace/README.md @@ -0,0 +1,28 @@ +--- +title: vim-lastplace +homepage: https://github.com/farmergreg/vim-lastplace +tagline: | + vim-lastplace - Intelligently reopen files at your last edit position in Vim. +--- + +To update (replacing the current version) run `webi vim-lastplace`. + +## Cheat Sheet + +> `vim-lastplace` will resume your cursor to its last position when you re-open +> a file, including re-opening folds as needed. + +Simply put: installing this plugin will cause your cursor to be put back where +you expect it when switching between files. + +### How to remove lastplace + +```vim +rm -rf ~/.vim/pack/plugins/start/vim-lastplace +``` + +### How to configure manually + +See + +and diff --git a/vim-lastplace/install.ps1 b/vim-lastplace/install.ps1 new file mode 100644 index 0000000..749d400 --- /dev/null +++ b/vim-lastplace/install.ps1 @@ -0,0 +1,6 @@ +#!/usr/bin/env pwsh + +New-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start" -ItemType Directory -Force + +Remove-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start\vim-lastplace" -Recurse -ErrorAction Ignore +& git clone --depth=1 https://github.com/farmergreg/vim-lastplace.git "$Env:USERPROFILE\.vim\pack\plugins\start\vim-lastplace" diff --git a/vim-lastplace/install.sh b/vim-lastplace/install.sh new file mode 100644 index 0000000..fa9e82c --- /dev/null +++ b/vim-lastplace/install.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +function __init_vim_lastplace() { + set -e + set -u + + mkdir -p "$HOME/.vim/pack/plugins/start" + rm -rf "$HOME/.vim/pack/plugins/start/vim-lastplace" + git clone --depth=1 https://github.com/farmergreg/vim-lastplace.git "$HOME/.vim/pack/plugins/start/vim-lastplace" + + if [ ! -f "$HOME/.vimrc" ]; then + touch "$HOME/.vimrc" + fi + + mkdir -p ~/.vim/plugins + if ! [ -f "$HOME/.vim/plugins/lastplace.vim" ]; then + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL -o ~/.vim/plugins/lastplace.vim "$WEBI_HOST/packages/vim-lastplace/lastplace.vim" + fi + + if ! grep 'source.*plugins.lastplace.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then + set +e + mkdir -p ~/.vim/plugins + printf '\n" lastplace: explicit defaults from webinstall.dev/vim-lastplace\n' >> ~/.vimrc + printf 'source ~/.vim/plugins/lastplace.vim\n' >> ~/.vimrc + set -e + echo "" + echo "add ~/.vim/plugins/lastplace.vim" + echo "updated ~/.vimrc with 'source ~/.vim/plugins/lastplace.vim'" + fi + + echo "" + echo "vim-lastplace enabled with explicit defaults" +} + +__init_vim_lastplace diff --git a/vim-lastplace/lastplace.vim b/vim-lastplace/lastplace.vim new file mode 100644 index 0000000..49888bf --- /dev/null +++ b/vim-lastplace/lastplace.vim @@ -0,0 +1,11 @@ +" For more configuration details read the source at +" https://github.com/farmergreg/vim-lastplace/blob/master/plugin/vim-lastplace.vim + +" configure what file types to ignore +let g:lastplace_ignore = "gitcommit,gitrebase,svn,hgcommit" + +" configure buffer types to ignore +let g:lastplace_ignore_buftype = "quickfix,nofile,help" + +" automatically open folds when jumping to the last edit position +let g:lastplace_open_folds = 0