From e7f2e6b2ff40c0735b0896ccbb5db89c5f33e877 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Thu, 14 Nov 2024 13:03:09 +1030 Subject: [PATCH] feat: more clean up --- .config/nvim/lua/core/remaps.lua | 6 +- .config/nvim/lua/plugins/harpoon.lua | 20 ++++++ .config/nvim/lua/plugins/laravel.lua | 76 -------------------- .config/nvim/lua/plugins/linting.lua | 6 +- .config/nvim/lua/plugins/lspconfig.lua | 15 ++-- .config/nvim/lua/plugins/nvim-treesitter.lua | 3 - .config/nvim/lua/plugins/refactoring.lua | 10 --- 7 files changed, 30 insertions(+), 106 deletions(-) delete mode 100644 .config/nvim/lua/plugins/laravel.lua delete mode 100644 .config/nvim/lua/plugins/refactoring.lua diff --git a/.config/nvim/lua/core/remaps.lua b/.config/nvim/lua/core/remaps.lua index e6241c5..38b5293 100644 --- a/.config/nvim/lua/core/remaps.lua +++ b/.config/nvim/lua/core/remaps.lua @@ -7,7 +7,7 @@ vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") -- Easily open splits -vim.keymap.set("n", "hs", "split", { desc = "Open horizontal spilt" }) +vim.keymap.set("n", "bs", "split", { desc = "Open horizontal spilt" }) vim.keymap.set("n", "vs", "vsplit", { desc = "Open vertical spilt" }) -- Spell-check @@ -40,8 +40,8 @@ vim.keymap.set("n", "n", "nzzzv", { desc = "Next search result" }) vim.keymap.set("n", "N", "Nzzzv", { desc = "Previous search result" }) -- Keep cursor centered when jumping through quickfix list -vim.keymap.set("n", "k", "cprevzz", { desc = "Previous item in quickfix list" }) -vim.keymap.set("n", "j", "cnextzz", { desc = "Next item in quickfix list" }) +vim.keymap.set("n", "K", "cprevzz", { desc = "Previous item in quickfix list" }) +vim.keymap.set("n", "J", "cnextzz", { desc = "Next item in quickfix list" }) -- Easily run global search and replace vim.keymap.set( diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua index cdac934..86fec35 100644 --- a/.config/nvim/lua/plugins/harpoon.lua +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -25,18 +25,38 @@ return { harpoon:list():select(1) end, { desc = "Go to first harpoon file" }) + keymap.set("n", "h", function() + harpoon:list():select(1) + end, { desc = "Go to first harpoon file" }) + + keymap.set("n", "2", function() harpoon:list():select(2) end, { desc = "Go to second harpoon file" }) + keymap.set("n", "j", function() + harpoon:list():select(2) + end, { desc = "Go to second harpoon file" }) + + keymap.set("n", "3", function() harpoon:list():select(3) end, { desc = "Go to third harpoon file" }) + keymap.set("n", "k", function() + harpoon:list():select(3) + end, { desc = "Go to third harpoon file" }) + + keymap.set("n", "4", function() harpoon:list():select(4) end, { desc = "Go to fourth harpoon file" }) + keymap.set("n", "l", function() + harpoon:list():select(4) + end, { desc = "Go to fourth harpoon file" }) + + keymap.set("n", "", function() harpoon:list():prev() end) diff --git a/.config/nvim/lua/plugins/laravel.lua b/.config/nvim/lua/plugins/laravel.lua deleted file mode 100644 index b9abf34..0000000 --- a/.config/nvim/lua/plugins/laravel.lua +++ /dev/null @@ -1,76 +0,0 @@ -return { - "tovijaeschke/laravel.nvim", - enabled = false, - branch = "feature/discovery-check-improvements", - dependencies = { - "nvim-telescope/telescope.nvim", - "tpope/vim-dotenv", - "MunifTanjim/nui.nvim", - -- "nvimtools/none-ls.nvim", - }, - cmd = { "Sail", "Artisan", "Composer", "Npm", "Yarn", "Laravel" }, - keys = { - { "la", ":Laravel artisan" }, - { "lr", ":Laravel routes" }, - { "lm", ":Laravel related" }, - }, - event = { "VeryLazy" }, - config = function() - local laravel = require("laravel") - - laravel.setup({ - lsp_server = "intelephense", - features = { - null_ls = { - enable = false, - }, - }, - environments = { - env_variable = "NVIM_LARAVEL_ENV", - auto_dicover = false, - default = "docker-compose", - definitions = { - { - name = "sail", - condition = { - file_exists = { "vendor/bin/sail", "docker-compose.yml" }, - }, - commands = { - sail = { "vendor/bin/sail" }, - { - commands = { "php", "composer", "npm", "yarn" }, - prefix = { "vendor/bin/sail" }, - }, - }, - }, - { - name = "docker-compose", - condition = { - file_exists = { "docker-compose.yml" }, - executable = { "docker" }, - }, - commands = { - compose = { "docker", "compose" }, - { - commands = { "php", "composer", "npm" }, - docker = { - container = { - env = "APP_SERVICE", - default = "fpm", - }, - exec = { "docker", "compose", "exec", "-it" }, - }, - }, - }, - }, - { - name = "local", - condition = { - executable = { "php" }, - }, - }, - }, - }, - }) - end, -} diff --git a/.config/nvim/lua/plugins/linting.lua b/.config/nvim/lua/plugins/linting.lua index d63f1fa..2907c39 100644 --- a/.config/nvim/lua/plugins/linting.lua +++ b/.config/nvim/lua/plugins/linting.lua @@ -79,8 +79,8 @@ return { end, }) - vim.keymap.set("n", "ll", function() - lint.try_lint() - end) + -- vim.keymap.set("n", "ll", function() + -- lint.try_lint() + -- end) end, } diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 76d6188..bb914df 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -63,9 +63,6 @@ return { vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR }) end, opts) - opts.desc = "Show documentation for what is under cursor" - keymap.set("n", "ld", vim.diagnostic.setqflist, opts) - opts.desc = "Show documentation for what is under cursor" keymap.set("n", "K", vim.lsp.buf.hover, opts) @@ -106,14 +103,10 @@ return { return result:lower():gsub("%s+", "") end - -- Set the base path based on the operating system - local os = get_os() - local base_path = "" - - if os == "darwin" then + -- base_path = "/usr/lib/node_modules" + local base_path = "/usr/local/lib/node_modules" + if get_os() == "darwin" then base_path = "/opt/homebrew/lib/node_modules" - elseif os == "linux" then - base_path = "/usr/lib/node_modules" end local function get_typescript_server_path(root_dir) @@ -292,7 +285,7 @@ return { for server_name, server in pairs(servers) do server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) - require("lspconfig")[server_name].setup(server) + lspconfig[server_name].setup(server) end end, } diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua index 709a3c2..06a79a8 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -21,11 +21,8 @@ return { "yaml", "html", "css", - "prisma", "markdown", "markdown_inline", - "svelte", - "graphql", "bash", "lua", "vim", diff --git a/.config/nvim/lua/plugins/refactoring.lua b/.config/nvim/lua/plugins/refactoring.lua deleted file mode 100644 index fe31a79..0000000 --- a/.config/nvim/lua/plugins/refactoring.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - config = function() - require("refactoring").setup() - end, -}