9384浏览
查看: 9384|回复: 4

【Linux教程】修改crontab默认编辑器为vim

[复制链接]
Debian系统在使用crontab默认的编辑器是nano,用起来很不方便,该如何进行切换呢?
root@debian:~# update-alternatives --config editor
There are 8 choices for the alternative editor (providing /usr/bin/editor).
  Selection    Path                Priority  Status
------------------------------------------------------------
  0            /usr/bin/joe        70        auto mode
* 1            /bin/nano            40        manual mode
  2            /usr/bin/jmacs      50        manual mode
  3            /usr/bin/joe        70        manual mode
  4            /usr/bin/jpico      50        manual mode
  5            /usr/bin/jstar      50        manual mode
  6            /usr/bin/rjoe        25        manual mode
  7            /usr/bin/vim.basic  30        manual mode
  8            /usr/bin/vim.tiny    10        manual mode
Press enter to keep the current choice
  • , or type selection number: 8
    update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in manual mode.
  • 输入命令之后,提示选择,根据自己喜好进行选择即可,这里我选择的是VI编辑器,输入8。
    现在crontab编辑器已经变成了VI。
    如果没有切换成功,请手动重启一下服务:/etc/init.d/cron restart

    pATAq  版主

    发表于 2017-4-27 19:55:05

    www.linuxidc.com
    。。。。。。
    回复

    使用道具 举报

    iooops  中级技匠

    发表于 2017-4-30 23:53:02

    不是有些程序猿宝宝特别喜欢EMACS……
    回复

    使用道具 举报

    iooops  中级技匠

    发表于 2017-4-30 23:53:13

    其实我觉得Nano挺好用的呀~
    回复

    使用道具 举报

    凌风清羽  中级技匠
     楼主|

    发表于 2017-5-9 21:05:49

    iooops 发表于 2017-4-30 23:53
    其实我觉得Nano挺好用的呀~

    用过Ctrl+V Shift+i Double Esc你就可以做决定了 
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    为本项目制作心愿单
    购买心愿单
    心愿单 编辑
    [[wsData.name]]

    硬件清单

    • [[d.name]]
    btnicon
    我也要做!
    点击进入购买页面
    上海智位机器人股份有限公司 沪ICP备09038501号-4

    © 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

    mail