因爲Linux的自帶vim看起代碼相當反人類,所以今天搞了一套C++的IDE,頓時舒服多了,但在root下vim 有的文件時,就會報錯:
Error detected while processing /root/.vimrc:
line 5:
E492: Not an editor command: Plug 'Valloric/YouCompleteMe'
line 6:
E492: Not an editor command: Plug 'bling/vim-airline'
line 7:
E492: Not an editor command: Plug 'vim-airline/vim-airline-themes'
line 8:
E492: Not an editor command: Plug 'morhetz/gruvbox'
line 9:
E492: Not an editor command: Plug 'octol/vim-cpp-enhanced-highlight'
line 299:
E31: No such mapping
line 300:
E31: No such mapping
line 301:
E31: No such mapping
line 302:
E31: No such mapping
line 307:
E492: Not an editor command: ^Iterminal
Press ENTER or type command to continue
也無法使用我新配置的vim編輯器;
解決方案(修改默認編輯器)
在root下輸入:
vim /root/.bashrc
添加:
export EDITOR=/usr/bin/vim
保存退出後重新進入用戶,完美解決!