【Linux】neocomplcache disabled: "sudo vim" is detected and $HOME is set to your user's home

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010168781/article/details/89890496
1、问题描述

使用sudo vim时,弹出提示:

neocomplcache disabled: "sudo vim" is detected and $HOME is set to your user's home. 
You may want to use the sudo.vim plugin, the "-H" option with "sudo" or set always_set_home in /etc/sudoers instead.
Press ENTER or type command to continue
2、解决方法

1)使用sudo -H vim test.txt,此时不会再弹出警告,但是用户的vim配置都不能使用了
2)使用vim test.txt直接编辑,保存时,使用

 :w ! sudo tee %

然后会提示输入sudo密码,回车后,弹出

W12: Warning: File "test.txt" has changed and the buffer was changed in Vim as well
See ":help W12" for more info.
[O]K, (L)oad File:

直接回车,然后!q强制退出

:q!

猜你喜欢

转载自blog.csdn.net/u010168781/article/details/89890496
今日推荐