![为 crontab -e 设置编辑器,为什么总是使用基本的 vim?](https://linux22.com/image/1105958/%E4%B8%BA%20crontab%20-e%20%E8%AE%BE%E7%BD%AE%E7%BC%96%E8%BE%91%E5%99%A8%EF%BC%8C%E4%B8%BA%E4%BB%80%E4%B9%88%E6%80%BB%E6%98%AF%E4%BD%BF%E7%94%A8%E5%9F%BA%E6%9C%AC%E7%9A%84%20vim%EF%BC%9F.png)
crontab -e
当以 形式发出时root
,我总是收到如下消息(部分),但是,vim
直接执行完全没有问题。
$EDITOR
已设置vim
为/root/.bash_profile
。
%> sudo crontab -e
Error detected while processing /root/.vimrc:
line 2:
E319: Sorry, the command is not available in this version: autocmd! BufNewFile * silent! 0r ~/.vim/skel/tmpl.%:e
line 20:
E319: Sorry, the command is not available in this version: autocmd VimEnter * set vb t_vb=
line 57:
E518: Unknown option: autochdir
line 65:
E319: Sorry, the command is not available in this version: syn on
line 78:
E538: No mouse support: mouse=a
line 79:
E319: Sorry, the command is not available in this version: filetype plugin indent on
line 87:
E319: Sorry, the command is not available in this version: funct! CommentBlock(comment)
line 88:
答案1
当您使用“sudo 命令”时,不会加载 root 用户配置文件,请改用sudo -i
和crontab -e
。
答案2
在 ubuntu-14.04 中,选择select-editor
“vim-gnome”而不是“vim-basic”