DEV Community

Anurag Vishwakarma
Anurag Vishwakarma

Posted on • Originally published at firstfinger.Medium on

Is Vim or Nano Better for Linux User?


Photo by Gabriel Heinzer on Unsplash

Two of the most popular and commonly used text editors are vim and nano.

🥊 What is Vim?

Vim (short for Vi) is an advanced, powerful text editor available on most Unix-based systems including Linux. It’s an improved version of the vi editor and provides several enhancements. Vim is a modal editor where it operates in different modes – normal mode for navigation, insert mode for inserting text, visual mode for selecting text, etc.

Features of Vim:

  • Modal editing interface
  • Powerful text editing capabilities
  • Extensive customization with .vimrc
  • Advanced regular expression search and replace
  • Multi-level undo/redo tree
  • Extensive plugin ecosystem for added functionality
  • Available in terminal (no GUI)

🛹 What is Nano?

Nano is a simple, basic text editor that comes pre-installed on most Linux distributions. It is designed to be easy to use for new Linux users and has a simple interface. Nano operates in a non-modal environment similar to other text editors.

Features of Nano:

  • Simple, intuitive interface
  • Easy to use out of the box
  • Linear editing like a typical text editor
  • Common shortcuts listed at the bottom
  • Syntax highlighting for code/config files
  • Search and replace functionality
  • Go to line numbers
  • Auto-indentation and undo/redo capabilities

🛝 Vim vs Nano

  • Hard to master : Vim has a steep learning curve and requires time investment to learn. Nano has a very simple interface and is easy for beginners.
  • Speed : Vim provides greater editing speed and productivity once learned. Nano is slower in comparison.
  • Functionality : Vim provides significantly more features and control for power users. Nano has just basic editing functions.
  • Customization : Vim is highly customizable using .vimrc. Nano has fewer customization options.
  • Modes : Vim uses modal editing. Nano uses a linear interface.
  • Usage : Vim is better for programming and code editing. Nano is better for quick edits and simpler files.

🥸 So , Which is Better – Vim or Nano?

  • For new Linux user s: Nano is better to start with as it is simpler.
  • For power users/programmers : Vim is more beneficial once learned due to advanced functionality.
  • For editing config files : Both vim and nano can work but vim offers more control.
  • For editing code : Vim is better with syntax highlighting, plugins, etc.
  • For a GUI editor : Nano is preferable as vim is terminal based.
  • For simple edits : Nano provides an easy interface for quick changes.

In short, if you’re a new Linux user who wants to edit some configuration files, nano is easier to get started with. For advanced developers who want to efficiently edit code, Vim is more suitable once learned.


If you enjoyed this article, please consider subscribing to our newsletter 📬 and joining our WhatsApp group 👥, where we share similar content. ✏️

Top comments (28)

Collapse
 
dreamhollow4219 profile image
Ian

It's really a matter of preference.

I'm a hardcore Vim user even though there's still I could learn about optimizing use of the program.

But I could see how people prefer Nano because it's closer to an interactive editor compared to Vim.

I'm surprised Emacs is being left in the dark, here.

Collapse
 
katafrakt profile image
Paweł Świątkowski

Emacs user myself, I'm not really surprised. While Emacs might work inside terminal, I think the default is to run is as a separate application. It's also not quite fast to start and more suitable for opening a project in it and working in it for a long time. This "Vim vs Nano" articles seem to be rather aimed at use case of quickly updating a config file over SSH, more than making it a daily main editor.

And the fact that Vi/Vim and nano are installed by default on most distributions while Emacs is not also probably has something to do with it.

Collapse
 
srtechwriter profile image
marcia wilbur • Edited

I was working with MX Linux re their Alpha for pi. I said, hey... where's Midnight Commander. The response was... well users can just install it... I'm like... this is small board and I really would like to request mc. Nope. The people who create the distros select packages... and I have met some interesting OS "devs". I'm the lead dev for respin, a distro customization tool. I'm waiting for someone respin to something better... still waiting. Why no emacs. Give options!!!!!

Collapse
 
srtechwriter profile image
marcia wilbur

right!

Collapse
 
m0n0x41d profile image
Ivan Zakutnii

Once in Vim, always in Vim.

p.s. This is not a 'how-to-exit-vim' joke.

Collapse
 
dotsilas profile image
Silas Duarte

VI key binds are genius, a very very cool way to manage all the things with the keyboard...

...and you can use it in other terminal apps (fish shell, ranger, etc), text editors (obsidian, VS Code, Notepad++), IDEs (Visual Studio, JetBrains IDEs, Eclipse, etc), web browsers (Vimium), Windows Managers (Hammerspoon, Komorebi, i3wm and a lot of more in Linux).

VI/Neovim are very customizable editors, you can do (almost) anything with them, and if you struggle with the configuration there is distros like NVChad or LunarVim with all the things out of the box.

So, even if you don't want to use vim/neovim as your main editor, when you learn VI, you can enjoy/take advantage of VI.. :)

Collapse
 
anurag_vishwakarma profile image
Anurag Vishwakarma

Thanks for letting me know all this stuff. Specially about the distro.

Collapse
 
gbhorwood profile image
grant horwood

i was super excited about lunarvim, but eventually went back to my custom vim set up if for no other reason than it was what i was familiar with.

for people just getting into vim or people who aren't stuck in their ways (like me!), though, lunar is probably going to be awesome.

Collapse
 
dotsilas profile image
Silas Duarte

I feel a bit the same, I'm currently working on my own Vim setup because I would like to have full knowledge of all the parts and how they work, and I would like something lighter than the distros, but for now I use LunarVim to get the job done.

Do you have your Vim/Neovim dotfiles somewhere? It's always inspiring to read other's setup :)

Thread Thread
 
gbhorwood profile image
grant horwood

i don't know if i'd call it "inspiring", but it's here:
github.com/gbhorwood/vimrc/blob/ma...

Collapse
 
kwnaidoo profile image
Kevin Naidoo

Nano, simply because, for complex code - I check this into GIT and use my IDE/VsCode locally.

Sometimes I need to make a quick change to a config, or a bash script, or something small - then all I need is to move between lines, search, search and replace, etc... - which nearly every editor has. VIM seems overly too much for this simple use case.

Collapse
 
marcorodnav profile image
Marco Rodríguez Navarro

Personally, I think this is not a fair comparison. Nowadays vim has lots of customization options. Heck, you can search for "Vim as a full IDE" and several guides will come up.
However, I don't see much of improvements for nano. I guess because nano is not a realistic option for anyone to do any serious job, besides quickly edit a config file in a server (or any similar task).
A fairer match would be "vi vs nano". These two are by default in almost all linux distros, and both fulfill the same goal: to make quick changes.

Collapse
 
cappe987 profile image
Casper

I'd argue that Vim learning curve isn't very steep. It's longer than Nano because Nano is very limited in functionality. Take 30 minutes to learn the basic Vim keys hjkli, Esc, and save/exit. Then you basically have what Nano has. Then continue learning as you go.

Vim also has these features by default:

  • Syntax highlighting for code/config files
  • Search and replace functionality
  • Go to line numbers
  • Auto-indentation and undo/redo capabilities
Collapse
 
anurag_vishwakarma profile image
Anurag Vishwakarma

WTF?

Collapse
 
barnesric56 profile image
RawHide81

EMACS

Image description

Collapse
 
anurag_vishwakarma profile image
Anurag Vishwakarma

If you’re interested you can join our WhatsApp Channel where I share stuff related to Cloud, DevOps etc.

Collapse
 
smilebootyvikki03 profile image
vandhanaKumar

Work in it.

Collapse
 
katafrakt profile image
Paweł Świątkowski

Vim is terminal based. Nano provides a simple GUI-based interface

Wait, how is nano not terminal-based? What am I missing?

Collapse
 
anurag_vishwakarma profile image
Anurag Vishwakarma

Vim is a terminal-based text editor. This means that vim runs in a terminal or shell window.

Nano provides a simple graphical user interface (GUI). Nano runs as its own application window, with menu bars, input boxes, and other GUI elements. This can make nano feel more familiar and user-friendly, especially for those used to GUI text editors.

Collapse
 
cappe987 profile image
Casper

No. Nano runs in the terminal just like Vim. If your Nano opens up a separate window you must have some non-standard version or maybe alias to override it. Feel free to share a screenshot of what Nano looks like to you.

Collapse
 
katafrakt profile image
Paweł Świątkowski

This is not true, at least in my experience. That's why I'm asking if you are referring to some GUI-fied version of nano. I've used GVim (separate window Vim), but never heard of such version of nano.

Collapse
 
mjablecnik profile image
Martin Jablečník

Nano does't have GUI (graphical user interface). It is running only in terminal with TUI (terminal user interface).
On the other hand Vim you can run in terminal with TUI but also in GUI (try find vim-gtk)
github.com/vhakulinen/gnvim
github.com/equalsraf/neovim-qt

Collapse
 
kaamkiya profile image
Kaamkiya

Never used Nano, I'm a hardcore Vim user. I love it's customizability, although I wish they didn't make a whole new script for customization (VimScript).

P.S. Vim is not short for Vi, it's short for Vi Improved.

Collapse
 
srtechwriter profile image
marcia wilbur

Never been a vim or vi fan. The vulnerability a few years made me go - See... Emacs was my first editor of choice but I honestly can say I prefer something like ATOM before MS bought github and scrapped it. I still use atom with --no-sandbox. Can use VSCode as long as telemetry is not enabled but it's MS and as an advocate, it's a hard pill to swallow.

nano for quick edits
midnight commander for quick edits
atom for notes, drafts, coding, writing

Collapse
 
brandonwallace profile image
brandon_wallace

Vim is not that hard to learn. Beginners can run vimtutor on the command line. Then learn more and more as time goes on.

Collapse
 
daalvand profile image
Mehdi Daalvand

Everybody says Nano is simpler than Vim, but I don't know why working with Nano was harder than Vim, even when I was a beginner.