linux - CentOS 7's vim can' 无法打开帮助(以 root 身份运行时),因为它无法处理 gzip 压缩的帮助文件

标签 linux vim

我发现了一个奇怪的 vim 问题,我似乎无法轻易修复:

[root@localhost .vim]# vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 10 2014 06:55:55)
Included patches: 1-160
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):

只是在虚拟机上以 root 用户身份搞乱了一些事情...我用 yum 安装了 vim,它与我的配置文件配合得很好...唯一的问题是我无法阅读大部分 Vim 文档。

enter image description here

我什至尝试将其添加到.vimrc:

augroup gzip
 autocmd!
 autocmd BufReadPre,FileReadPre *.gz set bin
 autocmd BufReadPost,FileReadPost   *.gz '[,']!gunzip
 autocmd BufReadPost,FileReadPost   *.gz set nobin
 autocmd BufReadPost,FileReadPost   *.gz execute ":doautocmd BufReadPost " . expand("%:r")
 autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
 autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
 autocmd FileAppendPre      *.gz !gunzip <afile>
 autocmd FileAppendPre      *.gz !mv <afile>:r <afile>
 autocmd FileAppendPost     *.gz !mv <afile> <afile>:r
 autocmd FileAppendPost     *.gz !gzip <afile>:r
augroup END

它没有修复它,甚至没有改变行为,我的想法是这些自动命令已经默认设置为开始。

有人遇到过这种情况吗?我什至以 root 用户身份运行它,所以我不太明白为什么某些特定的 options.txt.gz 文件甚至是只读的。

现在我必须承认,如果我实际登录到我自己的用户帐户而不是 root,一切似乎都工作正常。所以我想这仍然可以作为一个很好的提醒,不要以 root 用户身份做所有事情......

最佳答案

常见问题解答 Can I use compressed versions of the help files? 对此进行了介绍。

顺便说一句:helpgrep 可以在 CentOS 上运行吗?如果没有,您可能需要考虑在 Cent OS 上打开错误报告并请求不要压缩帮助文件。

关于linux - CentOS 7's vim can' 无法打开帮助(以 root 身份运行时),因为它无法处理 gzip 压缩的帮助文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27026230/

相关文章:

linux - Jenkins 日志记录

linux - sed 仅查找并替换特定的出现次数

c# - 用于在 Linux 中编程的工具

linux - 使用附加文件描述符关闭实用程序?

ruby-on-rails - 在 Vim 的状态栏中显示 Rails 测试的状态?

vim command + p like 查找文件命令

linux - XARGS、GREP 和 GNU 并行

vim - 如何使 %(跳转到匹配的括号)键忽略 Vim 中注释掉的代码

vim - 当光标线突出显示一行时,设置可见性和/或Vim中的隐藏或隐藏cchar的颜色

Vim:当下一个字符不在同一行时,删除到下一个字符