Nano Tabs and Line Numbers

To make the nano text editor nicer to use for development, you can change the tab size to 4 spaces, set it to convert tabs to spaces, make it always display line and character numbers and enable multiple file buffers. Since I always forget how, here are the settings that go in the ~/.nanorc file:

set tabsize 4
set tabstospaces
set const
set multibuffer

The multiple file buffer feature is really useful, as you can load multiple files with CTRL+R and quickly switch between them with ESC follow by > or <.

Sometimes you need hard tabs (in a Makefile for example). To achieve this, the -I flag can be used to ignore the .nanorc file for Makefiles:

nano -I Makefile

Leave a Reply

Your email address will not be published. Required fields are marked *