X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/cabc8c44dfafcab5e64a5c9d27aec7e1f0676a39..3c22fe5c28e8f2e06bc608be2d78b580ffd2fefb:/vim/ftplugin/cpp.vim diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index 06d4861..7984c68 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -63,6 +63,16 @@ setlocal errorformat+=%X%*\\a:\ Leaving\ directory\ [`']%f' setlocal errorformat+=%*[^[]\[%tRROR\]%m\ \[%f:%l\] setlocal errorformat+=%*[^[]\[%tARNING\]%m\ \[%f:%l\] +packadd termdebug +let g:termdebug_wide = 1 +function! s:Debug(...) + tabedit % + let t:debug_tab=1 + au BufDelete !gdb ++once if exists('t:debug_tab') | tabclose | endif +endfunction +command! -nargs=* -complete=file -bang Debug call Debug() | Termdebug +command! -nargs=+ -complete=file -bang DebugCommand call Debug() | TermdebugCommand + setlocal foldmethod=syntax " set foldlevel according to number of matches of 'namespace' and 'class' not " containing ';' @@ -70,7 +80,7 @@ function! InitialFoldLevel() let v:errmsg = "" keepjumps keeppatterns silent! 1,/}/s/^\(namespace\|class\) \+[^;]*$//n if v:errmsg == "" - let &foldlevel=str2nr(split(v:statusmsg)[0]) + let &l:foldlevel=str2nr(split(v:statusmsg)[0]) endif endf call InitialFoldLevel()