about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-05-08 21:12:03 +0900
committersefidel <contact@sefidel.net>2022-05-08 21:12:03 +0900
commitd435b5ca68a3348b120140a08129c8c17ee5c30a (patch)
tree96a10a957c62a29a726ee2882f23e1e004c577ee
parent13d21c4c4b8f15fe7e882d9a0283c5c7ac98697d (diff)
downloadnvimrc-d435b5ca68a3348b120140a08129c8c17ee5c30a.tar.gz
nvimrc-d435b5ca68a3348b120140a08129c8c17ee5c30a.zip
[WIP]: nvim-dap
-rw-r--r--fnl/nvrc/keymaps.fnl3
-rw-r--r--fnl/nvrc/pack.fnl4
-rw-r--r--fnl/nvrc/packs/dap.fnl22
-rw-r--r--fnl/nvrc/packs/rust.fnl7
4 files changed, 35 insertions, 1 deletions
diff --git a/fnl/nvrc/keymaps.fnl b/fnl/nvrc/keymaps.fnl
index 959c15e..85283c1 100644
--- a/fnl/nvrc/keymaps.fnl
+++ b/fnl/nvrc/keymaps.fnl
@@ -64,3 +64,6 @@
 (map! [i] :<A-r> "<esc>:m .-2<cr>==gi")
 (map! [v] :<A-e> ":m '>+1<cr>gv=gv")
 (map! [v] :<A-r> ":m '<-2<cr>gv=gv")
+
+(map! [n] :<leader>ll (vim.lsp.buf.hover))
+(map! [n] :<leader>b ((. (require :dap) :toggle_breakpoint)))
diff --git a/fnl/nvrc/pack.fnl b/fnl/nvrc/pack.fnl
index 5424aaa..2f1d60d 100644
--- a/fnl/nvrc/pack.fnl
+++ b/fnl/nvrc/pack.fnl
@@ -17,8 +17,10 @@
                                :requires [(pack :hrsh7th/cmp-nvim-lsp {:after :nvim-cmp})
                                           (pack :j-hui/fidget.nvim {:req :fidget :after :nvim-lspconfig})
                                           (pack :hrsh7th/cmp-nvim-lsp-signature-help {:after :cmp-nvim-lsp})]})
-(pack! :simrat39/rust-tools.nvim {:init :rust-tools :ft :rust :requires [(pack :nvim-lua/plenary.nvim)]})
+(pack! :simrat39/rust-tools.nvim {:req :rust :ft :rust :requires [(pack :nvim-lua/plenary.nvim)]})
 (pack! :p00f/clangd_extensions.nvim {:req :clangd :ft [:c :cpp :objc :objcpp] :module :clangd_extensions})
+(pack! :mfussenegger/nvim-dap {:req :dap :requires [(pack :nvim-lua/plenary.nvim)]})
+(pack! :rcarriga/nvim-dap-ui {:init :dapui :requires [(pack :mfussenegger/nvim-dap)]})
 (pack! :gpanders/editorconfig.nvim)
 (pack! :stefandtw/quickfix-reflector.vim {:ft :qf})
 (pack! :tpope/vim-fugitive)
diff --git a/fnl/nvrc/packs/dap.fnl b/fnl/nvrc/packs/dap.fnl
new file mode 100644
index 0000000..b17f7a3
--- /dev/null
+++ b/fnl/nvrc/packs/dap.fnl
@@ -0,0 +1,22 @@
+(local dap (require :dap))
+
+(set dap.adapters.lldb {:type :executable
+                    :command "/home/zach/.nix-profile/bin/lldb-vscode"
+                    :name :lldb})
+
+(set dap.configurations.cpp [{:name :Launch
+                         :type :lldb
+                         :request :launch
+                         :program (fn []
+                  (vim.fn.input "Path to executable: " (.. (vim.fn.getcwd) "/")
+                                :file))
+                         :cwd "${workspaceFolder}"
+                         :stopOnEntry false
+                         :args {}
+                         :runInTerminal false
+                         :postRunCommands ["process handle -p true -s false -n false SIGWINCH"]}])
+
+(set dap.configurations.c dap.configurations.cpp)
+(set dap.configurations.rust dap.configurations.cpp)
+
+(vim.fn.sign_define :DapStopped {:text :>})
diff --git a/fnl/nvrc/packs/rust.fnl b/fnl/nvrc/packs/rust.fnl
new file mode 100644
index 0000000..90024b8
--- /dev/null
+++ b/fnl/nvrc/packs/rust.fnl
@@ -0,0 +1,7 @@
+(local {: setup} (require :rust-tools))
+
+(let [rust-tools-dap (require :rust-tools.dap)
+      extension-path (.. (os.getenv :HOME) "/.codelldb/share/vscode/extensions/vadimcn.vscode-lldb/")
+      codelldb-path (.. extension-path "adapter/codelldb")
+      liblldb-path (.. extension-path "lldb/lib/liblldb.so")]
+  (setup {:dap {:adapter (rust-tools-dap.get_codelldb_adapter codelldb-path liblldb-path)}}))