Friday, March 26, 2010

Emacs Keyboard shortcuts

Movements:

M - f  <==> Move forward by one word
M - b <==> Move backward by one word

C - f   <==> Move forward by one letter
C - b  <==> Move backward by one letter
C - p  <==> Move up by one line
C - n  <==> Move down by one line

M - v  <==> PAGE UP
C - v  <==> PAGE DOWN

M - >  <==> Goto end of the file (U have to press "SHIFT" here to enter "<" )
M - <  <==> Goto the beginning of the file (same as above)

File operations:









C - x C- f  <==> To open a file
C - x k  <==> Close the current buffer (kill buffer)


M - d  <==> Delete next word
C - k   <==> Delete current line
C - y   <==> Paste (watever copied)

C - [space] <==> Start marking the portion
C - w  <==> Cut the portion till the cursor is in currently
M - w  <==> Copy the portion till the cursor is in currently

C - x u  <==> Undo last operation

M - g g  <==> Goto the line
M - x replace-string  <==> Search and replace

C - s [string]  <==> To search a string forward
C - r [string]  <==> To search a string backward

Windows:


C - x 0   <==> Close the current window
C - x 1   <==> Close all the windows except current window
C - x 2   <==> Split the current window vertically (means top and bottom)
C - x 3   <==> Split the current window horizontally (means left and right)
C - x o ('o' for 'others')   <==> Switch between windows

Shell:

M -x shell  <==> Open shell (terminal)

Setting Tab Size:


M - x set-variable [ENTER] c-basic-offset [ENTER]  8 <==> Setting tab size to 8


Auto-Indentation:

M -x indented-text-mode   <==> set auto indent (does not work through putty)

To search for a string in all the files in a directory:


M - x grep-find [Enter]  <==> This will generate a command; at the end of the command, give the string you want to search; and also set the directory in which you wana search

No comments:

Post a Comment