]> git.rmz.io Git - dotfiles.git/blobdiff - vim/ftplugin/cpp.vim
nvim: use nvim-origami for folds
[dotfiles.git] / vim / ftplugin / cpp.vim
index d24f1ff44a570d2def86a18b419ee117f6f0e73b..a039bacdca9557403cef9ca2c6b0a8a3b7eb5b55 100644 (file)
@@ -76,30 +76,3 @@ function! s:Debug(...)
 endfunction
 command! -nargs=* -complete=file -bang Debug call <SID>Debug() | Termdebug<bang> <args>
 command! -nargs=+ -complete=file -bang DebugCommand call <SID>Debug() | TermdebugCommand<bang> <args>
 endfunction
 command! -nargs=* -complete=file -bang Debug call <SID>Debug() | Termdebug<bang> <args>
 command! -nargs=+ -complete=file -bang DebugCommand call <SID>Debug() | TermdebugCommand<bang> <args>
-
-setlocal foldmethod=syntax
-" set foldlevel according to number of matches of 'namespace' and 'class' not
-" containing ';'
-function! InitialFoldLevel()
-    let v:errmsg = ""
-    keepjumps keeppatterns silent! 1,/}/s/^\(namespace\|class\) \+[^;]*$//n
-    if v:errmsg == ""
-        let &l:foldlevel=str2nr(split(v:statusmsg)[0])
-    endif
-endf
-call InitialFoldLevel()
-
-function! MyCppFoldText()
-  let l:line = getline(v:foldstart)
-  " expand tabs in line, foldtext does not do it on its own
-  let l:line = substitute(l:line, "\t", repeat(" ", shiftwidth()), "g")
-  let l:width = min([&textwidth, winwidth(0)])
-  let l:lineinfo = printf("%d", v:foldend - v:foldstart)
-  let l:ellipsis = "…"
-  return printf("%.*s%s%*d",
-        \ l:width - strdisplaywidth(l:ellipsis..l:lineinfo), l:line,
-        \ l:ellipsis,
-        \ l:width - strdisplaywidth(l:line..l:ellipsis),     l:lineinfo)
-endfunction
-setlocal foldtext=MyCppFoldText()
-setlocal fillchars+=fold:\