A vim / nvim plugin that intelligently reopens files at your last edit position.
A vim / nvim plugin that intelligently reopens files at your last edit position.
You can install vim-lastplace as a vim plugin without any additional tools when using vim 8 or newer.
mkdir -p ~/.vim/pack/plugins/start
rm -rf ~/.vim/pack/plugins/start/vim-lastplace
git clone --depth=1 https://github.com/farmergreg/vim-lastplace.git ~/.vim/pack/plugins/start/vim-lastplace
You can also install vim-lastplace and use it with neovim:
mkdir -p ~/.local/share/nvim/site/pack/plugins/start
rm -rf ~/.local/share/nvim/site/pack/plugins/start/vim-lastplace
git clone --depth=1 https://github.com/farmergreg/vim-lastplace.git ~/.local/share/nvim/site/pack/plugins/start/vim-lastplace
You can configure what file types to ignore by setting g:lastplace_ignore in your vimrc. This is a comma separated list. By default it is set to:
let g:lastplace_ignore = "gitcommit,gitrebase,hgcommit,svn,xxd"
You can configure buffer types to ignore by setting g:lastplace_ignore_buftype in your vimrc. This is a comma separated list. By default it is set to:
let g:lastplace_ignore_buftype = "help,nofile,quickfix"
Closed folds are automatically opened when jumping to the last edit position. If you do not like this behavior you can disable it by placing this in your vimrc:
let g:lastplace_open_folds = 0
Depending on which vim package you're using, vim may be preconfigured with last-edit-position logic that doesn't work as well as vim-lastplace.
If so, you may want to disable that in favor of vim-lastplace.
For example, for Vim as packaged with Git for Windows, you can edit C:\Program Files\Git\etc\vimrc
and comment out the "Remember positions in files" autocmd BufReadPost *
block.
This plugin is complete and stable. Please do not be afraid to try it even if there is very little recent activity in this repository. If you do find a bug, please submit a pull request that fixes whatever problem you're having.
vim-lastplace uses semver to manage version numbers.
Get the latest version, submit pull requests, and file bug reports on GitHub:
If you like this plugin, please star and rate it on these sites: