VimScript is pretty good: VIm London Jan 2014

VimScript is pretty good: VIm London Jan 2014

A talk about how learning VimScript has really improved my Vim usage.

Aea964cf59c0c81fff752896f070cbbb?s=128

Jack Franklin

January 28, 2014
Tweet

Transcript

  1. VimScript is pretty good. @Jack_Franklin

  2. I suck at VimScript.

  3. And I’m going to show you some rubbish VimScript

  4. This isn’t a presentation on learning VimScript.

  5. But why you should learn it.

  6. None
  7. None
  8. And this is why we all love Vim.

  9. We’ve all put mappings in our .vimrc

  10. And VimScript is the natural progression

  11. And VimScript is the natural progression

  12. None
  13. None
  14. None
  15. Each of these saves me time, but more importantly, keystrokes

  16. Plus VimScript isn’t that bad* ! *mostly

  17. function! TwitterLink() let searchRegex = '@\([^ .]*\)' let searchReplace =

    '[&](http:// twitter.com/\1)' ! let oldLine = getline('.') let newLine = substitute(oldLine, searchRegex, searchReplace, ‘g') ! call setline('.', newLine) endfunction
  18. You might not want to write plugins

  19. But any arbitrary VimScript can go inside a .vimrc…

  20. Something I do all the time is want to execute

    a file
  21. So I wrote some VimScript to do it all for

    me
  22. None
  23. map <leader>e :call ExecuteFile()<CR>

  24. None
  25. xkcd.com/1319

  26. github.com/jackfranklin/dotfiles ! github.com/jackfranklin/vim-markdown- writer ! github.com/r00k/dotfiles ! learnvimscriptthehardway.stevelosh.com/

  27. tilvim.com github.com/jackfranklin/tilvim

  28. @Jack_Franklin ! (PS: https://thenetawards.com/) ! (sorry)