In: , ,
On: 2012 / 10 / 20
Shorter URL for this post: http://ozh.in/vi

There's a really nice post that's getting shared all over the intarnets right now, showcasing useful keyboard tricks in various editors, but I thought it missed Notepad++ which does support most of those tricks out of the box.

I decided to list a few quick keyboard tricks in Notepad++ I use daily, and there are really a few cool ones.

Delete whole words

Delete previous word: Control + Backspace
Delete next word: Control + Delete

Actually I think that works in any Windows application since it works right here in my WordPress Write interface.

More power: you can delete from carret to start of line or to end of line adding Shift in the combo:

Delete to start of line: Control + Shift + Backspace
Delete to end of line: Control + Shift + Delete

Duplicate or delete current line

Duplicate current line: Control + D
Delete current line: Control + L

I use the first one pretty often, especially when wanting to test something slightly different: duplicate line, comment first one out and slightly alter second one. Which goes along really well with next trick:

Comment or uncomment one or several lines

Comment or uncomment: Control + Q

That one toggles a leading // in current line or for a line selection. You can also add "stream comments" (ie /* stuff */) with the following key combo:

Add stream comment: Shift + Control + Q

Move that line

Switch current and previous line: Control + T
Move whole line to another place: Shift + Control + Up or Shift + Control + Down

The totally cool stuff is, that second trick works with a multiple line selection. This works great to move an entire small function or CSS declaration.

Column Editing

I've always thought that one was insane :) Pretty usefull if you want to edit several lines of a file where the same text is repeated, such as a CSS file.

Column selection: Alt + Left Click

Where does that code block starts or end? Find matching brace

Go to matching brace : Control + B

Of course the highlighting helps but when the block is taller than your screen, it's not enough. That one is one of my favorites, it makes navigation in if then else or function blocks really easy.

Automatic indentation

Select several lines and move them to the right (indent) or to the left (unindent? outdent?) in a blink

Indent several lines: Tab
Unindent several lines: Shift + Tab

Scroll through the document without using your mouse

Scroll without changing carret position: Control + Up or Control + Down

More !

That's just a few quick and useful keyboard tricks I use all the time, but there are a lot more. Notepad++ has also a gazillion plugins to do just anything you'd think of. The ones I use all the time are Function List (displays a function list in the sidebar, very handy to quickly navigate) and Finger Text, one of the many snippet plugins available.

Shorter URL

Want to share or tweet this post? Please use this short URL: http://ozh.in/vi

Metastuff

This entry "Commanding your Text Editor: the Notepad++ Edition" was posted on 20/10/2012 at 6:50 pm and is tagged with , ,
Watch this discussion : Comments RSS 2.0.

8 Blablas

  1. Ronnie says:

    Ozh! I have tried to install the "Function List" plugin, but it crashes on me. Notepad++ Plugin Manager has it listed as unstable. Just curious how you got this puppy to work? I actually used this a few years ago when it was stable at the time.

    And thanks for the comment/uncomment multiple lines with SHIFT-CTRL-Q! That is a timesaver. On single lines I just double-slash it out, easier for my fingers to do.

  2. Ozh says:

    Ronnie » Yes, it is listed indeed as unstable and can easily crash. It was a reason why I didn't upgrade Notepad++ for a long time but there's a trick to properly install it. Currently I'm running N++ 6.2 and the function list plugin 2.1, I think that article was what fixed it right for me. HTH!

  3. Ronnie says:

    Outstanding! That did the trick. BTW, the Amdaris website is down right now … was able to pull up a cached version of that article you referenced. Thanks for help Ozh!

  4. Ozh says:

    Ronnie » hopefully I mirrored it here: https://gist.github.com/4190794 for future reference :)

  5. Ronnie says:

    Ozh! Current rule file for Php is not very good. Daniel Kassner's rule file is almost there. Found another rule file on Git which is much improved and includes rules for CSS also.

    I can't get the custom icons to show though. Might be that the image reference is wonked … looking into that.

    As with Daniel's version, edit your XML file outside of NPP. The resulting list is very much like Eclipse and Netbeans.

  6. Ozh says:

    Ronnie » Awesome!

  7. Ronnie says:

    Ozh! Give 'er a try. Even without the fancy icons like the screenshots show, it is more than enough to enhance NPP.

    Another buggy thing is when you click inside a function within the editor, it is not being highlighted in the function list panel. That was working with the default PHP rule group. I can live without that … it is just nice to have the list and showing the parameters for the function.

  8. Rahul Nigam says:

    Sir, How can i highlight a particular line & save it in the same manner so that next time when i open i could find in the same highlighted manner as i did last time…..Thank you

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar and sign for a free account
Spam: Various spam plugins may be activated. I'll put pins in a Voodoo doll if you spam me.

Read more ?