Ctrl + a (takes you to the beginning of the line)
Ctrl + e (takes you to the end of the line)
Alt or Option + (left arrow) or (right arrow) move back by 1 word (the alternative is Esc + b or Esc + f -- I have to retype Esc + b *each time*)
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Let’s you search through previously used commands
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.
Ctrl + K Clear the line after 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
VIM commands in MAC OSX
ctrl-F | Move forward one screen. |
ctrl-B | Move backward one screen. |
$ | Move cursor to end of line. |
^ | Move cursor to beginning of line. |
:1 | Move to first line of file |
:$ | Move to last line of file |
/ | Search for a character string. |
? | Reverse search for a character string. |
x | Delete the character at the cursor position. |
dd | Delete the current line. |
p | Paste data that was cut with x or dd commands. |
u | Undo. |
Entering Input Mode
a | Add text after the cursor. |
i | Insert text before the cursor. |
R | Replace text starting at the cursor. |
o | Insert a new line after the current one. |
Entering Command Mode
esc | Switch from Input mode to Command mode. |
Exiting or Saving Your File
:w | Write file to disk, without exiting editor. |
ZZ | Save the file and exit. |
:q! | Quit without saving. |
No comments:
Post a Comment