Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Vim introduction
Dmitrijs Vrublevskis
July 12, 2014
Programming
1
83
Vim introduction
https://plus.google.com/events/cv8rtf625f5hc8jn6qmhpsb2nho
Dmitrijs Vrublevskis
July 12, 2014
Tweet
Share
More Decks by Dmitrijs Vrublevskis
See All by Dmitrijs Vrublevskis
fylmtm
0
61
fylmtm
0
120
fylmtm
0
46
fylmtm
0
900
fylmtm
0
190
fylmtm
1
110
fylmtm
0
71
Other Decks in Programming
See All in Programming
junghyeonjae
0
170
shinyorke
0
110
hitsuji_haneta
2
660
lmcinnes
0
210
yuhta28
0
480
shiz
2
450
joytomo
9
1.7k
balconia
0
140
jdkfx
0
100
balconia
0
150
mizzsugar
1
890
balconia
0
140
Featured
See All Featured
keithpitt
403
20k
mthomps
43
2.4k
marcelosomers
223
15k
chriscoyier
498
130k
myddelton
110
11k
kastner
55
2k
geeforr
334
29k
shpigford
372
43k
sachag
448
36k
addyosmani
1351
200k
addyosmani
315
21k
jakevdp
777
200k
Transcript
Vim introduction @Dmitrijs Vrublevskis
About me • Developer @ “Transact PRO” • Unhappy with
PHP • In love with Ruby • Believe in Linux
Backup plan https://www.codebox.io
Intro • Programmer's text editor • Released publicly in 1991
• Based on the vi editor • Vim is a tool, the use of which must be learned. • Shortcuts & no-mouse
My use cases • Ruby (Rails) development (sometimes) • One-time
source editing (bugfixes, types and etc) • Editing via SSH (nginx, apache, hosts and etc) • Diff (rarely) • Development (Intellij IDEA plugin)
$ vim file.txt § - command sequences for pro
<esc> <esc> <esc> <esc> <ctrl-c> <ctrl-c> <ctrl-c> <ctrl-c>
Modes • Insert • Normal ! • Visual • Command
Modes[Insert] 1. Insert A. Cursor - <i> B. Append -
<a> C. On new line - <o> 2. Type text 3. Exit - <ctrl-c>
Modes[Normal] • Left - <h> - <left_arrow> • Right -
<l> - <right_arrow> • Down - <j> - <down_arrow> • Up - <k> - <up_arrow> ! • § 5l • § 2j
Modes[Normal] • Word - <w> • End word - <e>
• Back word - <b> • Find - <f><any_letter_to_find> ! • § F2e • § t”
Modes[Normal] • Delete under cursor - <x> • Replace -
<r><letter> • Delete - <d><motion> • Change - <c><motion> • Motion - <w>|<e>|<h> … ! • § d5k • § ca”
Modes[Visual] • Visual - <v> • Line visual - <shift-v>
• Block visual - <ctrl-v>
Modes[Command] • Write - <:><w> • Quit - <:><q> •
Write and quit - <:><w><q> • Write and quit - <:><x> • Quit without save - <:><q><!> • Search - </><pattern><enter> • Next / Prev - <n> / <N>
Useful • § <c><i><“> - Delete all in “” and
put in insert mode. • § <d><t><)> - Delete all till first ‘)’ • § <i><text><.> - Write some text and repeat • § <F><(> - Move cursor to first ‘(‘, backwards
Learn vim • http://www.viemu.com/ a_vi_vim_graphical_cheat_sheet_tutorial.html • http://vim-adventures.com/ • https://www.shortcutfoo.com
Vim projects • http://neovim.org/ - New next generation • https://github.com/gmarik/Vundle.vim
- Plugin manager • https://github.com/Valloric/YouCompleteMe - Autocompletion • https://github.com/FylmTM/dotfiles/blob/master/ vim/vimrc - Mine ‘.vimrc’
None