From 68f4a48ffe7b8f28fa74c65a2145aa69136ba257 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Mon, 6 Jul 2015 14:11:15 +0200 Subject: [PATCH] [vim] Remove WhatFunction echoFunc is used instead --- .vim/plugin/WhatFunction.vim | 63 ------------------------------------ 1 file changed, 63 deletions(-) delete mode 100644 .vim/plugin/WhatFunction.vim diff --git a/.vim/plugin/WhatFunction.vim b/.vim/plugin/WhatFunction.vim deleted file mode 100644 index 6df4cff..0000000 --- a/.vim/plugin/WhatFunction.vim +++ /dev/null @@ -1,63 +0,0 @@ -" Display current function in status bar -" -" Use WhatFunction could create some problems with lines longer that the -" screen size. WhatFunction could be interesting for C++ function -function! GetProtoLine() - let ret = "" - let line_save = line(".") - let col_save = col(".") - let top = line_save - winline() + 1 - let so_save = &so - let &so = 0 - let istypedef = 0 - " find closing brace - let closing_lnum = search('^}','cW') - if closing_lnum > 0 - if getline(line(".")) =~ '\w\s*;\s*$' - let istypedef = 1 - let closingline = getline(".") - endif - " go to the opening brace - normal! % - " if the start position is between the two braces - if line(".") <= line_save - if istypedef - let ret = matchstr(closingline, '\w\+\s*;') - else - " find a line contains function name - let lnum = search('^\w','bcnW') - if lnum > 0 - let ret = getline(lnum) - endif - endif - endif - endif - " restore position and screen line - exe "normal! " . top . "Gz\" - call cursor(line_save, col_save) - let &so = so_save - return ret -endfunction - -function! WhatFunction() - if &ft != "c" && &ft != "cpp" - return "" - endif - let proto = GetProtoLine() - if proto == "" - return "?" - endif - if stridx(proto, '(') > 0 - let ret = matchstr(proto, '\w\+(\@=') - elseif proto =~# '\' - let ret = matchstr(proto, 'struct\s\+\w\+') - elseif proto =~# '\' - let ret = matchstr(proto, 'class\s\+\w\+') - else - let ret = strpart(proto, 0, 15) . "..." - endif - return ret -endfunction - -" set statusline=%<%f\ %h%w%m%r%3.(\ %)%{fugitive#statusline()}%=%([%{Tlist_Get_Tagname_By_Line()}%{WhatFunction()}]%)%3.(\ %)%-14.(%l,%c%V%)\ %P -