Commands i find useful in Vim.
A good place to start using vim is to go through the guide in:
vimtutor
To read more about below commands use :help
in
vim.
:gf
Super useful, when you hover over a path or something in your
PATH
then vim will goto the file.
:Vexplore
and :Sexplore
Will split the text editor s.t. you can jump in a new window to something different.
CTRL-I
and CTRL-O
When you have jumped somewhere you can use these two to jump back and forth.
I often type
vim .
And then CTRL-O
to jump to the file I had just
been editing.
You can search and replace with :%s/from/go/gc
.
The c option gives a prompt which is great.
Mark stuff in visual mode and then type :sort
and you will sort stuff.
Used :f
find a word and :t
to find
a word but put the cursor before it. Useful in visual mode.
%
If you have the cursor on a bracket typing %
will jump to the closing bracket.
Type :terminal
and you will get a terminal
emulator. You can copy from this terminal emulator by going into
normal mode in it.
Feel free to comment here below. A Github account is required.