I started learning vim from https://www.openvim.com/. https://danielmiessler.com/study/vim/
below are some basic commands I learned.
Vim has two modes insert mode and normal mode.
Insert mode helps to write text in vim as normal text editor like atom.
Normal mode make work efficient by manipulating text with shortcut commands.
To toggle between insert mode and escape mode you can type esc for normal mode and i for insert mode.
vim -v (prints vim version)
vim ~/work/my-proj
Shift + g (points cursor to bottom of a file)
gg (points cursor to top of a file)
j (next below line of the file)
k (next up of current line)
l (shifts cursor to +1 index from current index)
h (shifts cursor to -1 index from current index)
:q (exits file with warning for unsaved files)
:q! (forcefully exits file without warning)
:wq (write and quits file from current session)
:dd deletes line
ZZ(capital) alternative to q
:syntax on syntax highlights
:syntax of syntax does not highlights
u undo
ctrl + r redo
Highlighting syntax default in vim
open vi ~/.vimrc
add vim command :syntax on and save
VIM cheatsheets
https://vim.rtorr.com/