Warning: Creating default object from empty value in /home/planetozh/planetozh.com/blog/wp-content/plugins/paged-comments/paged-comments.php on line 31

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/planetozh/planetozh.com/blog/wp-content/plugins/paged-comments/paged-comments.php:31) in /home/planetozh/planetozh.com/blog/wp-content/plugins/yourls-wordpress-to-twitter/plugin.php on line 73

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/planetozh/planetozh.com/blog/wp-content/plugins/paged-comments/paged-comments.php:31) in /home/planetozh/planetozh.com/blog/wp-content/plugins/yourls-wordpress-to-twitter/plugin.php on line 73

Warning: Cannot modify header information - headers already sent by (output started at /home/planetozh/planetozh.com/blog/wp-content/plugins/paged-comments/paged-comments.php:31) in /home/planetozh/planetozh.com/blog/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home/planetozh/planetozh.com/blog/wp-content/plugins/paged-comments/paged-comments.php:31) in /home/planetozh/planetozh.com/blog/wp-content/plugins/ozh-who-sees-ads/wp_ozh_whoseesads.php on line 630

Warning: Cannot modify header information - headers already sent by (output started at /home/planetozh/planetozh.com/blog/wp-content/plugins/paged-comments/paged-comments.php:31) in /home/planetozh/planetozh.com/blog/wp-content/plugins/ozh-who-sees-ads/wp_ozh_whoseesads.php on line 631

Warning: Cannot modify header information - headers already sent by (output started at /home/planetozh/planetozh.com/blog/wp-content/plugins/paged-comments/paged-comments.php:31) in /home/planetozh/planetozh.com/blog/wp-content/themes/planetozh/functions.php on line 172

Warning: Cannot modify header information - headers already sent by (output started at /home/planetozh/planetozh.com/blog/wp-content/plugins/paged-comments/paged-comments.php:31) in /home/planetozh/planetozh.com/blog/wp-content/themes/planetozh/functions.php on line 173
Commanding your Text Editor: the Notepad++ Edition « planetOzh
In: , ,
On: 2012 / 10 / 20 Viewed: 4204 times
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


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. 1
    Ronnie United States »
    wrote, on 02/Dec/12 at 6:13 pm # :

    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. 2
    Ozh »
    said, on 02/Dec/12 at 10:07 pm # :

    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. 3
    Ronnie United States »
    thought, on 03/Dec/12 at 8:03 pm # :

    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. 4
    Ozh »
    said, on 03/Dec/12 at 10:21 pm # :

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

  5. 5
    Ronnie United States »
    said, on 04/Dec/12 at 7:14 pm # :

    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. 6
    Ozh »
    said, on 04/Dec/12 at 9:48 pm # :

    Ronnie » Awesome!

  7. 7
    Ronnie United States »
    wrote, on 04/Dec/12 at 10:05 pm # :

    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. 8
    Rahul Nigam India »
    thought, on 07/Dec/13 at 8:27 pm # :

    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

Comment Guidelines or Die

  • HTML: You can use these tags: <a href=""> <em> <i> <b> <strong> <blockquote>
  • Posting code: Post raw code (no <> &lt; etc) within appropriate tags : [php][/php], [css][/css], [html][/html], [js][/js], [sql][/sql], [xml][/xml], or generic [code][code]
  • Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar.
  • Spam: Various spam plugins on patrol. I'll put pins in a Voodoo doll if you spam me.
  • I will mark as Spam test comments, all comments with SEO names (ie "My Cool Online Shop" instead of "Joe") or containing forum-like signatures.

Read more ?