Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Lukáš Šabľa - Vim

1,160 views

Published on

Published in: Technology
  • Be the first to comment

Lukáš Šabľa - Vim

  1. 1. :q!
  2. 2. [operator][count][motion]
  3. 3. (use text-objects) iw iW i( / ib
  4. 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. 5. selectcharacters v select lines V select block ^vswich cursor start/end o reselect prev. area gv prepend each line I
  6. 6. searching
  7. 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. 8. :registers registers:echo @r “a-“z “a-“z qr macro record @r macro playback
  9. 9. marksset mark m In file mm set mark M across files mM jump to line m ‘m jump to exact char `m
  10. 10. buffers:buffers:help :buffers:badd file:bnext:bprev:bdelete
  11. 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. 12. vimdiffdo get changesdp put changes]c next change[c^W ^W witch window
  13. 13. insert: ^p ^x, ^fnormal: ^a , ^x in/dekrement plugin Mondaycommand: ^r^w,^d
  14. 14. vimscript• Interny jazyk• .vimrc• Python, perl, ruby, ..• pluginy let items=[1,2,3,4] for item in items echo item endfor
  15. 15. pluginsgit clone git://github.com/joonty/myvim.git ~/.vimvim +BundleInstall +qall
  16. 16. syntax checking :!php –l %php QA toolsTags auto-completion ^x^oNERDTreeCtagsCodesniffer, mess detectorPHPUnitXdebug
  17. 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. 18. :set nobomb:syntax on:set number:set ignorecase, smartcase:set incsearch hlsearch
  19. 19. >> <<:retab! Ngu, gU, g~ - lower, uppercase^R+= simplecalc:sh:r!cmd
  20. 20. zf (fold) - nasleduje pohybovy prikaz - kolko riadkov - prvy z nichzfapvisual modezo (open)zc, zdzr, zm :set foldopen=allzR, zM :set foldclose=all

×