mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-02-14 17:49:53 +00:00
add vim-lastplace
This commit is contained in:
28
vim-lastplace/README.md
Normal file
28
vim-lastplace/README.md
Normal file
@@ -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
|
||||
<https://vim.fandom.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session>
|
||||
and <https://github.com/farmergreg/vim-lastplace>
|
||||
6
vim-lastplace/install.ps1
Normal file
6
vim-lastplace/install.ps1
Normal file
@@ -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"
|
||||
36
vim-lastplace/install.sh
Normal file
36
vim-lastplace/install.sh
Normal file
@@ -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
|
||||
11
vim-lastplace/lastplace.vim
Normal file
11
vim-lastplace/lastplace.vim
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user