elixir.vim 980 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. " Elixir filetype plugin
  2. " Language: Elixir
  3. " Maintainer: Mitchell Hanberg <vimNOSPAM@mitchellhanberg.com>
  4. " Last Change: 2023 Dec 27
  5. if exists("b:did_ftplugin")
  6. finish
  7. endif
  8. let b:did_ftplugin = 1
  9. let s:save_cpo = &cpo
  10. set cpo&vim
  11. " Matchit support
  12. if exists('loaded_matchit') && !exists('b:match_words')
  13. let b:match_ignorecase = 0
  14. let b:match_words = '\:\@<!\<\%(do\|fn\)\:\@!\>' .
  15. \ ':' .
  16. \ '\<\%(else\|catch\|after\|rescue\)\:\@!\>' .
  17. \ ':' .
  18. \ '\:\@<!\<end\>' .
  19. \ ',{:},\[:\],(:)'
  20. endif
  21. setlocal shiftwidth=2 softtabstop=2 expandtab iskeyword+=!,?
  22. setlocal comments=:#
  23. setlocal commentstring=#\ %s
  24. setlocal indentkeys=0#,!^F,o,O
  25. " Enable keys for blocks
  26. setlocal indentkeys+=0=after,0=catch,0=do,0=else,0=end,0=rescue
  27. " Enable keys that are usually the first keys in a line
  28. setlocal indentkeys+=0->,0\|>,0},0],0),>
  29. let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< indk<'
  30. let &cpo = s:save_cpo
  31. unlet s:save_cpo