CentOS 7's vim can't open help (when run a

2019-08-25 00:11发布

I found a strange issue with vim that I can't seem to easily fix:

[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 (-):

Just doing some messing around as root user on a VM here... I installed vim with yum, it works great with my config files... the only thing is I can't read most of the Vim documentation.

enter image description here

I even tried adding this to .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

It did not fix it or even change the behavior, my thinking is that these autocmds are already set by default to begin with.

Has this happened to anyone? I'm even running this as root user so i don't really understand why some particular options.txt.gz file would even be read-only.

Now I do have to admit that everything seems to work fine if I actually log in to my own user account instead of root. So I guess this can still serve as a pretty good reminder to not do everything as root user...

标签: linux vim
1条回答
Summer. ? 凉城
2楼-- · 2019-08-25 00:38

This is covered in the faq Can I use compressed versions of the help files?

BTW: Is helpgrep working on CentOS? If not, you might want to consider opening a bug report at Cent OS and request not to compress the help files.

查看更多
登录 后发表回答