

In the above output, * is displayed before option 3 since it is our default editor.

Press enter to keep the default, or type selection number: There are 5 alternatives which provide `editor’. When you enter the above command, you will see a prompt as shown below. $ sudo update-alternatives -config editor It will list all the editors available in your system, with a * displayed before the present default text editor. Open terminal and run the following command. The default text editor in Ubuntu will be changed to vi.Īlso read : How to Install AWS CLI in Ubuntu Alternatively, you can also run the following command. Now log out of your account and log in again, to apply changes. export EDITOR='vi'Īlso read : How to Undo Git Add before commit Replace vi with the text editor of your choice. bashrc file to set default editor to vi in Ubuntu. $ sudo vi ~/.bashrcĪdd the following lines to. Please use the dot(.) before its filename since it is a hidden file. Open terminal and run the following command to open. bashrc file, or using update-alternatives command. You can change default text editor in Ubuntu by editing. You can also use them to change text editor in other Linux distributions like CentOS, Redhat, Debian, and other systems. Here are the steps to set default text editor in Ubuntu.

In this article, we will look at both these methods. For example, if you are comfortable with vi then you may want to set the default text editor to vi. Sometimes you may need to change the default text editor for applications like crontab, that require a text editor. Join the nixCraft community via RSS Feed, Email Newsletter or follow on Twitter.By default, nano is the text editor in Ubuntu. He wrote more than 7k+ posts and helped numerous readers to master IT topics. Vivek Gite is the founder of nixCraft, the oldest running blog about Linux and open source. Here is a quick table summarizing text editors I talked about in this post:ĭid I miss your favorite CLI text editor? Let me know in the comment section below. VIM/Neovim, Emacs, and kakoune also work as IDE with various tweaks and plugins. There is ed too, which is regularly advertised as the standard text editor for Unix. Many like to use a simple text editor such as nano or micro to edit files over ssh-based sessions. I prefer vim as I started with vi on Unix. $EDITOR variable – what is the difference?” for more info. At the time of its first release, the name “Vim” was an acronym for “Vi IMitation”, but this changed to “‘Vi IMproved” late in 1993.Įxport VISUAL= vim # for each Bash login session update ~/.bash_profile echo 'export VISUAL=vim' > ~ /.bash_profile Vim’s author, Bram Moolenaar, based Vim on the source code for a port of the Stevie editor to the Amiga. It is a clone, with an additional set of features to the original Bill Joy’s vi text editor for Unix. vim – The most loved and memed text editor

It is fully compatible with Vim’s editing model and the Vimscript language. The authors of Neovim wanted text editor features to improve Vim’s extensibility and maintainability. Neovim is a fork of vim with additional features. neovim – Vim fork focused on extensibility, usability, and backward comparability GNU nano editing the /etc/nf on my Linux system 5. Plugin manager to download additional Lua plugins other users have made.Automatic linting and commenting via Lua plugins.Configurable keybindings and settings (tab width, tabs vs.It means you can click and drag to select the text, double click select by word, and triple-click to select by line Syntax highlighting for over 140 programming languages supported.Standard keybindings (Ctrl-s to save, Ctrl-z to undo, Ctrl-q to quit, etc.).Micro aims to be somewhat of a successor to the nano editor by being easy to install and use in a pinch, but micro also aims to be enjoyable to use full time, whether you work in the terminal because you prefer it (like me), or because you need to (over ssh). Micro is a terminal-based text editor that aims to be easy to use and intuitive while also taking advantage of modern terminals’ full capabilities. micro – A simple and easy to use text editor
