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

时间:2014-11-19 20:20:05

标签: 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用户身份搞错了...我用vim安装了yum,它配置文件很好用......唯一不能的就是我不能阅读大部分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

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

这发生在任何人身上吗?我甚至以root用户身份运行它,所以我真的不明白为什么某些特定的options.txt.gz文件甚至是只读的。

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

1 个答案:

答案 0 :(得分:0)

faq Can I use compressed versions of the help files?

中介绍了这一点 BTW:helpgrep是否在CentOS上运行?如果没有,您可能需要考虑在Cent OS上打开错误报告,并请求不压缩帮助文件。

相关问题