I used vim only to edit certain files but as my day to day tasks started becoming more on the terminal, I had to edit most of my files on Vim. This is a quick start guide to all short cuts I think that can come in handy to start, learn and increase productivity on vim. (Article is still being edited)

Basic Commands:

Insert Mode | Normal Mode | Quit | Write | Force

i =               "Insert Mode (Where you can type Stuff)"
Esc OR Ctrl + c = "Normal Mode"
:q =              "quit"
:q! =             "force quit"
:w =              "write"
:wq =             "write and quit"
:w! =             "force write (Override)"
o =               "open a new line in insert mode"
a =               "insert mode after the current cursor."


h j k l =   "left, down, up, right "
w =         "start of next word "
e =         "end of next word "
ctrl + ) =  "Takes you to the beginning of next sentence "
ctrl + ( =  "Takes you to the beginning of previous sentence "
shift + { = "Takes you to the beginning of previous paragraph "
shift + } = "Takes you to the beginning of next paragraph"
shift + g = "Takes you to the end of the file"
gg =        "Takes you to the beginning of the file"
ctrl + f =  "Takes you to the next screen"
ctrl + b =  "Takes you back one screen"
:[number] = "Cursor relocates to line the give line number"
vim [file] + [number] = "will open the file and take you to that line"
Shift + 4 [$] = "End of the line"

Finding and Selection

/ + [word_to_be_found] = "Finds the first occurence of word in the text"
Shift + 8 [*]= "Find the current word in the file"
Shift + v =    "Visual Selection"
Ctrl + v =     "Visual Block Selection Mode"

Cut, Copy, Paste & Delete

y + w =     "Copies the word"
p =       "paste's the copied text at the cursor"
shift + p = "Paste's the word before the cursor."
yy =      "copy whole line"
c + w =   "cut word"
c + ) =   "cut the sentence."
c + / + [character or word] = "cut everything uptil that character or word"
d + w =   "delete word"
d + ) =   "delete sentence"
dd =      "delete the entire line"
d + / + [word] = "Everything before that word will be deleted"
x =       "delete current character"

Replace and Marking

:s/[old_text]/[new_text] = "Replace the first occurance of a word with new text."
:s/[old_text]/[new_text]/g = "Replace all occurance of a word with the new text."
:s/[old_text]/[new_text]/gc = "Ask all occurance before replacing."

ma =      "Mark of a is set on the current line."
'a =      "Takes you back to the line if you are anywhere else"
It can also be used to delete through lines as marking a place and doing a [d'a] "


Vim has the concept of register where you can save your stuff and paste it later.

"ayy =     "this will copy the current line into register a.
"aP =      "will paste the contents of register "a" on any before the text.
ctrl + o = "go to previous location you were on"

ctrl + o = go to previous location you were on


:split =                "to split the screen in two with same files."
Ctrl + w + w = "cycle between windows."
Ctrl + w + c =  "close that window"

Traversing Directories and Files

:e [filename] or tab = "Iterate over files in that directory"
"It also opens the file in a new buffer"
:new [filename] = "opens the file in split mode."
:bd =             "buffer delete"
:bd [filename]    "delete the buffer for that file"
:e . =            "opens the current directory."
/ =               "search for files in that directory."
:e! =             "reload the file discarding any changes made."
:ls =             "move between opened files/buffers"
:bn / bp =        "move to the next and previous buffer."
:b [Click tabs]   "to iterate between buffers.

Reading or copying different files into others.

:r [filename] = will paste the content of the file into the opened file.
:-1r [filename] = will paste the content of the file excluding the first line.
:r! ls = will write the op of the ls command in the file

Command Line:

:! [command] = "runs the command in the directory"
:com! [your_command] ! [actual_command] %
#Explanations =
com! =  "define a command"
% =     "will expanded to the current file name"
Eg: com! Py ! python %
and running :Py will run that file.

Text Processing:

vim +1,2d +wq filename = "Deletes lines 1 and 2 of file"
vim file1 file2 -d     = "Starts vim with diff mode"
do = "Diff obtain [Obtain changes from one file"
dp = "Diff put [Insert changes into another file"

"If we face an error."
g + shift + f = "open the file in the same line as the error"