Vim 从上次关闭的光标开始

标签 vim cursor position

关闭。这个问题是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/

相关文章:

html - 强制一组动态链接保持不动?

vim - 如何在 VIM 中设置初始大写?

plsql - PL/SQL 在游标中引用另一个游标?

linux - 使用 BASH 脚本组合两行

angular - 在 Angular 中通过 ng-select 从下拉列表中选择一个选项后如何删除闪烁的光标?

mysql - 存储过程中的嵌套游标

jquery - 如何使用jquery根据其他div应用顶部和左侧位置

java - 设置位图的旋转和位置

vim - 打字时如何计算字符数?

Vim:显示 Vim 脚本的错误消息