diff --git a/src/.config/nvim/init.vim b/src/.config/nvim/init.vim index b909f38..f9305e8 100755 --- a/src/.config/nvim/init.vim +++ b/src/.config/nvim/init.vim @@ -1,7 +1,7 @@ set tabstop=4 shiftwidth=4 noexpandtab relativenumber ai nu rnu nosmd ignorecase smartcase set lazyredraw nocursorline ttyfast -let maplocalleader = "," +let mapleader = "," set shell=/bin/sh @@ -42,7 +42,7 @@ nnoremap - :call OpenNetRW() " gdb integration let g:termdebug_popup = 0 -let g:termdebug_wide = 100 +let g:termdebug_wide = 50 " Enter insert mode automatically in terminal windows "au BufEnter term://* startinsert @@ -50,25 +50,35 @@ let g:termdebug_wide = 100 au BufEnter *.c,*.cpp,*.h,*.hpp packadd termdebug tnoremap - -nnoremap :execute "Termdebug" $HOME .. "/.cache/termdebug.out" -nnoremap :!g++ -Wall -Wextra -Wpedantic -g %:p -o ~/.cache/termdebug.out -nnoremap :Run -nnoremap :Stop -nnoremap :Clear -nnoremap :Break -nnoremap :Continue +" start debugger +nnoremap dd :execute "Termdebug" $HOME .. "/.cache/termdebug/" .. expand("%:r"):Source +" compile +nnoremap dc :Source:w:execute "make ~/.cache/termdebug/" .. expand("%:r") .. " -f ~/.config/nvim/makefile" +" start, stop, continue forwards +nnoremap rs :Run +nnoremap rr :Stop +nnoremap rf :Continue +" clear, add breakpoints +nnoremap dsc :Clear +nnoremap dsf :Break nnoremap :vertical resize -5 nnoremap :vertical resize +5 -nnoremap w -nnoremap W - nnoremap :Step nnoremap :Over +" quickfix window (after running make) +nnoremap dqf :tab cope +nnoremap df :tabNext + vnoremap K :'<,'>Evaluate +" tab, window management +nnoremap w +nnoremap W +" force exit (akin to ZZ, ZQ) +nnoremap ZF :qa! + " Plugins " Run PlugInstall if there are missing plugins diff --git a/src/.config/nvim/makefile b/src/.config/nvim/makefile new file mode 100644 index 0000000..69d0a6d --- /dev/null +++ b/src/.config/nvim/makefile @@ -0,0 +1,5 @@ +# makefile for compiling individual files from vim + +~/.cache/termdebug/%: %.cpp + mkdir -p ~/.cache/termdebug/ + $(LINK.cpp) -g -Wall -Wpedantic $^ $(LOADLIBES) $(LDLIBS) -o $@