X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/32a180d2d9ce65bca5e463d42c3e6d6ab918b8b7..e48f84d521de72d8f39997054e57ae43f44c0d4b:/vim/ftplugin/cpp.vim diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index a8c9a51..2f545a5 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -69,6 +69,13 @@ function! s:Debug(...) tabedit % let t:debug_tab=1 au BufDelete !gdb ++once if exists('t:debug_tab') | tabclose | endif + + "TODO restore mappings + "TODO make mappings local to source buffer + nnoremap :call TermDebugSendCommand('advance -source '.expand('%').' -line '.line(".")) + nnoremap :Step + nnoremap :Over + nnoremap :Finish endfunction command! -nargs=* -complete=file -bang Debug call Debug() | Termdebug command! -nargs=+ -complete=file -bang DebugCommand call Debug() | TermdebugCommand @@ -80,7 +87,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()