Productive text editing with Vim
-
Upload
bryanbibat -
Category
Documents
-
view
1.090 -
download
1
description
Transcript of Productive text editing with Vim
Productive Text Editing with Vim
Bryan Bibatpangkaraniwang developer
Really old text-editors
vi – 35 years old
vim – 20 years old
Present in most *nix machines
Not just a weird editor with an “Insert mode”
i – insert mode
<esc> – normal mode
:e – open file
:w – write
:q – quit
vi – a language for editing
Tip 1:
Use insert mode only as needed.
Tip 8:
Plugins are fun.
Tip 3:
Normal mode is faster for navigation.
Tip 2:
“i” is not the only way to go to insert mode.
i – insert mode at currenta – (append) insert at next
I – insert at beginningA – append at end of line
o – new line at nextO – new line before
Tip 3:
Normal mode is faster for navigation.
Tip 3.1:
Feel free to use the arrow keys over h-j-k-l (though you
shouldn't use them much).
0 – beginning of line$ – end of line
w – next word
e – end of next wordb – prev word
f[char] – find char on same linet[char] – 'til char
* – next same word# – prev same word
/[pattern] – search for pattern?[pattern] – search backward
n – nextN – previous
Tip 4:
Learn the many text manipulation commands.
. – repeat last actionu – undo
<ctrl>r – redo
y – yank (copy)
Tip 4.1:
Using certain commands twice will apply the command to the
current line.
d – deletec – change (go to insert)
Tip 5:
You must learn combining commands with motion
commands.
ct[space] - replace everything until space
Tip 6:
Visual mode allows you to select text.
v – enter visual mode
V – enter visual line mode
Tip 7:
Split screen and tabs can make programming more convenient.
:split – horizontal split:vsplit – vertical split
ctrl-w[direction] – switch
:tabnew – new tabgt – change tab
Tip 8:
Plugins are fun.
Tip 9:
Learn a new thing every day/week.
Thank you for listening!
github.com/bryanbibat@bry_bibat
pd.bryanbibat.net
Thank you for listening!
github.com/bryanbibat@bry_bibat
pd.bryanbibat.net