Some handy shortcuts for Textmate, Vim and the command line.

Posted on 27 July 2008

These are probably my most used shortcuts:

Textmate

ctrl+shift+> = open and close erb tags <% = %>

alt+command+] = auto indent highlighted code

ctrl+shift+w = auto put html tags around highlighted code

alt+command+> = auto close tag

ctrl+command+w = close all open tabs

alt+command+a = type on the end of multiple lines of highlighted code

VIM

o - is new line

d, shift g - clears the file (d is delete and capital g is bottom of the file)

:set number - turn on line numbers

18, shift g - goes to line 18

dd - deletes a line

Command line

ctrl+r - searches through recent commands (repeat to keep searching)

ctrl+a - beginning of the line

ctrl+e - end of line

About Paul

Paul works for Kyan web design agency in Surrey, UK as a Ruby on Rails developer.

Follow Paul on Twitter

Email: paulsturgess [at] gmail.com

Read more articles in the archive →

Comments...

  • More command Line tips:

    ctrl+w - deletes back to the previous space
    esc+backspace - deletes back to the nearest punctuation (e.g., . , / -)
    esc+b and esc+f - jumps the cursor back or forward on the line to the nearest punctuation

    Phil Balchin at 28 Jul 08 at 04:30

  • Hi, just so you know,

    in vim entering :18 will go to the line 18 ;)

    Pixoo at 25 Nov 10 at 02:48

Got something to say?