The quest for a great text editor: A brief intro to Notepad++ | Opensource.com

The quest for a great text editor: A brief intro to Notepad++

The real power of Notepad++ starts to show up when you want to edit code.

The quest for a great text editor: A brief intro to Notepad++
Image by : 

opensource.com

I am far from the only person on a quest for the perfect text editor. It's become so much a part of technology culture that I've actually had the interview question "Vim or GNU Emacs?" come up a couple of times in my career. The bitter truth that regular users of text editors must face, however, is that there just is no One Ring of text editing. Different software development practices, different platforms, even the mindset of the user, can affect the right choice for that moment.

My work machine is running OSX, and our development platform is CentOS, so for that work, Vim is usually my editor of choice. But I do a lot of development and writing on my Windows machine at home, and for several of the places that I submit writing, the best way to format the submission is with Markdown. Special-purpose Markdown editors make life easier, certainly, but the quest for One Perfect Editor will not be denied!

Enter Notepad++. Notepad++ is licensed under the GNU Public License (GPL), and the source is available on GitHub. Installation is via a downloadable executable installer. If you're comfortable with Windows Notepad or WordPad, the Notepad++ interface will be very comfortable to you also. The default mode is plain-text, UTF-8 encoded, with Windows line-feeds, and word wrapping turned on—normal Notepad defaults. If that's what you need it for, you're ready to go.

The real power of Notepad++ starts to show up when you want to edit code. Over 50 programming languages are built right in, and choosing one from the Language menu lets you turn on syntax highlighting, document maps, collapsible functions, autocomplete, and much more, depending on the language you choose. You can also define rules for new languages. Notepad++ does not come with Markdown defined, but helpfully, someone took care of that and released it, and setting that up is a snap.

Another nice feature of Notepad++ that is lacking elsewhere is a tabbed interface. You can open multiple files, even with different language settings, and things work the way you'd expect it to. This avoids a cluttered taskbar when you have lots of files open at once. A handy macro recorder is included on the toolbar, for creating keystroke shortcuts for use in multiple windows. Notepad++ also has a robust plugin system, with many plugins available for installation when you download it, and the ability to pull community-developed plugins from GitHub.

Notepad++ layout

Notepad++ layout

While working on this article, I've also got a FORTRAN 90 file open (the purpose of which is to reverse the input string), and you see by the shading of the tabs which file I'm working on—the red shading of the disk icon on the Markdown file in the first tab indicates that it has unsaved changes. In the FORTRAN file, the highlighted line 20 indicates where the edit cursor is, and the collapse tool at the left changes color, to give me an idea of the scope where I am working. You can easily collapse and hide sections, and whole functions, with this tool.

Working on a Perl project

Working on a Perl project

Now I'm hacking some Perl as I look to solve an old student problem. I've added some POD-formatted documentation to the bottom of the file, which tells what it's about, and Notepad++ properly makes this into a collapsible section for me, as well, and the syntax highlighting throughout the file is spot-on. You can also see the autocomplete window popped open as I type the "print" command.

Is Notepad++ the long-sought-for One Ring of text editing for Windows? Probably not—with plenty of other choices out there, there will always be die-hards who want to use Vim for Windows or WordPad or something else. I'm finding Notepad++ more and more useful in my own writing and coding, so if you're not happy with your current choice, it's definitely worth a look.

About the author

D Ruth Bavousett
Ruth Holloway - Ruth Holloway has been a system administrator and software developer for a long, long time, getting her professional start on a VAX 11/780, way back when. She spent a lot of her career (so far) serving the technology needs of libraries, and has been a contributor since 2008 to the Koha open source library automation suite.Ruth is currently a Perl Developer at cPanel in Houston, and also serves as chief of staff for an obnoxious cat.