Compare commits
2 Commits
88c86ec9ed
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 24392b0e5b | |||
| f6115bc048 |
+14
-1
@@ -126,7 +126,20 @@
|
||||
(keymap :n "[d" (fn [] (vim.diagnostic.jump {:count -1 :float true})) opts)
|
||||
(keymap :n "]d" (fn [] (vim.diagnostic.jump {:count 1 :float true})) opts)
|
||||
(keymap :n "<leader>e" vim.diagnostic.open_float opts)
|
||||
(keymap :n "<leader>F" vim.lsp.buf.format opts))})
|
||||
(keymap :n "<leader>F" vim.lsp.buf.format opts)
|
||||
(let [client (vim.lsp.get_client_by_id ev.data.client_id)]
|
||||
(when (and client (client.supports_method "textDocument/references"))
|
||||
(pcall vim.cmd "anoremenu PopUp.Show\\ References <Cmd>lua vim.lsp.buf.references()<CR>"))))})
|
||||
|
||||
;; Remove "Show References" from the context menu once no attached client supports it
|
||||
(autocmd "LspDetach"
|
||||
{:callback (fn []
|
||||
(var has-references false)
|
||||
(each [_ client (ipairs (vim.lsp.get_clients))]
|
||||
(when (client.supports_method "textDocument/references")
|
||||
(set has-references true)))
|
||||
(when (not has-references)
|
||||
(pcall vim.cmd "aunmenu PopUp.Show\\ References")))})
|
||||
|
||||
;; LSP commands (lspconfig-style)
|
||||
(local usercmd vim.api.nvim_create_user_command)
|
||||
|
||||
+118
-1
@@ -114,7 +114,107 @@
|
||||
{lhs "<leader>h" :group "hunk"}
|
||||
{lhs "<leader>t" :group "toggle"}
|
||||
{lhs "<leader>l" :group "log"}
|
||||
{lhs "<leader>a" :group "AI/Claude"}]))}
|
||||
{lhs "<leader>a" :group "AI/Claude"}
|
||||
{lhs "<leader>d" :group "debug"}]))}
|
||||
|
||||
;; nvim-dap + nvim-dap-ui - Debugging via the Debug Adapter Protocol
|
||||
;; Adapters: lldb-dap (LLVM) for Rust, C and compiled rust-mal .clj
|
||||
;; executables, and gdb (-i dap) for .clj too. rust-mal's executables
|
||||
;; carry their gdb script (mal_Value variables shown as Clojure prints
|
||||
;; them); gdb runs it once auto-loading is allowed for their directory.
|
||||
;; The lldb one is imported when the cwd has debug/rust_mal_lldb.py.
|
||||
{repo "rcarriga/nvim-dap-ui"
|
||||
:dependencies ["mfussenegger/nvim-dap" "nvim-neotest/nvim-nio"]
|
||||
:keys [{lhs "<F5>" rhs #((. (require :dap) :continue)) :desc "Debug: start/continue"}
|
||||
{lhs "<F6>" rhs #((. (require :dap) :terminate)) :desc "Debug: stop"}
|
||||
{lhs "<F7>" rhs #((. (require :dapui) :toggle)) :desc "Debug: toggle UI"}
|
||||
{lhs "<F8>" rhs #((. (require :dap) :run_to_cursor)) :desc "Debug: run to cursor"}
|
||||
{lhs "<F9>" rhs #((. (require :dap) :toggle_breakpoint)) :desc "Debug: toggle breakpoint"}
|
||||
{lhs "<F10>" rhs #((. (require :dap) :step_over)) :desc "Debug: step over"}
|
||||
{lhs "<F11>" rhs #((. (require :dap) :step_into)) :desc "Debug: step into"}
|
||||
{lhs "<F12>" rhs #((. (require :dap) :step_out)) :desc "Debug: step out"}
|
||||
{lhs "<leader>db" rhs #((. (require :dap) :set_breakpoint) (vim.fn.input "Condition: "))
|
||||
:desc "Conditional breakpoint"}
|
||||
{lhs "<leader>dl" rhs #((. (require :dap) :set_breakpoint) nil nil (vim.fn.input "Log message: "))
|
||||
:desc "Log point"}
|
||||
{lhs "<leader>dB" rhs #((. (require :dap) :clear_breakpoints)) :desc "Clear breakpoints"}
|
||||
{lhs "<leader>dr" rhs #((. (require :dap) :run_last)) :desc "Re-run last session"}
|
||||
{lhs "<leader>dR" rhs #((. (require :dap) :restart)) :desc "Restart session"}
|
||||
{lhs "<leader>dk" rhs #((. (require :dap) :up)) :desc "Frame up"}
|
||||
{lhs "<leader>dj" rhs #((. (require :dap) :down)) :desc "Frame down"}
|
||||
{lhs "<leader>de" rhs #((. (require :dapui) :eval)) :mode [:n :v] :desc "Eval expression"}
|
||||
{lhs "<leader>dE" rhs #((. (require :dapui) :eval) (vim.fn.input "Expression: "))
|
||||
:desc "Eval prompt"}
|
||||
{lhs "<leader>do" rhs #((. (require :dap) :repl :toggle)) :desc "Toggle debug REPL"}]
|
||||
:config (fn []
|
||||
(local dap (require :dap))
|
||||
(local dapui (require :dapui))
|
||||
(dapui.setup)
|
||||
|
||||
;; Open/close the UI with the session
|
||||
(set dap.listeners.after.event_initialized.dapui #(dapui.open))
|
||||
(set dap.listeners.before.event_terminated.dapui #(dapui.close))
|
||||
(set dap.listeners.before.event_exited.dapui #(dapui.close))
|
||||
|
||||
(vim.fn.sign_define "DapBreakpoint" {:text "●" :texthl "DiagnosticError"})
|
||||
(vim.fn.sign_define "DapBreakpointCondition" {:text "◆" :texthl "DiagnosticWarn"})
|
||||
(vim.fn.sign_define "DapLogPoint" {:text "◉" :texthl "DiagnosticInfo"})
|
||||
(vim.fn.sign_define "DapStopped" {:text "▶" :texthl "DiagnosticOk"
|
||||
:linehl "Visual"})
|
||||
|
||||
(set dap.adapters.lldb {:type "executable"
|
||||
:command "lldb-dap"
|
||||
:name "lldb"})
|
||||
|
||||
;; Import rust-mal's lldb formatters when debugging from a rust-mal checkout
|
||||
(fn init-commands []
|
||||
(let [script (.. (vim.fn.getcwd) "/debug/rust_mal_lldb.py")]
|
||||
(if (= 1 (vim.fn.filereadable script))
|
||||
[(.. "command script import " script)]
|
||||
[])))
|
||||
|
||||
(fn launch [default-program]
|
||||
{:name "Launch executable"
|
||||
:type "lldb"
|
||||
:request "launch"
|
||||
:program #(vim.fn.input "Executable: " (default-program) "file")
|
||||
:args #(vim.split (vim.fn.input "Args: ") " " {:trimempty true})
|
||||
:cwd "${workspaceFolder}"
|
||||
:stopOnEntry false
|
||||
:initCommands init-commands})
|
||||
|
||||
;; gdb's own DAP server (gdb 14+), allowed to auto-load the scripts of
|
||||
;; the program's directory (rust-mal's pretty-printers are in the
|
||||
;; executable). Unlike lldb-dap, in .clj files its watches and
|
||||
;; breakpoint conditions are Clojure (built with --debug)
|
||||
(set dap.adapters.gdb
|
||||
(fn [callback config]
|
||||
(let [program (or config.program "")
|
||||
dir (if (= program "")
|
||||
(vim.fn.getcwd)
|
||||
(vim.fn.fnamemodify program ":p:h"))]
|
||||
(callback {:type "executable"
|
||||
:command "gdb"
|
||||
:args ["-q" "-i" "dap"
|
||||
"-iex" (.. "add-auto-load-safe-path " dir)]}))))
|
||||
|
||||
(fn gdb-launch [default-program]
|
||||
{:name "Launch executable (gdb)"
|
||||
:type "gdb"
|
||||
:request "launch"
|
||||
:program #(vim.fn.input "Executable: " (default-program) "file")
|
||||
:args #(vim.split (vim.fn.input "Args: ") " " {:trimempty true})
|
||||
:cwd "${workspaceFolder}"
|
||||
:stopAtBeginningOfMainSubprogram false})
|
||||
|
||||
;; rust-mal: `rust-mal -O0 foo.clj` writes ./foo next to foo.clj
|
||||
(set dap.configurations.clojure
|
||||
[(gdb-launch #(vim.fn.expand "%:p:r"))
|
||||
(launch #(vim.fn.expand "%:p:r"))])
|
||||
(set dap.configurations.rust
|
||||
[(launch #(.. (vim.fn.getcwd) "/target/debug/"))])
|
||||
(set dap.configurations.c
|
||||
[(launch #(.. (vim.fn.getcwd) "/"))]))}
|
||||
|
||||
;; claudecode.nvim - Claude Code AI assistant integration
|
||||
{repo "coder/claudecode.nvim"
|
||||
@@ -163,6 +263,23 @@
|
||||
(let [roslyn (require :roslyn)]
|
||||
(roslyn.setup {})))}
|
||||
|
||||
;; lean.nvim - Lean 4 support: LSP (via `lake serve`), infoview, unicode
|
||||
;; abbreviations (\to -> →), :Telescope loogle. Self-activates on *.lean and
|
||||
;; registers its own LSP client, so no vim.lsp.config entry is needed.
|
||||
;; Needs `lake`/`lean` on PATH (elan, ~/.elan/bin); :init prepends it so a
|
||||
;; stale parent shell/tmux PATH doesn't cause "language server not installed".
|
||||
;; Configured via vim.g.lean_config; require("lean").setup is deprecated, so
|
||||
;; :config is disabled to keep lazy.nvim from calling it through :opts.
|
||||
{repo "Julian/lean.nvim"
|
||||
:event ["BufReadPre *.lean" "BufNewFile *.lean"]
|
||||
:init (fn []
|
||||
(let [elan-bin (vim.fn.expand "~/.elan/bin")]
|
||||
(when (and (= 1 (vim.fn.isdirectory elan-bin))
|
||||
(not (vim.startswith vim.env.PATH (.. elan-bin ":"))))
|
||||
(set vim.env.PATH (.. elan-bin ":" vim.env.PATH))))
|
||||
(set vim.g.lean_config {:mappings true}))
|
||||
:config false}
|
||||
|
||||
;; marks.nvim - Show mark letters in the sign column
|
||||
{repo "chentoast/marks.nvim"
|
||||
:event "VeryLazy"
|
||||
|
||||
+14
-10
@@ -1,23 +1,27 @@
|
||||
{
|
||||
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
||||
"claudecode.nvim": { "branch": "main", "commit": "102d835c964069c9c5e37abaf05ae4f9c3ee6f00" },
|
||||
"conjure": { "branch": "main", "commit": "f7a375995a19fbf085707ea0fdb1f9c167e27e27" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "dd3f588bacbeb041be6facf1742e42097f62165d" },
|
||||
"claudecode.nvim": { "branch": "main", "commit": "2390c6e45c4789072c293ac69de051d169668b29" },
|
||||
"conjure": { "branch": "main", "commit": "349256ada7f73801f6e832abec1ac8eac32bf788" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "8d79f2410c76e62b92e51c28c82e28c1c5a3daeb" },
|
||||
"hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lean.nvim": { "branch": "main", "commit": "950eff1ae00db2b2f35996cb916c1a47254c3c96" },
|
||||
"marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e54f5bf5f12c560da31c17eee5b3e1bd369f3ff9" },
|
||||
"nfnl": { "branch": "main", "commit": "ac0177c5549df7abba7a19554c18a7765386c894" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
||||
"nfnl": { "branch": "main", "commit": "a4c47a1e7e52aaf234b358f73135acf783054e35" },
|
||||
"nvim-dap": { "branch": "master", "commit": "cfa2d58f4537aca6ca83e2de1a0d9f1491121264" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43" },
|
||||
"nvim-nio": { "branch": "master", "commit": "edcc181a875301dd21840189aa2f2f9ad69fc172" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "f603a2f4da48728f80257fb5fbb90145fd1dc173" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"roslyn.nvim": { "branch": "main", "commit": "b62d1a588765f0aa1b46ed260252c9e456408835" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" },
|
||||
"roslyn.nvim": { "branch": "main", "commit": "bf1bd4e70bc7068d1b4aebf4ce03cc19a86615be" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
|
||||
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "f04ab730b8f9c6bf3f54a206d0dcddfd70c52d59" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "40aedd8a68c78a656a10a8d62d80c54af59420fb" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
|
||||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" },
|
||||
"vim-sexp": { "branch": "master", "commit": "c6e7180781c5603f5ea0e2305adb0c117e4f8284" },
|
||||
"vim-sexp": { "branch": "master", "commit": "1bf50921308f0188d1c1ecf8a712cc72ab2775e5" },
|
||||
"vim-sexp-mappings-for-regular-people": { "branch": "master", "commit": "4debb74b0a3e530f1b18e5b7dff98a40b2ad26f1" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
|
||||
Reference in New Issue
Block a user