Thursday, June 17, 2010

emacs advanced tips




Select char only Word
M + @        
       
Select whole word including special chars
Ctrl +M+ @

Select paragraph
Ctrl + h 


Select whole function
Ctrl+M+h

Ctrl x + h
Select whole buffer

Select current page
Ctrl x  Ctrl p


/////////////////////////////////////////
Insert Block
C x + rt


Remove Block
C x + rk

Yank Block
C x + ry
/////////////////////////////////////////////


M-y
Immediately after C-y, this replaces the yanked part
by the other snippets in the kill ring.

Apply command on shell region:
select region + Alt | + command

find and replace
M + % Space or Del or Ret

Repeat
C + x z

Undo
C + z

Redo
C+g C+z



(define-key global-map "\C-z" 'undo)
(define-key global-map "\M-g" 'goto-line)



Bash quick reference

Ctrl + U Clears the line before the cursor position.
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
Esc + T Swap the last two words before the cursor
Alt + F Move cursor forward one word on the current line
Alt + B Move cursor backward one word on the current line

Tab Auto-complete files and folder names
Ctrl + K Clear the line after the cursor
Ctrl + R Let’s you search through previously used commands
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + H Same as backspace
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.