VPS侦探论坛

 找回密码
 注册
查看: 8235|回复: 0

[总结] Debian如何修改crontab默认编辑器nano为vim

[复制链接]
发表于 2013-9-8 09:46:40 | 显示全部楼层 |阅读模式

Debian终端下默认编辑器为nano,比如使用crontab -e命令时就会打开nano,如果想想修改为vim(需已安装,执行apt-get install vim安装),过程如下:

执行命令:update-alternatives --config editor

执行后有如下提示:
  1. root@vpser:~# update-alternatives --config editor
  2. There are 3 choices for the alternative editor (providing /usr/bin/editor).

  3.   Selection    Path                Priority   Status
  4. ------------------------------------------------------------
  5. * 0            /bin/nano            40        auto mode
  6.   1            /bin/nano            40        manual mode
  7.   2            /usr/bin/vim.basic   30        manual mode
  8.   3            /usr/bin/vim.tiny    10        manual mode

  9. Press enter to keep the current choice[*], or type selection number:
复制代码
然后选择/usr/vim/vim.basic,输入2回车就行了。
vim.basic是完全版的vim。
vim.tiny为精简版不支持高亮等功能。

ubuntu下的话执行命令:select-editor
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-17 02:59 , Processed in 0.026123 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表