加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Vim从最后一次关闭的光标开始

发布时间:2020-12-15 22:12:04 所属栏目:安全 来源:网络整理
导读:当我上次退出给定文件时,如何使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
当我上次退出给定文件时,如何使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在运行时停用该功能.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读