vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

elixir.vim (1158B)


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