From 0fcd056648da760f727a7296bae364ea5c4b5e98 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 17 Sep 2013 02:02:37 +0200 Subject: fix: Switch erlang to oscarh/vimerl (it doesnt use plugin dir) --- autoload/erlang_complete.vim | 219 ------------------------------------------- 1 file changed, 219 deletions(-) delete mode 100644 autoload/erlang_complete.vim (limited to 'autoload/erlang_complete.vim') diff --git a/autoload/erlang_complete.vim b/autoload/erlang_complete.vim deleted file mode 100644 index 9d108fbc..00000000 --- a/autoload/erlang_complete.vim +++ /dev/null @@ -1,219 +0,0 @@ -" Vim omni completion file -" Language: Erlang -" Author: Oscar Hellström -" Contributors: kTT (http://github.com/kTT) -" Ricardo Catalinas Jiménez -" Eduardo Lopez (http://github.com/tapichu) -" Zhihui Jiao (http://github.com/onlychoice) -" License: Vim license -" Version: 2012/11/26 - -if !exists('g:erlang_completion_cache') - let g:erlang_completion_cache = 1 -endif - -" Completion program path -let s:erlang_complete_file = expand(':p:h') . '/erlang_complete.erl' - -" Modules cache used to speed up the completion -let s:modules_cache = {} - -" File cache for persistence between Vim sessions -if filewritable(expand(':p:h')) == 2 - let s:file_cache = expand(':p:h') . '/vimerl_cache' -else - let s:file_cache = '/tmp/vimerl_cache' -endif - -" Patterns for completions -let s:erlang_local_func_beg = '\(\<[0-9A-Za-z_-]*\|\s*\)$' -let s:erlang_external_func_beg = '\<[0-9A-Za-z_-]\+:[0-9A-Za-z_-]*$' -let s:erlang_blank_line = '^\s*\(%.*\)\?$' - -" Main function for completion -function erlang_complete#Complete(findstart, base) - let lnum = line('.') - let column = col('.') - let line = strpart(getline('.'), 0, column - 1) - - " 1) Check if the char to the left of us are part of a function call - " - " Nothing interesting is written at the char just before the cursor - " This means _anything_ could be started here - " In this case, keyword completion should probably be used, - " for now we'll only try and complete local functions. - " - " TODO: Examine if we can stare Identifiers end complete on them - " Is this worth it? Is /completion/ of a "blank" wanted? Can we consider - " `(' interesting and check if we are in a function call etc.? - if line[column - 2] !~ '[0-9A-Za-z:_-]' - if a:findstart - return column - else - return s:ErlangFindLocalFunc(a:base) - endif - endif - - " 2) Function in external module - if line =~ s:erlang_external_func_beg - let delimiter = match(line, ':[0-9A-Za-z_-]*$') + 1 - if a:findstart - return delimiter - else - let module = matchstr(line[:-2], '\<\k*\>$') - return s:ErlangFindExternalFunc(module, a:base) - endif - endif - - " 3) Local function - if line =~ s:erlang_local_func_beg - let funcstart = match(line, ':\@ 0 - let cache_entry = {a:module : func_list} - execute 'redir >>' . s:file_cache - silent echon cache_entry - silent echon "\n" - redir END - endif - endif -endfunction - -function s:ErlangPurgeCache(...) - for mod_name in a:000 - if has_key(s:modules_cache, mod_name) - call remove(s:modules_cache, mod_name) - endif - endfor - - " Delete the old cache file - call delete(s:file_cache) - - " Write a new one - for mod_name in keys(s:modules_cache) - call s:ErlangWriteCache(mod_name) - endfor -endfunction - -" Load the file cache when this script is autoloaded -call s:ErlangLoadCache() - -" Command for removing modules from the cache -command -nargs=+ ErlangPurgeCache silent call s:ErlangPurgeCache() -- cgit v1.2.3