刚才在一台机器上打开 crontab -e,跳出来的编辑器是nano,太难使...
在debian下是使用 update-alternatives 命令修改默认编辑器。
先查看一下使用帮助
# update-alternatives --help
Usage: update-alternatives [ ...]
--config :show alternatives for the group and ask the user to select which one to use.
修改默认编辑器,选择4 /usr/bin/vim.basic
# update-alternatives --config editor
There are 5 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/emacs23 0 manual mode
4 /usr/bin/vim.basic 30 manual mode
5 /usr/bin/vim.tiny 10 manual mode
Press enter to keep the current choice[*], or type selection number: 4
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode
顺着提示看了一下对应的文件,都是软链接,最终指向 /usr/bin/vim.basic
# ls -l /usr/bin/editor
lrwxrwxrwx 1 root root 24 Dec 8 /usr/bin/editor -> /etc/alternatives/editor
# ls -l /etc/alternatives/editor
lrwxrwxrwx 1 root root 18 Aug 14 15:00 /etc/alternatives/editor -> /usr/bin/vim.basic
另外,可以通过导出变量临时修改编辑器:
export EDITOR="/usr/bin/vim" ; crontab -e
这样,再次打开 crontab -e,跳出来的就是vim了。
crontab修改默认编辑器
crontab默认编辑器为nano 修改crontab默认编辑器为vi或者其他的编辑器 可以用命令select-editor修改 改为3或者4 再用crontab -e 就是vim打开了
[crontab]修改默认编辑器
crontab默认编辑器为nano,超级不好用 想要修改成vim或者其他编辑器,方法如下. sudo select-editor 改为3或者4 再次打开就直接是vim打开了
git commit如何修改默认编辑器为vim
答:修改~/.gitconfig(修改这个文件将全局有效)或项目目录中的.git/config(修改此文件只是使当前项目默认使用vim)中增加以下内容: [core] editor=vim
git 修改默认编辑器
vim,notepad(windows自带),notepad++ 当然要选notepad++ 1.首先下载notepad++ 2.将notepad++安装目录放到path中 3.git config ...
Ubuntu 修改默认编辑器
sudo update-alternatives --config editor
修改Linux系统默认编辑器
修改ubuntu的默认编辑器: echo export EDITOR=/usr/bin/vim >> ~/.bashrc 故障过程: 修改过程: 强制断开连接,重新连接,修改默认编辑器:e ...
debian修改crontab默认编辑器为vim
debian终端下默认编辑器为nano,比如crontab -e就会打开nano,这个编辑器用起来很不习惯,想修改为vim,当然,你的debian系统必须先安装vim.如果已经安装vim,请输入如下命 ...
Eclipse —— 如何修改文件的默认编辑器
Eclipse下的各类文件各自都有默认的编辑器,但不一定好用.如何指定各种文件的默认编辑器呢? 假如,Properties文件,我不想用Eclipse自带的编辑器,而是使用PropertiesEd ...
git学习------>git commit命令的默认编辑器的修改
今天在新同事的电脑上,用git commit命令帮新同事提交代码的时候,编辑完commit的信息后,居然不记得怎么退出了.蛋疼. 后来百度了一下,原来此时是进入GUN nano编辑器.在这里可以添加你 ...
随机推荐
Oracle中使用REGEXP_SUBSTR,regexp_replace函数
REGEXP_SUBSTR函数格式如下: function REGEXP_SUBSTR(String, pattern, position, occurrence, modifier)__srcstr ...
ASP.NET Core Web API 开发-RESTful API实现
Core Web API 开发-RESTful API实现 REST 介绍: 符合REST设计风格的Web API称为RESTful API. 具象状态传输(英文:Representa ...
Python 创建和发布安装函数模块
1. create dir "nester" under C:\Users\eric\AppData\Local\Programs\Python\Python35-32\ 2. c ...
C#读取注册表信息
注册表是视窗系统的一个核心的数据库,在这个数据库中存放中与系统相关的各种参数,这些参数直接控制中系统的启动.硬件的驱动程序安装信息以及在视窗系统上运行的各种应用程序的注册信息等.这就意味着,如果注册表 ...
Android开源库
/xiaanming/article/details/9470223 一.兼容类库 ActionBarSherlock: Action Bar是Android ...
Angular5.0.0新特性
文章来自官网部分翻译https://blog.angular.io/version-5-0-0-of-angular-now-available-37e414935ced Angular5.0.0版本 ...
微信小程序-weui实例代码提取
搜索框 对应代码如下: wxss文件
ImportError: cannot import name webdriver
遇到问题: 学习selenium过程中为了方便自己知道学习的脚本的存放路径,以selenium命名 起初.py文件都在selenium文件夹下面,使用 from selenium import web ...
python学习之旅(四)
Python基础知识(3):基本数据类型之数字 一.基本数据类型 数字Number.字符串String.列表List.元组Tuple.集合Set.字典Dictionary 二.数字 Python3支持 ...
dp入门——由分杆问题认识动态规划
简介 如果你常刷leetcode,会发现许多问题带有Dynamic Programming的标签.事实上带有dp标签的题目有115道,大部分为中等和难题,占所有题目的12.8%(9月),是占 ...
如果觉得《debian html 编辑器 debian修改默认编辑器》对你有帮助,请点赞、收藏,并留下你的观点哦!