Hacker Public Radio

HPR3486: Unleash the true potential of GNU nano text editor


Listen Later

Text editors are highly subjective and highly opinionated commodities. Everyone is aware of infamous rivalry between users of Emacs and Vi/Vim. Every single text editor has its own strengths and weaknesses. At the end of the day it's the question of your personal preferences and muscle memory when it comes to default key-bindings. Both Emacs and Vim have a learning curve. Steepness of that curve depends on the person's background and interests. Hey, but today I'm not here to talk about Emacs and Vim. I'm here to talk about a simple, easy to use and almost ever present text editor called GNU nano. So what exactly is this nano text editor? Well, according to documentation available on GNU nano's website,
GNU nano was designed to be a free replacement for the Pico text editor, part of the Pine email suite from The University of Washington. It aimed to "emulate Pico as closely as is reasonable and then include extra functionality".
Pico and Pine email suites are still around so what was the need to create nano in the first place? The answer is license. Pico and Pine email suites nowadays are available under Apache-2.0 license but that always wasn't the case and this ambiguity in the original licensing terms of the Pico editor led to the creation of nano. It was first created in 1999 with the name TIP (an acronym for TIP Isn't Pico), by Chris Allegretta. The name was changed to nano on January 10th, 2000 to avoid a naming conflict with the existing Unix utility tip. The name comes from the system of SI prefixes, in which nano is 1000 times larger than pico. In February 2001, nano became a part of the GNU Project. BTW if you want to know more about SI prefixes, I'd highly recommend you to listen to HPR episode 3453 - Engineering notation by Ken Fallon.
nano is really small in footprint and is relatively easy to use compared to Emacs and Vim and perhaps this is the reason why you'd invariably find it already installed on almost all GNU/Linux distributions. If you have ever used nano before you might have noticed that it looks kinda boring; there are no line-numbers nor there is any syntax highlighting and spell-checking also seems absent. But this is not true. nano has all of these features and even some more like regex searches, indentation, multiple buffers, available at its disposal. Then why does it come across as a plain Jane? The short answer is, I honestly don't know! For some unknown and obscure reasons many of nano's cool features are disabled by default. This results in nano coming across as a plain Jane little text editor that is uncool. And as I mentioned earlier, that is not true. But worry not! It is so darn easy to unleash the true potential of nano and make it shine. Are you ready? Great! Let's do it together then!
First thing we need to to do is create a file with the name .nanorc in the $HOME directory. Open your terminal emulator and run,
touch $HOME/.nanorc
We'd also need to create a directory called Nano_Backups in our Documents directory. To do so run the following command,
mkdir -p $HOME/Documents/Nano_Backups
Next open that .nanorc file and simply paste the following content in it,
set atblanks
set autoindent
set backup
set backupdir "/home/USERNAME/Documents/Nano_Backups"
set boldtext
set constantshow
set cutfromcursor
set indicator
set linenumbers
set magic
set minibar
set mouse
set showcursor
set softwrap
set speller "aspell -x -c"
set trimblanks
s
...more
View all episodesView all episodes
Download on the App Store

Hacker Public RadioBy Hacker Public Radio

  • 4.2
  • 4.2
  • 4.2
  • 4.2
  • 4.2

4.2

34 ratings


More shows like Hacker Public Radio

View all
The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

290 Listeners

Defensive Security Podcast - Malware, Hacking, Cyber Security & Infosec by Jerry Bell and Andrew Kalat

Defensive Security Podcast - Malware, Hacking, Cyber Security & Infosec

372 Listeners

LINUX Unplugged by Jupiter Broadcasting

LINUX Unplugged

268 Listeners

SANS Internet Stormcenter Daily Cyber Security Podcast (Stormcast) by Johannes B. Ullrich

SANS Internet Stormcenter Daily Cyber Security Podcast (Stormcast)

651 Listeners

Curious Cases by BBC Radio 4

Curious Cases

822 Listeners

The Strong Towns Podcast by Strong Towns

The Strong Towns Podcast

423 Listeners

Late Night Linux by The Late Night Linux Family

Late Night Linux

164 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,061 Listeners

Cybersecurity Today by Jim Love

Cybersecurity Today

179 Listeners

CISO Series Podcast by David Spark, Mike Johnson, and Andy Ellis

CISO Series Podcast

189 Listeners

TechCrunch Daily Crunch by TechCrunch

TechCrunch Daily Crunch

42 Listeners

Strict Scrutiny by Crooked Media

Strict Scrutiny

5,797 Listeners

2.5 Admins by The Late Night Linux Family

2.5 Admins

98 Listeners

Cyber Security Headlines by CISO Series

Cyber Security Headlines

139 Listeners

What the Hack? by DeleteMe

What the Hack?

228 Listeners