From f1892c5fb8b2a4e739c099a21f25009b5b01a191 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 2 Apr 2024 11:58:39 -0600 Subject: [PATCH] update nvim config --- .chezmoiignore | 1 + dot_config/nvim/lazy-lock.json | 60 ----------------------- dot_config/nvim/lua/community.lua | 28 +++++++++-- dot_config/nvim/lua/plugins/astrocore.lua | 32 +++++++----- dot_config/nvim/lua/plugins/astrolsp.lua | 14 +++--- 5 files changed, 53 insertions(+), 82 deletions(-) delete mode 100644 dot_config/nvim/lazy-lock.json diff --git a/.chezmoiignore b/.chezmoiignore index 2839eab..56b3bd1 100644 --- a/.chezmoiignore +++ b/.chezmoiignore @@ -5,4 +5,5 @@ README.md Dockerfile *.local *.local.* +*/lazy-lock.json diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json deleted file mode 100644 index c1bd480..0000000 --- a/dot_config/nvim/lazy-lock.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "AstroNvim": { "branch": "main", "commit": "7aa58a758eb6f662f5ca4fc1a94152e29e0bc758" }, - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, - "aerial.nvim": { "branch": "master", "commit": "3748e87a316a68754341cdffcef44fee61dee51c" }, - "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, - "astrocore": { "branch": "main", "commit": "29befa985b96809272c04a90608dd10c1cba221a" }, - "astrolsp": { "branch": "main", "commit": "21629f447c574965399329a8dd925d9eeac82752" }, - "astrotheme": { "branch": "main", "commit": "e056b8216214f7140eda3e0adcfc27efba705231" }, - "astroui": { "branch": "main", "commit": "5aa0f687e111a120a33746c89926604134f9ae74" }, - "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-dap": { "branch": "master", "commit": "ea92773e84c0ad3288c3bc5e452ac91559669087" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "dressing.nvim": { "branch": "master", "commit": "42d767b04c50a6966c9633e3968bc65c0c2f2bfc" }, - "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, - "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" }, - "guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" }, - "heirline.nvim": { "branch": "master", "commit": "03cff30d7e7d3ba6fdc00925f015822f79cef908" }, - "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, - "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "2ba17cecfde8b8c7c7c287909a1e4de895223df6" }, - "mason-null-ls.nvim": { "branch": "main", "commit": "e270134d83ba59425edc53356c6fd337b61bb8dd" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "3614a39aae98ccd34124b072939d6283853b3dd2" }, - "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, - "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" }, - "neo-tree.nvim": { "branch": "main", "commit": "16d1b194376bf1fc2acd89ccb3c29ba8315bfcea" }, - "neoconf.nvim": { "branch": "main", "commit": "f8947e998dac4213f6c7bb1c7b843cba64db22dd" }, - "neodev.nvim": { "branch": "main", "commit": "da1562e1e3df0e994ddc52cb4ba22376a5d7f2fc" }, - "none-ls.nvim": { "branch": "main", "commit": "e632688737b6b878e900ac69179a9aae734bb331" }, - "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, - "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, - "nvim-cmp": { "branch": "main", "commit": "2fb2a3cf78bbc1b0bea030e8c8728985af1cf302" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, - "nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" }, - "nvim-dap-ui": { "branch": "master", "commit": "f7d75cca202b52a60c520ec7b1ec3414d6e77b0f" }, - "nvim-lspconfig": { "branch": "master", "commit": "f4619ab31fc4676001ea05ae8200846e6e7700c7" }, - "nvim-nio": { "branch": "master", "commit": "33c62b3eadd8154169e42144de16ba4db6784bec" }, - "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-treesitter": { "branch": "master", "commit": "30492e7e1c9e5af3642e8a74c2f88dc1f50ec305" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" }, - "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, - "nvim-ufo": { "branch": "main", "commit": "95a148d9b3c02facce59c2050fd20fa6e8eb2cb6" }, - "nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" }, - "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, - "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, - "promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" }, - "resession.nvim": { "branch": "master", "commit": "dc8825439c619030925543a444c4186a2487c200" }, - "smart-splits.nvim": { "branch": "master", "commit": "f6fcb79527872e9330c554915af2ca511c388390" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, - "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, - "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, - "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, - "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, - "which-key.nvim": { "branch": "main", "commit": "ce741eb559c924d72e3a67d2189ad3771a231414" } -} \ No newline at end of file diff --git a/dot_config/nvim/lua/community.lua b/dot_config/nvim/lua/community.lua index e5d30a3..2476a84 100644 --- a/dot_config/nvim/lua/community.lua +++ b/dot_config/nvim/lua/community.lua @@ -10,18 +10,38 @@ return { { import = "astrocommunity.colorscheme.catppuccin" }, -- { import = "astrocommunity.editing-support.yanky-nvim" }, - { import = "astrocommunity.diagnostics.trouble-nvim"}, + { import = "astrocommunity.diagnostics.trouble-nvim" }, { import = "astrocommunity.editing-support.todo-comments-nvim" }, { import = "astrocommunity.editing-support.multicursors-nvim" }, - { import = "astrocommunity.lsp.lsp-signature-nvim" }, + -- { import = "astrocommunity.lsp.lsp-signature-nvim" }, { import = "astrocommunity.lsp.inc-rename-nvim" }, { import = "astrocommunity.markdown-and-latex.glow-nvim" }, -- { import = "astrocommunity.motion.flash-nvim" }, { import = "astrocommunity.scrolling.mini-animate" }, - { import = "astrocommunity.syntax.vim-sandwich" }, { import = "astrocommunity.test.neotest" }, + { import = "astrocommunity.utility.noice-nvim" }, -- { import = "astrocommunity.workflow.hardtime-nvim" }, - + { import = "astrocommunity.motion.nvim-surround" }, + { + "kylechui/nvim-surround", + opts = { + keymaps = { + normal = 'sa', + normal_cur = false, + normal_line = false, + normal_cur_line = false, + visual = 's', + visual_line = 'S', + delete = 'sd', + change = 'sr', + }, + aliases = { + ['i'] = ']', -- Index + ['r'] = ')', -- Round + ['b'] = '}', -- Brackets + }, + }, + }, { import = "astrocommunity.completion.copilot-lua" }, { -- further customize the options set by the community "zbirenbaum/copilot.lua", diff --git a/dot_config/nvim/lua/plugins/astrocore.lua b/dot_config/nvim/lua/plugins/astrocore.lua index 8d4dc19..3834335 100644 --- a/dot_config/nvim/lua/plugins/astrocore.lua +++ b/dot_config/nvim/lua/plugins/astrocore.lua @@ -11,11 +11,11 @@ return { -- Configure core features of AstroNvim features = { large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter - autopairs = true, -- enable autopairs at start - cmp = true, -- enable completion at start - diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on) - highlighturl = true, -- highlight URLs at start - notifications = true, -- enable notifications at start + autopairs = true, -- enable autopairs at start + cmp = true, -- enable completion at start + diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on) + highlighturl = true, -- highlight URLs at start + notifications = true, -- enable notifications at start }, -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on diagnostics = { @@ -24,14 +24,14 @@ return { }, -- vim options can be configured here options = { - opt = { -- vim.opt. + opt = { -- vim.opt. relativenumber = true, -- sets vim.opt.relativenumber - number = true, -- sets vim.opt.number - spell = false, -- sets vim.opt.spell - signcolumn = "auto", -- sets vim.opt.signcolumn to auto - wrap = false, -- sets vim.opt.wrap + number = true, -- sets vim.opt.number + spell = false, -- sets vim.opt.spell + signcolumn = "auto", -- sets vim.opt.signcolumn to auto + wrap = false, -- sets vim.opt.wrap }, - g = { -- vim.g. + g = { -- vim.g. -- configure global vim variables (vim.g) -- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup` -- This can be found in the `lua/lazy_setup.lua` file @@ -53,7 +53,17 @@ return { -- function() require("astrocore.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end, -- desc = "Previous buffer", -- }, + [""] = { "", desc = "Scroll half down" }, + [""] = { "", desc = "Scroll half up" }, + ["sw"] = { "saiw", desc = "Surround word", remap = true }, + ["sW"] = { "saiW", desc = "Surround Word", remap = true }, + [""] = { + function() + require("notify").dismiss({ silent = true, pending = true }) + end, + desc = "Dismiss notifications", + }, -- mappings seen under group name "Buffer" ["bn"] = { "tabnew", desc = "New tab" }, ["bD"] = { diff --git a/dot_config/nvim/lua/plugins/astrolsp.lua b/dot_config/nvim/lua/plugins/astrolsp.lua index 7619b3e..07b7e51 100644 --- a/dot_config/nvim/lua/plugins/astrolsp.lua +++ b/dot_config/nvim/lua/plugins/astrolsp.lua @@ -10,16 +10,16 @@ return { opts = { -- Configuration table of features provided by AstroLSP features = { - autoformat = true, -- enable or disable auto formatting on start - codelens = true, -- enable/disable codelens refresh on start - inlay_hints = false, -- enable/disable inlay hints on start + autoformat = true, -- enable or disable auto formatting on start + codelens = true, -- enable/disable codelens refresh on start + inlay_hints = false, -- enable/disable inlay hints on start semantic_tokens = true, -- enable/disable semantic token highlighting }, -- customize lsp formatting options formatting = { -- control auto formatting on save format_on_save = { - enabled = true, -- enable or disable format on save globally + enabled = true, -- enable or disable format on save globally allow_filetypes = { -- enable format on save for specified filetypes only -- "go", }, @@ -46,15 +46,15 @@ return { config = { -- clangd = { capabilities = { offsetEncoding = "utf-8" } }, zls = { - cmd = {"zls"}; - filetypes = {"zig"}; + cmd = { "zls" }, + filetypes = { "zig" }, }, clangd = { cmd = { "clangd", "--offset-encoding=utf-16", }, - filetypes = {"c", "cpp", "objc", "objcpp"}, + filetypes = { "c", "cpp", "objc", "objcpp" }, }, }, -- customize how language servers are attached