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.
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.
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
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.
Want to share or tweet this post? Please use this short URL: http://ozh.in/vi