vim-polyglot/ftplugin/elixir.vim

41 lines
1.0 KiB
VimL
Raw Normal View History

if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
2013-09-12 11:31:56 -04:00
if (exists("b:did_ftplugin"))
finish
endif
let b:did_ftplugin = 1
" Matchit support
if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 0
2016-01-22 03:08:00 -05:00
let b:match_words = '\:\@<!\<\%(do\|fn\)\:\@!\>' .
2013-09-12 11:31:56 -04:00
\ ':' .
\ '\<\%(else\|elsif\|catch\|after\|rescue\)\:\@!\>' .
\ ':' .
\ '\:\@<!\<end\>' .
\ ',{:},\[:\],(:)'
endif
2017-05-17 05:07:28 -04:00
setlocal shiftwidth=2 softtabstop=2 expandtab iskeyword+=!,?
2013-09-12 11:31:56 -04:00
setlocal comments=:#
setlocal commentstring=#\ %s
2016-05-02 04:42:37 -04:00
let &l:path =
\ join([
2017-05-17 05:07:28 -04:00
\ 'lib',
\ 'src',
\ 'deps/**/lib',
\ 'deps/**/src',
2016-05-02 04:42:37 -04:00
\ &g:path
\ ], ',')
2017-05-17 05:07:28 -04:00
setlocal includeexpr=elixir#util#get_filename(v:fname)
2016-05-02 04:42:37 -04:00
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl
2016-07-05 03:53:49 -04:00
silent! setlocal formatoptions-=t formatoptions+=croqlj
2016-05-02 04:42:37 -04:00
2017-05-17 05:07:28 -04:00
let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< '.
\ '| unlet! b:match_ignorecase b:match_words'
endif