From 102af95a0bf90f093575aba512ff888e0a8d765f Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Fri, 26 Apr 2024 16:57:31 -0600 Subject: [PATCH 01/20] feat: move coding-related plugins to `coding.lua` This is the first commit of my v2 update. I am following the LazyVim pattern for organizing all of my configuration options. I like LazyVim a lot and would use it myself - except I have an obsession with tinkering and doing this part myself. So I shall! --- lazy-lock.json | 44 +++++++++---------- lua/plugins/coding.lua | 86 ++++++++++++++++++++++++++++++++++++++ lua/plugins/commentary.lua | 3 -- lua/plugins/completion.lua | 59 -------------------------- lua/plugins/hardtime.lua | 28 ------------- lua/plugins/surround.lua | 3 -- 6 files changed, 109 insertions(+), 114 deletions(-) create mode 100644 lua/plugins/coding.lua delete mode 100644 lua/plugins/commentary.lua delete mode 100644 lua/plugins/completion.lua delete mode 100644 lua/plugins/hardtime.lua delete mode 100644 lua/plugins/surround.lua diff --git a/lazy-lock.json b/lazy-lock.json index 06761ad..310898c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,33 +1,35 @@ { - "LuaSnip": { "branch": "master", "commit": "79cc25c39878401d4e8b6ec42fcf14639426bafc" }, + "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, - "hardtime.nvim": { "branch": "main", "commit": "21b0f9146198bb43fbc9f5ec66c8af3234f278ed" }, + "conform.nvim": { "branch": "master", "commit": "4660e534bf7678ee0f85879aa75fdcb6855612c2" }, + "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, - "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" }, + "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "b129892f783740e6cf741f2ea09fa5dd512aa584" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "16d1b194376bf1fc2acd89ccb3c29ba8315bfcea" }, + "mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" }, + "mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" }, + "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, + "mini.surround": { "branch": "main", "commit": "a00d69be09e3fe27dfa9e5b0298410d0e148e3e2" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, - "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, - "nvim-cmp": { "branch": "main", "commit": "2fb2a3cf78bbc1b0bea030e8c8728985af1cf302" }, - "nvim-lint": { "branch": "master", "commit": "6670b3ac73fa4caf720f017b91c619e9424d955e" }, - "nvim-lspconfig": { "branch": "master", "commit": "f4619ab31fc4676001ea05ae8200846e6e7700c7" }, - "nvim-treesitter": { "branch": "master", "commit": "30492e7e1c9e5af3642e8a74c2f88dc1f50ec305" }, - "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, - "nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" }, - "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, + "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, + "nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" }, + "nvim-treesitter": { "branch": "master", "commit": "3ef8d25df2d8eca6f15a6889cb2bc9d4c6101096" }, + "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, + "nvim-web-devicons": { "branch": "master", "commit": "beb6367ab8496c9e43f22e0252735fdadae1872d" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, - "tokyonight.nvim": { "branch": "main", "commit": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5" }, + "tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" }, "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, - "vim-commentary": { "branch": "master", "commit": "f67e3e67ea516755005e6cccb178bc8439c6d402" }, - "vim-fugitive": { "branch": "master", "commit": "c0b03f1cac242d96837326d300f42a660306fc1a" }, - "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua new file mode 100644 index 0000000..35e93d5 --- /dev/null +++ b/lua/plugins/coding.lua @@ -0,0 +1,86 @@ +return { + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-nvim-lsp" }, + config = function() + local cmp = require("cmp") + + cmp.setup({ + -- Highlights the first result always + completion = { + completeopt = "menu,menuone,noinsert", + }, + + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { "i" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { "i" }), + [""] = cmp.mapping.confirm({ + behaviour = cmp.ConfirmBehavior.Insert, + select = true, + }), + }), + + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, + { + "L3MON4D3/LuaSnip", + dependencies = { "rafamadriz/friendly-snippets" }, + }, + { + "echasnovski/mini.pairs", + version = false, + opts = {}, + }, + { + "echasnovski/mini.surround", + version = false, + opts = {}, + }, + { + "JoosepAlviste/nvim-ts-context-commentstring", + opts = { + enable_autocmd = false, + }, + }, + { + "echasnovski/mini.comment", + version = false, + opts = { + options = { + custom_commentstring = function() + return require("ts_context_commentstring.internal").calculate_commentstring() + or vim.bo.commentstring + end, + }, + }, + }, +} diff --git a/lua/plugins/commentary.lua b/lua/plugins/commentary.lua deleted file mode 100644 index 4e85c75..0000000 --- a/lua/plugins/commentary.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "tpope/vim-commentary" -} diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua deleted file mode 100644 index 6696501..0000000 --- a/lua/plugins/completion.lua +++ /dev/null @@ -1,59 +0,0 @@ -return { - { - "hrsh7th/nvim-cmp", - config = function() - local cmp = require("cmp") - - cmp.setup({ - -- Highlights the first result always - completion = { - completeopt = "menu,menuone,noinsert" - }, - - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { "i" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { "i" }), - [""] = cmp.mapping.confirm({ - behaviour = cmp.ConfirmBehavior.Insert, - select = true - }) - }), - - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end - }, - - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" } - }, { - { name = "buffer" } - }) - }) - end - }, - { - "hrsh7th/cmp-nvim-lsp" - }, - { - "L3MON4D3/LuaSnip" - } -} diff --git a/lua/plugins/hardtime.lua b/lua/plugins/hardtime.lua deleted file mode 100644 index 47b18eb..0000000 --- a/lua/plugins/hardtime.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - "m4xshen/hardtime.nvim", - dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" }, - opts = { - disable_mouse = true, - disabled_keys = { - -- Drill Sergeant Demchuk! - [""] = { "", "i" }, - [""] = { "", "i" }, - [""] = { "", "i" }, - [""] = { "", "i" }, - }, - disabled_filetypes = { - "checkhealth", - "fugitive", - "help", - "lazy", - "mason", - "markdown", - "neo-tree", - "neo-tree-popup", - "netrw", - "noice", - "notify", - "qf", - }, - }, -} diff --git a/lua/plugins/surround.lua b/lua/plugins/surround.lua deleted file mode 100644 index b5dd6ff..0000000 --- a/lua/plugins/surround.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "tpope/vim-surround" -} -- 2.47.2 From 6829dbbb06dfcba2c2e5c365dcd51b5a117ae7cd Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Fri, 26 Apr 2024 17:00:15 -0600 Subject: [PATCH 02/20] feat: small tweak to colorscheme.lua --- lua/plugins/colorscheme.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 890c312..790f129 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,8 +1,9 @@ return { - "folke/tokyonight.nvim", - lazy = true, - opts = { - transparent = true, - dim_inactive = true, - } + "folke/tokyonight.nvim", + lazy = true, + opts = { + style = "storm", + transparent = true, + dim_inactive = true, + }, } -- 2.47.2 From 9a9e5cf5f935a89a3cac89a2850e95bdf0b64f73 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Fri, 26 Apr 2024 17:44:16 -0600 Subject: [PATCH 03/20] feat: move editor related plugins to `editor.lua` --- lazy-lock.json | 3 + lua/plugins/editor.lua | 121 ++++++++++++++++++++++++++++++++++ lua/plugins/neo-tree.lua | 52 --------------- lua/plugins/telescope.lua | 36 ---------- lua/plugins/todo-comments.lua | 5 -- lua/plugins/trouble.lua | 7 -- lua/plugins/which-key.lua | 9 --- 7 files changed, 124 insertions(+), 109 deletions(-) create mode 100644 lua/plugins/editor.lua delete mode 100644 lua/plugins/neo-tree.lua delete mode 100644 lua/plugins/telescope.lua delete mode 100644 lua/plugins/todo-comments.lua delete mode 100644 lua/plugins/trouble.lua delete mode 100644 lua/plugins/which-key.lua diff --git a/lazy-lock.json b/lazy-lock.json index 310898c..e59bebb 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -3,7 +3,9 @@ "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "conform.nvim": { "branch": "master", "commit": "4660e534bf7678ee0f85879aa75fdcb6855612c2" }, + "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, + "gitsigns.nvim": { "branch": "main", "commit": "035da036e68e509ed158414416c827d022d914bd" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, @@ -20,6 +22,7 @@ "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, "nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" }, + "nvim-spectre": { "branch": "master", "commit": "026394a8458d62c6b7b305c076ce675420dbaa4c" }, "nvim-treesitter": { "branch": "master", "commit": "3ef8d25df2d8eca6f15a6889cb2bc9d4c6101096" }, "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua new file mode 100644 index 0000000..2d7716f --- /dev/null +++ b/lua/plugins/editor.lua @@ -0,0 +1,121 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + vim.keymap.set("n", "ee", ":Neotree toggle", { desc = "Toggle Neotree" }) + vim.keymap.set("n", "er", ":Neotree reveal", { desc = "Reveal file" }) + + local nt = require("neo-tree") + + nt.setup({ + open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, + filesystem = { + filtered_items = { + show_hidden_count = false, + hide_dotfiles = false, + hide_gitignored = true, + always_show = { + ".env", + }, + never_show = { + ".git", + "thumbs.db", + ".DS_Store", + }, + }, + }, + window = { + mappings = { + ["m"] = { + "move", + config = { + show_path = "relative", + }, + }, + }, + }, + event_handlers = { + { + event = "neo_tree_popup_input_ready", + handler = function() + -- Switch to normal inside popups by default. + vim.cmd.stopinsert() + end, + }, + }, + }) + end, + }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = {}, + }, + { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + vim.keymap.set("n", "tt", ":TroubleToggle", { desc = "Toggle Trouble" }) + end, + }, + { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, + }, + { + "nvim-pack/nvim-spectre", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { open_cmd = "noswapfile vnew" }, + keys = { + { + "sr", + function() + require("spectre").open() + end, + desc = "Replace in Files (Spectre)", + }, + }, + }, + { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local builtin = require("telescope.builtin") + + vim.keymap.set("n", "ff", builtin.git_files, { desc = "Search git_files" }) + vim.keymap.set("n", "fg", builtin.live_grep, { desc = "Grep git_files" }) + vim.keymap.set("n", "fh", builtin.help_tags, { desc = "View help tags" }) + vim.keymap.set("n", "fb", builtin.buffers, { desc = "Search buffers" }) + vim.keymap.set("n", "sR", builtin.resume, { desc = "Resume" }) + end, + }, + { + "nvim-telescope/telescope-ui-select.nvim", + config = function() + require("telescope").setup({ + defaults = { + initial_mode = "normal", + }, + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + }) + + require("telescope").load_extension("ui-select") + end, + }, +} diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua deleted file mode 100644 index 08755e1..0000000 --- a/lua/plugins/neo-tree.lua +++ /dev/null @@ -1,52 +0,0 @@ -return { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - }, - config = function() - vim.keymap.set("n", "nn", ":Neotree toggle", { desc = "Toggle Neotree" }) - - local nt = require("neo-tree") - - nt.setup({ - open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, - filesystem = { - filtered_items = { - show_hidden_count = false, - hide_dotfiles = false, - hide_gitignored = true, - always_show = { - ".env", - }, - never_show = { - ".git", - "thumbs.db", - ".DS_Store", - }, - }, - }, - window = { - mappings = { - ["m"] = { - "move", - config = { - show_path = "relative", - }, - }, - }, - }, - event_handlers = { - { - event = "neo_tree_popup_input_ready", - handler = function() - -- Switch to normal inside popups by default. - vim.cmd.stopinsert() - end, - }, - }, - }) - end, -} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua deleted file mode 100644 index 51e53fb..0000000 --- a/lua/plugins/telescope.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - { - 'nvim-telescope/telescope.nvim', - tag = '0.1.5', - dependencies = { 'nvim-lua/plenary.nvim' }, - config = function() - local builtin = require('telescope.builtin') - - vim.keymap.set('n', 'pp', builtin.git_files, { desc = "Search git_files" }) - vim.keymap.set('n', 'pf', builtin.find_files, { desc = "Search all files " }) - vim.keymap.set('n', 'fh', builtin.help_tags, { desc = "View help tags" }) - vim.keymap.set('n', 'gc', builtin.git_branches, { desc = "Checkout git branches" }) - vim.keymap.set('n', 'ps', function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }) - end, { desc = "Grep entire project for string" }) - vim.keymap.set('n', 'b', builtin.buffers, { desc = "Search buffers" }) - end - }, - { - "nvim-telescope/telescope-ui-select.nvim", - config = function() - require("telescope").setup { - defaults = { - initial_mode = "normal" - }, - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown {} - } - } - } - - require("telescope").load_extension("ui-select") - end - } -} diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua deleted file mode 100644 index 2ca05d6..0000000 --- a/lua/plugins/todo-comments.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = {}, -} diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua deleted file mode 100644 index 4745503..0000000 --- a/lua/plugins/trouble.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "folke/trouble.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - vim.keymap.set("n", "tt", ":TroubleToggle", { desc = "Toggle Trouble" }) - end -} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua deleted file mode 100644 index 410f8db..0000000 --- a/lua/plugins/which-key.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - opts = {} -} -- 2.47.2 From bd031587a5d5fa58bf6834883fb6e3aa0c43da32 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Fri, 26 Apr 2024 17:49:31 -0600 Subject: [PATCH 04/20] feat: add flash.nvim plugin --- lua/plugins/coding.lua | 12 +++++++++++- lua/plugins/editor.lua | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index 35e93d5..7a28339 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -63,7 +63,17 @@ return { { "echasnovski/mini.surround", version = false, - opts = {}, + opts = { + mappings = { + add = "gsa", -- Add surrounding in Normal and Visual modes + delete = "gsd", -- Delete surrounding + find = "gsf", -- Find surrounding (to the right) + find_left = "gsF", -- Find surrounding (to the left) + highlight = "gsh", -- Highlight surrounding + replace = "gsr", -- Replace surrounding + update_n_lines = "gsn", -- Update `n_lines` + }, + }, }, { "JoosepAlviste/nvim-ts-context-commentstring", diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 2d7716f..99fb667 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -118,4 +118,18 @@ return { require("telescope").load_extension("ui-select") end, }, + { + "folke/flash.nvim", + event = "VeryLazy", + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, + }, } -- 2.47.2 From bca2c8ec942a0dcda089600b377d5c362cedeb7f Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Fri, 26 Apr 2024 22:49:30 -0600 Subject: [PATCH 05/20] feat: move formatting plugins to `formatting.lua` --- lua/plugins/alpha-nvim.lua | 78 ++++++++++++------------- lua/plugins/formatting.lua | 20 +++++++ lua/plugins/fugitive.lua | 16 ++--- lua/plugins/lsp-config.lua | 116 +++++++++++++++---------------------- lua/plugins/lualine.lua | 20 +++---- lua/plugins/treesitter.lua | 62 ++++++++++++-------- lua/plugins/ui.lua | 106 ++++++++++++++++----------------- 7 files changed, 214 insertions(+), 204 deletions(-) create mode 100644 lua/plugins/formatting.lua diff --git a/lua/plugins/alpha-nvim.lua b/lua/plugins/alpha-nvim.lua index b4ee958..3f407db 100644 --- a/lua/plugins/alpha-nvim.lua +++ b/lua/plugins/alpha-nvim.lua @@ -1,43 +1,43 @@ return { - 'goolord/alpha-nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") + "goolord/alpha-nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") - -- https://github.com/MaximilianLloyd/ascii.nvim - dashboard.section.header.val = { - " ", - " ░░░ ▄▄▄▄▄▄███▄▄▄▄▄ ", - " ▄███████▀▀▀▀▀▀█▓▓▓▓▓▓██▄▄▄▄ ", - " ▐████▄▄ ■▓▓▓▓▀▀▀▀▀▀▀▀▀█████■ ██▄ ", - " ▀█████████▄▄▄▄▄███████████▀▀ ▄▄ ████░▄▄▄ ", - " ▐██▄ ▄▄▄▄▄▄▀▀▀▀▀▀▀▀▓▓▓▀░░░▄▄▄ ▄▄ ▐███▏▐██▓▄████ ", - " ▄█▓░███▓ ▄▓▓▓▄▄████████████▄█████▄ ▄█████████▐███ ████▏██▀████▀ ", - " ▐███▄███░▀████████▀▀ ▀▓█████▓▀██▓████▀▀ ███████ ▄█████ ■ ██▀ ", - " ▀████▓██ ▐██████ ▐████ ▐████▀ ▒████████▄ ▄███████ ", - " ▀███ ▀▀█████▄ ▄████ ▄████▏ ▄█████▀█████████▀ ███ ", - " ▀████▄ ▄████▐██▄███████▄▄▄███▓██▏ ▀██████▀ ▐██ ", - " ▀████████▀ ▀████▀▀████████▀▐██▏ ▀██▀▀ ▐██▏ ", - " ▓▓█ ▀████ ▀ ■███▄▄ ███ ██▏ ", - " ▀▀▀ ▀▀ ▀█████▄▓▀ ██▏ ", - " ░░ ▄████████████▄▄▄▄▄▄▄ ▀▀▀████▄▄ ▒▒▒ ██▏ ▄▄ ", - " ▀▀████▀▀▀▀▀▀████████████▄▄▓▓▓███▄ ░░░░ ▐█▏ ■▀▀ ", - " ▀▀▀▀▀▀█████▓▓▓▓█▄▄ ▐█ ", - " ▄█████████▄▄ ", - " ▄▄▄▄████████▀▀▀▀▀▀▀███▏ ", - " ▄▄█████▀▀▀▀ ▀■ ", - " ▄███▀▀▀▀ ", - " ■▀▀ ", - " ", - } + -- https://github.com/MaximilianLloyd/ascii.nvim + dashboard.section.header.val = { + " ", + " ░░░ ▄▄▄▄▄▄███▄▄▄▄▄ ", + " ▄███████▀▀▀▀▀▀█▓▓▓▓▓▓██▄▄▄▄ ", + " ▐████▄▄ ■▓▓▓▓▀▀▀▀▀▀▀▀▀█████■ ██▄ ", + " ▀█████████▄▄▄▄▄███████████▀▀ ▄▄ ████░▄▄▄ ", + " ▐██▄ ▄▄▄▄▄▄▀▀▀▀▀▀▀▀▓▓▓▀░░░▄▄▄ ▄▄ ▐███▏▐██▓▄████ ", + " ▄█▓░███▓ ▄▓▓▓▄▄████████████▄█████▄ ▄█████████▐███ ████▏██▀████▀ ", + " ▐███▄███░▀████████▀▀ ▀▓█████▓▀██▓████▀▀ ███████ ▄█████ ■ ██▀ ", + " ▀████▓██ ▐██████ ▐████ ▐████▀ ▒████████▄ ▄███████ ", + " ▀███ ▀▀█████▄ ▄████ ▄████▏ ▄█████▀█████████▀ ███ ", + " ▀████▄ ▄████▐██▄███████▄▄▄███▓██▏ ▀██████▀ ▐██ ", + " ▀████████▀ ▀████▀▀████████▀▐██▏ ▀██▀▀ ▐██▏ ", + " ▓▓█ ▀████ ▀ ■███▄▄ ███ ██▏ ", + " ▀▀▀ ▀▀ ▀█████▄▓▀ ██▏ ", + " ░░ ▄████████████▄▄▄▄▄▄▄ ▀▀▀████▄▄ ▒▒▒ ██▏ ▄▄ ", + " ▀▀████▀▀▀▀▀▀████████████▄▄▓▓▓███▄ ░░░░ ▐█▏ ■▀▀ ", + " ▀▀▀▀▀▀█████▓▓▓▓█▄▄ ▐█ ", + " ▄█████████▄▄ ", + " ▄▄▄▄████████▀▀▀▀▀▀▀███▏ ", + " ▄▄█████▀▀▀▀ ▀■ ", + " ▄███▀▀▀▀ ", + " ■▀▀ ", + " ", + } - dashboard.section.buttons.val = { - dashboard.button("e", " > New File", "ene"), - dashboard.button("SPC ee", " > File explorer", "Neotree"), - dashboard.button("q", " > Quit", "qa"), - } + dashboard.section.buttons.val = { + dashboard.button("e", " > New File", "ene"), + dashboard.button("SPC ee", " > File explorer", "Neotree"), + dashboard.button("q", " > Quit", "qa"), + } - alpha.setup(dashboard.opts) - end -}; + alpha.setup(dashboard.opts) + end, +} diff --git a/lua/plugins/formatting.lua b/lua/plugins/formatting.lua new file mode 100644 index 0000000..5820e06 --- /dev/null +++ b/lua/plugins/formatting.lua @@ -0,0 +1,20 @@ +return { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + css = { "prettierd" }, + scss = { "prettierd" }, + html = { "djlint" }, + lua = { "stylelua" }, + javascript = { "prettierd" }, + javascriptreact = { "prettierd" }, + json = { "prettierd" }, + jsonc = { "prettierd" }, + typescript = { "prettierd" }, + typescriptreact = { "prettierd" }, + }, + format_on_save = { + lsp_fallback = true, + }, + }, +} diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index 1a989fb..684d54b 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -1,10 +1,10 @@ return { - "tpope/vim-fugitive", - config = function() - vim.keymap.set("n", "gs", vim.cmd.Git, { desc = "View `git status`" }) - vim.keymap.set("n", "gh", "diffget //2", { desc = "Pick gitdiff on left" }) - vim.keymap.set("n", "gl", "diffget //3", { desc = "Pick gitdiff on right" }) - vim.keymap.set("n", "gp", ":Git push", { desc = "Run `git push`" }) - vim.keymap.set("n", "gc", ":Git checkout ", { desc = "Git checkout" }) - end + "tpope/vim-fugitive", + config = function() + vim.keymap.set("n", "gs", vim.cmd.Git, { desc = "View `git status`" }) + vim.keymap.set("n", "gh", "diffget //2", { desc = "Pick gitdiff on left" }) + vim.keymap.set("n", "gl", "diffget //3", { desc = "Pick gitdiff on right" }) + vim.keymap.set("n", "gp", ":Git push", { desc = "Run `git push`" }) + vim.keymap.set("n", "gc", ":Git checkout ", { desc = "Git checkout" }) + end, } diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua index 6a45483..a831f96 100644 --- a/lua/plugins/lsp-config.lua +++ b/lua/plugins/lsp-config.lua @@ -1,76 +1,52 @@ return { - { - "williamboman/mason.nvim", - config = function() - require("mason").setup() - end - }, - { - "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "tsserver", "html" } - }) - end - }, - { - "neovim/nvim-lspconfig", - config = function() - local lspconfig = require("lspconfig") - local capabilities = require("cmp_nvim_lsp").default_capabilities() + { + "williamboman/mason.nvim", + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "tsserver", "html" }, + }) + end, + }, + { + "neovim/nvim-lspconfig", + config = function() + local lspconfig = require("lspconfig") + local capabilities = require("cmp_nvim_lsp").default_capabilities() - lspconfig.lua_ls.setup({ - capabilities = capabilities - }) + lspconfig.lua_ls.setup({ + capabilities = capabilities, + }) - lspconfig.tsserver.setup({ - capabilities = capabilities, - }) + lspconfig.tsserver.setup({ + capabilities = capabilities, + }) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { desc = "Go to definition" }) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { desc = "Go to implementation" }) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, { desc = "Show signature" }) - vim.keymap.set('n', 'f', vim.lsp.buf.format, { desc = "Format buffer" }) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, { desc = "View code actions" }) - end - }, - { - "WhoIsSethDaniel/mason-tool-installer.nvim", - config = function() - local mason_tool_installer = require("mason-tool-installer") + vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" }) + vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show signature" }) + vim.keymap.set("n", "f", vim.lsp.buf.format, { desc = "Format buffer" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "View code actions" }) + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + config = function() + local mason_tool_installer = require("mason-tool-installer") - mason_tool_installer.setup({ - ensure_installed = { - "djlint", - "prettierd", - "eslint_d", - }, - automatic_installation = true - }) - end - }, - { - "stevearc/conform.nvim", - opts = { - formatters_by_ft = { - lua = { "stylua" }, - javascript = { "eslint_d" }, - javascriptreact = { "eslint_d" }, - json = { "prettierd" }, - jsonc = { "prettierd" }, - yaml = { "prettierd" }, - typescript = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - html = { "djlint" }, - ejs = { "prettierd" }, - css = { "prettierd" }, - scss = { "prettierd" }, - graphql = { "prettierd" }, - ["_"] = { "trim_whitespace" }, - }, - format_on_save = { - lsp_fallback = true, - }, - }, - } + mason_tool_installer.setup({ + ensure_installed = { + "djlint", + "prettierd", + "eslint_d", + }, + automatic_installation = true, + }) + end, + }, } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index b368357..9f40934 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,12 +1,12 @@ return { - 'nvim-lualine/lualine.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - config = function() - require('lualine').setup({ - options = { - icons_enabled = true, - theme = 'tokyonight' - } - }) - end + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("lualine").setup({ + options = { + icons_enabled = true, + theme = "tokyonight", + }, + }) + end, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index b632f9d..932d76f 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,26 +1,40 @@ return { - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - local config = require("nvim-treesitter.configs") - config.setup({ - ensure_installed = { "lua", "javascript", "typescript", "tsx", "htmldjango", "html", "jsonc", "json", "jsdoc", "markdown", "markdown_inline", "vim", "vimdoc" }, - sync_install = false, - highlight = { enable = true }, - indent = { enable = true } - }) - end - }, - { - "nvim-treesitter/nvim-treesitter-context", - opts = { - max_lines = 2, - } - }, - { - 'windwp/nvim-autopairs', - event = "InsertEnter", - opts = {} - } + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local config = require("nvim-treesitter.configs") + config.setup({ + ensure_installed = { + "lua", + "javascript", + "typescript", + "tsx", + "htmldjango", + "html", + "jsonc", + "json", + "jsdoc", + "markdown", + "markdown_inline", + "vim", + "vimdoc", + }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, + }, + { + "nvim-treesitter/nvim-treesitter-context", + opts = { + max_lines = 2, + }, + }, + { + "windwp/nvim-autopairs", + event = "InsertEnter", + opts = {}, + }, } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 9aa07d6..9d2083d 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,55 +1,55 @@ return { - { - "lukas-reineke/indent-blankline.nvim", - opts = { - indent = { - char = "│", - tab_char = "│", - }, - scope = { enabled = false }, - exclude = { - filetypes = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - }, - }, - }, - main = "ibl", - }, - { - "echasnovski/mini.indentscope", - opts = { - symbol = "│", - options = { try_as_border = true }, - }, - init = function() - vim.api.nvim_create_autocmd("FileType", { - pattern = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - }, - callback = function() - vim.b.miniindentscope_disable = true - end, - }) - end, - }, + { + "lukas-reineke/indent-blankline.nvim", + opts = { + indent = { + char = "│", + tab_char = "│", + }, + scope = { enabled = false }, + exclude = { + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + }, + }, + main = "ibl", + }, + { + "echasnovski/mini.indentscope", + opts = { + symbol = "│", + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + }, } -- 2.47.2 From d6cf3129ff3d690af854bf3508bc6a28f10feb3e Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Fri, 26 Apr 2024 23:15:31 -0600 Subject: [PATCH 06/20] feat: move all linting to `linting.lua` --- lua/plugins/{lint.lua => linting.lua} | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) rename lua/plugins/{lint.lua => linting.lua} (61%) diff --git a/lua/plugins/lint.lua b/lua/plugins/linting.lua similarity index 61% rename from lua/plugins/lint.lua rename to lua/plugins/linting.lua index 42fae39..97cbede 100644 --- a/lua/plugins/lint.lua +++ b/lua/plugins/linting.lua @@ -1,28 +1,22 @@ return { "mfussenegger/nvim-lint", - event = { - "BufReadPre", - "BufNewFile", - }, - config = function() - local lint = require("lint") - - local djlint = lint.linters.djlint - djlint.args = { - "--reformat", - } - - lint.linters_by_ft = { + opts = { + events = { "BufWritePost", "BufReadPost", "InsertLeave" }, + linters_by_ft = { html = { "djlint" }, javascript = { "eslint_d" }, typescript = { "eslint_d" }, javascriptreact = { "eslint_d" }, typescriptreact = { "eslint_d" }, - } + }, + }, + config = function(_, opts) + local lint = require("lint") + lint.linters_by_ft = opts.linters_by_ft local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) - vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + vim.api.nvim_create_autocmd(opts.events, { group = lint_augroup, callback = function() lint.try_lint() -- 2.47.2 From 5e93f497de72808557fd2f686063f295e47314c7 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Fri, 26 Apr 2024 23:55:34 -0600 Subject: [PATCH 07/20] feat: update treesitter.lua --- lazy-lock.json | 3 +- lua/plugins/treesitter.lua | 77 +++++++++++++++++++------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index e59bebb..15813f4 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -5,7 +5,6 @@ "conform.nvim": { "branch": "master", "commit": "4660e534bf7678ee0f85879aa75fdcb6855612c2" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, - "gitsigns.nvim": { "branch": "main", "commit": "035da036e68e509ed158414416c827d022d914bd" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, @@ -23,7 +22,7 @@ "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, "nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" }, "nvim-spectre": { "branch": "master", "commit": "026394a8458d62c6b7b305c076ce675420dbaa4c" }, - "nvim-treesitter": { "branch": "master", "commit": "3ef8d25df2d8eca6f15a6889cb2bc9d4c6101096" }, + "nvim-treesitter": { "branch": "master", "commit": "ab3b3ff01028fef83cfb79b651bf65afb76ee062" }, "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, "nvim-web-devicons": { "branch": "master", "commit": "beb6367ab8496c9e43f22e0252735fdadae1872d" }, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 932d76f..85cf8f5 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,40 +1,41 @@ return { - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - local config = require("nvim-treesitter.configs") - config.setup({ - ensure_installed = { - "lua", - "javascript", - "typescript", - "tsx", - "htmldjango", - "html", - "jsonc", - "json", - "jsdoc", - "markdown", - "markdown_inline", - "vim", - "vimdoc", - }, - sync_install = false, - highlight = { enable = true }, - indent = { enable = true }, - }) - end, - }, - { - "nvim-treesitter/nvim-treesitter-context", - opts = { - max_lines = 2, - }, - }, - { - "windwp/nvim-autopairs", - event = "InsertEnter", - opts = {}, - }, + { + "nvim-treesitter/nvim-treesitter", + version = false, + build = ":TSUpdate", + opts = { + ensure_installed = { + "lua", + "javascript", + "typescript", + "tsx", + "htmldjango", + "html", + "jsonc", + "json", + "jsdoc", + "markdown", + "markdown_inline", + "vim", + "vimdoc", + }, + highlight = { enable = true }, + indent = { enable = true }, + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + }, + { + "nvim-treesitter/nvim-treesitter-context", + opts = { + max_lines = 2, + }, + }, + { + -- TODO: Figure out why this plugin is not working. + "windwp/nvim-autopairs", + event = "VeryLazy", + opts = {}, + }, } -- 2.47.2 From 1c1f869b16ae257d499c179800f33821cb1bf56d Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Sat, 27 Apr 2024 18:09:47 -0700 Subject: [PATCH 08/20] feat: move all LSP config to `lsp.lua` --- lua/plugins/lsp-config.lua | 52 --------------------------------- lua/plugins/lsp.lua | 60 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 52 deletions(-) delete mode 100644 lua/plugins/lsp-config.lua create mode 100644 lua/plugins/lsp.lua diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua deleted file mode 100644 index a831f96..0000000 --- a/lua/plugins/lsp-config.lua +++ /dev/null @@ -1,52 +0,0 @@ -return { - { - "williamboman/mason.nvim", - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "tsserver", "html" }, - }) - end, - }, - { - "neovim/nvim-lspconfig", - config = function() - local lspconfig = require("lspconfig") - local capabilities = require("cmp_nvim_lsp").default_capabilities() - - lspconfig.lua_ls.setup({ - capabilities = capabilities, - }) - - lspconfig.tsserver.setup({ - capabilities = capabilities, - }) - - vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" }) - vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show signature" }) - vim.keymap.set("n", "f", vim.lsp.buf.format, { desc = "Format buffer" }) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "View code actions" }) - end, - }, - { - "WhoIsSethDaniel/mason-tool-installer.nvim", - config = function() - local mason_tool_installer = require("mason-tool-installer") - - mason_tool_installer.setup({ - ensure_installed = { - "djlint", - "prettierd", - "eslint_d", - }, - automatic_installation = true, - }) - end, - }, -} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..bad9c77 --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,60 @@ +return { + { + "williamboman/mason.nvim", + opts = {}, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = { + ensure_installed = { + "lua_ls", + "tsserver", + "html", + } + } + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + opts = { + ensure_installed = { + "djlint", + "eslint_d", + "prettierd", + "stylua", + }, + automatic_installation = true, + } + }, + -- lspconfig should be the last step. + { + "neovim/nvim-lspconfig", + event = "VeryLazy", + dependencies = { + "mason.nvim", + "williamboman/mason-lspconfig.nvim", + }, + opts = { + servers = { + tsserver = {}, + lua_ls = {} + } + }, + config = function(_, opts) + local lspconfig = require("lspconfig") + local capabilities = require("cmp_nvim_lsp").default_capabilities() + + local servers = opts.servers + + for server, server_opts in pairs(servers) do + local sopts = vim.tbl_deep_extend("force", server_opts, capabilities) + lspconfig[server].setup(sopts) + end + + vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" }) + vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show signature" }) + vim.keymap.set("n", "f", vim.lsp.buf.format, { desc = "Format buffer" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "View code actions" }) + end, + }, +} -- 2.47.2 From 8a81569687fc5716883053cda3d06b32ca110e18 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Sat, 27 Apr 2024 18:48:05 -0700 Subject: [PATCH 09/20] feat: move all UI plugins to `ui.lua` --- lazy-lock.json | 6 +- lua/options.lua | 2 + lua/plugins/alpha-nvim.lua | 43 -------- lua/plugins/lualine.lua | 12 --- lua/plugins/ui.lua | 207 +++++++++++++++++++++++++++---------- 5 files changed, 161 insertions(+), 109 deletions(-) delete mode 100644 lua/plugins/alpha-nvim.lua delete mode 100644 lua/plugins/lualine.lua diff --git a/lazy-lock.json b/lazy-lock.json index 15813f4..7743fef 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,8 +1,10 @@ { "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "conform.nvim": { "branch": "master", "commit": "4660e534bf7678ee0f85879aa75fdcb6855612c2" }, + "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, @@ -16,13 +18,15 @@ "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, "mini.surround": { "branch": "main", "commit": "a00d69be09e3fe27dfa9e5b0298410d0e148e3e2" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, + "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, "nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-spectre": { "branch": "master", "commit": "026394a8458d62c6b7b305c076ce675420dbaa4c" }, - "nvim-treesitter": { "branch": "master", "commit": "ab3b3ff01028fef83cfb79b651bf65afb76ee062" }, + "nvim-treesitter": { "branch": "master", "commit": "0883ff05655117a3fc79ab295a640c4984cfd415" }, "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, "nvim-web-devicons": { "branch": "master", "commit": "beb6367ab8496c9e43f22e0252735fdadae1872d" }, diff --git a/lua/options.lua b/lua/options.lua index 68e05f4..e08d218 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -42,3 +42,5 @@ vim.opt.fillchars = { vim.opt.foldlevel = 99 vim.opt.foldmethod = "indent" + +vim.opt.termguicolors = true diff --git a/lua/plugins/alpha-nvim.lua b/lua/plugins/alpha-nvim.lua deleted file mode 100644 index 3f407db..0000000 --- a/lua/plugins/alpha-nvim.lua +++ /dev/null @@ -1,43 +0,0 @@ -return { - "goolord/alpha-nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") - - -- https://github.com/MaximilianLloyd/ascii.nvim - dashboard.section.header.val = { - " ", - " ░░░ ▄▄▄▄▄▄███▄▄▄▄▄ ", - " ▄███████▀▀▀▀▀▀█▓▓▓▓▓▓██▄▄▄▄ ", - " ▐████▄▄ ■▓▓▓▓▀▀▀▀▀▀▀▀▀█████■ ██▄ ", - " ▀█████████▄▄▄▄▄███████████▀▀ ▄▄ ████░▄▄▄ ", - " ▐██▄ ▄▄▄▄▄▄▀▀▀▀▀▀▀▀▓▓▓▀░░░▄▄▄ ▄▄ ▐███▏▐██▓▄████ ", - " ▄█▓░███▓ ▄▓▓▓▄▄████████████▄█████▄ ▄█████████▐███ ████▏██▀████▀ ", - " ▐███▄███░▀████████▀▀ ▀▓█████▓▀██▓████▀▀ ███████ ▄█████ ■ ██▀ ", - " ▀████▓██ ▐██████ ▐████ ▐████▀ ▒████████▄ ▄███████ ", - " ▀███ ▀▀█████▄ ▄████ ▄████▏ ▄█████▀█████████▀ ███ ", - " ▀████▄ ▄████▐██▄███████▄▄▄███▓██▏ ▀██████▀ ▐██ ", - " ▀████████▀ ▀████▀▀████████▀▐██▏ ▀██▀▀ ▐██▏ ", - " ▓▓█ ▀████ ▀ ■███▄▄ ███ ██▏ ", - " ▀▀▀ ▀▀ ▀█████▄▓▀ ██▏ ", - " ░░ ▄████████████▄▄▄▄▄▄▄ ▀▀▀████▄▄ ▒▒▒ ██▏ ▄▄ ", - " ▀▀████▀▀▀▀▀▀████████████▄▄▓▓▓███▄ ░░░░ ▐█▏ ■▀▀ ", - " ▀▀▀▀▀▀█████▓▓▓▓█▄▄ ▐█ ", - " ▄█████████▄▄ ", - " ▄▄▄▄████████▀▀▀▀▀▀▀███▏ ", - " ▄▄█████▀▀▀▀ ▀■ ", - " ▄███▀▀▀▀ ", - " ■▀▀ ", - " ", - } - - dashboard.section.buttons.val = { - dashboard.button("e", " > New File", "ene"), - dashboard.button("SPC ee", " > File explorer", "Neotree"), - dashboard.button("q", " > Quit", "qa"), - } - - alpha.setup(dashboard.opts) - end, -} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua deleted file mode 100644 index 9f40934..0000000 --- a/lua/plugins/lualine.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("lualine").setup({ - options = { - icons_enabled = true, - theme = "tokyonight", - }, - }) - end, -} diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 9d2083d..cd7c73b 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,55 +1,156 @@ return { - { - "lukas-reineke/indent-blankline.nvim", - opts = { - indent = { - char = "│", - tab_char = "│", - }, - scope = { enabled = false }, - exclude = { - filetypes = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - }, - }, - }, - main = "ibl", - }, - { - "echasnovski/mini.indentscope", - opts = { - symbol = "│", - options = { try_as_border = true }, - }, - init = function() - vim.api.nvim_create_autocmd("FileType", { - pattern = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - }, - callback = function() - vim.b.miniindentscope_disable = true - end, - }) - end, - }, + { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = { + options = { + icons_enabled = true, + theme = "tokyonight", + disabled_filetypes = { + statusline = { + "alpha", + "neo-tree", + } + } + } + }, + }, + { + "akinsho/bufferline.nvim", + event = "VeryLazy", + keys = { + { "[b", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "]b", "BufferLineCycleNext", desc = "Next Buffer" }, + }, + opts = { + options = { + diagnostics = "nvim_lsp", + offsets = { + { + filetype = "neo-tree", + text = "Neo-tree", + highlight = "Directory", + text_align = "left", + }, + }, + } + } + }, + { + "lukas-reineke/indent-blankline.nvim", + opts = { + indent = { + char = "│", + tab_char = "│", + }, + scope = { enabled = false }, + exclude = { + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + }, + }, + main = "ibl", + }, + { + "echasnovski/mini.indentscope", + opts = { + symbol = "│", + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + }, + { + "stevearc/dressing.nvim", + event = "VeryLazy", + opts = {} + }, + { + "rcarriga/nvim-notify", + opts = {} + }, + { + "MunifTanjim/nui.nvim" + }, + { + "folke/noice.nvim", + event = "VeryLazy", + opts = {}, + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + } + }, + { + "goolord/alpha-nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") + + -- https://github.com/MaximilianLloyd/ascii.nvim + dashboard.section.header.val = { + " ", + " ░░░ ▄▄▄▄▄▄███▄▄▄▄▄ ", + " ▄███████▀▀▀▀▀▀█▓▓▓▓▓▓██▄▄▄▄ ", + " ▐████▄▄ ■▓▓▓▓▀▀▀▀▀▀▀▀▀█████■ ██▄ ", + " ▀█████████▄▄▄▄▄███████████▀▀ ▄▄ ████░▄▄▄ ", + " ▐██▄ ▄▄▄▄▄▄▀▀▀▀▀▀▀▀▓▓▓▀░░░▄▄▄ ▄▄ ▐███▏▐██▓▄████ ", + " ▄█▓░███▓ ▄▓▓▓▄▄████████████▄█████▄ ▄█████████▐███ ████▏██▀████▀ ", + " ▐███▄███░▀████████▀▀ ▀▓█████▓▀██▓████▀▀ ███████ ▄█████ ■ ██▀ ", + " ▀████▓██ ▐██████ ▐████ ▐████▀ ▒████████▄ ▄███████ ", + " ▀███ ▀▀█████▄ ▄████ ▄████▏ ▄█████▀█████████▀ ███ ", + " ▀████▄ ▄████▐██▄███████▄▄▄███▓██▏ ▀██████▀ ▐██ ", + " ▀████████▀ ▀████▀▀████████▀▐██▏ ▀██▀▀ ▐██▏ ", + " ▓▓█ ▀████ ▀ ■███▄▄ ███ ██▏ ", + " ▀▀▀ ▀▀ ▀█████▄▓▀ ██▏ ", + " ░░ ▄████████████▄▄▄▄▄▄▄ ▀▀▀████▄▄ ▒▒▒ ██▏ ▄▄ ", + " ▀▀████▀▀▀▀▀▀████████████▄▄▓▓▓███▄ ░░░░ ▐█▏ ■▀▀ ", + " ▀▀▀▀▀▀█████▓▓▓▓█▄▄ ▐█ ", + " ▄█████████▄▄ ", + " ▄▄▄▄████████▀▀▀▀▀▀▀███▏ ", + " ▄▄█████▀▀▀▀ ▀■ ", + " ▄███▀▀▀▀ ", + " ■▀▀ ", + " ", + } + + dashboard.section.buttons.val = { + dashboard.button("e", " > New File", "ene"), + dashboard.button("SPC ee", " > File explorer", "Neotree"), + dashboard.button("q", " > Quit", "qa"), + } + + alpha.setup(dashboard.opts) + end, + } } -- 2.47.2 From 4d8be78a08e653b1a777f8793b30fe30fda2fe91 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Sat, 27 Apr 2024 18:55:42 -0700 Subject: [PATCH 10/20] feat: add lazygit plugin --- lazy-lock.json | 2 +- lua/plugins/editor.lua | 278 +++++++++++++++++++++------------------ lua/plugins/fugitive.lua | 10 -- 3 files changed, 149 insertions(+), 141 deletions(-) delete mode 100644 lua/plugins/fugitive.lua diff --git a/lazy-lock.json b/lazy-lock.json index 7743fef..47d5792 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -9,6 +9,7 @@ "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, + "lazygit.nvim": { "branch": "main", "commit": "0ada6c6e7e138df92f5009b6952f4ac41248305a" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "b129892f783740e6cf741f2ea09fa5dd512aa584" }, @@ -36,6 +37,5 @@ "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" }, "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, - "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 99fb667..d52742a 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -1,135 +1,153 @@ return { - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - }, - config = function() - vim.keymap.set("n", "ee", ":Neotree toggle", { desc = "Toggle Neotree" }) - vim.keymap.set("n", "er", ":Neotree reveal", { desc = "Reveal file" }) + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + vim.keymap.set("n", "ee", ":Neotree toggle", { desc = "Toggle Neotree" }) + vim.keymap.set("n", "er", ":Neotree reveal", { desc = "Reveal file" }) - local nt = require("neo-tree") + local nt = require("neo-tree") - nt.setup({ - open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, - filesystem = { - filtered_items = { - show_hidden_count = false, - hide_dotfiles = false, - hide_gitignored = true, - always_show = { - ".env", - }, - never_show = { - ".git", - "thumbs.db", - ".DS_Store", - }, - }, - }, - window = { - mappings = { - ["m"] = { - "move", - config = { - show_path = "relative", - }, - }, - }, - }, - event_handlers = { - { - event = "neo_tree_popup_input_ready", - handler = function() - -- Switch to normal inside popups by default. - vim.cmd.stopinsert() - end, - }, - }, - }) - end, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - opts = {}, - }, - { - "folke/trouble.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - vim.keymap.set("n", "tt", ":TroubleToggle", { desc = "Toggle Trouble" }) - end, - }, - { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = {}, - }, - { - "nvim-pack/nvim-spectre", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { open_cmd = "noswapfile vnew" }, - keys = { - { - "sr", - function() - require("spectre").open() - end, - desc = "Replace in Files (Spectre)", - }, - }, - }, - { - "nvim-telescope/telescope.nvim", - tag = "0.1.5", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - local builtin = require("telescope.builtin") - - vim.keymap.set("n", "ff", builtin.git_files, { desc = "Search git_files" }) - vim.keymap.set("n", "fg", builtin.live_grep, { desc = "Grep git_files" }) - vim.keymap.set("n", "fh", builtin.help_tags, { desc = "View help tags" }) - vim.keymap.set("n", "fb", builtin.buffers, { desc = "Search buffers" }) - vim.keymap.set("n", "sR", builtin.resume, { desc = "Resume" }) - end, - }, - { - "nvim-telescope/telescope-ui-select.nvim", - config = function() - require("telescope").setup({ - defaults = { - initial_mode = "normal", - }, - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown({}), - }, - }, - }) - - require("telescope").load_extension("ui-select") - end, - }, - { - "folke/flash.nvim", - event = "VeryLazy", - ---@type Flash.Config - opts = {}, - -- stylua: ignore - keys = { - { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, - { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, - { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, - { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, - { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + nt.setup({ + open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, + filesystem = { + filtered_items = { + show_hidden_count = false, + hide_dotfiles = false, + hide_gitignored = true, + always_show = { + ".env", + }, + never_show = { + ".git", + "thumbs.db", + ".DS_Store", + }, + }, + }, + window = { + mappings = { + ["m"] = { + "move", + config = { + show_path = "relative", + }, + }, + }, + }, + event_handlers = { + { + event = "neo_tree_popup_input_ready", + handler = function() + -- Switch to normal inside popups by default. + vim.cmd.stopinsert() + end, + }, + }, + }) + end, }, - }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = {}, + }, + { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + vim.keymap.set("n", "tt", ":TroubleToggle", { desc = "Toggle Trouble" }) + end, + }, + { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, + }, + { + "nvim-pack/nvim-spectre", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { open_cmd = "noswapfile vnew" }, + keys = { + { + "sr", + function() + require("spectre").open() + end, + desc = "Replace in Files (Spectre)", + }, + }, + }, + { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local builtin = require("telescope.builtin") + + vim.keymap.set("n", "ff", builtin.git_files, { desc = "Search git_files" }) + vim.keymap.set("n", "fg", builtin.live_grep, { desc = "Grep git_files" }) + vim.keymap.set("n", "fh", builtin.help_tags, { desc = "View help tags" }) + vim.keymap.set("n", "fb", builtin.buffers, { desc = "Search buffers" }) + vim.keymap.set("n", "sR", builtin.resume, { desc = "Resume" }) + end, + }, + { + "nvim-telescope/telescope-ui-select.nvim", + config = function() + require("telescope").setup({ + defaults = { + initial_mode = "normal", + }, + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + }) + + require("telescope").load_extension("ui-select") + end, + }, + { + "folke/flash.nvim", + event = "VeryLazy", + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, + }, + { + "kdheepak/lazygit.nvim", + event = "VeryLazy", + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + }, + keys = { + { "gs", "LazyGit", desc = "LazyGit" } + } + } } diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua deleted file mode 100644 index 684d54b..0000000 --- a/lua/plugins/fugitive.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "tpope/vim-fugitive", - config = function() - vim.keymap.set("n", "gs", vim.cmd.Git, { desc = "View `git status`" }) - vim.keymap.set("n", "gh", "diffget //2", { desc = "Pick gitdiff on left" }) - vim.keymap.set("n", "gl", "diffget //3", { desc = "Pick gitdiff on right" }) - vim.keymap.set("n", "gp", ":Git push", { desc = "Run `git push`" }) - vim.keymap.set("n", "gc", ":Git checkout ", { desc = "Git checkout" }) - end, -} -- 2.47.2 From 7afc4aab7274525eb9abff5ddbb5ae2ce8136757 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Sat, 27 Apr 2024 19:05:16 -0700 Subject: [PATCH 11/20] fix: update keybind for lazygit --- lua/plugins/editor.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index d52742a..4af3788 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -147,7 +147,7 @@ return { "nvim-lua/plenary.nvim", }, keys = { - { "gs", "LazyGit", desc = "LazyGit" } + { "gg", "LazyGit", desc = "LazyGit" } } } } -- 2.47.2 From 8f87ddde79a11c06aba5b332c6714b88c3a24d48 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Mon, 29 Apr 2024 08:58:14 -0700 Subject: [PATCH 12/20] feat: add rename func; format files --- lua/autocmds.lua | 14 +-- lua/plugins/coding.lua | 180 ++++++++++++++++++------------------ lua/plugins/colorscheme.lua | 14 +-- lua/plugins/formatting.lua | 36 ++++---- lua/plugins/linting.lua | 44 ++++----- lua/plugins/lsp.lua | 1 + 6 files changed, 145 insertions(+), 144 deletions(-) diff --git a/lua/autocmds.lua b/lua/autocmds.lua index 39927ae..d0c2e37 100644 --- a/lua/autocmds.lua +++ b/lua/autocmds.lua @@ -1,14 +1,14 @@ local function augroup(name) - return vim.api.nvim_create_augroup("wf_" .. name, { clear = true }) + return vim.api.nvim_create_augroup("wf_" .. name, { clear = true }) end vim.api.nvim_create_autocmd({ "FileType" }, { - group = augroup("spellcheck"), - pattern = { "gitcommit", "markdown", "md", "mdx" }, - callback = function() - vim.opt_local.spell = true - vim.opt_local.wrap = true - end, + group = augroup("spellcheck"), + pattern = { "gitcommit", "markdown", "md", "mdx" }, + callback = function() + vim.opt_local.spell = true + vim.opt_local.wrap = true + end, }) -- vim.api.nvim_create_autocmd({ "FileType" }, { diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index 7a28339..a8a64e2 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -1,96 +1,96 @@ return { - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-nvim-lsp" }, - config = function() - local cmp = require("cmp") + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-nvim-lsp" }, + config = function() + local cmp = require("cmp") - cmp.setup({ - -- Highlights the first result always - completion = { - completeopt = "menu,menuone,noinsert", - }, + cmp.setup({ + -- Highlights the first result always + completion = { + completeopt = "menu,menuone,noinsert", + }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { "i" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { "i" }), - [""] = cmp.mapping.confirm({ - behaviour = cmp.ConfirmBehavior.Insert, - select = true, - }), - }), + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { "i" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { "i" }), + [""] = cmp.mapping.confirm({ + behaviour = cmp.ConfirmBehavior.Insert, + select = true, + }), + }), - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - }), - }) - end, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { "rafamadriz/friendly-snippets" }, - }, - { - "echasnovski/mini.pairs", - version = false, - opts = {}, - }, - { - "echasnovski/mini.surround", - version = false, - opts = { - mappings = { - add = "gsa", -- Add surrounding in Normal and Visual modes - delete = "gsd", -- Delete surrounding - find = "gsf", -- Find surrounding (to the right) - find_left = "gsF", -- Find surrounding (to the left) - highlight = "gsh", -- Highlight surrounding - replace = "gsr", -- Replace surrounding - update_n_lines = "gsn", -- Update `n_lines` - }, - }, - }, - { - "JoosepAlviste/nvim-ts-context-commentstring", - opts = { - enable_autocmd = false, - }, - }, - { - "echasnovski/mini.comment", - version = false, - opts = { - options = { - custom_commentstring = function() - return require("ts_context_commentstring.internal").calculate_commentstring() - or vim.bo.commentstring - end, - }, - }, - }, + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, + { + "L3MON4D3/LuaSnip", + dependencies = { "rafamadriz/friendly-snippets" }, + }, + { + "echasnovski/mini.pairs", + version = false, + opts = {}, + }, + { + "echasnovski/mini.surround", + version = false, + opts = { + mappings = { + add = "gsa", -- Add surrounding in Normal and Visual modes + delete = "gsd", -- Delete surrounding + find = "gsf", -- Find surrounding (to the right) + find_left = "gsF", -- Find surrounding (to the left) + highlight = "gsh", -- Highlight surrounding + replace = "gsr", -- Replace surrounding + update_n_lines = "gsn", -- Update `n_lines` + }, + }, + }, + { + "JoosepAlviste/nvim-ts-context-commentstring", + opts = { + enable_autocmd = false, + }, + }, + { + "echasnovski/mini.comment", + version = false, + opts = { + options = { + custom_commentstring = function() + return require("ts_context_commentstring.internal").calculate_commentstring() + or vim.bo.commentstring + end, + }, + }, + }, } diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 790f129..cde1558 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,9 +1,9 @@ return { - "folke/tokyonight.nvim", - lazy = true, - opts = { - style = "storm", - transparent = true, - dim_inactive = true, - }, + "folke/tokyonight.nvim", + lazy = true, + opts = { + style = "storm", + transparent = true, + dim_inactive = true, + }, } diff --git a/lua/plugins/formatting.lua b/lua/plugins/formatting.lua index 5820e06..d3ca74e 100644 --- a/lua/plugins/formatting.lua +++ b/lua/plugins/formatting.lua @@ -1,20 +1,20 @@ return { - "stevearc/conform.nvim", - opts = { - formatters_by_ft = { - css = { "prettierd" }, - scss = { "prettierd" }, - html = { "djlint" }, - lua = { "stylelua" }, - javascript = { "prettierd" }, - javascriptreact = { "prettierd" }, - json = { "prettierd" }, - jsonc = { "prettierd" }, - typescript = { "prettierd" }, - typescriptreact = { "prettierd" }, - }, - format_on_save = { - lsp_fallback = true, - }, - }, + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + css = { "prettierd" }, + scss = { "prettierd" }, + html = { "djlint" }, + lua = { "stylelua" }, + javascript = { "prettierd" }, + javascriptreact = { "prettierd" }, + json = { "prettierd" }, + jsonc = { "prettierd" }, + typescript = { "prettierd" }, + typescriptreact = { "prettierd" }, + }, + format_on_save = { + lsp_fallback = true, + }, + }, } diff --git a/lua/plugins/linting.lua b/lua/plugins/linting.lua index 97cbede..995389c 100644 --- a/lua/plugins/linting.lua +++ b/lua/plugins/linting.lua @@ -1,26 +1,26 @@ return { - "mfussenegger/nvim-lint", - opts = { - events = { "BufWritePost", "BufReadPost", "InsertLeave" }, - linters_by_ft = { - html = { "djlint" }, - javascript = { "eslint_d" }, - typescript = { "eslint_d" }, - javascriptreact = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - }, - }, - config = function(_, opts) - local lint = require("lint") - lint.linters_by_ft = opts.linters_by_ft + "mfussenegger/nvim-lint", + opts = { + events = { "BufWritePost", "BufReadPost", "InsertLeave" }, + linters_by_ft = { + html = { "djlint" }, + javascript = { "eslint_d" }, + typescript = { "eslint_d" }, + javascriptreact = { "eslint_d" }, + typescriptreact = { "eslint_d" }, + }, + }, + config = function(_, opts) + local lint = require("lint") + lint.linters_by_ft = opts.linters_by_ft - local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) + local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) - vim.api.nvim_create_autocmd(opts.events, { - group = lint_augroup, - callback = function() - lint.try_lint() - end, - }) - end, + vim.api.nvim_create_autocmd(opts.events, { + group = lint_augroup, + callback = function() + lint.try_lint() + end, + }) + end, } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index bad9c77..c680cb4 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -55,6 +55,7 @@ return { vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show signature" }) vim.keymap.set("n", "f", vim.lsp.buf.format, { desc = "Format buffer" }) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "View code actions" }) + vim.keymap.set("n", "cr", vim.lsp.buf.rename, { desc = "Rename" }) end, }, } -- 2.47.2 From 84ee840a9c95c176a7969aa01539c6d634e3ee98 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Mon, 29 Apr 2024 09:13:23 -0700 Subject: [PATCH 13/20] feat: add some buffer-related commands --- lua/autocmds.lua | 9 --------- lua/plugins/ui.lua | 11 +++++++++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lua/autocmds.lua b/lua/autocmds.lua index d0c2e37..1f6502d 100644 --- a/lua/autocmds.lua +++ b/lua/autocmds.lua @@ -10,12 +10,3 @@ vim.api.nvim_create_autocmd({ "FileType" }, { vim.opt_local.wrap = true end, }) - --- vim.api.nvim_create_autocmd({ "FileType" }, { --- group = augroup("close_with_q"), --- pattern = { "fugitive", "git", "gitcommit" }, --- callback = function(event) --- vim.bo[event.buf].buflisted = false --- vim.keymap.set("n", "q", "close", { buffer = event.buf, silent = true }) --- end, --- }) diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index cd7c73b..ce45753 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -15,12 +15,19 @@ return { } }, }, + { + "famiu/bufdelete.nvim", + keys = { + { "bd", "Bdelete", desc = "Close Buffer" }, + }, + }, { "akinsho/bufferline.nvim", event = "VeryLazy", keys = { - { "[b", "BufferLineCyclePrev", desc = "Prev Buffer" }, - { "]b", "BufferLineCycleNext", desc = "Next Buffer" }, + { "bp", "BufferLineTogglePin", desc = "Toggle Pin" }, + { "[b", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "]b", "BufferLineCycleNext", desc = "Next Buffer" }, }, opts = { options = { -- 2.47.2 From fd346109c45a7343c69adeb1f92812bbb362382e Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Mon, 29 Apr 2024 09:13:44 -0700 Subject: [PATCH 14/20] feat: update deps --- lazy-lock.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 47d5792..c9df74b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,12 +1,13 @@ { "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, "bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "conform.nvim": { "branch": "master", "commit": "4660e534bf7678ee0f85879aa75fdcb6855612c2" }, + "conform.nvim": { "branch": "master", "commit": "12b3995537f52ba2810a9857e8ca256881febbda" }, "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, - "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, + "friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "lazygit.nvim": { "branch": "main", "commit": "0ada6c6e7e138df92f5009b6952f4ac41248305a" }, @@ -24,13 +25,13 @@ "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, - "nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" }, + "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-spectre": { "branch": "master", "commit": "026394a8458d62c6b7b305c076ce675420dbaa4c" }, - "nvim-treesitter": { "branch": "master", "commit": "0883ff05655117a3fc79ab295a640c4984cfd415" }, + "nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" }, + "nvim-treesitter": { "branch": "master", "commit": "160e5d52c841dc9261c0b2dc6f253bddbcf3d766" }, "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, - "nvim-web-devicons": { "branch": "master", "commit": "beb6367ab8496c9e43f22e0252735fdadae1872d" }, + "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, -- 2.47.2 From 3f76f98d4799b3bddeda8f23505e99ae15d2d4ff Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Thu, 2 May 2024 11:27:13 -0700 Subject: [PATCH 15/20] feat: update js formatting --- lua/plugins/formatting.lua | 8 ++++---- lua/plugins/lsp.lua | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/plugins/formatting.lua b/lua/plugins/formatting.lua index d3ca74e..ef27e71 100644 --- a/lua/plugins/formatting.lua +++ b/lua/plugins/formatting.lua @@ -6,12 +6,12 @@ return { scss = { "prettierd" }, html = { "djlint" }, lua = { "stylelua" }, - javascript = { "prettierd" }, - javascriptreact = { "prettierd" }, + javascript = { "eslint_d", "prettierd" }, + javascriptreact = { "eslint_d", "prettierd" }, json = { "prettierd" }, jsonc = { "prettierd" }, - typescript = { "prettierd" }, - typescriptreact = { "prettierd" }, + typescript = { "eslint_d", "prettierd" }, + typescriptreact = { "eslint_d", "prettierd" }, }, format_on_save = { lsp_fallback = true, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index c680cb4..d94564a 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -18,6 +18,7 @@ return { opts = { ensure_installed = { "djlint", + "eslint", "eslint_d", "prettierd", "stylua", -- 2.47.2 From 54a77fb6401d6b9e80debe7153a0739127c56ea9 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Thu, 2 May 2024 20:50:21 -0700 Subject: [PATCH 16/20] feat: add more keybinds --- lua/keybinds.lua | 7 ++++--- lua/plugins/coding.lua | 12 ++++++------ lua/plugins/editor.lua | 2 ++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lua/keybinds.lua b/lua/keybinds.lua index c875b40..5f4a455 100644 --- a/lua/keybinds.lua +++ b/lua/keybinds.lua @@ -3,6 +3,10 @@ vim.keymap.set("n", "", "", { desc = "Go to split above" }) vim.keymap.set("n", "", "", { desc = "Go to split below" }) vim.keymap.set("n", "", "", { desc = "Go to split on right" }) +vim.keymap.set("n", "|", "v", { desc = "Split window right" }) +vim.keymap.set("n", "-", "s", { desc = "Split window below" }) +vim.keymap.set("n", "wd", "c", { desc = "Delete window" }) + vim.keymap.set("v", "J", ":m '>+1gv=gv", { desc = "Move lines under cursor up" }) vim.keymap.set("v", "K", ":m '<-2gv=gv", { desc = "Move lines under cursor down" }) @@ -14,7 +18,4 @@ vim.keymap.set("x", "p", "\"_dP", { desc = "Paste without replacing clip vim.keymap.set("n", "y", "\"*y", { desc = "Yank into system clipboard" }) vim.keymap.set("v", "y", "\"*y", { desc = "Yank into system clipboard" }) -vim.keymap.set("n", "s", [[:%s/\<\>//gI]], - { desc = "Like `ciw` for any highlighted text (doesn't have to be word)" }) - vim.keymap.set("i", "jk", "", { desc = "Exit insert mode" }) diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index a8a64e2..0e0ab2a 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -65,12 +65,12 @@ return { version = false, opts = { mappings = { - add = "gsa", -- Add surrounding in Normal and Visual modes - delete = "gsd", -- Delete surrounding - find = "gsf", -- Find surrounding (to the right) - find_left = "gsF", -- Find surrounding (to the left) - highlight = "gsh", -- Highlight surrounding - replace = "gsr", -- Replace surrounding + add = "gsa", -- Add surrounding in Normal and Visual modes + delete = "gsd", -- Delete surrounding + find = "gsf", -- Find surrounding (to the right) + find_left = "gsF", -- Find surrounding (to the left) + highlight = "gsh", -- Highlight surrounding + replace = "gsr", -- Replace surrounding update_n_lines = "gsn", -- Update `n_lines` }, }, diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 4af3788..13ee7e6 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -98,7 +98,9 @@ return { vim.keymap.set("n", "fg", builtin.live_grep, { desc = "Grep git_files" }) vim.keymap.set("n", "fh", builtin.help_tags, { desc = "View help tags" }) vim.keymap.set("n", "fb", builtin.buffers, { desc = "Search buffers" }) + vim.keymap.set("n", "sk", builtin.keymaps, { desc = "Resume" }) vim.keymap.set("n", "sR", builtin.resume, { desc = "Resume" }) + vim.keymap.set("n", "st", "TodoTelescope", { desc = "Search TODOs" }) end, }, { -- 2.47.2 From 97aa1d9a28891df4fe05fa07807ecdae6e089c5c Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Thu, 2 May 2024 22:07:59 -0700 Subject: [PATCH 17/20] fix: editor updates --- lazy-lock.json | 13 +++++++------ lua/plugins/coding.lua | 14 +++++++------- lua/plugins/editor.lua | 2 ++ lua/plugins/lsp.lua | 6 ++---- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index c9df74b..5b42fce 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,8 +1,9 @@ { - "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, + "LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, "bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "conform.nvim": { "branch": "master", "commit": "12b3995537f52ba2810a9857e8ca256881febbda" }, "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, @@ -17,19 +18,19 @@ "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" }, "mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" }, - "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, - "mini.surround": { "branch": "main", "commit": "a00d69be09e3fe27dfa9e5b0298410d0e148e3e2" }, + "mini.pairs": { "branch": "main", "commit": "5c975d8f68dc1e11bf4b20ced71e7987ed782513" }, + "mini.surround": { "branch": "main", "commit": "0f528eb2e1bab420c0569d9e52615144c51db920" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, - "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, + "nvim-lint": { "branch": "master", "commit": "861a04313501563bb1b11f125ae9b7237a517b9b" }, "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" }, - "nvim-treesitter": { "branch": "master", "commit": "160e5d52c841dc9261c0b2dc6f253bddbcf3d766" }, - "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, + "nvim-treesitter": { "branch": "master", "commit": "b1f3f02027f1fd21956c1e219878764014498a59" }, + "nvim-treesitter-context": { "branch": "master", "commit": "2650e6431f7daba5d9c2c64134fa5eb2312eb3d7" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index 0e0ab2a..5698b27 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -1,7 +1,10 @@ return { { "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-nvim-lsp" }, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + }, config = function() local cmp = require("cmp") @@ -30,16 +33,13 @@ return { fallback() end end, { "i" }), - [""] = cmp.mapping.confirm({ - behaviour = cmp.ConfirmBehavior.Insert, - select = true, - }), + [""] = cmp.mapping.confirm({ select = true }), }), snippet = { expand = function(args) - require("luasnip").lsp_expand(args.body) - end, + require('luasnip').lsp_expand(args.body) + end }, sources = cmp.config.sources({ diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 13ee7e6..e251f33 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -1,6 +1,7 @@ return { { "nvim-neo-tree/neo-tree.nvim", + event = "VeryLazy", branch = "v3.x", dependencies = { "nvim-lua/plenary.nvim", @@ -22,6 +23,7 @@ return { hide_gitignored = true, always_show = { ".env", + ".env.local", }, never_show = { ".git", diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index d94564a..860226c 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -37,18 +37,16 @@ return { opts = { servers = { tsserver = {}, - lua_ls = {} + lua_ls = {}, } }, config = function(_, opts) local lspconfig = require("lspconfig") - local capabilities = require("cmp_nvim_lsp").default_capabilities() local servers = opts.servers for server, server_opts in pairs(servers) do - local sopts = vim.tbl_deep_extend("force", server_opts, capabilities) - lspconfig[server].setup(sopts) + lspconfig[server].setup(server_opts) end vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) -- 2.47.2 From 21b4bf98cf13f653cdf44892108ad1bbcf4d9840 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Thu, 9 May 2024 12:43:59 -0700 Subject: [PATCH 18/20] fix: description text for sk --- lua/plugins/editor.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index e251f33..3d477b7 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -100,7 +100,7 @@ return { vim.keymap.set("n", "fg", builtin.live_grep, { desc = "Grep git_files" }) vim.keymap.set("n", "fh", builtin.help_tags, { desc = "View help tags" }) vim.keymap.set("n", "fb", builtin.buffers, { desc = "Search buffers" }) - vim.keymap.set("n", "sk", builtin.keymaps, { desc = "Resume" }) + vim.keymap.set("n", "sk", builtin.keymaps, { desc = "View keymaps" }) vim.keymap.set("n", "sR", builtin.resume, { desc = "Resume" }) vim.keymap.set("n", "st", "TodoTelescope", { desc = "Search TODOs" }) end, -- 2.47.2 From 2bc897ece0d54567c87a5e5bfcb0e204a30b9147 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Thu, 9 May 2024 13:03:17 -0700 Subject: [PATCH 19/20] feat: some small tweaks --- lua/plugins/coding.lua | 6 +++++- lua/plugins/ui.lua | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index 5698b27..5ec6181 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -58,7 +58,11 @@ return { { "echasnovski/mini.pairs", version = false, - opts = {}, + opts = { + mappings = { + ["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } }, + }, + }, }, { "echasnovski/mini.surround", diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index ce45753..467aeb7 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -103,7 +103,10 @@ return { }, { "rcarriga/nvim-notify", - opts = {} + opts = { + timeout = 2000, + stages = "static", + } }, { "MunifTanjim/nui.nvim" -- 2.47.2 From 5da9fe221032ebd0291d3a85097a0c29b2fd74de Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Thu, 9 May 2024 13:04:52 -0700 Subject: [PATCH 20/20] feat: add gitsigns --- lazy-lock.json | 1 + lua/plugins/editor.lua | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/lazy-lock.json b/lazy-lock.json index 5b42fce..83c8054 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -9,6 +9,7 @@ "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" }, + "gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "lazygit.nvim": { "branch": "main", "commit": "0ada6c6e7e138df92f5009b6952f4ac41248305a" }, diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 3d477b7..cb91684 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -153,5 +153,19 @@ return { keys = { { "gg", "LazyGit", desc = "LazyGit" } } + }, + { + "lewis6991/gitsigns.nvim", + event = "VeryLazy", + opts = { + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "" }, + topdelete = { text = "" }, + changedelete = { text = "▎" }, + untracked = { text = "▎" }, + }, + } } } -- 2.47.2