Change the Default Terminal Editor in Debian
Debian comes with a very handy utility called update-alternatives that helps to set default tools for various tasks.
It is possible for several programs fulfilling the same or similar functions to be installed on a single system at the same time. For example, many systems have several text editors installed at once. This gives choice to the users of a system, allowing each to use a different editor, if desired, but makes it difficult for a program to make a good choice for an editor to invoke if the user has not specified a particular preference.On Linode, it seems that the default editor is nano, I prefer to use vim for editing git commits, visudo, and other things that use the default editor which is symbolically linked through
/usr/bin/editor.
The update-alternatives package basically changes the symbolic links for you. In order to change your default editor, you simply need to run the following command:
sudo update-alternatives --config editor
There are 3 choices for the alternative editor (providing /usr/bin/editor).Selection Path Priority Status
0 /bin/nano 40 auto mode 1 /bin/nano 40 manual mode 2 /usr/bin/vim.basic 30 manual mode
- 3 /usr/bin/vim.tiny 10 manual mode
Press enter to keep the current choice[*], or type selection number:
levlaz@dev:~$ ls -al /usr/bin/editor lrwxrwxrwx 1 root root 24 Feb 10 20:49 /usr/bin/editor -> /etc/alternatives/editor levlaz@dev:~$ ls -al /etc/alternatives/editor lrwxrwxrwx 1 root root 17 Apr 28 18:56 /etc/alternatives/editor -> /usr/bin/vim.tiny
Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.
Check out some more stuff to read down below.
Most popular posts this month
- Reinstalling Windows at 1am
- 2024
- SQLite DB Migrations with PRAGMA user_version
- Everything wrong with developer tools in a single paragraph
- Urge to Edit Old Posts
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- Submarines DevCon 2025 Keynote Speech from JoshHaines.com
- The people should own the town square from Mastodon Blog
- Divine Attah-Ohiemi: My 30-Day Outreachy Experience with the Debian Community from Planet Debian
- 25 Years of the Mac OS Dock from The Internet Review
- “Founder Mode” and the Art of Mythmaking from charity.wtf
Articles from blogs I follow around the net
Submarines DevCon 2025 Keynote Speech
I was asked to give a keynote speech at the Rolls-Royce Submarines Developer Conference in February 2025. The post below contains some sanitized details of the talk for both attendees to reference and others to learn from.
via JoshHaines.com February 4, 2025The Pigeonhole Principle
Why perfect organization is not possible. I stare at the blank index pages of my new commonplace book, my pen hovering uncertainly. More than two decades of digital design work, and I’m stumped by the simple task of organizing an analog notebook. Come on,…
via Christopher Butler January 17, 202506/01/2025
# Today is the fourth anniversary of switching to my own custom CMS. It doesn't seem possible that I've been using it for that long. Each year I've written about the major changes; these last 12 months have had the least. I started strong with …
via Colin Walker - Daily Feed January 17, 2025Generated by openring