Compare commits

...

3 Commits

Author SHA1 Message Date
833c0d6168
nvim: misc aesthetic changes
- hide tab line
- remove line numbers in terminals
2023-03-19 13:10:16 -04:00
6feafc7a39
nvim: overhaul of debugging system
- keybinds changed from function keys to <leader> + ...
- compilation now uses a makefile
- quickfix tab added
2023-03-19 12:55:08 -04:00
258196f052
nvim: misc tex snippet modifications 2023-03-19 12:45:16 -04:00
3 changed files with 32 additions and 15 deletions

View File

@ -1,7 +1,8 @@
set tabstop=4 shiftwidth=4 noexpandtab relativenumber ai nu rnu nosmd ignorecase smartcase
set showtabline=0
set lazyredraw nocursorline ttyfast
let maplocalleader = ","
let mapleader = ","
set shell=/bin/sh
@ -42,33 +43,44 @@ nnoremap - :call OpenNetRW()<cr>
" 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
au BufEnter *.c,*.cpp,*.h,*.hpp packadd termdebug
au TermOpen * setlocal nonumber norelativenumber
tnoremap <silent> <esc> <c-\><c-n><c-\><c-n>
nnoremap <silent> <f3> :execute "Termdebug" $HOME .. "/.cache/termdebug.out"<cr>
nnoremap <silent> <f4> :!g++ -Wall -Wextra -Wpedantic -g %:p -o ~/.cache/termdebug.out<cr>
nnoremap <silent> <f5> :Run<cr>
nnoremap <silent> <f6> :Stop<cr>
nnoremap <silent> <f8> :Clear<cr>
nnoremap <silent> <f9> :Break<cr>
nnoremap <silent> <f10> :Continue<cr>
" start debugger
nnoremap <silent> <leader>dd :execute "Termdebug" $HOME .. "/.cache/termdebug/" .. expand("%:r")<cr>:Source<cr>
" compile
nnoremap <silent> <leader>dc :Source<cr>:w<cr>:execute "make ~/.cache/termdebug/" .. expand("%:r") .. " -f ~/.config/nvim/makefile"<cr>
" start, stop, continue forwards
nnoremap <silent> <leader>rs :Run<cr>
nnoremap <silent> <leader>rr :Stop<cr>
nnoremap <silent> <leader>rf :Continue<cr>
" clear, add breakpoints
nnoremap <silent> <leader>dsc :Clear<cr>
nnoremap <silent> <leader>dsf :Break<cr>
nnoremap <silent> <C-h> :vertical resize -5<cr>
nnoremap <silent> <C-l> :vertical resize +5<cr>
nnoremap <C-j> <C-w>w
nnoremap <C-k> <C-w>W
nnoremap <silent> <c-p> :Step<cr>
nnoremap <silent> <c-n> :Over<cr>
" quickfix window (after running make)
nnoremap <silent> <leader>dqf :tab cope<cr>
nnoremap <silent> <leader>df :tabNext<cr>
vnoremap <silent> K :'<,'>Evaluate<cr>
" tab, window management
nnoremap <C-j> <C-w>w
nnoremap <C-k> <C-w>W
" force exit (akin to ZZ, ZQ)
nnoremap <silent> ZF :qa!<cr>
" Plugins
" Run PlugInstall if there are missing plugins

View File

@ -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 $@

View File

@ -252,11 +252,11 @@ snippet bigo "O() asymptotic time complexity"
endsnippet
snippet logn "O(log n) time complexity" i
\log n
\log N
endsnippet
snippet nlogn "O(n log n) time complexity" i
n \log n
N \log N
endsnippet
snippet rec "tikz rectangle draw" bi