Glump.net Glump.net.
- /ExtGState/ProcSet/PDF/Text/ImageB/ImageC/ImageI /Annots 9 0 R 10 0 R /MediaBox 0 0 1008 612 /Contents 4 0 R/Group/ProcSet/PDF/Text/ImageB/ImageC/ImageI.
- Mac OS X:: VI Keyboard Shortcut Cheat Sheet Twitter: @pcgeek86 Source: http://www.worldtimzone.com/res/vi.html.
- LINUX COMMANDS CHEAT SHEET System dmesg = Displays bootup messages cat /proc/cpuinfo = Displays more information about CPU e.g model, model name, cores, vendor id cat /proc/meminfo = Displays more information about hardware memory e.g. Total and Free memory lshw =Displays information about system’s hardware configuration.
- Vim Cheat Sheet by Martinsos - Cheatography.com Created Date: 0049Z.
vi is one of the most commonly used editor program and included by default with every UNIX and linux system. vi basically operates in 3 modes, namely :
- vi mode – the mode vi starts in
- command mode – you can be in command mode from the vi mode by pressing the key colon (“:”)
- input mode – in this mode user starts the actual editing of the text
Below are some of the most commonly used vi commands in all 3 modes of operation.
Vim Mac Download
vi mode commands
Command | Action |
---|---|
k | Move one line upwards |
l | Move one character to the right |
h | Move one character to the left |
w | Move one word to the right |
W | Move one word to the right past punctuation |
b | Move one word to the left |
B | Move one word to the left past punctuation |
e | Move to the end of the current word |
1G | Move to the beginning of the file |
H | Move to the top of the current screen |
M | Move to the middle of the current screen |
L | Move to the bottom of the current screen |
Ctrl-G | Move to the last line in the file |
Ctrl-F | Move one screen towards the end of the file |
Ctrl-D | Move 1/2 screen towards the end of the file |
Ctrl-B | Move one screen towards the beginning of the file |
Ctrl-U | Move 1/2 screen towards the beginning of the file |
Ctrl-L | Refresh the screen |
5G | Move to line 5 of the file (5 can be any line number) |
/string | Find text string forward |
?string | Find text string backward |
n | Find forward next string instance after a string search |
N | Find backward next string instance after a string search |
ZZ | Save the file exit vi |
x | Delete the character at the cursor |
X | Delete the character behind the cursor |
dd | Delete the line the cursor is on |
10dd | Delete the 10 lines following the cursor |
yy | Yank the current line |
p | Put the yanked line below the current line |
P | Put the yanked line above the current line |
Command mode commands
Command | Action |
---|---|
:g/X/s//x/g | Global Search and replace (X=search object x=replace object) |
:r file | Import a file into the current file |
:34 r file | Import a file into the current file after line 34 |
:w | Write out the file to save changes |
:w file | Write the file to named file |
:wq | Save the file exit vi |
:w! | Force save the file |
:q! | Quit vi but don’t save changes |
Input mode commands
Command | Action |
---|---|
a | Insert characters to the right of the cursor |
A | Append characters to the current line |
i | Insert characters to the left of cursor |
I | Insert characters at the beginning of the current line |
o | Add a new line after current line |
O | Insert a new line above the current line |
Familiarity with Vim shortcuts will help Linux users. Vim editor is a more enhanced version of the venerable VI Editor. The Vim Editor, a cross-platform text editor, is a very lightweight, efficient, highly configurable and powerful tool. The Vim helps you to work with more than one document at a time, and it can do extraordinary things without a mouse.
List of Vim Shortcuts – Vim Cheat sheet
Table of Contents
- 1 List of Vim Shortcuts – Vim Cheat sheet
Vim Cheat Sheet
Note that the VIM shortcuts depend upon the mode of the editor. Hence you must check the way first while using the VIM shortcuts.
Below is the list of Vim shortcuts. By mastering a couple of Vim shortcuts, you’ll quickly achieve higher productivity that you’ll with a daily text editor. With this, you will see small improvements in your keyboard commands. Download the Vim shortcuts PDF.
General Shortcuts
Action | Shortcut Keys |
---|---|
Yank (Copy) a line | yy |
Yank 2 lines | 2yy |
Yank word | yw |
yank to end of line | y$ |
Put (paste) the clipboard after cursor | p |
Put (paste) before cursor | P |
Delete a line | dd |
Delete the current word | dw |
Delete current character | x |
Editing Shortcuts
Action | Shortcut Keys |
---|---|
Change an entire line | cc |
Change to the end of word | cw |
Change to the end of line | c$ |
Delete character at cursor | s |
Transpose two letters | xp |
Undo | u |
Repeat last command | . |
Replace a single character | r |
Join line below to the current one | J |
Cursor Movement Shortcuts
Action | Shortcut Keys |
---|---|
Move left | h |
Move down | j |
Move up | k |
Move right | I |
Jump by start of words | w |
Jump by words | W |
Jump by end of words | e |
Jump by end of words | E |
Jump backward by words | b |
Jump backward by words | B |
start of line | 0 |
First non-blank character of line | ^ |
End of line | $ |
Go to command | G |
Inserting and Appending text | Insert |
Visual Mode Shortcuts
Action | Shortcut Keys |
---|---|
Start visual mode | v |
Move to other end of marked area | o |
Start linewise visual mode | V |
Move to other corner of block | O |
mark a word | aw |
a () block | ab |
a {} block | aB |
Inner () block | ib |
Inner {} block | iB |
Exit | Esc |
Visual Commands Shortcuts
Action | Shortcut Keys |
---|---|
Shift Right | > |
Shift Left | < |
Copy marked text | y |
Delete marked text | d |
switch case | ~ |
Search and Replace Shortcuts
Vim Cheat Sheet Pdf For Mac Os
Action | Shortcut Keys |
---|---|
Search for pattern | /pattern |
Search backward for pattern | ?pattern |
Repeat search in the same direction | n |
Repeat search in the opposite direction | N |
Replace all old with new throughout the file | :%s/old/new/g |
Replace all old with new throughout file with a confirmation | :%s/old/new/gc |
Others shortcuts
Action | Shortcut Keys |
---|---|
Edit a file in a new buffer | :e filename |
Go to Next buffer | :bnext |
Go to previous buffer | :bprev |
Delete a buffer | :bd |
Split windows | Ctrl + ws |
Switch between windows | Ctrl + ww |
Quit a window | Ctrl + wq |
Split windows vertically | Ctrl + wv |
Save the file | :w |
Save and Quit | :wq |
Quit | :q |
Related Blog
Vim isn’t easy to learn for all and so it requires you to learn a variety of editor commands. These Vim shortcuts are best suited for people who are programmers, coders, system administrators, and individuals with the streamlined editor.
Vim in today’s world has reached its massive popularity. However, if you wish to see some alternative to Vim shortcuts are: Notepad ++ shortcuts, Visual Studio Code shortcuts, Sublime Text shortcuts.
Hope you have liked our blog on Vim Shortcuts and Vim Cheat Sheets. Suggestions are always welcomed for the blog you looking forward to hearing from us. Connect with us and Take your Office Productivity to Next Level.