From e8401f49e98fbb48f937823fb12d54811e7eed7e Mon Sep 17 00:00:00 2001 From: blob42 Date: Fri, 21 Jun 2024 19:09:05 +0200 Subject: [PATCH] updates Signed-off-by: blob42 --- lua/core/mappings.lua | 33 ++++++++++----------- lua/custom/plugins/configs/navigator.lua | 6 ++-- lua/custom/plugins/configs/rustaceanvim.lua | 3 ++ lua/custom/plugins/configs/zk.lua | 2 +- lua/custom/plugins/init.lua | 19 ++++++------ lua/custom/plugins/nvchadui.lua | 2 +- plugin/spike/autocmd.lua | 12 ++++++++ 7 files changed, 46 insertions(+), 31 deletions(-) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 5bc9d61..6bfdb71 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -292,13 +292,6 @@ M.general = { --{{{ ["tS"] = { " TSDisable highlight ", "disable treesitter higlights" }, - ["tp"] = { - function() - vim.cmd("TSPlaygroundToggle") - end, - "Treesitter playground" - }, - -- Moving lines around [""] = { ":m +1==", "move line up" }, [""] = { ":m .-2==", "move line up" }, @@ -343,12 +336,16 @@ M.general = { --{{{ end, "TS swap left with sibling", opts = { expr = true } }, -- quickfix - ["]e"] = { " cn ", "quickfix next error" }, - ["[e"] = { " cp ", "quickfix previous error" }, + ["]e"] = { " cn ", "quickfix next" }, + ["[e"] = { " cp ", "quickfix previous" }, + ["k"] = { " cn ", "quickfix next" }, + ["k"] = { " cp ", "quickfix previous" }, -- loclist - ["]l"] = { " lne ", "loclist next error" }, - ["[l"] = { " lp ", "loclist previous error" }, + ["]l"] = { " lne ", "loclist next" }, + ["[l"] = { " lp ", "loclist previous" }, + ["l"] = { " lne ", "loclist next" }, + ["l"] = { " lp ", "loclist previous" }, -- Tabularize mappings @@ -409,6 +406,7 @@ M.general = { --{{{ ["A"] = { "ArgWrap", "arg wrap" }, + -- LSP {{{ -- TODO: move to lspconfig section -- ["lsp"] = { " lua require('custom.plugins.configs.navigator').enable()", "lsp enable"}, ["lsp"] = { function() @@ -416,7 +414,7 @@ M.general = { --{{{ require('rustaceanvim.lsp').start() else vim.cmd("LspStart") - end + end end, "lsp enable" }, -- [""] = { " LspStart", "lsp enable" }, [""] = { function() @@ -430,7 +428,7 @@ M.general = { --{{{ [""] = {function() local bufnr = vim.api.nvim_get_current_buf() -- get all clients for buffer - local clients = vim.lsp.get_active_clients({ + local clients = vim.lsp.get_clients({ bufnr = bufnr }) @@ -451,8 +449,9 @@ M.general = { --{{{ end end, "lsp disable" }, - ["lst"] = { " LspStop", "lsp disable" }, - + ["lst"] = { " LspStop", "lsp disable" },-- }}} + ["j"] = {function() vim.diagnostic.jump({count=1}) end,"diagnostic next" }, + ["j"] = {function() vim.diagnostic.jump({count=-1}) end,"diagnostic previous" }, -- My custom commands ["gB"] = {" GitBlob"}, @@ -690,7 +689,7 @@ M.nvimtree = { --{{{ n = { -- toggle - [""] = { " NvimTreeToggle ", "toggle nvimtree" }, + [""] = { " NvimTreeToggle ", "toggle nvimtree" }, }, } --}}} @@ -924,7 +923,7 @@ M.blankline = { --{{{ M.aerial = { plugin = true, n = { - [""] = { " AerialToggle right" }, + [""] = { " AerialToggle right" }, } } diff --git a/lua/custom/plugins/configs/navigator.lua b/lua/custom/plugins/configs/navigator.lua index 0b14423..134dac8 100644 --- a/lua/custom/plugins/configs/navigator.lua +++ b/lua/custom/plugins/configs/navigator.lua @@ -97,17 +97,17 @@ local config = { --TODO: toggle diagnostics { key = ']d', - func = vim.diagnostic.goto_next, + func = function() vim.diagnostic.jump {count=1} end, desc = 'next diagnostics', }, { key = '[d', - func = vim.diagnostic.goto_prev, + func = function() vim.diagnostic.jump {count=-1} end, desc = 'prev diagnostics', }, { key = ']O', - func = vim.diagnostic.set_loclist, + func = vim.diagnostic.setloclist, desc = 'diagnostics set loclist', }, { key = ']r', func = require('navigator.treesitter').goto_next_usage, desc = 'lsp goto_next_usage' }, diff --git a/lua/custom/plugins/configs/rustaceanvim.lua b/lua/custom/plugins/configs/rustaceanvim.lua index 6830c31..1a15537 100644 --- a/lua/custom/plugins/configs/rustaceanvim.lua +++ b/lua/custom/plugins/configs/rustaceanvim.lua @@ -1,6 +1,9 @@ local M = {} local config = { + inlay_hints = { + highlight = "NonText" + }, server = { cmd = {"run-rust-analyzer"}, auto_attach = false, diff --git a/lua/custom/plugins/configs/zk.lua b/lua/custom/plugins/configs/zk.lua index 3e10934..962abf4 100644 --- a/lua/custom/plugins/configs/zk.lua +++ b/lua/custom/plugins/configs/zk.lua @@ -14,7 +14,7 @@ local opts = { -- etc, see `:h vim.lsp.start_client()` on_attach = function(client, bufnr) vim.keymap.set("n", "K", " lua vim.lsp.buf.hover()", { desc = "zk lsp hover"}) - vim.keymap.set("v", "za", ":'<,'> vim.lsp.buf.range_code_action()", { desc = { "zk range code action"}}) + vim.keymap.set("v", "za", ":'<,'> vim.lsp.buf.range_code_action()", { desc = "zk range code action" }) end }, diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 95fc63f..1134c53 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -84,15 +84,16 @@ return { require("syntax-tree-surfer").setup() end }, - -- Treesitter dev/exploration tool + -- Treesitter dev/exploration tool + -- NOTE: builtin in neovim :InspectTree -- https://git.blob42.xyz/blob42/playground/commit/460fe1b3e3b2971c52c5f02a7dbbb132f1f30584 - ["nvim-treesitter/playground"] = { - -- ["https://git.blob42.xyz/blob42/playground"] = { - lock = false, - -- opt = true, - cmd = { "TSPlayground*" }, - -- commit = "460fe1b3e3b2971c52c5f02a7dbbb132f1f30584", - }, + -- ["nvim-treesitter/playground"] = { + -- -- ["https://git.blob42.xyz/blob42/playground"] = { + -- lock = false, + -- -- opt = true, + -- cmd = { "TSPlayground*" }, + -- -- commit = "460fe1b3e3b2971c52c5f02a7dbbb132f1f30584", + -- }, ["nvim-treesitter/nvim-treesitter-context"] = { lock = false, @@ -773,7 +774,7 @@ return { ['stevearc/aerial.nvim'] = { -- lock = true, after = { "base46" }, - keys = { "" }, + keys = { "" }, cmd = { "Aerial*" }, config = function() require("core.utils").load_mappings "aerial" diff --git a/lua/custom/plugins/nvchadui.lua b/lua/custom/plugins/nvchadui.lua index 4a7309d..31e2864 100644 --- a/lua/custom/plugins/nvchadui.lua +++ b/lua/custom/plugins/nvchadui.lua @@ -136,7 +136,7 @@ return { local lsp_status = "" local dap_status = "" if rawget(vim, "lsp") then - for _, client in ipairs(vim.lsp.get_active_clients()) do + for _, client in ipairs(vim.lsp.get_clients()) do if client.attached_buffers[vim.api.nvim_get_current_buf()] then lsp_status = (vim.o.columns > 100 and "%#St_LspStatus#" .. "[" .. client.name .. "]") or "%#St_LspStatus#" .. " " end diff --git a/plugin/spike/autocmd.lua b/plugin/spike/autocmd.lua index 2a09b52..e636a6c 100644 --- a/plugin/spike/autocmd.lua +++ b/plugin/spike/autocmd.lua @@ -17,4 +17,16 @@ local function dwm() }) end +local function xremap() + local group = augroup('xremap', {}) + autocmd({'BufWritePost'}, { + group = group, + pattern = '*/.config/xremap/*.yml', + callback = function() + vim.system({"systemctl", "--user", "restart", "xremap"}):wait() + end + }) +end + dwm() +xremap()