Vim for Mere Mortals
-
Upload
clayton-parker -
Category
Technology
-
view
174 -
download
0
Transcript of Vim for Mere Mortals
![Page 2: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/2.jpg)
Who am I?@claytron IRL and on the internets
Senior Software Engineer at TinderBox Vimmer ca. 2003
![Page 3: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/3.jpg)
is hard retro.
![Page 4: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/4.jpg)
Don't rage :quit! just yet...
![Page 5: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/5.jpg)
Fundamentals
![Page 6: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/6.jpg)
You start by learning the minimal to survive,
then you integrate all the tricks slowly.— Learn Vim Progressively
![Page 7: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/7.jpg)
$ vimtutor
![Page 9: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/9.jpg)
Terminology
![Page 10: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/10.jpg)
A buffer is the in-memory text of a file.A window is a viewport on a buffer.
A tab page is a collection of windows.:help window
![Page 11: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/11.jpg)
![Page 12: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/12.jpg)
![Page 13: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/13.jpg)
Modal Editing
![Page 14: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/14.jpg)
NormalVisualSelectInsert
CommandEx
![Page 15: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/15.jpg)
How do you generate a random string?
![Page 16: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/16.jpg)
Put a first year CS student in front of Vim and tell them to save and exit.
![Page 17: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/17.jpg)
#normalmodeproblems
![Page 18: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/18.jpg)
Normal Mode
![Page 19: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/19.jpg)
Insert Mode
![Page 20: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/20.jpg)
Command Mode
![Page 21: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/21.jpg)
Help!
![Page 22: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/22.jpg)
:help
![Page 23: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/23.jpg)
:help help
![Page 24: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/24.jpg)
For any topic :help syntasticFor an option :help 'syntastic_ignore_files'For a command :help :SyntasticInfo
![Page 25: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/25.jpg)
:helpgrep syntastic.*checker\c
![Page 26: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/26.jpg)
:tab help intro
![Page 27: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/27.jpg)
1. Help commands *online-help*
*help* *<Help>* *:h* *:help* *<F1>* *i_<F1>* *i_<Help>*<Help> or:h[elp] Open a window and display the help file in read-only mode. If there is a help window open already, use that one. Otherwise, if the current window uses the full width of the screen or is at least 80 characters wide, the help window will appear just above the current window. Otherwise the new window is put at the very top.
![Page 29: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/29.jpg)
Vim! Do you speak it?
![Page 30: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/30.jpg)
:help motion.txt
![Page 31: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/31.jpg)
2d3w │││└─ motion ││└─ count │└─ operator └─ count
![Page 32: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/32.jpg)
ggguG
the jerry yang treatment.
![Page 33: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/33.jpg)
xp
Transpose characters.
![Page 34: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/34.jpg)
dw
Delete till end of word.
![Page 35: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/35.jpg)
diw
Delete the current word.
![Page 36: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/36.jpg)
d2w
Delete two words.
![Page 37: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/37.jpg)
dd
Delete a line.
![Page 38: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/38.jpg)
d2d
Delete two lines.
![Page 39: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/39.jpg)
cw ciw c2w cg_ cG
vw viw v2w vg_ vG
![Page 40: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/40.jpg)
68i-<Esc>
Add an ascii bar
![Page 41: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/41.jpg)
2d3w │││└─ motion ││└─ count │└─ operator └─ count
![Page 42: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/42.jpg)
Arrow Keys?
![Page 43: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/43.jpg)
Experienced users prefer the hjkl keys because they are always right
under their fingers.
![Page 44: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/44.jpg)
Beginners often prefer the arrow keys,
because they do not know what the hjkl keys do.
![Page 45: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/45.jpg)
The mnemonic value of hjkl is clear from looking at the
keyboard.Think of j as an arrow pointing downwards.
— :help motion.txt
![Page 46: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/46.jpg)
VIMWIZARD
[1] a man who has magical powers, especially in legends and fairy tales
![Page 47: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/47.jpg)
You can use yourMOUSE
![Page 48: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/48.jpg)
Use vim-sensible to start out.Or go all in with Vim Bootstrap, Janus or spf13.
![Page 49: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/49.jpg)
Plugins
![Page 50: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/50.jpg)
Plugin ManagersPathogenVundlevim-plug
vim-addon-managerdein.vimVizardryVimana
![Page 51: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/51.jpg)
Install Pluginscall plug#begin()Plug 'tpope/vim-sensible'Plug 'scrooloose/syntastic'call plug#end()
![Page 52: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/52.jpg)
Pillaging .vimrc
![Page 53: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/53.jpg)
THE END
![Page 54: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/54.jpg)
Links→ @VimIndy→ vim.org→ Neovim
→ Help always in a tab→ My .vimrc
→ VIM: Hard Mode→ vim-galore: Everything you
need to know about Vim
![Page 56: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/56.jpg)
Articles / Books
→ Learn Vim Progressively→ Learn Vim the Hard Way→ Coming Home to Vim
→ Everyone Who Tried to Convince Me to use Vim was Wrong→ Learn to Speak Vim
→ Vim Text Objects: The Definitive Guide
→ Practical Vim
![Page 57: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/57.jpg)
Photo Credits Title (B.B. Wijdieks)
Fundamentals (@nobida) Terminology (@nicklockey)
Modal (@chrisobayda) Help (@mountaineer4061)
Help (@carbonated) Do you speak it? (@reallyboring) Arrow Keys (@regocasasnovas)
hjkl (@donpdonp) mouse (@kapy)
Sensible (@matt_gibson) Plugins (@chicagobart) Pillaging (Damian Gadal)
Links (@volvob12b)⬅ This Picture (@rhodes)
Thanks to and
![Page 58: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/58.jpg)
Vim for Mere Mortals by claytron is licensed under a Creative Commons Attribution-ShareAlike 4.0
International License.
![Page 59: Vim for Mere Mortals](https://reader034.fdocument.pub/reader034/viewer/2022042611/587121f81a28abe4448b540b/html5/thumbnails/59.jpg)
*bar*| To screen column [count] in the current line. |exclusive| motion. Ceci n'est pas une pipe.