关闭。这个问题是off-topic .它目前不接受答案。
想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。
9年前关闭。
Improve this question
我如何让 Vim 总是从我上次退出给定文件时所在的行开始?
最佳答案
把它放在你的 .vimrc 中:
" When editing a file, always jump to the last cursor position
au BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif
那么你可以使用
:let g:leave_my_cursor_position_alone=1
在运行时停用该功能。
关于Vim 从上次关闭的光标开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3699904/