fix LSPs, add c# support
This commit is contained in:
+24
-8
@@ -80,15 +80,31 @@
|
||||
:settings {:Lua {:runtime {:version :LuaJIT}
|
||||
:workspace {:library (vim.api.nvim_get_runtime_file "" true)}}}})
|
||||
|
||||
(vim.lsp.config :fennel_language_server
|
||||
{:cmd [:fennel-language-server]
|
||||
(vim.lsp.config :fennel_ls
|
||||
{:cmd [:fennel-ls]
|
||||
:filetypes [:fennel]
|
||||
:root_markers [:.nfnl.fnl :fnl :.git]
|
||||
:settings {:fennel {:workspace {:library (vim.api.nvim_get_runtime_file "" true)}
|
||||
:diagnostics {:globals [:vim]}}}})
|
||||
|
||||
;; Enable the configured LSP servers
|
||||
(vim.lsp.enable [:clojure_lsp :lua_ls :fennel_language_server])
|
||||
;; rust-analyzer: prefer nightly toolchain (version-matched to proc-macro server),
|
||||
;; then PATH, then Mason
|
||||
(local rust-analyzer-bin
|
||||
(let [nightly-ra (.. (vim.fn.expand "~") "/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/rust-analyzer")]
|
||||
(if (= (vim.fn.executable nightly-ra) 1)
|
||||
nightly-ra
|
||||
(= (vim.fn.executable "rust-analyzer") 1)
|
||||
"rust-analyzer"
|
||||
(.. (vim.fn.stdpath "data") "/mason/bin/rust-analyzer"))))
|
||||
|
||||
(vim.lsp.config :rust_analyzer
|
||||
{:cmd [rust-analyzer-bin]
|
||||
:filetypes [:rust]
|
||||
:root_markers [:Cargo.toml :Cargo.lock :.git]
|
||||
:settings {:rust-analyzer {:checkOnSave {:command "clippy"}}}})
|
||||
|
||||
;; Enable the configured LSP servers (roslyn handled by roslyn.nvim plugin)
|
||||
(vim.lsp.enable [:clojure_lsp :lua_ls :fennel_ls :rust_analyzer])
|
||||
|
||||
;; LSP keymaps (set on attach)
|
||||
(autocmd "LspAttach"
|
||||
@@ -107,8 +123,8 @@
|
||||
opts)
|
||||
(keymap :n "<leader>rn" vim.lsp.buf.rename opts)
|
||||
(keymap :n "<leader>ca" vim.lsp.buf.code_action opts)
|
||||
(keymap :n "[d" (fn [] (vim.diagnostic.jump {:count -1})) opts)
|
||||
(keymap :n "]d" (fn [] (vim.diagnostic.jump {:count 1})) opts)
|
||||
(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))})
|
||||
|
||||
@@ -123,9 +139,9 @@
|
||||
(fn [opts]
|
||||
(if (and opts.args (> (length opts.args) 0))
|
||||
(vim.lsp.enable opts.args)
|
||||
(vim.lsp.enable [:clojure_lsp :lua_ls :fennel_language_server])))
|
||||
(vim.lsp.enable [:clojure_lsp :lua_ls :fennel_ls :rust_analyzer])))
|
||||
{:nargs "?"
|
||||
:complete (fn [] [:clojure_lsp :lua_ls :fennel_language_server])
|
||||
:complete (fn [] [:clojure_lsp :lua_ls :fennel_ls :rust_analyzer])
|
||||
:desc "Start LSP server"})
|
||||
|
||||
(usercmd "LspStop"
|
||||
|
||||
+17
-7
@@ -105,13 +105,15 @@
|
||||
{repo "williamboman/mason.nvim"
|
||||
:lazy false
|
||||
:build ":MasonUpdate"
|
||||
:opts {:ui {:border "rounded"}}}
|
||||
:opts {:ui {:border "rounded"}
|
||||
:registries ["github:mason-org/mason-registry"
|
||||
"github:Crashdummyy/mason-registry"]}}
|
||||
|
||||
;; Auto-install LSP servers and tools via Mason
|
||||
{repo "WhoIsSethDaniel/mason-tool-installer.nvim"
|
||||
:lazy false
|
||||
:dependencies ["williamboman/mason.nvim"]
|
||||
:opts {:ensure_installed ["clojure-lsp" "clj-kondo" "fennel-language-server" "lua-language-server"]}}
|
||||
:opts {:ensure_installed ["clojure-lsp" "clj-kondo" "fennel-ls" "lua-language-server" "rust-analyzer" "roslyn"]}}
|
||||
|
||||
;; Hop - EasyMotion-like word jumping
|
||||
{repo "smoka7/hop.nvim"
|
||||
@@ -184,15 +186,23 @@
|
||||
:opts {:keymap {:preset "super-tab"
|
||||
"<C-Space>" [(fn [cmp] (cmp.show {:providers ["supermaven"]})) :fallback]
|
||||
"<Tab>" [:select_and_accept :snippet_forward :fallback]
|
||||
"<CR>" [:select_and_accept :fallback]}
|
||||
:completion {:trigger {:show_on_keyword false
|
||||
:show_on_trigger_character false}
|
||||
:list {:selection {:preselect true :auto_insert false}}
|
||||
"<CR>" [:select_and_accept :fallback]
|
||||
"<Esc>" [:cancel :fallback]}
|
||||
:completion {:list {:selection {:preselect true :auto_insert false}}
|
||||
:documentation {:auto_show true}}
|
||||
:sources {:default ["lsp" "supermaven" "path" "buffer"]
|
||||
:sources {:default ["lsp" "path" "buffer"]
|
||||
:providers {:supermaven {:name "Supermaven"
|
||||
:module "supermaven-blink"}}}}}
|
||||
|
||||
;; roslyn.nvim - C# and Blazor/Razor LSP via Roslyn language server
|
||||
;; Must not be ft-gated: plugin/roslyn.lua calls vim.lsp.enable which needs to
|
||||
;; run before the FileType event fires, or existing .cs buffers won't attach.
|
||||
{repo "seblj/roslyn.nvim"
|
||||
:lazy false
|
||||
:config (fn []
|
||||
(let [roslyn (require :roslyn)]
|
||||
(roslyn.setup {})))}
|
||||
|
||||
;; gitsigns.nvim - Git diff signs in the sign column
|
||||
{repo "lewis6991/gitsigns.nvim"
|
||||
:event ["BufReadPre" "BufNewFile"]
|
||||
|
||||
Reference in New Issue
Block a user