From bf081cbf48aa99ad171565b359c1f245af53c4e0 Mon Sep 17 00:00:00 2001 From: Ivan D Vasin Date: Thu, 4 Apr 2024 19:34:35 -0400 Subject: [PATCH] chore: migrate from astronvim-v3 config Origin: https://github.com/nisavid/astronvim-v3-config --- after/ftplugin/json5.lua | 2 + after/ftplugin/man.lua | 6 ++ ginit.vim | 1 + lazy-lock.json | 156 +++++++++++++++++++++++++++ lua/community.lua | 215 +++++++++++++++++++++++++++++++++++-- lua/ginit.lua | 38 +++++++ lua/lazy_setup.lua | 17 ++- lua/plugins/astrocore.lua | 188 ++++++++++++++++++++++---------- lua/plugins/astrolsp.lua | 162 +++++++++++++--------------- lua/plugins/astronvim.lua | 92 ++++++++++++++++ lua/plugins/astroui.lua | 35 ++---- lua/plugins/mason.lua | 45 ++++---- lua/plugins/misc.lua | 194 +++++++++++++++++++++++++++++++++ lua/plugins/none-ls.lua | 36 ++++--- lua/plugins/treesitter.lua | 60 ++++++++++- lua/plugins/user.lua | 85 --------------- lua/polish.lua | 27 ++--- neovim.yml | 2 + 18 files changed, 1030 insertions(+), 331 deletions(-) create mode 100644 after/ftplugin/json5.lua create mode 100644 after/ftplugin/man.lua create mode 100644 ginit.vim create mode 100644 lazy-lock.json create mode 100644 lua/ginit.lua create mode 100644 lua/plugins/astronvim.lua create mode 100644 lua/plugins/misc.lua delete mode 100644 lua/plugins/user.lua diff --git a/after/ftplugin/json5.lua b/after/ftplugin/json5.lua new file mode 100644 index 0000000..3d8cfe2 --- /dev/null +++ b/after/ftplugin/json5.lua @@ -0,0 +1,2 @@ +vim.opt.comments = "sO:* -,mO:* ,exO:*/,s1:/*,mb:*,ex:*/,://" +vim.opt.commentstring = "//%s" diff --git a/after/ftplugin/man.lua b/after/ftplugin/man.lua new file mode 100644 index 0000000..b037227 --- /dev/null +++ b/after/ftplugin/man.lua @@ -0,0 +1,6 @@ +vim.keymap.set( + "n", + "gO", + vim.tbl_filter(function(map) return map.lhs == "gO" end, vim.api.nvim_buf_get_keymap(0, "n"))[1].rhs .. "L", + { buffer = true, desc = "View outline" } +) diff --git a/ginit.vim b/ginit.vim new file mode 100644 index 0000000..5347377 --- /dev/null +++ b/ginit.vim @@ -0,0 +1 @@ +lua require("ginit") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..446d943 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,156 @@ +{ + "AstroNvim": { "branch": "main", "commit": "f98079ee98ef1f62a2da6517fdc1d52eef52576f" }, + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, + "SchemaStore.nvim": { "branch": "main", "commit": "32e3a9654693f513a2cbb76ba99cbc9947b1352d" }, + "accelerated-jk.nvim": { "branch": "main", "commit": "8fb5dad4ccc1811766cebf16b544038aeeb7806f" }, + "aerial.nvim": { "branch": "master", "commit": "3748e87a316a68754341cdffcef44fee61dee51c" }, + "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "ansible-vim": { "branch": "master", "commit": "afc739e505053a6143a1fc6cedac6fb4d7a1d4db" }, + "arshlib.nvim": { "branch": "master", "commit": "e76e35c927098d07445c72e9416cce243f6aae59" }, + "astrocommunity": { "branch": "main", "commit": "875ebcbaa62a3427006fa869ecc7874bef8f53e2" }, + "astrocore": { "branch": "main", "commit": "7a77e6d53218937a70362f68ce561590b4d46bd1" }, + "astrolsp": { "branch": "main", "commit": "21629f447c574965399329a8dd925d9eeac82752" }, + "astrotheme": { "branch": "main", "commit": "e056b8216214f7140eda3e0adcfc27efba705231" }, + "astroui": { "branch": "main", "commit": "8bf267c3f325cb930cb900711187eeec26bb2d7b" }, + "blame.nvim": { "branch": "main", "commit": "7cb17b953bf1a5a11e36505497f1a74a609627d3" }, + "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, + "catppuccin": { "branch": "main", "commit": "aebe43db9cb26e1c70fc5b2fd4158169c405e720" }, + "chezmoi.nvim": { "branch": "main", "commit": "7c7746adced0e4ba5b1be4dd766a786ffddc65c1" }, + "clangd_extensions.nvim": { "branch": "main", "commit": "2992ba8c13c2de41f91a7c7488bf1c48bcec31fe" }, + "cmake-tools.nvim": { "branch": "master", "commit": "a4cd0b3a2c8a166a54b36bc00579954426748959" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-dap": { "branch": "master", "commit": "ea92773e84c0ad3288c3bc5e452ac91559669087" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-tailwind-colors": { "branch": "main", "commit": "8ad13923316e2b5ca00420c171268fc23f32c01d" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" }, + "compiler.nvim": { "branch": "main", "commit": "a0fc34e3aa6c8109863441fc674cf04de6241bd0" }, + "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, + "crates.nvim": { "branch": "main", "commit": "3cee6e68f7a84873454fcfd52556bf817db0c5df" }, + "csv.vim": { "branch": "master", "commit": "962f88787ec6873eba1c7dbbd81d2723f1ee3c4b" }, + "deno-nvim": { "branch": "master", "commit": "4bc9b5db13e8152b01aed51ce0451cdd38ca6743" }, + "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, + "dooku.nvim": { "branch": "main", "commit": "ab70b3fe1b189af2468edc4870e59ec61a8f86a6" }, + "dressing.nvim": { "branch": "master", "commit": "42d767b04c50a6966c9633e3968bc65c0c2f2bfc" }, + "firenvim": { "branch": "master", "commit": "3363c140dca2ef0b89e2be0317917f077d752cd7" }, + "flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" }, + "flit.nvim": { "branch": "main", "commit": "04f744bbb2b91fb2ad2c702b5eb8e23d17924fa6" }, + "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, + "garbage-day.nvim": { "branch": "main", "commit": "3af496f0d1dc6586dcf4ceda6bbf61a8f820ab66" }, + "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" }, + "glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" }, + "go.nvim": { "branch": "master", "commit": "ae58327c9e894f6663bf43496063c167170b4ac3" }, + "grapple.nvim": { "branch": "main", "commit": "34b8f4728294058e9fdad116fd21f72feb66ab73" }, + "guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" }, + "guihua.lua": { "branch": "master", "commit": "3b3126ae87c254f6849e708549ba76c39e3f42f8" }, + "haskell-snippets.nvim": { "branch": "master", "commit": "89a4f683b83a656e6ccb4ad0db97ad8863037f5d" }, + "haskell-tools.nvim": { "branch": "master", "commit": "217cb7958ebbebf360f7c43efd5129e66d748042" }, + "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, + "heirline.nvim": { "branch": "master", "commit": "03cff30d7e7d3ba6fdc00925f015822f79cef908" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "indent-tools.nvim": { "branch": "master", "commit": "31b839d65aa04b568fabe5e100a63cc44ef3f5d5" }, + "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, + "leap.nvim": { "branch": "main", "commit": "7a9407d17fab3a1c3cfe201965d680a408776152" }, + "legendary.nvim": { "branch": "master", "commit": "3a47364508503f0f44e26433cd0c0e4876f2136e" }, + "lsp_lines.nvim": { "branch": "main", "commit": "6f3defec73f7c87939e800e9afa5d0571b19b401" }, + "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" }, + "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "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" }, + "mini.surround": { "branch": "main", "commit": "49e0364b8c9a3258b485c5ece40bb0f3a5e94b1c" }, + "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, + "neo-tree.nvim": { "branch": "main", "commit": "16d1b194376bf1fc2acd89ccb3c29ba8315bfcea" }, + "neoconf.nvim": { "branch": "main", "commit": "f8947e998dac4213f6c7bb1c7b843cba64db22dd" }, + "neodev.nvim": { "branch": "main", "commit": "da1562e1e3df0e994ddc52cb4ba22376a5d7f2fc" }, + "neogen": { "branch": "main", "commit": "0daffcec249bf42275e322361fe55b89a05ff278" }, + "neogit": { "branch": "master", "commit": "c0b1d4dfc8ba6371857868ca7c4d33954cf002fd" }, + "neoscroll.nvim": { "branch": "master", "commit": "21d52973bde32db998fc8b6590f87eb3c3c6d8e4" }, + "neotest": { "branch": "master", "commit": "e07fe8241112274aae9947b98d255763738a1d52" }, + "neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" }, + "neotest-haskell": { "branch": "master", "commit": "a4e73415548d2de91912d9f015cced49e82af4c0" }, + "neotest-python": { "branch": "master", "commit": "2e83d2bc00acbcc1fd529dbf0a0e677cabfe6b50" }, + "nlsp-settings.nvim": { "branch": "main", "commit": "def1b1a1911d62df7adba03dab4ad947be744699" }, + "none-ls.nvim": { "branch": "main", "commit": "0d42ba8d506242b2252d2d2885a7f6f4f5b2bcb2" }, + "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, + "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, + "nvim-biscuits": { "branch": "main", "commit": "0224be36b60588e88b21b8244a0bcd069699720e" }, + "nvim-bqf": { "branch": "main", "commit": "52703d7adc3be3f7c09eea9a80c5b8caa615fb25" }, + "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-coverage": { "branch": "main", "commit": "aa4b4400588e2259e87e372b1e4e90ae13cf5a39" }, + "nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" }, + "nvim-dap-go": { "branch": "main", "commit": "36abe1d320cb61bfdf094d4e0fe815ef58f2302a" }, + "nvim-dap-python": { "branch": "master", "commit": "66560f0ebddf96604f7037e1efad3ba6942761e6" }, + "nvim-dap-repl-highlights": { "branch": "master", "commit": "902d533b2682c26d6be4f8a4d1dfd895cbba4840" }, + "nvim-dap-ruby": { "branch": "main", "commit": "a2248b7b31f6f096b9e847e769afd00060e0aae4" }, + "nvim-dap-ui": { "branch": "master", "commit": "f7d75cca202b52a60c520ec7b1ec3414d6e77b0f" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "baa5b0dc6663284cce32e0d00ac1f2511b13496f" }, + "nvim-devdocs": { "branch": "master", "commit": "1653f093042d892a32ee0a56feb0ae2f97c2ddaf" }, + "nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" }, + "nvim-lsp-file-operations": { "branch": "master", "commit": "223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" }, + "nvim-lspconfig": { "branch": "master", "commit": "96e5711040df23583591391ce49e556b8cd248d8" }, + "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, + "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, + "nvim-spider": { "branch": "main", "commit": "828444de406bc7df3b30c8e000ce6f54f0754499" }, + "nvim-treesitter": { "branch": "master", "commit": "1b050206e490a4146cdf25c7b38969c1711b5620" }, + "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "60e8c288e011403f248b5f6478dde12bed8a6c55" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "f5183cea0fda26126e22e789382c208e7b1120f4" }, + "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, + "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, + "nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" }, + "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, + "octo.nvim": { "branch": "master", "commit": "a511b52fbf040f928a24deb72e17ec465613b442" }, + "openingh.nvim": { "branch": "main", "commit": "613c18967d42202f3e2a9ac788caf62a402e7c1a" }, + "overseer.nvim": { "branch": "master", "commit": "b04b0b105c07b4f02b3073ea3a98d6eca90bf152" }, + "package-info.nvim": { "branch": "master", "commit": "45acce5b12ce824332d8000cc2c91805b6710446" }, + "persistent-breakpoints.nvim": { "branch": "main", "commit": "01e43512ef8d137f2b9e5c1c74fd35c37e787b59" }, + "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, + "portal.nvim": { "branch": "main", "commit": "77d9d53fec945bfa407d5fd7120f1b4f117450ed" }, + "projectmgr.nvim": { "branch": "main", "commit": "2d29b21b5afefa7a1690854c56db9b43195d9a10" }, + "promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" }, + "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, + "resession.nvim": { "branch": "master", "commit": "dc8825439c619030925543a444c4186a2487c200" }, + "rustaceanvim": { "branch": "master", "commit": "e2dbf91daed26d4dd7263affbecbf9a36e0096e5" }, + "sad.nvim": { "branch": "master", "commit": "869c7f3ca3dcd28fd78023db6a7e1bf8af0f4714" }, + "smart-splits.nvim": { "branch": "master", "commit": "f6fcb79527872e9330c554915af2ca511c388390" }, + "smartcolumn.nvim": { "branch": "main", "commit": "cefb17be095ad5526030a21bb2a80553cae09127" }, + "sqlite.lua": { "branch": "master", "commit": "40701b6151f8883980c1548647116de39b763540" }, + "ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" }, + "statuscol.nvim": { "branch": "main", "commit": "d954893262a57a92e46edd87de67e2b3fe72305e" }, + "stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" }, + "suda.vim": { "branch": "master", "commit": "66727b416837836712975e748bc8a19fb6cf4ec3" }, + "telescope-all-recent.nvim": { "branch": "main", "commit": "b47ef2069e91f128d19c24ca231b204a553edfcf" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "5ee5002373655fd684a4ad0d47a3de876ceacf9a" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "telescope-heading.nvim": { "branch": "main", "commit": "23ce2c9ef252aecbaa37300c1209b5ef2b51e6c5" }, + "telescope-lazy.nvim": { "branch": "main", "commit": "08eb9d05455cabc126e9b850470205d4f3ac7caf" }, + "telescope-undo.nvim": { "branch": "main", "commit": "d19e2edc8b18d03283bd91f67310ac300ad003ce" }, + "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "telescope_hoogle": { "branch": "master", "commit": "5c2ae51bcf905a7101134a597e6f7be2dc05f975" }, + "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, + "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, + "treesj": { "branch": "main", "commit": "60e27280030f9cd8dfb6ceb335922c6ff76682cc" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "tsc.nvim": { "branch": "main", "commit": "02856f0c67741a7c060df8f24a7f2806e1935f46" }, + "typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" }, + "venv-selector.nvim": { "branch": "main", "commit": "3c57922256e7e26205a25f5a42ecf7104d9f2c78" }, + "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, + "vim-matchup": { "branch": "master", "commit": "2d660e4aa7c566014c667af2cda0458043527902" }, + "vim-ps1": { "branch": "master", "commit": "839cec1550e09fc902c74103053e9e765051083d" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "web-tools.nvim": { "branch": "master", "commit": "a831f4347153e7ec40cd85f88ff04a41c5b223dd" }, + "which-key.nvim": { "branch": "main", "commit": "ce741eb559c924d72e3a67d2189ad3771a231414" }, + "yanky.nvim": { "branch": "main", "commit": "7c5cbf0122ff2dfbb6a92f14885894f65949cc8b" }, + "zi-vim-syntax": { "branch": "main", "commit": "489f4f4e9972ea0ad6deac4c226c74842bb10e40" } +} \ No newline at end of file diff --git a/lua/community.lua b/lua/community.lua index c842899..0356b9e 100644 --- a/lua/community.lua +++ b/lua/community.lua @@ -1,12 +1,215 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - --- AstroCommunity: import any community modules here --- We import this file in `lazy_setup.lua` before the `plugins/` folder. --- This guarantees that the specs are processed before any user plugins. +-- AstroCommunity plugins configuration ---@type LazySpec return { "AstroNvim/astrocommunity", + { import = "astrocommunity.bars-and-lines.bufferline-nvim" }, + -- Neovim >= 0.10 + --{ import = "astrocommunity.bars-and-lines.dropbar-nvim" }, + --{ + -- "Bekaboo/dropbar.nvim", + -- opts = { + -- general = { + -- enable = function(buf, win) + -- -- Disable for confini. For some reason, dropbar uses only Neovim's built-in tree-sitter integration + -- -- (not nvim-treesitter), which fails to map filetype confini to tree-sitter language ini. This causes + -- -- a flood of errors when editing confini files. + -- return not vim.api.nvim_win_get_config(win).zindex + -- and vim.bo[buf].buftype == "" + -- and vim.api.nvim_buf_get_name(buf) ~= "" + -- and not vim.wo[win].diff + -- and vim.o.filetype ~= "confini" + -- end, + -- }, + -- }, + --}, + { import = "astrocommunity.bars-and-lines.smartcolumn-nvim" }, + { import = "astrocommunity.bars-and-lines.statuscol-nvim" }, + { import = "astrocommunity.code-runner.compiler-nvim" }, + { import = "astrocommunity.code-runner.overseer-nvim" }, + { import = "astrocommunity.color.headlines-nvim" }, + { import = "astrocommunity.colorscheme.catppuccin" }, + { import = "astrocommunity.completion.cmp-cmdline" }, + { import = "astrocommunity.completion.copilot-lua-cmp" }, + { import = "astrocommunity.debugging.nvim-bqf" }, + { import = "astrocommunity.debugging.nvim-dap-repl-highlights" }, + { import = "astrocommunity.debugging.nvim-dap-virtual-text" }, + { import = "astrocommunity.debugging.persistent-breakpoints-nvim" }, + { import = "astrocommunity.diagnostics.lsp_lines-nvim" }, + { import = "astrocommunity.diagnostics.trouble-nvim" }, + { + "folke/trouble.nvim", + opts = { + mode = "document_diagnostics", + auto_open = true, + auto_close = true, + }, + }, + { import = "astrocommunity.editing-support.comment-box-nvim" }, + { import = "astrocommunity.editing-support.neogen" }, + { import = "astrocommunity.editing-support.nvim-devdocs" }, + { import = "astrocommunity.editing-support.nvim-treesitter-endwise" }, + { import = "astrocommunity.editing-support.refactoring-nvim" }, + { import = "astrocommunity.editing-support.suda-vim" }, + { import = "astrocommunity.editing-support.stickybuf-nvim" }, + { import = "astrocommunity.editing-support.treesj" }, + --{ import = "astrocommunity.editing-support.telescope-undo-nvim" }, + --{ "debugloop/telescope-undo.nvim" }, + { + "nvim-telescope/telescope.nvim", + dependencies = { "debugloop/telescope-undo.nvim" }, + keys = { + { + "fu", + function() require("telescope").extensions.undo.undo() end, + desc = "Find undos", + }, + }, + opts = function(opts) + local telescope_undo = require "telescope-undo.actions" + return require("astrocore").extend_tbl(opts, { + extensions = { + undo = { + mappings = { + i = { + [""] = telescope_undo.yank_additions, + [""] = telescope_undo.yank_deletions, + [""] = telescope_undo.restore, + }, + }, + }, + }, + }) + end, + config = function(_, opts) + require("telescope").setup(opts) + require("telescope").load_extension "undo" + end, + }, + -- TODO: After is resolved + --{ import = "astrocommunity.editing-support.yanky-nvim" }, + --{ + -- "gbprod/yanky.nvim", + -- opts = { ring = { history_length = 100 } }, + --}, + --{ + -- "nvim-telescope/telescope.nvim", + -- keys = { + -- { "fy", function() require("telescope").extensions.yank_history.yank_history() end, desc = "Find yanks" }, + -- }, + -- opts = { extensions = { yank_history = { dynamic_preview_title = true } } }, + --}, + { + "gbprod/yanky.nvim", + dependencies = { + { "kkharji/sqlite.lua", enabled = not jit.os:find "Windows" }, + { + "AstroNvim/astrocore", + opts = { + mappings = { + n = { + ["fy"] = { "Telescope yank_history", desc = "Open Yank History" }, + ["y"] = { "(YankyYank)", desc = "Yank text" }, + ["p"] = { "(YankyPutAfter)", desc = "Put yanked text after cursor" }, + ["P"] = { "(YankyPutBefore)", desc = "Put yanked text before cursor" }, + ["gp"] = { "(YankyGPutAfter)", desc = "Put yanked text after selection" }, + ["gP"] = { "(YankyGPutBefore)", desc = "Put yanked text before selection" }, + ["[y"] = { "(YankyCycleForward)", desc = "Cycle forward through yank history" }, + ["]y"] = { "(YankyCycleBackward)", desc = "Cycle backward through yank history" }, + ["]p"] = { "(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" }, + ["[p"] = { "(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" }, + ["]P"] = { "(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" }, + ["[P"] = { "(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" }, + [">p"] = { "(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" }, + ["(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" }, + [">P"] = { "(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" }, + ["(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" }, + ["=p"] = { "(YankyPutAfterFilter)", desc = "Put after applying a filter" }, + ["=P"] = { "(YankyPutBeforeFilter)", desc = "Put before applying a filter" }, + }, + x = { + ["y"] = { "(YankyYank)", desc = "Yank text" }, + ["p"] = { "(YankyPutAfter)", desc = "Put yanked text after cursor" }, + ["P"] = { "(YankyPutBefore)", desc = "Put yanked text before cursor" }, + ["gp"] = { "(YankyGPutAfter)", desc = "Put yanked text after selection" }, + ["gP"] = { "(YankyGPutBefore)", desc = "Put yanked text before selection" }, + }, + }, + }, + }, + }, + opts = function() + local mapping = require "yanky.telescope.mapping" + local mappings = mapping.get_defaults() + mappings.i[""] = nil + return { + highlight = { timer = 200 }, + ring = { storage = jit.os:find "Windows" and "shada" or "sqlite" }, + picker = { + telescope = { + use_default_mappings = false, + mappings = mappings, + }, + }, + } + end, + }, + { import = "astrocommunity.git.blame-nvim" }, + { import = "astrocommunity.git.diffview-nvim" }, + { import = "astrocommunity.git.neogit" }, + { import = "astrocommunity.git.octo-nvim" }, + { import = "astrocommunity.git.openingh-nvim" }, + { import = "astrocommunity.indent.indent-tools-nvim" }, + { import = "astrocommunity.lsp.garbage-day-nvim" }, + --{ import = "astrocommunity.lsp.inc-rename-nvim" }, + { import = "astrocommunity.lsp.lsp-signature-nvim" }, + { import = "astrocommunity.lsp.nvim-lsp-file-operations" }, + { import = "astrocommunity.markdown-and-latex.glow-nvim" }, + { import = "astrocommunity.markdown-and-latex.markdown-preview-nvim" }, + { import = "astrocommunity.motion.flit-nvim" }, + { import = "astrocommunity.motion.grapple-nvim" }, + { import = "astrocommunity.motion.leap-nvim" }, + { import = "astrocommunity.motion.mini-surround" }, + { import = "astrocommunity.motion.nvim-spider" }, + { import = "astrocommunity.motion.portal-nvim" }, + { import = "astrocommunity.motion.vim-matchup" }, + { import = "astrocommunity.pack.angular" }, + { import = "astrocommunity.pack.ansible" }, + { import = "astrocommunity.pack.bash" }, + { import = "astrocommunity.pack.cmake" }, + { import = "astrocommunity.pack.cpp" }, + { import = "astrocommunity.pack.docker" }, + { import = "astrocommunity.pack.elm" }, + --{ import = "astrocommunity.pack.haskell" }, + { import = "astrocommunity.pack.html-css" }, + { import = "astrocommunity.pack.go" }, + { import = "astrocommunity.pack.json" }, { import = "astrocommunity.pack.lua" }, - -- import/override with your plugins folder + { import = "astrocommunity.pack.markdown" }, + { import = "astrocommunity.pack.ps1" }, + { import = "astrocommunity.pack.python" }, + { import = "astrocommunity.pack.ruby" }, + { import = "astrocommunity.pack.rust" }, + { import = "astrocommunity.pack.svelte" }, + { import = "astrocommunity.pack.tailwindcss" }, + { import = "astrocommunity.pack.terraform" }, + { import = "astrocommunity.pack.toml" }, + { import = "astrocommunity.pack.typescript-all-in-one" }, + { import = "astrocommunity.pack.yaml" }, + { import = "astrocommunity.programming-language-support.csv-vim" }, + { import = "astrocommunity.programming-language-support.dooku-nvim" }, + { import = "astrocommunity.programming-language-support.web-tools-nvim" }, + { import = "astrocommunity.project.nvim-spectre" }, + { import = "astrocommunity.project.projectmgr-nvim" }, + { import = "astrocommunity.search.sad-nvim" }, + --{ import = "astrocommunity.scrolling.mini-animate" }, + { import = "astrocommunity.scrolling.neoscroll-nvim" }, + { "karb94/neoscroll.nvim", enabled = vim.fn.exists "g:goneovim" == 0 }, + -- Neovim < 0.10 + { import = "astrocommunity.scrolling.nvim-scrollbar" }, + -- Neovim >= 0.10 + --{ import = "astrocommunity.scrolling.satellite-nvim" }, + { import = "astrocommunity.terminal-integration.flatten-nvim" }, + { import = "astrocommunity.test.neotest" }, + { import = "astrocommunity.test.nvim-coverage" }, } diff --git a/lua/ginit.lua b/lua/ginit.lua new file mode 100644 index 0000000..c0bfbcb --- /dev/null +++ b/lua/ginit.lua @@ -0,0 +1,38 @@ +-- GUI configuration + +--vim.g.GuiName = vim.tbl_map( +-- function(chan) return vim.api.nvim_get_chan_info(chan).client.name end, +-- vim.tbl_map(function(ui) return ui.chan end, vim.tbl_filter(function(ui) return ui.rgb end, vim.api.nvim_list_uis())) +--)[1] + +vim.opt.guifont = "OperatorMonoSSmLig NF Light:h10:w26" + +vim.keymap.set({ "n", "x" }, "", '"+gP') +vim.keymap.set("i", "", "+") +vim.keymap.set("x", "", '"+ygv') + +if vim.fn.GuiName() == "nvim-qt" then + if vim.fn.exists "g:GuiLoaded" == 1 then + vim.cmd.GuiTabline(1) + vim.cmd.GuiPopupmenu(1) + vim.cmd.GuiScrollBar(1) + + vim.cmd.GuiRenderLigatures(1) + + -- FIXME: expected valid type, got Float + --vim.cmd.GuiWindowOpacity(0.85) + vim.cmd "GuiWindowOpacity 0.85" + + if vim.fn.exists "g:GuiClipboard" == 1 then vim.fn.GuiClipboard() end + + vim.keymap.set({ "n", "x" }, "", vim.fn.GuiShowContextMenu, { silent = true }) + vim.keymap.set("i", "", function() + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "i", false) + vim.fn.GuiShowContextMenu() + end, { silent = true }) + vim.keymap.set("s", "", function() + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "i", false) + vim.fn.GuiShowContextMenu() + end, { silent = true }) + end +end diff --git a/lua/lazy_setup.lua b/lua/lazy_setup.lua index cca2306..4c5b28d 100644 --- a/lua/lazy_setup.lua +++ b/lua/lazy_setup.lua @@ -1,24 +1,23 @@ require("lazy").setup({ { "AstroNvim/AstroNvim", - version = "^4", -- Remove version tracking to elect for nighly AstroNvim + version = "^4", import = "astronvim.plugins", - opts = { -- AstroNvim options must be set here with the `import` key - mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up - maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up - icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available) - pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override + opts = { + mapleader = " ", + maplocalleader = ",", + icons_enabled = true, + -- Pin plugins when tracking `version` of AstroNvim + pin_plugins = nil, }, }, { import = "community" }, { import = "plugins" }, } --[[@as LazySpec]], { - -- Configure any other `lazy.nvim` configuration options here - install = { colorscheme = { "astrodark", "habamax" } }, + install = { colorscheme = {} }, ui = { backdrop = 100 }, performance = { rtp = { - -- disable some rtp plugins, add more to your liking disabled_plugins = { "gzip", "netrwPlugin", diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index de17c22..2f2a0bb 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -1,79 +1,157 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - --- AstroCore provides a central place to modify mappings, vim options, autocommands, and more! --- Configuration documentation can be found with `:h astrocore` --- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) --- as this provides autocomplete and documentation while editing +-- AstroCore configuration ---@type LazySpec return { "AstroNvim/astrocore", ---@type AstroCoreOpts + -- @see `:h astrocore` opts = { - -- 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 + -- Global limits for large files for disabling features like treesitter + large_buf = { size = 1024 * 500, lines = 10000 }, + autopairs = true, + cmp = true, + -- Diagnostic mode on start + -- 0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on + diagnostics_mode = 3, + highlighturl = true, + notifications = true, }, - -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on - diagnostics = { - virtual_text = true, + diagnostics = { -- vim.diagnostics.config({...})) underline = true, }, - -- vim options can be configured here options = { 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 + updatetime = 100, + + title = true, + + splitbelow = true, + splitright = true, + diffopt = vim.opt.diffopt + "vertical", + + relativenumber = true, + + cursorcolumn = true, + cursorline = true, + + wrap = true, + linebreak = true, + breakindent = true, + + list = true, + listchars = { + tab = "󰌒", + trail = "·", + nbsp = "␣", + extends = "…", + precedes = "…", + }, }, - 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 + g = { + firenvim_config = { + globalSettings = { alt = "all" }, + localSettings = { + [".*"] = { + cmdline = "neovim", + content = "text", + priority = 0, + selector = 'textarea:not([readonly], [aria-readonly]), div[role="textbox"]', + takeover = "never", + }, + }, + }, }, }, - -- Mappings can be configured through AstroCore as well. - -- NOTE: keycodes follow the casing in the vimdocs. For example, `` must be capitalized mappings = { - -- first key is the mode + c = { + [""] = "", + [""] = "", + [""] = "", + [""] = "", + }, + i = {}, + l = {}, n = { - -- second key is the lefthand side of the map - - -- navigate buffer tabs with `H` and `L` - -- L = { - -- function() require("astrocore.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end, - -- desc = "Next buffer", - -- }, - -- H = { - -- function() require("astrocore.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end, - -- desc = "Previous buffer", - -- }, + [""] = { + function() require("astrocore.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end, + desc = "Previous buffer", + }, + [""] = { + function() require("astrocore.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end, + desc = "Next buffer", + }, - -- mappings seen under group name "Buffer" - ["bD"] = { - function() - require("astroui.status.heirline").buffer_picker( - function(bufnr) require("astrocore.buffer").close(bufnr) end - ) + ["r"] = { name = "Refactor" }, + ["r/"] = { name = "Replace all" }, + ["r/e"] = { ":%s/\\m\\k\\@=expand('')\\m\\k\\@!/", desc = "C expression" }, + ["r/f"] = { ":%s/\\m\\f\\@=expand('')\\m\\f\\@!/", desc = "path name" }, + ["r/w"] = { ":%s/\\m\\k\\@=expand('')\\m\\k\\@!/", desc = "word" }, + ["r/W"] = { ":%s/\\m\\k\\@=expand('')\\m\\k\\@!/", desc = "WORD" }, + }, + o = { + ["a="] = { name = "assignment" }, + ["i="] = { name = "assignment" }, + }, + s = {}, + t = {}, + v = {}, + x = { + ["r"] = { name = "Refactor" }, + ["r/"] = { name = "Replace all" }, + ["r//"] = { '"sy:%s/\\Vs/', desc = "Replace all" }, + ["r/w"] = { '"sy:%s/\\m\\k\\@s\\m\\k\\@!/', desc = "Replace all (keyword match)" }, + }, + }, + autocmds = { + -- Disable `alpha_autostart` due to incompatibility + -- with `restore_session` (below) + alpha_autostart = false, + -- Workaround for https://github.com/folke/trouble.nvim/issues/253 + close_trouble_before_quit = { + desc = "Close Trouble window before quitting", + event = "QuitPre", + callback = function() + if require("lazy.core.config").plugins["trouble.nvim"]._.loaded then vim.cmd.TroubleClose() end + end, + }, + cursorlines_only_in_curr_win = { + { + desc = "Enable cursorcolumn/cursorline in current window", + event = "WinEnter", + callback = function() + vim.opt_local.cursorcolumn = true + vim.opt_local.cursorline = true + end, + }, + { + desc = "Disable cursorcolumn/cursorline in non-current window", + event = "WinLeave", + callback = function() + vim.opt_local.cursorcolumn = false + vim.opt_local.cursorline = false + end, + }, + }, + restore_session = { + { + desc = "Restore previous directory session if Neovim is started with no arguments", + event = "VimEnter", + callback = function() + if vim.fn.argc(-1) == 0 then + require("resession").load(vim.fn.getcwd(), { dir = "dirsession", silence_errors = true }) + vim.tbl_map(vim.cmd.doautoall, { "BufReadPre", "BufReadPost" }) + end end, - desc = "Pick to close", }, - -- tables with just a `desc` key will be registered with which-key if it's installed - -- this is useful for naming menus - ["b"] = { desc = "Buffers" }, - -- quick save - -- [""] = { ":w!", desc = "Save File" }, -- change description but the same command }, - t = { - -- setting a mapping to false will disable it - -- [""] = false, + update_breakindent = { + { + desc = "Update breakindent to match effective shiftwidth", + event = "OptionSet", + pattern = { "shiftwidth", "tabstop" }, + callback = function() vim.opt_local.breakindentopt = { shift = vim.fn.shiftwidth() } end, + }, }, }, }, diff --git a/lua/plugins/astrolsp.lua b/lua/plugins/astrolsp.lua index 3d5f7ff..01d80f0 100644 --- a/lua/plugins/astrolsp.lua +++ b/lua/plugins/astrolsp.lua @@ -1,108 +1,92 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - --- AstroLSP allows you to customize the features in AstroNvim's LSP configuration engine --- Configuration documentation can be found with `:h astrolsp` --- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) --- as this provides autocomplete and documentation while editing +-- AstroLSP configuration ---@type LazySpec return { "AstroNvim/astrolsp", ---@type AstroLSPOpts + -- @see `:h astrolsp` 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 - semantic_tokens = true, -- enable/disable semantic token highlighting + autoformat = true, + codelens = true, + inlay_hints = true, + semantic_tokens = true, }, - -- customize lsp formatting options formatting = { - -- control auto formatting on save format_on_save = { - enabled = true, -- enable or disable format on save globally - allow_filetypes = { -- enable format on save for specified filetypes only - -- "go", - }, - ignore_filetypes = { -- disable format on save for specified filetypes - -- "python", - }, - }, - disabled = { -- disable formatting capabilities for the listed language servers - -- disable lua_ls formatting capability if you want to use StyLua to format your lua code - -- "lua_ls", + enabled = true, + allow_filetypes = {}, + ignore_filetypes = {}, }, - timeout_ms = 1000, -- default format timeout - -- filter = function(client) -- fully override the default formatting function - -- return true - -- end + disabled = {}, + timeout_ms = 5000, }, - -- enable servers that you already have installed without mason - servers = { - -- "pyright" - }, - -- customize language server configuration options passed to `lspconfig` + -- Servers installed without mason + servers = {}, ---@diagnostic disable: missing-fields config = { - -- clangd = { capabilities = { offsetEncoding = "utf-8" } }, - }, - -- customize how language servers are attached - handlers = { - -- a function without a key is simply the default handler, functions take two parameters, the server name and the configured options table for that server - -- function(server, opts) require("lspconfig")[server].setup(opts) end - - -- the key is the server that is being setup with `lspconfig` - -- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server - -- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed - }, - -- Configure buffer local auto commands to add when attaching a language server - autocmds = { - -- first key is the `augroup` to add the auto commands to (:h augroup) - lsp_document_highlight = { - -- Optional condition to create/delete auto command group - -- can either be a string of a client capability or a function of `fun(client, bufnr): boolean` - -- condition will be resolved for each client on each execution and if it ever fails for all clients, - -- the auto commands will be deleted for that buffer - cond = "textDocument/documentHighlight", - -- cond = function(client, bufnr) return client.name == "lua_ls" end, - -- list of auto commands to set - { - -- events to trigger - event = { "CursorHold", "CursorHoldI" }, - -- the rest of the autocmd options (:h nvim_create_autocmd) - desc = "Document Highlighting", - callback = function() vim.lsp.buf.document_highlight() end, - }, - { - event = { "CursorMoved", "CursorMovedI", "BufLeave" }, - desc = "Document Highlighting Clear", - callback = function() vim.lsp.buf.clear_references() end, - }, + bashls = { + init_options = { bashIde = { shellcheckPath = "" } }, + on_attach = function(client, bufnr) + for other_client in vim.iter(vim.lsp.get_clients { bufnr = bufnr }) do + if other_client.name == "pkgbuild_language_server" then + vim.lsp.buf_detach_client(bufnr, client.id) + break + end + end + end, }, - }, - -- mappings to be set up on attaching of a language server - mappings = { - n = { - gl = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }, - -- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean - -- gD = { - -- function() vim.lsp.buf.declaration() end, - -- desc = "Declaration of current symbol", - -- cond = "textDocument/declaration", - -- }, - -- ["uY"] = { - -- function() require("astrolsp.toggles").buffer_semantic_tokens() end, - -- desc = "Toggle LSP semantic highlight (buffer)", - -- cond = function(client) return client.server_capabilities.semanticTokensProvider and vim.lsp.semantic_tokens end, - -- }, + cssls = { + capabilities = (function() + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.completion.completionItem.snippetSupport = true + return capabilities + end)(), + }, + pkgbuild_language_server = { + filetypes = { "bash" }, + root_dir = require("lspconfig.util").root_pattern "PKGBUILD", + on_attach = function(_, bufnr) + for other_client in vim.iter(vim.lsp.get_clients { bufnr = bufnr }) do + if other_client.name == "bashls" then vim.lsp.buf_detach_client(bufnr, other_client.id) end + end + end, + }, + taplo = { + -- Add `.*.toml` to root patterns in order to work around + root_dir = require("lspconfig.util").root_pattern("*.toml", ".*.toml", ".git"), + }, + tsserver = { + settings = { + javascript = { + inlayHints = { + includeInlayEnumMemberValueHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayVariableTypeHints = true, + }, + }, + typescript = { + inlayHints = { + includeInlayEnumMemberValueHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayVariableTypeHints = true, + }, + }, + }, }, }, - -- A custom `on_attach` function to be run after the default `on_attach` function - -- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`) - on_attach = function(client, bufnr) - -- this would disable semanticTokensProvider for all clients - -- client.server_capabilities.semanticTokensProvider = nil - end, + handlers = {}, + autocmds = {}, + mappings = {}, + --on_attach = function(client, bufnr) + --end, }, } diff --git a/lua/plugins/astronvim.lua b/lua/plugins/astronvim.lua new file mode 100644 index 0000000..8cf0023 --- /dev/null +++ b/lua/plugins/astronvim.lua @@ -0,0 +1,92 @@ +-- AstroNvim bundled plugins configuration + +return { + { "max397574/better-escape.nvim", enabled = false }, + { "numToStr/Comment.nvim", opts = { padding = false } }, + { + "stevearc/dressing.nvim", + opts = { + select = { + get_config = function(opts) + if opts.kind == "legendary.nvim" then + return { + telescope = { + sorter = require("telescope.sorters").fuzzy_with_index_bias {}, + }, + } + else + return {} + end + end, + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = { + auto_install = vim.fn.executable "tree-sitter" ~= 0, + textobjects = { + select = { + keymaps = { + ["a/"] = { query = "@comment.outer", desc = "around comment" }, + ["i/"] = { query = "@comment.inner", desc = "inside comment" }, + ["ah"] = { query = "@statement.outer", desc = "around statement" }, + ["al"] = { query = "@class.outer", desc = "around class" }, + ["il"] = { query = "@class.inner", desc = "inside class" }, + ["a%"] = { query = "@loop.outer", desc = "around loop" }, + ["i%"] = { query = "@loop.inner", desc = "inside loop" }, + ["a_"] = { query = "@return.outer", desc = "around return" }, + ["i_"] = { query = "@return.inner", desc = "inside return" }, + ["a=e"] = { query = "@assignment.outer", desc = "around assignment" }, + ["i=e"] = { query = "@assignment.inner", desc = "inside assignment" }, + ["a=<"] = { query = "@assignment.lhs", desc = "left side of assignment" }, + ["i=<"] = { query = "@assignment.lhs", desc = "left side of assignment" }, + ["a=>"] = { query = "@assignment.rhs", desc = "right side of assignment" }, + ["i=>"] = { query = "@assignment.rhs", desc = "right side of assignment" }, + ["ar"] = { query = "@attribute.outer", desc = "around attribute" }, + ["ir"] = { query = "@attribute.inner", desc = "inside attribute" }, + ["a&"] = { query = "@call.outer", desc = "around call" }, + ["i&"] = { query = "@call.inner", desc = "inside call" }, + ["a*"] = { query = "@regex.outer", desc = "around regex" }, + ["i*"] = { query = "@regex.inner", desc = "inside regex" }, + ["i#"] = { query = "@number.inner", desc = "number" }, + }, + }, + move = { + goto_next_start = { + ["]h"] = { query = "@statement.outer", desc = "Next statement start" }, + ["]l"] = { query = "@class.outer", desc = "Next class start" }, + ["]r"] = { query = "@attribute.outer", desc = "Next attribute start" }, + }, + goto_next_end = { + ["]H"] = { query = "@statement.outer", desc = "Next statement end" }, + ["]L"] = { query = "@class.outer", desc = "Next class end" }, + ["]R"] = { query = "@attribute.outer", desc = "Next attribute end" }, + }, + goto_previous_start = { + ["[h"] = { query = "@statement.outer", desc = "Previous statement start" }, + ["[l"] = { query = "@class.outer", desc = "Previous class start" }, + ["[r"] = { query = "@attribute.outer", desc = "Previous attribute start" }, + }, + goto_previous_end = { + ["[H"] = { query = "@statement.outer", desc = "Previous statement end" }, + ["[L"] = { query = "@class.outer", desc = "Previous class end" }, + ["[R"] = { query = "@attribute.outer", desc = "Previous attribute end" }, + }, + }, + swap = { + swap_next = { + [">H"] = { query = "@statement.outer", desc = "Swap next statement" }, + [">L"] = { query = "@class.outer", desc = "Swap next class" }, + [">R"] = { query = "@attribute.outer", desc = "Swap next attribute" }, + }, + swap_previous = { + ["(accelerated_jk_gj)", desc = "Move down" }, + ["k"] = { "(accelerated_jk_gk)", desc = "Move up" }, + }, + } + end, + }, + { + "xvzc/chezmoi.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "User AstroFile", + opts = { + suggestion = { + auto_trigger = true, + debounce = 150, + keymap = { + accept = "", + accept_word = "", + accept_line = "", + }, + }, + }, + }, + { + "glacambre/firenvim", + lazy = not vim.g.started_by_firenvim, + module = false, + build = function() vim.fn["firenvim#install"](0) end, + }, + { + "ellisonleao/glow.nvim", + cmd = { "Glow" }, + keys = { { "", ":Glow", desc = "Render markdown (floating)" } }, + opts = function(_, opts) + opts.width = vim.o.columns + opts.height = vim.o.lines + opts.width_ratio = 0.62 + opts.height_ratio = 0.76 + local style = os.getenv "GLAMOUR_STYLE" + if style and vim.uv.fs_access(style, "R") then opts.style = style end + return opts + end, + }, + { + "mrjones2014/legendary.nvim", + dependencies = { "kkharji/sqlite.lua", enabled = not jit.os:find "Windows" }, + priority = 10000, + lazy = false, + keys = { + { + "", + mode = { "n", "v", "x", "s", "o", "i", "l", "c", "t" }, + function() + ---@diagnostic disable: missing-fields + require("legendary").find { + filters = { require("legendary.filters").current_mode() }, + formatter = function(item, mode) + local values = require("legendary.ui.format").default_format(item) + if require("legendary.toolbox").is_keymap(item) then values[1] = mode end + return values + end, + } + end, + desc = "Legend for current mode", + }, + { "fL", vim.cmd.Legendary, desc = "Legend" }, + }, + opts = function() + local opts = { + sort = { frecency = { db_root = vim.fn.stdpath "state" .. "/legendary/" } }, + extensions = { + lazy_nvim = { auto_register = true }, + which_key = { auto_register = true }, + }, + } + local is_available = require("astrocore").is_available + if is_available "diffview.nvim" then opts.extensions.diffview = true end + if is_available "nvim-tree.lua" then opts.extensions.nvim_tree = true end + if is_available "op.nvim" then opts.extensions.op_nvim = true end + if is_available "smart-splits.nvim" then opts.extensions.smart_splits = true end + return opts + end, + }, + --{ + -- "ray-x/lsp_signature.nvim", + -- init = function() + -- vim.api.nvim_create_autocmd("LspAttach", { + -- group = vim.api.nvim_create_augroup("LspAttach_inlayhints", {}), + -- callback = function(args) + -- if not (args.data and args.data.client_id) then return end + -- local client = vim.lsp.get_client_by_id(args.data.client_id) + -- if not client.server_capabilities.inlayHintProvider then + -- local lsp_signature = require "lsp_signature" + -- lsp_signature.on_attach({ + -- hint_enable = false, + -- select_signature_key = "", + -- }, args.buf) + -- end + -- end, + -- }) + -- end, + --}, + { + "iamcco/markdown-preview.nvim", + cmd = { + "MarkdownPreview", + "MarkdownPreviewStop", + "MarkdownPreviewToggle", + }, + keys = { { "", "MarkdownPreviewToggle", desc = "Render markdown (web browser)" } }, + }, + { + "jghauser/mkdir.nvim", + event = "BufEnter", + }, + { + "tamago324/nlsp-settings.nvim", + dependencies = { "neovim/nvim-lspconfig", "rcarriga/nvim-notify" }, + cmd = "LspSettings", + event = "BufEnter", + opts = { + append_default_schemas = true, + nvim_notify = { enable = true }, + }, + }, + { + "code-biscuits/nvim-biscuits", + event = "BufEnter", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + build = function() vim.cmd.TSUpdate() end, + }, + { + "kosayoda/nvim-lightbulb", + opts = { autocmd = { enabled = true } }, + }, + { + "nvim-treesitter/nvim-treesitter-context", + event = "BufEnter", + }, + { + "cshuaimin/ssr.nvim", + keys = { { "rs", mode = { "n", "x" }, desc = "Structural search & replace" } }, + config = function() + require("astrocore").set_mappings { + n = { ["rs"] = { function() require("ssr").open() end, desc = "Structural search & replace" } }, + x = { ["rs"] = { function() require("ssr").open() end, desc = "Structural search & replace" } }, + } + end, + }, + { + "prochri/telescope-all-recent.nvim", + dependencies = { "nvim-telescope/telescope.nvim", "kkharji/sqlite.lua" }, + opts = { + database = { path = vim.fn.stdpath "state" }, + }, + }, + { "nvim-telescope/telescope-file-browser.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, + { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-telescope/telescope-file-browser.nvim" }, + keys = { + { "ff", function() require("telescope").extensions.file_browser.file_browser() end, desc = "Find files" }, + }, + }, + { "crispgm/telescope-heading.nvim", dependencies = { "nvim-treesitter/nvim-treesitter" } }, + { + "nvim-telescope/telescope.nvim", + dependencies = { "crispgm/telescope-heading.nvim" }, + keys = { + { "fH", function() require("telescope").extensions.heading.heading() end, desc = "Find headings" }, + }, + opts = { extensions = { heading = { treesitter = true } } }, + }, + { "tsakirist/telescope-lazy.nvim", dependencies = { "nvim-telescope/telescope-file-browser.nvim" } }, + { + "nvim-telescope/telescope.nvim", + dependencies = { "tsakirist/telescope-lazy.nvim" }, + keys = { { "fp", function() require("telescope").extensions.lazy.lazy() end, desc = "Find packages" } }, + }, + { "z-shell/zi-vim-syntax", ft = { "zsh" } }, +} diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index 382368d..432c176 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -1,22 +1,28 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - --- Customize None-ls sources +-- None-ls sources configuration ---@type LazySpec return { "nvimtools/none-ls.nvim", - opts = function(_, config) - -- config variable is the default configuration table for the setup function call - -- local null_ls = require "null-ls" - - -- Check supported formatters and linters - -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting - -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics - config.sources = { - -- Set a formatter - -- null_ls.builtins.formatting.stylua, - -- null_ls.builtins.formatting.prettier, + opts = function(_, opts) + local null_ls = require "null-ls" + opts.sources = { + null_ls.builtins.diagnostics.checkmake, + null_ls.builtins.diagnostics.dotenv_linter, + null_ls.builtins.diagnostics.fish, + null_ls.builtins.diagnostics.qmllint, + null_ls.builtins.diagnostics.rpmspec, + null_ls.builtins.diagnostics.rstcheck, + null_ls.builtins.diagnostics.tfsec, + null_ls.builtins.diagnostics.zsh, + --null_ls.builtins.formatting.cabal_fmt, + null_ls.builtins.formatting.fish_indent, + null_ls.builtins.formatting.nginx_beautifier, + null_ls.builtins.formatting.pg_format, + null_ls.builtins.formatting.qmlformat, + null_ls.builtins.formatting.shellharden, + null_ls.builtins.formatting.shfmt, + --null_ls.builtins.formatting.xmllint, } - return config -- return final config table + return opts end, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 0e8d2f7..d2b51f3 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,16 +1,66 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - --- Customize Treesitter +-- Tree-sitter parsers configuration ---@type LazySpec return { "nvim-treesitter/nvim-treesitter", + dependencies = { + { + "AstroNvim/astrocore", + opts = function(_, opts) + local mappings = opts.mappings + local prefix = "pt" + mappings.n[prefix] = { desc = "Tree-sitter" } + mappings.n[prefix .. "s"] = { + vim.cmd.TSInstallInfo, + desc = "Language module status", + } + mappings.n[prefix .. "S"] = { + vim.cmd.TSModuleInfo, + desc = "Language module features", + } + mappings.n[prefix .. "u"] = { + vim.cmd.TSModuleInfo, + desc = "Update all modules", + } + end, + }, + }, opts = function(_, opts) - -- add more things to the ensure_installed table protecting against community packs modifying it opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { + "bash", + "comment", + "css", + "diff", + "ebnf", + "embedded_template", + "git_config", + "git_rebase", + "gitattributes", + "gitcommit", + "gitignore", + "hjson", + "html", + "htmldjango", + "http", + "ini", + "javascript", + "jq", + "json", + "json5", + "jsonc", + "jsonnet", + "latex", "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "mermaid", + "pem", + "regex", + "sql", "vim", - -- add more arguments for adding more treesitter parsers + "vimdoc", }) end, } diff --git a/lua/plugins/user.lua b/lua/plugins/user.lua deleted file mode 100644 index 121089e..0000000 --- a/lua/plugins/user.lua +++ /dev/null @@ -1,85 +0,0 @@ -if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE - --- You can also add or configure plugins by creating files in this `plugins/` folder --- Here are some examples: - ----@type LazySpec -return { - - -- == Examples of Adding Plugins == - - "andweeb/presence.nvim", - { - "ray-x/lsp_signature.nvim", - event = "BufRead", - config = function() require("lsp_signature").setup() end, - }, - - -- == Examples of Overriding Plugins == - - -- customize alpha options - { - "goolord/alpha-nvim", - opts = function(_, opts) - -- customize the dashboard header - opts.section.header.val = { - " █████ ███████ ████████ ██████ ██████", - "██ ██ ██ ██ ██ ██ ██ ██", - "███████ ███████ ██ ██████ ██ ██", - "██ ██ ██ ██ ██ ██ ██ ██", - "██ ██ ███████ ██ ██ ██ ██████", - " ", - " ███  ██ ██  ██ ██ ███  ███", - " ████  ██ ██  ██ ██ ████  ████", - " ██ ██  ██ ██  ██ ██ ██ ████ ██", - " ██  ██ ██  ██  ██  ██ ██  ██  ██", - " ██   ████   ████   ██ ██      ██", - } - return opts - end, - }, - - -- You can disable default plugins as follows: - { "max397574/better-escape.nvim", enabled = false }, - - -- You can also easily customize additional setup of plugins that is outside of the plugin's setup call - { - "L3MON4D3/LuaSnip", - config = function(plugin, opts) - require "astronvim.plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call - -- add more custom luasnip configuration such as filetype extend or custom snippets - local luasnip = require "luasnip" - luasnip.filetype_extend("javascript", { "javascriptreact" }) - end, - }, - - { - "windwp/nvim-autopairs", - config = function(plugin, opts) - require "astronvim.plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call - -- add more custom autopairs configuration such as custom rules - local npairs = require "nvim-autopairs" - local Rule = require "nvim-autopairs.rule" - local cond = require "nvim-autopairs.conds" - npairs.add_rules( - { - Rule("$", "$", { "tex", "latex" }) - -- don't add a pair if the next character is % - :with_pair(cond.not_after_regex "%%") - -- don't add a pair if the previous character is xxx - :with_pair( - cond.not_before_regex("xxx", 3) - ) - -- don't move right when repeat character - :with_move(cond.none()) - -- don't delete if the next character is xx - :with_del(cond.not_after_regex "xx") - -- disable adding a newline when you press - :with_cr(cond.none()), - }, - -- disable for .vim files, but it work for another filetypes - Rule("a", "a", "-vim") - ) - end, - }, -} diff --git a/lua/polish.lua b/lua/polish.lua index 14c38cd..92b54a7 100644 --- a/lua/polish.lua +++ b/lua/polish.lua @@ -1,18 +1,13 @@ -if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE +-- Final setup --- This will run last in the setup process and is a good place to configure --- things like custom filetypes. This just pure lua so anything that doesn't --- fit in the normal config locations above can go here - --- Set up custom filetypes -vim.filetype.add { - extension = { - foo = "fooscript", - }, - filename = { - ["Foofile"] = "fooscript", - }, - pattern = { - ["~/%.config/foo/.*"] = "fooscript", - }, +local cmd_abbrevs = { + h = "vert h", + help = "vertical help", } +for lhs, rhs in pairs(cmd_abbrevs) do + vim.cmd.cnoreabbrev( + "", + lhs, + "getcmdtype() == ':' && getcmdline() ==# '" .. lhs .. "' ? '" .. rhs .. "' : '" .. lhs .. "'" + ) +end diff --git a/neovim.yml b/neovim.yml index b9235ab..7a2a32c 100644 --- a/neovim.yml +++ b/neovim.yml @@ -4,3 +4,5 @@ base: lua51 globals: vim: any: true + jit: + any: true