Your SlideShare is downloading. ×
Lukáš Šabľa - Vim
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Lukáš Šabľa - Vim

867

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
867
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. :q!
  • 2. [operator][count][motion]
  • 3. (use text-objects) iw iW i( / ib
  • 4. beginning of line I before cursor i after cursor a end of line A previous line O next line o substitute character s substitute line S line from cursor C
  • 5. selectcharacters v select lines V select block ^vswich cursor start/end o reselect prev. area gv prepend each line I
  • 6. searching
  • 7. substitutions:%s/foo/bar „foor“ -> „bar“:s/foo/bar/g on the line:s/..k/ax/ wildcards:2,4s/foo/bar/g:s/(.*):(.*)/2 : 1/:g/foobar/d delete all lines containing „foobar“c C – case (in)sensitive
  • 8. :registers registers:echo @r “a-“z “a-“z qr macro record @r macro playback
  • 9. marksset mark m In file mm set mark M across files mM jump to line m ‘m jump to exact char `m
  • 10. buffers:buffers:help :buffers:badd file:bnext:bprev:bdelete
  • 11. windowsvim -o / -O filename filename2split,vsplit: filename:q - pokial je otvorenych viac okien,vim sa nestara o ulozenie suboruCtrl + W + h,j,k,l / sipky - prepinanie okienCtrl + W + r,R - rotacia okienCtrl + W + xCtrl + [+] / [-]Ctrl + W + <,>Ctrl + W + _ , Ctrl + W + |, Ctrl + W + =
  • 12. vimdiffdo get changesdp put changes]c next change[c^W ^W witch window
  • 13. insert: ^p ^x, ^fnormal: ^a , ^x in/dekrement plugin Mondaycommand: ^r^w,^d
  • 14. vimscript• Interny jazyk• .vimrc• Python, perl, ruby, ..• pluginy let items=[1,2,3,4] for item in items echo item endfor
  • 15. pluginsgit clone git://github.com/joonty/myvim.git ~/.vimvim +BundleInstall +qall
  • 16. syntax checking :!php –l %php QA toolsTags auto-completion ^x^oNERDTreeCtagsCodesniffer, mess detectorPHPUnitXdebug
  • 17. Mapping map <F2> :NERDTreeToggle<CR> imap ,a <a href=""></a><Esc>F"i nmap vmapKostry autocmd BufNewFile *.php 0r ~/.vim/skeletons/skeleton.php:filetype plugin on
  • 18. :set nobomb:syntax on:set number:set ignorecase, smartcase:set incsearch hlsearch
  • 19. >> <<:retab! Ngu, gU, g~ - lower, uppercase^R+= simplecalc:sh:r!cmd
  • 20. zf (fold) - nasleduje pohybovy prikaz - kolko riadkov - prvy z nichzfapvisual modezo (open)zc, zdzr, zm :set foldopen=allzR, zM :set foldclose=all

×