Customizing nano editor

On the last post we saw how to enable sintax highlighting in nano. I use nano basically for two things: write webpages and write code. To work more comfortably i like the text editor to have:

  1. Sintax highlighting
  2. Autoindent on any new line
  3. Tabs with a nice size
  4. Line numbers

By default nano has none of those. It’s possible to customize it, for the sintax highlight we edited the ~/.nanorc file, the other customizations are done the same way. Let’s open the file with our favorite text editor:

$ nano ~/.nanorc

Add the following lines to it:

include "/usr/share/nano/c.nanorc"
set autoindent
set tabsize 4
set const

The first line enables the sintax highlighting for C. If you want to enable it for other languages as well check out the contents of your /usr/share/nano/ folder and add the language rule you want. The second line enables the autoindent for any new line, that is any new line will have the same indentation as the line before. The third line sets the tab size to 4, that’s half the default size (8), you can set it the size you want. Finally the last line enables the line and column numbering, now you’ll know exactly on what line and column you are when editing a text file.

That’s the way I like having my nano. Check out nanorc man page if you want to learn more about how to modify nano.

0 comments

Please insert the result of the arithmetical operation from the following image
Enter the result of the arithmetical operation from this image