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

在vim中,我如何得到一个文件打开在相同的行号我上次关闭它?

发布时间:2020-12-15 16:49:11 所属栏目:安全 来源:网络整理
导读:我想配置vim打开一个文件在我离开的同一个地方。 从Ubuntu的/ etc / vim / vimrc文件,这个示例被注释掉: " Uncomment the following to have Vim jump to the last position when " reopening a fileif has("autocmd") au BufReadPost * if line("'"") 0
我想配置vim打开一个文件在我离开的同一个地方。
从Ubuntu的/ etc / vim / vimrc文件,这个示例被注释掉:
" Uncomment the following to have Vim jump to the last position when                                                       
" reopening a file
if has("autocmd")
  au BufReadPost * if line("'"") > 0 && line("'"") <= line("$")
    | exe "normal! g'"" | endif
endif

如果这不工作,一个常见的问题是没有您的?/ .viminfo文件的所有权。如果是这种情况,则运行:

sudo chown user:group ~/.viminfo

其中user是您的用户名,组通常与您的用户名相同。

(编辑:李大同)

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

    推荐文章
      热点阅读