linux 默认文本编辑器_如何在Linux上更改默认文本编辑器

linux 默认文本编辑器

On Linux, a default editor is used for text editing such as crontab -e or git commit. How to change it to the editor of my own choice?

Linux上 ,默认编辑器用于文本编辑,例如crontab -egit commit 。 如何将其更改为我自己选择的编辑器?

The default editor is indicated by the EDITOR environment variable. You can set this environment variable to set the default editor. For example, set it to emacs by EDITOR=emacs.

默认编辑器由EDITOR环境变量指示。 您可以设置此环境变量来设置默认编辑器。 例如,将其设置为emacs的EDITOR=emacs

If you want to set it for all users, add this line to /etc/bashrc or /etc/profile:

如果要为所有用户设置它,请将此行添加到/etc/bashrc/etc/profile

export EDITOR=emacs

If you want to set it for yourself only, add this line to ~/.bashrc or ~/.profile:

如果只想自己设置,请将此行添加到~/.bashrc~/.profile

export EDITOR=emacs

If you want to set it for one shell instance only, run this:

如果仅要将其设置为一个shell实例,请运行以下命令:

export EDITOR=emacs

If you want to set it for just one instance of a program, say crontabe -e, run this:

如果只想为一个程序实例设置它,例如crontabe -e ,请运行以下命令:

EDITOR=emacs crontab -e
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-change-the-default-text-editor-on-linux/

linux 默认文本编辑器

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值