summaryrefslogtreecommitdiff
path: root/vimscript
diff options
context:
space:
mode:
Diffstat (limited to 'vimscript')
-rw-r--r--vimscript/functions.vim33
-rw-r--r--vimscript/nv-whichkey/init.vim13
2 files changed, 46 insertions, 0 deletions
diff --git a/vimscript/functions.vim b/vimscript/functions.vim
index 9a468f45..56c4526c 100644
--- a/vimscript/functions.vim
+++ b/vimscript/functions.vim
@@ -25,3 +25,36 @@ command! PreviewHunk lua require 'nv-utils'.preview_hunk()
command! BlameLine lua require 'nv-utils'.blame_line()
command! W noa w
+" Debugging
+command! DebugToggleBreakpoint lua require'dap'.toggle_breakpoint()
+command! DebugStart lua require'dap'.continue()
+command! DebugContinue lua require'dap'.continue()
+command! DebugStepOver lua require'dap'.step_over()
+command! DebugStepOut lua require'dap'.step_out()
+command! DebugStepInto lua require'dap'.step_into()
+command! DebugToggleRepl lua require'dap'.repl.toggle()
+command! DebugGetSession lua require'dap'.session()
+
+" Available Debug Adapters:
+" https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
+"
+" Adapter configuration and installation instructions:
+" https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
+"
+" Debug Adapter protocol:
+" https://microsoft.github.io/debug-adapter-protocol/
+
+" TODO Add full support later
+" nnoremap <silent> <F5> :lua require'dap'.continue()<CR>
+" nnoremap <silent> <F10> :lua require'dap'.step_over()<CR>
+" nnoremap <silent> <F11> :lua require'dap'.step_into()<CR>
+" nnoremap <silent> <F12> :lua require'dap'.step_out()<CR>
+" nnoremap <silent> <leader>b :lua require'dap'.toggle_breakpoint()<CR>
+" nnoremap <silent> <leader>B :lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>
+" nnoremap <silent> <leader>lp :lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>
+" nnoremap <silent> <leader>dr :lua require'dap'.repl.open()<CR>
+" nnoremap <silent> <leader>dl :lua require'dap'.run_last()<CR>
+
+" TODO find out why this thing follows me everywhere in java
+let blacklist = ['java']
+autocmd CursorHold,CursorHoldI * if index(blacklist, &ft) < 0 | lua require'nvim-lightbulb'.update_lightbulb()
diff --git a/vimscript/nv-whichkey/init.vim b/vimscript/nv-whichkey/init.vim
index bddbcceb..81ef410f 100644
--- a/vimscript/nv-whichkey/init.vim
+++ b/vimscript/nv-whichkey/init.vim
@@ -85,6 +85,19 @@ let g:which_key_map.b = {
\ '?' : ['Buffers' , 'fzf-buffer'],
\ }
+" d is for debug
+let g:which_key_map.d = {
+ \ 'name' : '+debug' ,
+ \ 'b' : ['DebugToggleBreakpoint ' , 'toggle breakpoint'],
+ \ 'c' : ['DebugContinue' , 'continue'],
+ \ 'i' : ['DebugStepInto' , 'step into'],
+ \ 'o' : ['DebugStepOver' , 'step over'],
+ \ 'r' : ['DebugToggleRepl' , 'toggle repl'],
+ \ 's' : ['DebugStart' , 'start'],
+ \ }
+ " \ 'O' : ['DebugStepOut' , 'next-buffer'],
+ " \ 'S' : ['DebugGetSession ' , 'fzf-buffer'],
+
" F is for fold
let g:which_key_map.F = {