From 4ab408aea0b72ce61d8ec83f34e4bbe701cd4693 Mon Sep 17 00:00:00 2001 From: Jules Sang Date: Wed, 20 Nov 2024 10:02:10 +0100 Subject: [PATCH] TMP: remove stoopid errors --- lazyvim.json | 8 +- lua/config/lazy.lua | 5 +- lua/plugins/harpoon.lua | 39 ++-- lua/plugins/lsp-config.lua | 119 ++++++------ lua/plugins/which-key.lua | 358 ++++++++----------------------------- 5 files changed, 164 insertions(+), 365 deletions(-) diff --git a/lazyvim.json b/lazyvim.json index c0e11c4..07cd326 100644 --- a/lazyvim.json +++ b/lazyvim.json @@ -1,10 +1,12 @@ { - "extras": [ - "lazyvim.plugins.extras.coding.codeium", + "extras.bak": [ "lazyvim.plugins.extras.editor.leap" ], + "extras": [ + "lazyvim.plugins.extras.coding.codeium" + ], "news": { "NEWS.md": "2123" }, "version": 2 -} \ No newline at end of file +} diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 2acb56a..2263fb1 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -2,7 +2,8 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then -- bootstrap lazy.nvim -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", + lazypath }) end vim.opt.rtp:prepend(vim.env.LAZY or lazypath) @@ -15,7 +16,7 @@ require("lazy").setup({ -- import any extras modules here { import = "lazyvim.plugins.extras.lang.typescript" }, { import = "lazyvim.plugins.extras.lang.json" }, - { import = "lazyvim.plugins.extras.lang.tailwind" }, + -- { import = "lazyvim.plugins.extras.lang.tailwind" }, { import = "lazyvim.plugins.extras.lsp.none-ls" }, -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, -- import/override with your plugins diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index 68ed225..7bfe842 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -1,19 +1,22 @@ -return { - "ThePrimeagen/harpoon", - config = function() - local ui = require("harpoon.ui") +return {} - require("harpoon").setup({ - menu = { - width = vim.api.nvim_win_get_width(0) - 24, - }, - global_settings = { - mark_branch = true, - }, - }) - - vim.keymap.set("n", "", function() - ui.nav_next() - end, { desc = "Navigate next" }) - end, -} +-- +-- return { +-- "ThePrimeagen/harpoon", +-- config = function() +-- local ui = require("harpoon.ui") +-- +-- require("harpoon").setup({ +-- menu = { +-- width = vim.api.nvim_win_get_width(0) - 24, +-- }, +-- global_settings = { +-- mark_branch = true, +-- }, +-- }) +-- +-- vim.keymap.set("n", "", function() +-- ui.nav_next() +-- end, { desc = "Navigate next" }) +-- end, +-- } diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua index f05f19f..4a72d64 100644 --- a/lua/plugins/lsp-config.lua +++ b/lua/plugins/lsp-config.lua @@ -27,7 +27,6 @@ return { "typescriptreact", "typescript.tsx", }, - root_dir = util.root_pattern("tsconfig.json", "jsconfig.json", "package.json", ".git"), settings = { complete_function_calls = true, vtsls = { @@ -53,58 +52,58 @@ return { variableTypes = { enabled = false }, }, }, - keys = { - { - "gD", - function() - local params = vim.lsp.util.make_position_params() - LazyVim.lsp.execute({ - command = "typescript.goToSourceDefinition", - arguments = { params.textDocument.uri, params.position }, - open = true, - }) - end, - desc = "Goto Source Definition", - }, - { - "gR", - function() - LazyVim.lsp.execute({ - command = "typescript.findAllFileReferences", - arguments = { vim.uri_from_bufnr(0) }, - open = true, - }) - end, - desc = "File References", - }, - { - "co", - LazyVim.lsp.action["source.organizeImports"], - desc = "Organize Imports", - }, - { - "cM", - LazyVim.lsp.action["source.addMissingImports.ts"], - desc = "Add missing imports", - }, - { - "cu", - LazyVim.lsp.action["source.removeUnused.ts"], - desc = "Remove unused imports", - }, - { - "cD", - LazyVim.lsp.action["source.fixAll.ts"], - desc = "Fix all diagnostics", - }, - { - "cV", - function() - LazyVim.lsp.execute({ command = "typescript.selectTypeScriptVersion" }) - end, - desc = "Select TS workspace version", - }, - }, + -- keys = { + -- { + -- "gD", + -- function() + -- local params = vim.lsp.util.make_position_params() + -- LazyVim.lsp.execute({ + -- command = "typescript.goToSourceDefinition", + -- arguments = { params.textDocument.uri, params.position }, + -- open = true, + -- }) + -- end, + -- desc = "Goto Source Definition", + -- }, + -- { + -- "gR", + -- function() + -- LazyVim.lsp.execute({ + -- command = "typescript.findAllFileReferences", + -- arguments = { vim.uri_from_bufnr(0) }, + -- open = true, + -- }) + -- end, + -- desc = "File References", + -- }, + -- { + -- "co", + -- LazyVim.lsp.action["source.organizeImports"], + -- desc = "Organize Imports", + -- }, + -- { + -- "cM", + -- LazyVim.lsp.action["source.addMissingImports.ts"], + -- desc = "Add missing imports", + -- }, + -- { + -- "cu", + -- LazyVim.lsp.action["source.removeUnused.ts"], + -- desc = "Remove unused imports", + -- }, + -- { + -- "cD", + -- LazyVim.lsp.action["source.fixAll.ts"], + -- desc = "Fix all diagnostics", + -- }, + -- { + -- "cV", + -- function() + -- LazyVim.lsp.execute({ command = "typescript.selectTypeScriptVersion" }) + -- end, + -- desc = "Select TS workspace version", + -- }, + -- }, }, }, marksman = {}, @@ -220,13 +219,13 @@ return { vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {}) 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) - 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) + -- end, }, }, } diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index b0894df..63e1ede 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -2,9 +2,9 @@ return { "folke/which-key.nvim", config = function() local wk = require("which-key") - local mark = require("harpoon.mark") - local ui = require("harpoon.ui") - local term = require("harpoon.term") + -- local mark = require("harpoon.mark") + -- local ui = require("harpoon.ui") + -- local term = require("harpoon.term") local newMappings = { mode = { "n", "v" }, @@ -29,79 +29,79 @@ return { 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", - }, + -- { "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", @@ -113,212 +113,6 @@ return { }, } - 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" }, - 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, - }, - }, - } - wk.add(newMappings) -- wk.add(mappings, { mode = "n", prefix = "" })