diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua index a179dd1..9375c37 100644 --- a/lua/plugins/lsp-config.lua +++ b/lua/plugins/lsp-config.lua @@ -47,18 +47,18 @@ return { require("lazyvim.util").lsp.on_attach(function(client) if client.name == "eslint" then client.server_capabilities.documentFormattingProvider = true - elseif client.name == "tsserver" then + elseif client.name == "ts_ls" then client.server_capabilities.documentFormattingProvider = false end end) end, tailwindcss = function(_, opts) - local tw = require("lspconfig.server_configurations.tailwindcss") - --- @param ft string - opts.filetypes = vim.tbl_filter(function(ft) - return not vim.tbl_contains(opts.filetypes_exclude or {}, ft) - end, tw.default_config.filetypes) + -- local tw = require("lspconfig.server_configurations.tailwindcss") + -- --- @param ft string + -- opts.filetypes = vim.tbl_filter(function(ft) + -- return not vim.tbl_contains(opts.filetypes_exclude or {}, ft) + -- end, tw.default_config.filetypes) end, }, }, diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index cec23f2..b0894df 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -6,6 +6,216 @@ return { local ui = require("harpoon.ui") local term = require("harpoon.term") + local newMappings = { + mode = { "n", "v" }, + { "w", group = "Window" }, + { "wh", ":wincmd h", desc = "Jump left" }, + { "wj", ":wincmd j", desc = "Jump bottom" }, + { "wk", ":wincmd k", desc = "Jump up" }, + { "wl", ":wincmd l", desc = "Jump right" }, + { "t", group = "Neotree" }, + { "tt", "Neotree toggle", desc = "Toggle" }, + { "b", group = "Buffer" }, + { "bn", "BufferLineCycleNext", desc = "Next" }, + { "bl", "BufferLineCyclePrev", desc = "Next" }, + { "bL", "BufferLineMoveNext", desc = "Next" }, + { "bh", "BufferLineCyclePrev", desc = "Previous" }, + { "bH", "BufferLineMovePrev", desc = "Previous" }, + { "bp", "BufferLinePick", desc = "Pick buffer" }, + { + "bq", + function() + require("mini.bufremove").delete(0, false) + end, + desc = "Close buffer", + }, + { "h", group = "Harpoon" }, + { "ha", mark.add_file, desc = "Add file" }, + { "hh", ui.toggle_quick_menu, desc = "Toggle quick menu" }, + { + "hn", + function() + ui.nav_next() + end, + desc = "Navigate next", + }, + { + "hp", + function() + ui.nav_prev() + end, + desc = "Navigate previous", + }, + { + "h1", + function() + ui.nav_file(1) + end, + desc = "Navigate 1", + }, + { + "h2", + function() + ui.nav_file(2) + end, + desc = "Navigate 2", + }, + { + "h3", + function() + ui.nav_file(3) + end, + desc = "Navigate 3", + }, + { + "h4", + function() + ui.nav_file(4) + end, + desc = "Navigate 4", + }, + { + "h&", + function() + ui.nav_file(1) + end, + desc = "Navigate 1", + }, + { + "hé", + function() + ui.nav_file(2) + end, + desc = "Navigate 2", + }, + { + 'h"', + function() + ui.nav_file(3) + end, + desc = "Navigate 3", + }, + { + "h'", + function() + ui.nav_file(4) + end, + desc = "Navigate 4", + }, + { "c", group = "Language" }, + { + "cr", + function() + vim.cmd([[Telescope lsp_references]]) + end, + desc = "Find references", + -- remap = true, + }, + } + + local mappingsz = { + w = { + h = { ":wincmd h", "Jump left" }, + j = { ":wincmd j", "Jump bottom" }, + k = { ":wincmd k", "Jump up" }, + l = { ":wincmd l", "Jump right" }, + }, + t = { + t = { "Neotree toggle", "Toggle" }, + }, + b = { + name = "Buffer", + n = { "BufferLineCycleNext", "Next" }, + l = { "BufferLineCyclePrev", "Next" }, + L = { "BufferLineMoveNext", "Next" }, + h = { "BufferLineCyclePrev", "Previous" }, + H = { "BufferLineMovePrev", "Previous" }, + p = { "BufferLinePick", "Pick buffer" }, + q = { + function() + require("mini.bufremove").delete(0, false) + end, + "Close", + }, + d = { "", "which_key_ignore" }, + }, + h = { + name = "Harpoon", + a = { mark.add_file, "Add file" }, + h = { ui.toggle_quick_menu, "Toggle quick menu" }, + n = { + function() + ui.nav_next() + end, + "Navigate next", + }, + p = { + function() + ui.nav_prev() + end, + "Navigate previous", + }, + ["1"] = { + function() + ui.nav_file(1) + end, + "Navigate 1", + }, + ["2"] = { + function() + ui.nav_file(2) + end, + "Navigate 2", + }, + ["3"] = { + function() + ui.nav_file(3) + end, + "Navigate 3", + }, + ["4"] = { + function() + ui.nav_file(4) + end, + "Navigate 4", + }, + ["&"] = { + function() + ui.nav_file(1) + end, + "Navigate 1", + }, + ["é"] = { + function() + ui.nav_file(2) + end, + "Navigate 2", + }, + ['"'] = { + function() + ui.nav_file(3) + end, + "Navigate 3", + }, + ["'"] = { + function() + ui.nav_file(4) + end, + "Navigate 4", + }, + }, + c = { + name = "Language", + r = { + function() + vim.cmd([[Telescope lsp_references]]) + end, + "Find references", + remap = true, + }, + }, + } + local mappings = { w = { h = { ":wincmd h", "Jump left" }, @@ -109,7 +319,9 @@ return { }, } - wk.register(mappings, { mode = "n", prefix = "" }) - wk.register(mappings, { mode = "v", prefix = "" }) + wk.add(newMappings) + + -- wk.add(mappings, { mode = "n", prefix = "" }) + -- wk.add(mappings, { mode = "v", prefix = "" }) end, }