vim - notes
Handy Dandy Cheat Sheet
:jumps command gives a list of positions you jumped to.
Jump to last
ctrl + o
Open vim with backup copy
vim -c "set backupcopy=yes" <file_name>
vim remove starting spaces
or use left align command
vim remove trailing white space
Open multiple files in vim
vim -d file1 file2
Create a new file
Show buffers (other open files)
Switch between buffers
:b <number> :b 2
Next buffer / previous buffer
:split file_name :vsplit filename :vsp filename :vs :sp
move between windows or splits
control + w 2times or ctrl + w [h/j/k/l] --> vim movements
open multiple files in tabs
vim -p file1 file2
tabnew path/to/file tabedit file
Move between tabs
gt --> move to next tab gT --> move to previous tab
Vim file explorer
:Explore - opens netrw in the current window :Sexplore - opens netrw in a horizontal split :Vexplore - opens netrw in a vertical split
If you found this useful please consider supporting the blog.
I use Fastmail to host my email for the blog. If you follow the link from this page you’ll get a 10% discount and I’ll get a little bit of break on my costs as well. It’s a win win.
Backblaze is a cloud backup solution for Mac and Windows desktops. I use it on my home computers, and if you sign up using the link on this page you get a free month of service through backblaze, and so do I. If you’re looking for a good backup solution give them a try!