From ccbe053f881d11e9514ec10c0c46c782202387c2 Mon Sep 17 00:00:00 2001 From: Oliver Ladner Date: Tue, 5 Mar 2024 21:26:01 +0100 Subject: [PATCH] housekeeping --- init.lua | 4 +- lazy-lock.json | 36 +++++++------- lua/weeheavy/plugins/gitsigns.lua | 73 +++++++++++++++-------------- lua/weeheavy/plugins/lazygit.lua | 29 ------------ lua/weeheavy/plugins/telescope.lua | 4 +- lua/weeheavy/plugins/treesitter.lua | 3 ++ lua/weeheavy/plugins/troube.lua | 19 -------- 7 files changed, 64 insertions(+), 104 deletions(-) delete mode 100644 lua/weeheavy/plugins/lazygit.lua diff --git a/init.lua b/init.lua index 5208b84..d47e897 100644 --- a/init.lua +++ b/init.lua @@ -2,12 +2,12 @@ My simple Neovim configuration. Made from scratch, inspired by https://www.youtube.com/watch?v=w7i4amO_zaE -EXTERNAL DEPENDENCIES MACOS +NOTE: EXTERNAL DEPENDENCIES MACOS - ripgrep (https://github.com/BurntSushi/ripgrep, used by telescope) - fd (https://github.com/sharkdp/fd, used by telescope) - A Nerd font (https://www.nerdfonts.com/, used by nvim-web-devicons) -EXTERNAL DEPENDENCIES WINDOWS +NOTE: EXTERNAL DEPENDENCIES WINDOWS See https://blog.nikfp.com/how-to-install-and-set-up-neovim-on-windows - ripgrep (https://github.com/BurntSushi/ripgrep, used by telescope) - fd (https://github.com/sharkdp/fd, used by telescope) diff --git a/lazy-lock.json b/lazy-lock.json index b1515a9..5a59bed 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,29 +1,29 @@ { "LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "conform.nvim": { "branch": "master", "commit": "cbc5745bf7519acaf3a5cbaaa677fd556aa813d7" }, - "gitsigns.nvim": { "branch": "main", "commit": "4aaacbf5e5e2218fd05eb75703fe9e0f85335803" }, - "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, - "lazygit.nvim": { "branch": "main", "commit": "1e08e3f5ac1152339690140e61a4a32b3bdc7de5" }, - "lsp-zero.nvim": { "branch": "v3.x", "commit": "dec1c21204e2d9d49dad989b577c88958ed2c113" }, - "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, + "conform.nvim": { "branch": "master", "commit": "3d59cbd01a4b74124c5a6fb23b8cc63e5c2db3d5" }, + "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, + "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "abac76482ec3012a2b359ba956a74e2ffd33d46f" }, + "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, - "mason.nvim": { "branch": "main", "commit": "baf99d94c3380640d19af9c70c0541bd6e7cd0cb" }, - "nightfox.nvim": { "branch": "main", "commit": "a4bc2bd3d7ff1770ae104068458d3b0b8f8ec00d" }, - "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, - "nvim-lspconfig": { "branch": "master", "commit": "042aa6b27b8b8d4f4e1bd42de2037c83d676a8a0" }, - "nvim-treesitter": { "branch": "master", "commit": "090880c0f1fec219f7de838cb51b8dc07ce74a6d" }, - "nvim-treesitter-context": { "branch": "master", "commit": "85cf977181fb8e816e47ac05df7f756e9cb72caf" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "19a91a38b02c1c28c14e0ba468d20ae1423c39b2" }, - "nvim-web-devicons": { "branch": "master", "commit": "140edfcf25093e8b321d13e154cbce89ee868ca0" }, + "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, + "nightfox.nvim": { "branch": "main", "commit": "a408e6bb101066952b81de9c11be367114bd561f" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-lspconfig": { "branch": "master", "commit": "76251e810256dce4db531c98b8b746a38c0ed488" }, + "nvim-treesitter": { "branch": "master", "commit": "10d79b5dbbdffc3edf307b189284fb62e2e79a3e" }, + "nvim-treesitter-context": { "branch": "master", "commit": "f2ef98cd18fca352448756d3feb6e58d82583274" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "dd0b2036c3a27cb6e6486f8bd24188c6ca43af0b" }, + "nvim-web-devicons": { "branch": "master", "commit": "7f30f2da3c3641841ceb0e2c150281f624445e8f" }, "oil.nvim": { "branch": "master", "commit": "bf753c3e3f8736939ad5597f92329dfe7b1df4f5" }, - "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, - "tokyonight.nvim": { "branch": "main", "commit": "633039585dff7fd2b9b62fb190bf768702609d95" }, + "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, + "tokyonight.nvim": { "branch": "main", "commit": "67c6050e1ca41260c919236a098ba278472c7520" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" }, - "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, + "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, - "zen-mode.nvim": { "branch": "main", "commit": "50e2e2a36cc97847d9ab3b1a3555ba2ef6839b50" } + "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" } } \ No newline at end of file diff --git a/lua/weeheavy/plugins/gitsigns.lua b/lua/weeheavy/plugins/gitsigns.lua index 7bec830..6d8b8ad 100644 --- a/lua/weeheavy/plugins/gitsigns.lua +++ b/lua/weeheavy/plugins/gitsigns.lua @@ -1,38 +1,43 @@ -- Adds git related signs to the gutter, as well as utilities for managing changes return { - 'lewis6991/gitsigns.nvim', - opts = { - -- See `:help gitsigns.txt` - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - on_attach = function(bufnr) - --vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) + "lewis6991/gitsigns.nvim", + opts = { + -- See `:help gitsigns.txt` + signs = { + add = { text = "+" }, + change = { text = "~" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + }, + on_attach = function(bufnr) + vim.keymap.set( + "n", + "ggh", + require("gitsigns").preview_hunk, + { buffer = bufnr, desc = "Preview git hunk" } + ) - -- don't override the built-in and fugitive keymaps - local gs = package.loaded.gitsigns - vim.keymap.set({ 'n', 'v' }, ']c', function() - if vim.wo.diff then - return ']c' - end - vim.schedule(function() - gs.next_hunk() - end) - return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) - vim.keymap.set({ 'n', 'v' }, '[c', function() - if vim.wo.diff then - return '[c' - end - vim.schedule(function() - gs.prev_hunk() - end) - return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) - end, - }, + -- don't override the built-in and fugitive keymaps + local gs = package.loaded.gitsigns + vim.keymap.set({ "n", "v" }, "]c", function() + if vim.wo.diff then + return "]c" + end + vim.schedule(function() + gs.next_hunk() + end) + return "" + end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" }) + vim.keymap.set({ "n", "v" }, "[c", function() + if vim.wo.diff then + return "[c" + end + vim.schedule(function() + gs.prev_hunk() + end) + return "" + end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" }) + end, + }, } diff --git a/lua/weeheavy/plugins/lazygit.lua b/lua/weeheavy/plugins/lazygit.lua deleted file mode 100644 index 5084a40..0000000 --- a/lua/weeheavy/plugins/lazygit.lua +++ /dev/null @@ -1,29 +0,0 @@ --- Git UI --- https://github.com/kdheepak/lazygit.nvim -return { - "kdheepak/lazygit.nvim", - lazy = true, - event = "VeryLazy", - dependencies = { - "nvim-lua/plenary.nvim", - }, - --config = function() - -- local oil = require("oil") - -- oil.setup({ - -- default_file_explorer = true, - -- columns = { - -- --"size", - -- "icon", - -- }, - -- view_options = { - -- show_hidden = true, - -- }, - -- keymaps = { - -- -- This should be matched to the open action in remap.lua - -- ["e"] = "actions.close", - -- [""] = "actions.select_vsplit", - -- [""] = "actions.select_split", - -- }, - -- }) - --end, -} diff --git a/lua/weeheavy/plugins/telescope.lua b/lua/weeheavy/plugins/telescope.lua index 506a2db..b1b70a3 100644 --- a/lua/weeheavy/plugins/telescope.lua +++ b/lua/weeheavy/plugins/telescope.lua @@ -20,8 +20,8 @@ return { layout_config = { horizontal = { prompt_position = "top", - preview_width = 0.4, - width = 0.75, + preview_width = 0.45, + width = 0.90, height = 0.75, preview_cutoff = 90, }, diff --git a/lua/weeheavy/plugins/treesitter.lua b/lua/weeheavy/plugins/treesitter.lua index e5a05c1..c29ac3d 100644 --- a/lua/weeheavy/plugins/treesitter.lua +++ b/lua/weeheavy/plugins/treesitter.lua @@ -41,6 +41,9 @@ return { "python", "regex", "json", + "go", + "gomod", + "gosum", }, incremental_selection = { enable = true, diff --git a/lua/weeheavy/plugins/troube.lua b/lua/weeheavy/plugins/troube.lua index d03dd4f..5b7be24 100644 --- a/lua/weeheavy/plugins/troube.lua +++ b/lua/weeheavy/plugins/troube.lua @@ -6,23 +6,4 @@ return { dependencies = { "nvim-tree/nvim-web-devicons", }, - --config = function() - -- local oil = require("oil") - -- oil.setup({ - -- default_file_explorer = true, - -- columns = { - -- --"size", - -- "icon", - -- }, - -- view_options = { - -- show_hidden = true, - -- }, - -- keymaps = { - -- -- This should be matched to the open action in remap.lua - -- ["e"] = "actions.close", - -- [""] = "actions.select_vsplit", - -- [""] = "actions.select_split", - -- }, - -- }) - --end, }