logo
search
list

Table of Content

How to Choose a Linux Text Editor
Nano: Best Default for Quick Terminal Edits
Vim and Neovim: Power Editing in the Terminal
GUI Editors: Gedit and Kate
VS Code: Best When You Need a Coding Workbench
Set Your Default Text Editor
Common Pitfalls
From Plain Text to Shareable Office Documents
FAQ

Linux Text Editor Guide: Nano, Vim, VS Code (Ubuntu)

Posted by Algirdas Jasaitis

calendar

2026-07-27

views

889

likes

5

The best Linux text editor depends on the job. For a quick config change in a terminal, use Nano. For fast, keyboard-driven editing on servers, use Vim or Neovim. On a desktop, Gedit (GNOME) or Kate (KDE) covers everyday files. For coding with extensions and Git, use Visual Studio Code.

Success means you can open a file, save it cleanly, and exit—without locking yourself into the wrong tool. Prefer App Center or apt for editors shipped with Ubuntu; use the vendor’s documented install path for VS Code.

sudo apt update
Concept illustration of choosing a Linux text editor—terminal and desktop editor panels on a Linux laptop
Pick by job: Nano for quick CLI edits, Vim/Neovim for power users, Gedit/Kate for GUI, VS Code for coding.

For a broader must-have software list on Ubuntu, see best Linux apps.

How to Choose a Linux Text Editor

Your situationPickWhy
SSH / server, first-time CLINanoOn-screen shortcuts; easy exit
Daily terminal power userVim / NeovimFast, scriptable, everywhere
Simple GUI notes on GNOMEGedit (Text Editor)Point-and-click; preinstalled on many Ubuntu desktops
KDE / Plasma desktopKateStrong multi-document GUI editor
Projects, languages, Git UIVS CodeExtensions + integrated terminal
Deep customization workflowsEmacsPowerful; steep learning curve

Ask Ubuntu’s long-running comparisons (Nano vs Vim vs Emacs) still map to the same rule: start simple, graduate when the workflow demands it.

Nano: Best Default for Quick Terminal Edits

Nano is the friendly terminal Linux text editor for beginners and emergency fixes. Shortcuts are listed at the bottom of the window (^ means Ctrl).

sudo apt install nano
nano ~/notes.txt
sudo nano /etc/hosts

Common keys: Ctrl+O save, Ctrl+X exit, Ctrl+W search.

Vim and Neovim: Power Editing in the Terminal

Vim ships widely and remains the classic choice for admins. Neovim (nvim) is a modern Vim-compatible fork available from Ubuntu packages.

sudo apt install vim
# or
sudo apt install neovim
vim file.conf
nvim file.conf

Minimal survival kit:

i          # insert mode
Esc        # normal mode
:w         # save
:q         # quit
:wq        # save and quit
:q!        # quit without saving

Use Vim/Neovim when you live in SSH sessions or want macros and motions. Skip it for a one-line edit if Nano is enough.

GUI Editors: Gedit and Kate

Desktop Ubuntu flavors ship a GUI editor so you are not forced into the terminal for notes and plain text.

sudo apt install gedit    # GNOME Text Editor
sudo apt install kate     # KDE Kate
gedit ~/todo.txt
kate ~/todo.txt

Ask Ubuntu tip: to edit system files with a GUI editor, prefer a controlled elevation path (for example pkexec / admin prompts your desktop provides) over casually running a full GUI app as root all day.

VS Code: Best When You Need a Coding Workbench

VS Code is a full-featured editor with extensions, debugging, and Git—not a tiny config tweaker. On Ubuntu it is not a default apt package from Canonical’s main archive; install from Microsoft’s documented channels (Snap or Microsoft’s APT repo / .deb).

sudo snap install --classic code
code .

For the Microsoft APT repository or a local .deb, follow the current steps on the official VS Code Linux docs—add the vendor source or install ./code_….deb as a local file, then keep updates through that channel.

Set Your Default Text Editor

echo 'export EDITOR=nano' >> ~/.bashrc
source ~/.bashrc

# system-wide interactive choice (example)
sudo update-alternatives --config editor

git config --global core.editor "nano"
# or: nvim, code --wait, etc.

Common Pitfalls

ProblemWhat to try
Stuck inside VimPress Esc, then :q! or :wq
“Permission denied” saving a system fileEdit with sudo in the terminal, or a proper admin GUI prompt
Huge multi-GB text file freezes the GUIPrefer terminal tools (less, streaming edits)
Wrong editor opens for crontab -eSet EDITOR / VISUAL or select-editor

From Plain Text to Shareable Office Documents

A Linux text editor is for configs, scripts, logs, and plain notes. When those notes must become a DOCX, spreadsheet, or PDF for Windows teammates, switch to a desktop office suite.

WPS Office for Linux includes Writer, Spreadsheet, Presentation, and PDF tools, with strong Microsoft Office format compatibility and official DEB/RPM packages for Ubuntu and other mainstream distros.

WPS Office Writer on a Linux desktop editing a Project Notes DOCX with a familiar ribbon toolbar
When plain text becomes a shareable DOCX or PDF, open WPS Writer on Linux—keep Nano/Vim/VS Code for configs and code.
What you need after editing textWhat WPS gives you
Keep layout when exchanging Office filesStrong .docx / .xlsx / .pptx fidelity with Windows or macOS
One app for docs, sheets, slides, PDFFree core suite plus PDF view/edit/convert
Familiar UI on a modest laptopRibbon-style apps with a lighter footprint than many heavy suites
Trusted installOfficial DEB (Ubuntu/Debian/Mint) and RPM builds

Get the current 64-bit build from the official WPS Office for Linux download page (choose Deb on Ubuntu), then install the local file—replace VERSION with the name you downloaded:

cd ~/Downloads
sudo apt install ./wps-office_VERSION_amd64.deb

Keep Nano/Vim/VS Code for plain text and code; use WPS when the result must open cleanly as a real Office document.

FAQ

What is the best Linux text editor for beginners?
Nano in the terminal, or Gedit/Kate on the desktop. Move to Vim or VS Code when you need more power.

Is Vim better than Nano?
For quick edits, Nano is easier. For frequent terminal work, Vim/Neovim are faster once learned.

Does Ubuntu include a text editor by default?
Yes—typically Nano in the terminal and a GUI editor such as Gedit (flavor-dependent).

How do I edit a file as root safely?
Prefer sudo nano /path/to/file or your desktop’s admin elevation for GUI editors. Avoid leaving a root GUI session open longer than needed.

Should I use VS Code for /etc configs?
You can, but Nano or Vim over SSH is simpler for small system files. Use VS Code for projects and multi-file coding.

Algirdas Jasaitis

15 years of office industry experience, tech lover and copywriter. Follow me for product reviews, comparisons, and recommendations for new apps and software.