aboutsummaryrefslogtreecommitdiff
path: root/.vim/after/plugin/dap.vim
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-06-04 19:17:01 +0800
committerGuangxiong Lin <[email protected]>2022-06-05 11:41:04 +0800
commit47be6a508c4150f8ef2627ae185c650c081c6bbf (patch)
tree49656b4c2ffcc6adae8df89f4c9747287663311f /.vim/after/plugin/dap.vim
parent8c54a7ae533b5e07e978c705f3790eff054196c0 (diff)
downloaddotfiles-47be6a508c4150f8ef2627ae185c650c081c6bbf.tar.gz
dotfiles-47be6a508c4150f8ef2627ae185c650c081c6bbf.tar.bz2
dotfiles-47be6a508c4150f8ef2627ae185c650c081c6bbf.zip
Add more plugins for nvim
Diffstat (limited to '.vim/after/plugin/dap.vim')
-rw-r--r--.vim/after/plugin/dap.vim46
1 files changed, 46 insertions, 0 deletions
diff --git a/.vim/after/plugin/dap.vim b/.vim/after/plugin/dap.vim
new file mode 100644
index 0000000..d452fce
--- /dev/null
+++ b/.vim/after/plugin/dap.vim
@@ -0,0 +1,46 @@
+finish
+
+packadd nvim-dap
+packadd nvim-dap-ui
+packadd nvim-dap-go
+
+lua <<EOF
+
+local dap = require 'dap'
+local dap_go = require 'dap-go'
+
+local widgets = require 'dap.ui.widgets'
+
+vim.keymap.set('n', '<localleader>b', dap.toggle_breakpoint)
+vim.keymap.set('n', '<localleader>B', dap.list_breakpoints)
+vim.keymap.set('n', '<localleader>c', dap.continue)
+vim.keymap.set('n', '<localleader>n', dap.step_over)
+vim.keymap.set('n', '<localleader>si', dap.step_into)
+vim.keymap.set('n', '<localleader>so', dap.step_out)
+vim.keymap.set('n', '<localleader>rl', dap.run_last)
+vim.keymap.set('n', '<localleader>ut', dap.run_to_cursor)
+vim.keymap.set('n', '<localleader>su', dap.up)
+vim.keymap.set('n', '<localleader>sd', dap.down)
+vim.keymap.set('n', '<localleader>K', widgets.hover)
+
+float_scopes = function ()
+ widgets.centered_float(widgets.scopes)
+end
+
+float_frames = function ()
+ widgets.centered_float(widgets.frames)
+end
+
+float_threads = function ()
+ widgets.centered_float(widgets.threads)
+end
+
+vim.keymap.set('n', '<localleader><localleader>s', float_scopes)
+vim.keymap.set('n', '<localleader><localleader>f', float_frames)
+vim.keymap.set('n', '<localleader><localleader>t', float_threads)
+vim.keymap.set('n', '<localleader><localleader>r', dap.repl.toggle)
+
+dap_go.setup()
+
+EOF
+