From 8029fdebcc8cf40c648eaa5c5e43ec3c9b870705 Mon Sep 17 00:00:00 2001 From: Mike Priscella Date: Tue, 5 Nov 2024 10:41:57 -0500 Subject: [PATCH] feat: Add harpoon plugin, as well as other small changes (#56) --- .config/nvim/lazy-lock.json | 19 ++++---- .config/nvim/lua/custom/plugins/debug.lua | 11 ++--- .config/nvim/lua/custom/plugins/harpoon.lua | 47 +++++++++++++++++++ .config/nvim/lua/custom/plugins/lint.lua | 7 ++- .config/nvim/lua/custom/plugins/lsp.lua | 13 +++++ .../nvim/lua/custom/plugins/treesitter.lua | 12 ++++- README.md | 2 +- 7 files changed, 89 insertions(+), 22 deletions(-) create mode 100644 .config/nvim/lua/custom/plugins/harpoon.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 9f2106d..c60b224 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,15 +1,16 @@ { - "LuaSnip": { "branch": "master", "commit": "2c08f32a570c07b8130144813266e21393da80d3" }, + "LuaSnip": { "branch": "master", "commit": "4bf40748f6fe939bdcb69325918535b1c5edea51" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "6a28c90082a67f62a323ab90d988e000a718a8c7" }, + "conform.nvim": { "branch": "master", "commit": "d28ccf945374edd9f1c34a82f6c22261dbd8ab98" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" }, - "gitsigns.nvim": { "branch": "main", "commit": "2d725fdd7fe4a612fa3171ca0a965f455d8dc325" }, + "gitsigns.nvim": { "branch": "main", "commit": "7c27a30450130cd59c4994a6755e3c5d74d83e76" }, + "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" }, "lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" }, - "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, + "lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" }, "lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, @@ -20,14 +21,14 @@ "neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, - "nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" }, + "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, "nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" }, "nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" }, "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, - "nvim-lint": { "branch": "master", "commit": "16b21a7d04d06661f92f273a0744fd81fb19e09e" }, - "nvim-lspconfig": { "branch": "master", "commit": "59a6766cbf32c7e4cf3ed685ccad7ffe1dde8c40" }, + "nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" }, + "nvim-lspconfig": { "branch": "master", "commit": "bc6ada4b0892b7f10852c0b8ca7209fd39a6d754" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "39016abc99853c3e9d70f1bec7e2fa661b9a81bf" }, + "nvim-treesitter": { "branch": "master", "commit": "01a92da4389b5346b4049c5b42256c9d84526f04" }, "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, @@ -36,7 +37,7 @@ "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, - "tokyonight.nvim": { "branch": "main", "commit": "2e1daa1d164ad8cc3e99b44ca68e990888a66038" }, + "tokyonight.nvim": { "branch": "main", "commit": "52d67cc5d18c30f618897134620c64a11208fcae" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "vs-tasks.nvim": { "branch": "main", "commit": "33f8f5a53541cfff018863289353ba144a19fd54" }, "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" } diff --git a/.config/nvim/lua/custom/plugins/debug.lua b/.config/nvim/lua/custom/plugins/debug.lua index 196f2c6..caefdd9 100644 --- a/.config/nvim/lua/custom/plugins/debug.lua +++ b/.config/nvim/lua/custom/plugins/debug.lua @@ -63,7 +63,6 @@ return { -- online, please don't ask me how to install them :) ensure_installed = { -- Update this to ensure that you have the debuggers for the langs you want - 'delve', }, } @@ -95,11 +94,11 @@ return { -- Install golang specific config require('dap-go').setup { - delve = { - -- On Windows delve must be run attached or it crashes. - -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring - detached = vim.fn.has 'win32' == 0, - }, + -- delve = { + -- -- On Windows delve must be run attached or it crashes. + -- -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring + -- detached = vim.fn.has('win32') == 0, + -- }, } end, } diff --git a/.config/nvim/lua/custom/plugins/harpoon.lua b/.config/nvim/lua/custom/plugins/harpoon.lua new file mode 100644 index 0000000..1c12628 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/harpoon.lua @@ -0,0 +1,47 @@ +return { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local harpoon = require('harpoon') + harpoon:setup() + + vim.keymap.set('n', 'a', function() + harpoon:list():add() + end) + + vim.keymap.set('n', '', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + + -- Set 1..5 be my shortcuts to moving to the files + for _, idx in ipairs({ 1, 2, 3, 4, 5 }) do + vim.keymap.set('n', string.format('%d', idx), function() + harpoon:list():select(idx) + end) + end + + local conf = require('telescope.config').values + local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end + + require('telescope.pickers') + .new({}, { + prompt_title = 'Harpoon', + finder = require('telescope.finders').new_table({ + results = file_paths, + }), + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }) + :find() + end + + vim.keymap.set('n', 'h', function() + toggle_telescope(harpoon:list()) + end, { desc = 'Open Harpoon window' }) + end, +} diff --git a/.config/nvim/lua/custom/plugins/lint.lua b/.config/nvim/lua/custom/plugins/lint.lua index a27cd95..a34c0f9 100644 --- a/.config/nvim/lua/custom/plugins/lint.lua +++ b/.config/nvim/lua/custom/plugins/lint.lua @@ -1,13 +1,12 @@ return { - { -- Linting 'mfussenegger/nvim-lint', event = { 'BufReadPre', 'BufNewFile' }, config = function() local lint = require 'lint' - -- lint.linters_by_ft = { - -- markdown = { 'markdownlint' }, - -- } + lint.linters_by_ft = { + markdown = { 'markdownlint' }, + } -- To allow other plugins to add linters to require('lint').linters_by_ft, -- instead set linters_by_ft like this: diff --git a/.config/nvim/lua/custom/plugins/lsp.lua b/.config/nvim/lua/custom/plugins/lsp.lua index 8680695..90b99de 100644 --- a/.config/nvim/lua/custom/plugins/lsp.lua +++ b/.config/nvim/lua/custom/plugins/lsp.lua @@ -184,6 +184,19 @@ return { }, }, }, + yamlls = { + settings = { + validate = true, + -- disable the schema store + schemaStore = { + enable = false, + url = '', + }, + schemas = { + ['https://json.schemastore.org/github-workflow.json'] = '.github/workflows/*.{yml,yaml}', + }, + }, + }, } -- Ensure the servers and tools above are installed diff --git a/.config/nvim/lua/custom/plugins/treesitter.lua b/.config/nvim/lua/custom/plugins/treesitter.lua index 6cbf2b6..7c0c9af 100644 --- a/.config/nvim/lua/custom/plugins/treesitter.lua +++ b/.config/nvim/lua/custom/plugins/treesitter.lua @@ -16,6 +16,8 @@ return { 'markdown', 'markdown_inline', 'query', + 'terraform', + 'zig', 'vim', 'vimdoc', }, @@ -26,10 +28,16 @@ return { -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. -- If you are experiencing weird indenting issues, add the language to -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { 'ruby' }, + -- additional_vim_regex_highlighting = { 'ruby' }, }, - indent = { enable = true, disable = { 'ruby' } }, + -- indent = { enable = true, disable = { 'ruby' } }, + indent = { enable = true }, }, + config = function() + vim.opt.foldmethod = 'expr' + vim.opt.foldexpr = 'nvim_treesitter#foldexpr()' + vim.opt.foldlevelstart = 99 + end, -- There are additional nvim-treesitter modules that you can use to interact -- with nvim-treesitter. You should go explore a few and see what interests you: -- diff --git a/README.md b/README.md index f202c3c..01582a9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ may vary. ## Installation ```shell -$ ./dotfiles.sh install +./dotfiles.sh install ``` ## Usage in Development Containers