J R*_*erg 5 editor gedit command-line cron default-programs
如何让 gedit 成为 crontab 的默认编辑器?
到目前为止,我已经尝试过:
sudo update-alternatives --install /usr/bin/gnome-text-editor gnome-text-editor /usr/bin/gedit 100
Run Code Online (Sandbox Code Playgroud)
和
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/gedit 100
Run Code Online (Sandbox Code Playgroud)
到目前为止没有运气。(也许我只需要重新启动?)
Rav*_*ina 10
.profile
使用您想要的编辑器打开文件:
gedit ~/.profile
Run Code Online (Sandbox Code Playgroud)
将此行添加到文件中并保存:
export EDITOR=gedit
Run Code Online (Sandbox Code Playgroud)
注销并重新登录。现在当你使用crontab -e
它时会打开gedit
.
请记住,它也将设置gedit
为其他命令的默认编辑器,如果您希望它只影响crontab
,那么您可以创建一个别名:
alias crontab='EDITOR=gedit crontab'
Run Code Online (Sandbox Code Playgroud)