Intelligently reopen files at your last edit position. By default git, svn, and mercurial commit messages are ignored because you probably want to type a new message and not re-edit the previous one.
Advantages over the snippets that can be found around the net include:
You can use pathogen.vim or other plugin managers to install and use vim-lastplace.
cd ~/.vim/bundle
git clone git://github.com/farmergreg/vim-lastplace.git
Depending on which Vim package you're using, Vim may be preconfigured with
last-edit-position logic that doesn't work quite 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.
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,svn,hgcommit"
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 = "quickfix,nofile,help"
Folds are automatically opened when jumping to the last edit position. If you do not like this behavior you can disable it by putting this in your vimrc:
let g:lastplace_open_folds = 0
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:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。