mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-09-27 12:38:58 +02:00
mzte-nv: use lspsaga
This commit is contained in:
parent
5774d8a102
commit
3b65225082
11 changed files with 42 additions and 61 deletions
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714076141,
|
"lastModified": 1714253743,
|
||||||
"narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=",
|
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856",
|
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -23,14 +23,9 @@
|
||||||
(nmap :<S-F4> (cmd :cprevious))
|
(nmap :<S-F4> (cmd :cprevious))
|
||||||
|
|
||||||
;; LSP
|
;; LSP
|
||||||
(nmap :-a vim.lsp.buf.code_action)
|
|
||||||
(nmap :-d vim.diagnostic.goto_next)
|
|
||||||
(nmap :-n vim.lsp.buf.rename)
|
|
||||||
(nmap :-r #(vim.lsp.buf.format {:async true}))
|
(nmap :-r #(vim.lsp.buf.format {:async true}))
|
||||||
(nmap :<C-k> vim.lsp.buf.signature_help)
|
(nmap :<C-k> vim.lsp.buf.signature_help)
|
||||||
(nmap :<space>e vim.diagnostic.open_float)
|
(vim.keymap.set :i :<C-k> vim.lsp.buf.signature_help opts)
|
||||||
|
|
||||||
(nmap :K vim.lsp.buf.hover)
|
|
||||||
|
|
||||||
;; command to stop LSPs
|
;; command to stop LSPs
|
||||||
(vim.api.nvim_create_user_command :StopLsps
|
(vim.api.nvim_create_user_command :StopLsps
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
(local aerial (require :aerial))
|
|
||||||
|
|
||||||
(aerial.setup {:backends [:lsp :treesitter :markdown :man]})
|
|
||||||
|
|
||||||
(vim.keymap.set :n :-o #(aerial.toggle) (. (require :mzte_nv) :utils :map_opt))
|
|
|
@ -9,12 +9,12 @@
|
||||||
:dim_inactive {:enabled true}
|
:dim_inactive {:enabled true}
|
||||||
;; Enable all relevant integrations
|
;; Enable all relevant integrations
|
||||||
:default_integrations false
|
:default_integrations false
|
||||||
:integrations {:aerial true
|
:integrations {:cmp true
|
||||||
:cmp true
|
|
||||||
:dap true
|
:dap true
|
||||||
:dap_ui true
|
:dap_ui true
|
||||||
:gitsigns true
|
:gitsigns true
|
||||||
:harpoon true
|
:harpoon true
|
||||||
|
:lsp_saga true
|
||||||
:markdown true
|
:markdown true
|
||||||
:native_lsp {:enabled true
|
:native_lsp {:enabled true
|
||||||
:virtual_text (collect [_ diag (ipairs [:errors
|
:virtual_text (collect [_ diag (ipairs [:errors
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
(local lightbulb (require :nvim-lightbulb))
|
|
||||||
|
|
||||||
(local ignored-clients [:null-ls])
|
|
||||||
|
|
||||||
(lightbulb.setup {:ignore {:clients ignored-clients}
|
|
||||||
;; No gutter sign
|
|
||||||
:sign {:enabled false}
|
|
||||||
;; Status bar text
|
|
||||||
:status_text {:enabled true :text ""}})
|
|
||||||
|
|
||||||
;; Create update autocmd on LSP attach
|
|
||||||
(fn on-lsp-attach [args]
|
|
||||||
(let [buf args.buf
|
|
||||||
client (vim.lsp.get_client_by_id args.data.client_id)]
|
|
||||||
(when (and client.server_capabilities.codeActionProvider
|
|
||||||
(not vim.b.mzte_reg_lighbulb_aucmd)
|
|
||||||
(not (vim.list_contains ignored-clients client.name)))
|
|
||||||
(set vim.b.mzte_reg_lighbulb_aucmd true)
|
|
||||||
(vim.api.nvim_create_autocmd :CursorHold
|
|
||||||
{:buffer buf
|
|
||||||
:callback lightbulb.update_lightbulb}))))
|
|
||||||
|
|
||||||
(vim.api.nvim_create_autocmd :LspAttach {:callback on-lsp-attach})
|
|
|
@ -1,6 +1,5 @@
|
||||||
(local (mztenv lline lightbulb lspprogress)
|
(local (mztenv lline lspprogress)
|
||||||
(values (require :mzte_nv) (require :lualine) (require :nvim-lightbulb)
|
(values (require :mzte_nv) (require :lualine) (require :lsp-progress)))
|
||||||
(require :lsp-progress)))
|
|
||||||
|
|
||||||
(lline.setup {:options {:theme :catppuccin}
|
(lline.setup {:options {:theme :catppuccin}
|
||||||
:sections {:lualine_b [:filename :diff]
|
:sections {:lualine_b [:filename :diff]
|
||||||
|
@ -9,9 +8,6 @@
|
||||||
;; show file name
|
;; show file name
|
||||||
:mode 1}]
|
:mode 1}]
|
||||||
:lualine_c [#(or (. (lspprogress.progress) :msg) "")]
|
:lualine_c [#(or (. (lspprogress.progress) :msg) "")]
|
||||||
:lualine_x [:searchcount
|
|
||||||
{1 #(lightbulb.get_status_text)
|
|
||||||
:color {:fg mztenv.reg.catppuccin-palette.teal}}]
|
|
||||||
:lualine_y [:branch]}})
|
:lualine_y [:branch]}})
|
||||||
|
|
||||||
(vim.api.nvim_create_autocmd :User
|
(vim.api.nvim_create_autocmd :User
|
||||||
|
|
24
mzte-nv/conf/lua/pluginconf/p-lsp-saga.fnl
Normal file
24
mzte-nv/conf/lua/pluginconf/p-lsp-saga.fnl
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
(local lsps (require :lspsaga))
|
||||||
|
|
||||||
|
(local mztenv (require :mzte_nv))
|
||||||
|
(local catppuccin (require :catppuccin.groups.integrations.lsp_saga))
|
||||||
|
|
||||||
|
(lsps.setup {:ui {:kind (catppuccin.custom_kind) :code_action "" :actionfix ""}
|
||||||
|
:lightbulb {:enable false}
|
||||||
|
:code_action {:show_server_name true :extend_gitsigns true}})
|
||||||
|
|
||||||
|
(local lsps-codeaction (require :lspsaga.codeaction))
|
||||||
|
(local lsps-definition (require :lspsaga.definition))
|
||||||
|
(local lsps-diagnostic (require :lspsaga.diagnostic))
|
||||||
|
(local lsps-finder (require :lspsaga.finder))
|
||||||
|
(local lsps-hover (require :lspsaga.hover))
|
||||||
|
(local lsps-symbol (require :lspsaga.symbol))
|
||||||
|
(local lsps-rename (require :lspsaga.rename))
|
||||||
|
|
||||||
|
(vim.keymap.set :n :-a #(lsps-codeaction:code_action) mztenv.utils.map_opt)
|
||||||
|
(vim.keymap.set :n :<C-p> #(lsps-definition:init 1 1) mztenv.utils.map_opt)
|
||||||
|
(vim.keymap.set :n :-d #(lsps-diagnostic:goto_next) mztenv.utils.map_opt)
|
||||||
|
(vim.keymap.set :n :<C-g> #(lsps-finder:new []) mztenv.utils.map_opt)
|
||||||
|
(vim.keymap.set :n :K #(lsps-hover:render_hover_doc []) mztenv.utils.map_opt)
|
||||||
|
(vim.keymap.set :n :-o #(lsps-symbol:outline) mztenv.utils.map_opt)
|
||||||
|
(vim.keymap.set :n :-n #(lsps-rename:lsp_rename []) mztenv.utils.map_opt)
|
|
@ -3,14 +3,10 @@
|
||||||
(macro src [categ name]
|
(macro src [categ name]
|
||||||
`(. nullls :builtins ,categ ,name))
|
`(. nullls :builtins ,categ ,name))
|
||||||
|
|
||||||
(nullls.setup {:sources [(src :code_actions :gitsigns)
|
(nullls.setup {:sources [(src :code_actions :shellcheck)
|
||||||
(src :code_actions :shellcheck)
|
|
||||||
(src :diagnostics :fish)
|
(src :diagnostics :fish)
|
||||||
(src :diagnostics :shellcheck)
|
(src :diagnostics :shellcheck)
|
||||||
(src :diagnostics :tidy)
|
(src :diagnostics :tidy)
|
||||||
;; a shitty python formatter
|
|
||||||
;; TODO: remove once done with involuntary python classes
|
|
||||||
(src :formatting :black)
|
|
||||||
(src :formatting :clang_format)
|
(src :formatting :clang_format)
|
||||||
(src :formatting :fish_indent)
|
(src :formatting :fish_indent)
|
||||||
(src :formatting :fnlfmt)
|
(src :formatting :fnlfmt)
|
||||||
|
|
|
@ -11,11 +11,12 @@
|
||||||
(local startup-plugins [])
|
(local startup-plugins [])
|
||||||
|
|
||||||
;; Plugins to load in the background
|
;; Plugins to load in the background
|
||||||
(local deferred-plugins [:lspconf
|
(local deferred-plugins [:catppuccin
|
||||||
|
:lspconf
|
||||||
|
:lsp-saga
|
||||||
:cmp
|
:cmp
|
||||||
:luasnip
|
:luasnip
|
||||||
:nullls
|
:nullls
|
||||||
:catppuccin
|
|
||||||
:lspprogress
|
:lspprogress
|
||||||
:line
|
:line
|
||||||
:treesitter
|
:treesitter
|
||||||
|
@ -27,12 +28,10 @@
|
||||||
:tterm
|
:tterm
|
||||||
:ts-context
|
:ts-context
|
||||||
:ufo
|
:ufo
|
||||||
:aerial
|
|
||||||
:dap
|
:dap
|
||||||
:harpoon
|
:harpoon
|
||||||
:recorder
|
:recorder
|
||||||
:tsn-actions
|
:tsn-actions
|
||||||
:lightbulb
|
|
||||||
:dressing
|
:dressing
|
||||||
:gitsigns])
|
:gitsigns])
|
||||||
|
|
||||||
|
|
|
@ -118,15 +118,15 @@ fn lGetBundleInfo(l: *c.lua_State) !c_int {
|
||||||
// bundles
|
// bundles
|
||||||
c.lua_newtable(l);
|
c.lua_newtable(l);
|
||||||
|
|
||||||
var has_fernflower = false;
|
var has_cfr = false;
|
||||||
var iter = dir.iterate();
|
var iter = dir.iterate();
|
||||||
var idx: c_int = 1;
|
var idx: c_int = 1;
|
||||||
while (try iter.next()) |f| {
|
while (try iter.next()) |f| {
|
||||||
if (f.kind != .file or !std.mem.endsWith(u8, f.name, ".jar"))
|
if (f.kind != .file or !std.mem.endsWith(u8, f.name, ".jar"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!has_fernflower and std.mem.containsAtLeast(u8, f.name, 1, "fernflower"))
|
if (!has_cfr and std.mem.containsAtLeast(u8, f.name, 1, "cfr"))
|
||||||
has_fernflower = true;
|
has_cfr = true;
|
||||||
|
|
||||||
const path = try std.fs.path.joinZ(std.heap.c_allocator, &.{ bundle_path, f.name });
|
const path = try std.fs.path.joinZ(std.heap.c_allocator, &.{ bundle_path, f.name });
|
||||||
defer std.heap.c_allocator.free(path);
|
defer std.heap.c_allocator.free(path);
|
||||||
|
@ -141,8 +141,8 @@ fn lGetBundleInfo(l: *c.lua_State) !c_int {
|
||||||
// content_provider
|
// content_provider
|
||||||
c.lua_newtable(l);
|
c.lua_newtable(l);
|
||||||
|
|
||||||
if (has_fernflower) {
|
if (has_cfr) {
|
||||||
c.lua_pushstring(l, "fernflower");
|
c.lua_pushstring(l, "cfr");
|
||||||
c.lua_setfield(l, -2, "preferred");
|
c.lua_setfield(l, -2, "preferred");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ let
|
||||||
"20-lspconfig" = plugin "nvim-lspconfig";
|
"20-lspconfig" = plugin "nvim-lspconfig";
|
||||||
"20-nullls" = plugin "null-ls.nvim";
|
"20-nullls" = plugin "null-ls.nvim";
|
||||||
"20-jdtls" = plugin "nvim-jdtls";
|
"20-jdtls" = plugin "nvim-jdtls";
|
||||||
|
"20-lsp-saga" = plugin "lspsaga.nvim";
|
||||||
|
|
||||||
# CMP
|
# CMP
|
||||||
"45-cmp" = plugin "nvim-cmp";
|
"45-cmp" = plugin "nvim-cmp";
|
||||||
|
@ -44,12 +45,10 @@ let
|
||||||
"50-toggleterm" = plugin "toggleterm.nvim";
|
"50-toggleterm" = plugin "toggleterm.nvim";
|
||||||
"50-dressing" = plugin "dressing.nvim";
|
"50-dressing" = plugin "dressing.nvim";
|
||||||
"50-ufo" = plugin "nvim-ufo";
|
"50-ufo" = plugin "nvim-ufo";
|
||||||
"50-aerial" = plugin "aerial.nvim";
|
|
||||||
"50-dap" = plugin "nvim-dap";
|
"50-dap" = plugin "nvim-dap";
|
||||||
"50-dapui" = plugin "nvim-dap-ui";
|
"50-dapui" = plugin "nvim-dap-ui";
|
||||||
"50-harpoon" = plugin "harpoon";
|
"50-harpoon" = plugin "harpoon";
|
||||||
"50-recorder" = plugin "nvim-recorder";
|
"50-recorder" = plugin "nvim-recorder";
|
||||||
"50-lightbulb" = plugin "nvim-lightbulb";
|
|
||||||
"50-lsp-progress" = plugin "lsp-progress.nvim";
|
"50-lsp-progress" = plugin "lsp-progress.nvim";
|
||||||
|
|
||||||
# Libraries
|
# Libraries
|
||||||
|
|
Loading…
Reference in a new issue