diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2017-09-28 22:18:09 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2017-09-28 22:18:09 +0200 |
commit | 27903c5b8656c796564ef073c1ebe77a2f0154e1 (patch) | |
tree | 2b0a3a14494d7976fb79a7517706e25d2a95d080 /ftplugin/erlang.vim | |
parent | d5e38fa97bc50a93a66473d6cd7072fbcbadda57 (diff) | |
download | vim-polyglot-3.0.0.tar.gz vim-polyglot-3.0.0.zip |
Revert inlining basic language packv3.0.0
Diffstat (limited to 'ftplugin/erlang.vim')
-rw-r--r-- | ftplugin/erlang.vim | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/ftplugin/erlang.vim b/ftplugin/erlang.vim deleted file mode 100644 index ddf27709..00000000 --- a/ftplugin/erlang.vim +++ /dev/null @@ -1,91 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vim') == -1 - -" Vim ftplugin file -" Language: Erlang -" Author: Oscar Hellström <oscar@oscarh.net> -" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com> -" Eduardo Lopez (http://github.com/tapichu) -" License: Vim license -" Version: 2012/01/25 - -if exists('b:did_ftplugin') - finish -else - let b:did_ftplugin = 1 -endif - -if exists('s:did_function_definitions') - call s:SetErlangOptions() - finish -else - let s:did_function_definitions = 1 -endif - -let s:cpo_save = &cpo -set cpo&vim - -if !exists('g:erlang_keywordprg') - let g:erlang_keywordprg = 'erl -man' -endif - -if !exists('g:erlang_folding') - let g:erlang_folding = 0 -endif - -let s:erlang_fun_begin = '^\a\w*(.*$' -let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$' - -function s:SetErlangOptions() - if g:erlang_folding - setlocal foldmethod=expr - setlocal foldexpr=GetErlangFold(v:lnum) - setlocal foldtext=ErlangFoldText() - endif - - setlocal comments=:%%%,:%%,:% - setlocal commentstring=%%s - - setlocal formatoptions+=ro - let &l:keywordprg = g:erlang_keywordprg -endfunction - -function GetErlangFold(lnum) - let lnum = a:lnum - let line = getline(lnum) - - if line =~ s:erlang_fun_end - return '<1' - endif - - if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1 - return '1' - endif - - if line =~ s:erlang_fun_begin - return '>1' - endif - - return '=' -endfunction - -function ErlangFoldText() - let line = getline(v:foldstart) - let foldlen = v:foldend - v:foldstart + 1 - let lines = ' ' . foldlen . ' lines: ' . substitute(line, "[\ \t]*", '', '') - if foldlen < 10 - let lines = ' ' . lines - endif - let retval = '+' . v:folddashes . lines - - return retval -endfunction - -call s:SetErlangOptions() - -let b:undo_ftplugin = "setlocal foldmethod< foldexpr< foldtext<" - \ . " comments< commentstring< formatoptions<" - -let &cpo = s:cpo_save -unlet s:cpo_save - -endif |