From 76409072a4a70483eb6212f8ac6376862ccf2ac0 Mon Sep 17 00:00:00 2001 From: Filip Rojek Date: Mon, 18 May 2026 07:42:27 +0200 Subject: [PATCH] added: latest nvim configuration --- .config/nvim/.luarc.json | 3 + .config/nvim/README.md | 9 +-- .config/nvim/init.lua | 11 ++- .config/nvim/lazy-lock.json | 91 +++++++++---------------- .config/nvim/lua/autocmds.lua | 21 ------ .config/nvim/lua/community.lua | 5 +- .config/nvim/lua/lazy_setup.lua | 2 +- .config/nvim/lua/plugins/astrocore.lua | 18 ++++- .config/nvim/lua/plugins/astrolsp.lua | 18 ++--- .config/nvim/lua/plugins/flutter.lua | 11 --- .config/nvim/lua/plugins/mason.lua | 43 +++++------- .config/nvim/lua/plugins/none-ls.lua | 24 +++++++ .config/nvim/lua/plugins/treesitter.lua | 19 ++++-- .config/nvim/lua/plugins/user.lua | 47 +++++++------ .config/nvim/lua/plugins/zen-mode.lua | 10 --- .config/nvim/lua/polish.lua | 17 +---- 16 files changed, 159 insertions(+), 190 deletions(-) create mode 100644 .config/nvim/.luarc.json delete mode 100644 .config/nvim/lua/autocmds.lua delete mode 100644 .config/nvim/lua/plugins/flutter.lua create mode 100644 .config/nvim/lua/plugins/none-ls.lua delete mode 100644 .config/nvim/lua/plugins/zen-mode.lua diff --git a/.config/nvim/.luarc.json b/.config/nvim/.luarc.json new file mode 100644 index 0000000..8415579 --- /dev/null +++ b/.config/nvim/.luarc.json @@ -0,0 +1,3 @@ +{ + "format.enable": false +} diff --git a/.config/nvim/README.md b/.config/nvim/README.md index a026b21..4488bde 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -1,16 +1,9 @@ # AstroNvim Template -**NOTE:** This is for AstroNvim v4+ +**NOTE:** This is for AstroNvim v6+ A template for getting started with [AstroNvim](https://github.com/AstroNvim/AstroNvim) -## System dependencies -- `lazygit` for lazygit integration -- `typescript-language-server` and `typescript` installed globally from npm -```bash -npm install -g typescript-language-server typescript -``` - ## 🛠️ Installation #### Make a backup of your current nvim and shared folder diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 77ca2f6..424e48d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,10 +1,18 @@ -- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution -- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk. local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim" + if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) + local result = vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) + if vim.v.shell_error ~= 0 then + -- stylua: ignore + vim.api.nvim_echo({ { ("Error cloning lazy.nvim:\n%s\n"):format(result), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {}) + vim.fn.getchar() + vim.cmd.quit() + end end + vim.opt.rtp:prepend(lazypath) -- validate that lazy is available @@ -17,4 +25,3 @@ end require "lazy_setup" require "polish" -require "autocmds" diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index cf847f2..a56b127 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,68 +1,45 @@ { - "AstroNvim": { "branch": "main", "commit": "c5e610f614e74c9dd9bf11760c4d0ad2c98c0abe" }, - "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, - "aerial.nvim": { "branch": "master", "commit": "6ab1a0ce4874d21610fc5a67a6c82c7b943c635b" }, - "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, - "astrocommunity": { "branch": "main", "commit": "d451f1d8e90e21c0cad730add858d8f952c66f01" }, - "astrocore": { "branch": "main", "commit": "44a3dc0bf1591022b2a6bc89dccdfac1be17bec9" }, - "astrolsp": { "branch": "main", "commit": "909fbe64f3f87d089ff3777751261544557117cc" }, - "astrotheme": { "branch": "main", "commit": "4a2af93815e4e6adfe69c836e46047a9451de858" }, - "astroui": { "branch": "main", "commit": "e923a84c488d879a260fc9cfb2dc27dd870fb6ac" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "AstroNvim": { "branch": "main", "commit": "bf37390b310fc2e3a1c57b21362b525bbfe6eed4" }, + "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, + "aerial.nvim": { "branch": "master", "commit": "645d108a5242ec7b378cbe643eb6d04d4223f034" }, + "astrocore": { "branch": "main", "commit": "b061e0c185cd5fecbac7489151a98117ce799a47" }, + "astrolsp": { "branch": "main", "commit": "ebc1676127b3bfbd46e3e26589b104853cac3730" }, + "astrotheme": { "branch": "main", "commit": "cf0e65a7b3ce2f830b052f4da937729eee1e7a7d" }, + "astroui": { "branch": "main", "commit": "920dd5df6629a9076a11ea10f0d21f4225203585" }, + "better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" }, + "blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" }, + "blink.compat": { "branch": "main", "commit": "2ed6d9a28b07fa6f3bface818470605f8896408c" }, "cmp-dap": { "branch": "master", "commit": "ea92773e84c0ad3288c3bc5e452ac91559669087" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, - "flutter-tools.nvim": { "branch": "main", "commit": "6faf2c70bd56f1fe78620591a2bb73f4dc6f4870" }, - "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" }, - "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "gitsigns.nvim": { "branch": "main", "commit": "a462f416e2ce4744531c6256252dee99a7d34a83" }, + "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, "heirline.nvim": { "branch": "master", "commit": "fae936abb5e0345b85c3a03ecf38525b0828b992" }, - "hover.nvim": { "branch": "main", "commit": "3b49066e09e03e63be6d6f43ae2b8bcd58301f63" }, - "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, - "lazydev.nvim": { "branch": "main", "commit": "01bc2aacd51cf9021eb19d048e70ce3dd09f7f93" }, - "lsp_signature.nvim": { "branch": "master", "commit": "a793d02b6a5e639fa9d3f2a89a839fa688ab2d0a" }, - "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25f609e7fca78af7cede4f9fa3af8a94b1c4950b" }, "mason-null-ls.nvim": { "branch": "main", "commit": "2b8433f76598397fcc97318d410e0c4f7a4bea6a" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, - "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "mini.animate": { "branch": "main", "commit": "0365de8b69331c25d0d0d7573407a7dc7719e578" }, - "mini.bufremove": { "branch": "main", "commit": "285bdac9596ee7375db50c0f76ed04336dcd2685" }, - "neo-tree.nvim": { "branch": "main", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, - "neoconf.nvim": { "branch": "main", "commit": "f630568a4d04154803886f21ca60923f12709f0f" }, - "none-ls.nvim": { "branch": "main", "commit": "a117163db44c256d53c3be8717f3e1a2a28e6299" }, - "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, - "nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" }, - "nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "517df88cf2afb36652830df2c655df2da416a0ae" }, - "nvim-dap": { "branch": "master", "commit": "6a5bba0ddea5d419a783e170c20988046376090d" }, - "nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" }, - "nvim-lspconfig": { "branch": "master", "commit": "185b2af444b27d6541c02d662b5b68190e5cf0c4" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "e51f9b259f066c4347f9a79ffde54c29a0619384" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, + "neo-tree.nvim": { "branch": "main", "commit": "84c75e7a7e443586f60508d12fc50f90d9aee14e" }, + "none-ls.nvim": { "branch": "main", "commit": "c9317c2a8629d4e39e7cf47be74cb67f3ab37cda" }, + "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, + "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, + "nvim-dap": { "branch": "master", "commit": "4f5deb110d9ff8994d96c21df95e2271d11214f9" }, + "nvim-dap-ui": { "branch": "master", "commit": "f5b6673f374626515401c5bc51b005f784a4f252" }, + "nvim-highlight-colors": { "branch": "main", "commit": "e2cb22089cc2358b2b995c09578224f142de6039" }, + "nvim-lspconfig": { "branch": "master", "commit": "0203a9608d63eda57679b01e69f33a7b4c34b0d1" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-notify": { "branch": "master", "commit": "a3020c2cf4dfc4c4f390c4a21e84e35e46cf5d17" }, - "nvim-treesitter": { "branch": "master", "commit": "f8aaf5ce4e27cd20de917946b2ae5c968a2c2858" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" }, - "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-ufo": { "branch": "main", "commit": "61463090a4f55f5d080236ea62f09d1cd8976ff3" }, - "nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" }, + "nvim-treesitter": { "branch": "main", "commit": "c82bf96f0a773d85304feeb695e1e23b2207ac35" }, + "nvim-treesitter-textobjects": { "branch": "main", "commit": "93d60a475f0b08a8eceb99255863977d3a25f310" }, + "nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" }, "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, - "promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" }, - "schemastore.nvim": { "branch": "main", "commit": "aa25399c48236b77af71d4b64cdf157d2ba4e990" }, - "smart-splits.nvim": { "branch": "master", "commit": "ddb23c1a1cf1507bda487cda7f6e4690965ef9f5" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope.nvim": { "branch": "master", "commit": "a17d611a0e111836a1db5295f04945df407c5135" }, + "smart-splits.nvim": { "branch": "master", "commit": "12426763591f06b865c20990d8423345ea96d44f" }, + "snacks.nvim": { "branch": "main", "commit": "e6fd58c82f2f3fcddd3fe81703d47d6d48fc7b9f" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, - "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, - "vim-illuminate": { "branch": "master", "commit": "19cb21f513fc2b02f0c66be70107741e837516a1" }, - "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" }, - "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" } + "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" } } diff --git a/.config/nvim/lua/autocmds.lua b/.config/nvim/lua/autocmds.lua deleted file mode 100644 index 3cdfcb9..0000000 --- a/.config/nvim/lua/autocmds.lua +++ /dev/null @@ -1,21 +0,0 @@ --- Autocommand: trigger Flutter hot reload on save --- --- This runs whenever you save a *.dart file (BufWritePost). --- It checks if a tmux session named "flutter" exists. --- If it does, it sends the keys "r" to the "app" window --- of that session, which tells `flutter run` to hot-reload. --- --- Workflow: --- 1. Start tmux: tmux new -s flutter -n app --- 2. Inside tmux "app" window, run: flutter run --- 3. Open another window/pane for nvim. --- 4. Whenever you :w a Dart file in nvim, hot reload will fire. --- - -vim.api.nvim_create_autocmd("BufWritePost", { - pattern = "*.dart", - callback = function() - local result = vim.fn.system({ "tmux", "send-keys", "-t", "flutter:app", "r", "Enter" }) - vim.notify("Flutter hot reload triggered", vim.log.levels.INFO) - end, -}) diff --git a/.config/nvim/lua/community.lua b/.config/nvim/lua/community.lua index f0b957a..c842899 100644 --- a/.config/nvim/lua/community.lua +++ b/.config/nvim/lua/community.lua @@ -1,3 +1,5 @@ +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. @@ -7,7 +9,4 @@ return { "AstroNvim/astrocommunity", { import = "astrocommunity.pack.lua" }, -- import/override with your plugins folder - { import = "astrocommunity.utility.hover-nvim" }, - { import = "astrocommunity.diagnostics.trouble-nvim" }, - { import = "astrocommunity.scrolling.mini-animate" }, } diff --git a/.config/nvim/lua/lazy_setup.lua b/.config/nvim/lua/lazy_setup.lua index 8a19892..8e1abfb 100644 --- a/.config/nvim/lua/lazy_setup.lua +++ b/.config/nvim/lua/lazy_setup.lua @@ -1,7 +1,7 @@ require("lazy").setup({ { "AstroNvim/AstroNvim", - version = "^4", -- Remove version tracking to elect for nightly AstroNvim + version = "^6", -- Remove version tracking to elect for nightly AstroNvim 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 diff --git a/.config/nvim/lua/plugins/astrocore.lua b/.config/nvim/lua/plugins/astrocore.lua index b2c2173..03d7441 100644 --- a/.config/nvim/lua/plugins/astrocore.lua +++ b/.config/nvim/lua/plugins/astrocore.lua @@ -1,3 +1,5 @@ +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`) @@ -13,7 +15,7 @@ return { large_buf = { size = 1024 * 256, 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) + diagnostics = { virtual_text = true, virtual_lines = false }, -- diagnostic settings on startup highlighturl = true, -- highlight URLs at start notifications = true, -- enable notifications at start }, @@ -22,6 +24,19 @@ return { virtual_text = true, underline = true, }, + -- passed to `vim.filetype.add` + filetypes = { + -- see `:h vim.filetype.add` for usage + extension = { + foo = "fooscript", + }, + filename = { + [".foorc"] = "fooscript", + }, + pattern = { + [".*/etc/foo/.*"] = "fooscript", + }, + }, -- vim options can be configured here options = { opt = { -- vim.opt. @@ -30,7 +45,6 @@ return { spell = false, -- sets vim.opt.spell signcolumn = "yes", -- sets vim.opt.signcolumn to yes wrap = false, -- sets vim.opt.wrap - scrolloff = 8, }, g = { -- vim.g. -- configure global vim variables (vim.g) diff --git a/.config/nvim/lua/plugins/astrolsp.lua b/.config/nvim/lua/plugins/astrolsp.lua index 8c9c535..b180a39 100644 --- a/.config/nvim/lua/plugins/astrolsp.lua +++ b/.config/nvim/lua/plugins/astrolsp.lua @@ -1,3 +1,5 @@ +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`) @@ -39,20 +41,18 @@ return { servers = { -- "pyright" }, - -- customize language server configuration options passed to `lspconfig` - ---@diagnostic disable: missing-fields + -- customize language server configuration passed to `vim.lsp.config` + -- client specific configuration can also go in `lsp/` in your configuration root (see `:h lsp-config`) config = { - ts_ls = {}, - -- clangd = { capabilities = { offsetEncoding = "utf-8" } }, + -- ["*"] = { capabilities = {} }, -- modify default LSP client settings such as capabilities }, -- 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 + -- a function with the key `*` modifies the default handler, functions takes the server name as the parameter + -- ["*"] = function(server) vim.lsp.enable(server) end - -- the key is the server that is being setup with `lspconfig` + -- the key is the server that is being setup with `vim.lsp.config` -- 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 = { @@ -95,7 +95,7 @@ return { }, }, -- A custom `on_attach` function to be run after the default `on_attach` function - -- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`) + -- takes two parameters `client` and `bufnr` (`:h lsp-attach`) on_attach = function(client, bufnr) -- this would disable semanticTokensProvider for all clients -- client.server_capabilities.semanticTokensProvider = nil diff --git a/.config/nvim/lua/plugins/flutter.lua b/.config/nvim/lua/plugins/flutter.lua deleted file mode 100644 index b4dcd72..0000000 --- a/.config/nvim/lua/plugins/flutter.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - -- Add the community repository of plugin specifications - "AstroNvim/astrocommunity", - { import = "astrocommunity.pack.dart" }, - -- Configure flutter-tools - { "akinsho/flutter-tools.nvim", - opts = { - ... - } - } -} diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua index b6be8eb..2d79b5f 100644 --- a/.config/nvim/lua/plugins/mason.lua +++ b/.config/nvim/lua/plugins/mason.lua @@ -1,36 +1,27 @@ --- Customize Mason plugins +if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE + +-- Customize Mason ---@type LazySpec return { - -- use mason-lspconfig to configure LSP installations + -- use mason-tool-installer for automatically installing Mason packages { - "williamboman/mason-lspconfig.nvim", - -- overrides `require("mason-lspconfig").setup(...)` - opts = { - ensure_installed = { - "lua_ls", - -- add more arguments for adding more language servers - }, - }, - }, - -- use mason-null-ls to configure Formatters/Linter installation for null-ls sources - { - "jay-babu/mason-null-ls.nvim", - -- overrides `require("mason-null-ls").setup(...)` + "WhoIsSethDaniel/mason-tool-installer.nvim", + -- overrides `require("mason-tool-installer").setup(...)` opts = { + -- Make sure to use the names found in `:Mason` ensure_installed = { + -- install language servers + "lua-language-server", + + -- install formatters "stylua", - -- add more arguments for adding more null-ls sources - }, - }, - }, - { - "jay-babu/mason-nvim-dap.nvim", - -- overrides `require("mason-nvim-dap").setup(...)` - opts = { - ensure_installed = { - "python", - -- add more arguments for adding more debuggers + + -- install debuggers + "debugpy", + + -- install any other package + "tree-sitter-cli", }, }, }, diff --git a/.config/nvim/lua/plugins/none-ls.lua b/.config/nvim/lua/plugins/none-ls.lua new file mode 100644 index 0000000..2b0ed18 --- /dev/null +++ b/.config/nvim/lua/plugins/none-ls.lua @@ -0,0 +1,24 @@ +if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE + +-- Customize None-ls sources + +---@type LazySpec +return { + "nvimtools/none-ls.nvim", + opts = function(_, opts) + -- opts 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 + + -- Only insert new sources, do not replace the existing ones + -- (If you wish to replace, use `opts.sources = {}` instead of the `list_insert_unique` function) + opts.sources = require("astrocore").list_insert_unique(opts.sources, { + -- Set a formatter + -- null_ls.builtins.formatting.stylua, + -- null_ls.builtins.formatting.prettier, + }) + end, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index 94436aa..3a9afe9 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -1,15 +1,24 @@ if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE -- Customize Treesitter +-- -------------------- +-- Treesitter customizations are handled with AstroCore +-- as nvim-treesitter simply provides a download utility for parsers ---@type LazySpec return { - "nvim-treesitter/nvim-treesitter", + "AstroNvim/astrocore", + ---@type AstroCoreOpts opts = { - ensure_installed = { - "lua", - "vim", - -- add more arguments for adding more treesitter parsers + treesitter = { + highlight = true, -- enable/disable treesitter based highlighting + indent = true, -- enable/disable treesitter based indentation + auto_install = true, -- enable/disable automatic installation of detected languages + ensure_installed = { + "lua", + "vim", + -- add more arguments for adding more treesitter parsers + }, }, }, } diff --git a/.config/nvim/lua/plugins/user.lua b/.config/nvim/lua/plugins/user.lua index 76fd493..d332627 100644 --- a/.config/nvim/lua/plugins/user.lua +++ b/.config/nvim/lua/plugins/user.lua @@ -1,4 +1,7 @@ +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 +-- PLEASE REMOVE THE EXAMPLES YOU HAVE NO INTEREST IN BEFORE ENABLING THIS FILE -- Here are some examples: ---@type LazySpec @@ -15,26 +18,28 @@ return { -- == Examples of Overriding Plugins == - -- customize alpha options + -- customize dashboard options { - "goolord/alpha-nvim", - opts = function(_, opts) - -- customize the dashboard header - opts.section.header.val = { - " █████ ███████ ████████ ██████ ██████", - "██ ██ ██ ██ ██ ██ ██ ██", - "███████ ███████ ██ ██████ ██ ██", - "██ ██ ██ ██ ██ ██ ██ ██", - "██ ██ ███████ ██ ██ ██ ██████", - " ", - " ███  ██ ██  ██ ██ ███  ███", - " ████  ██ ██  ██ ██ ████  ████", - " ██ ██  ██ ██  ██ ██ ██ ████ ██", - " ██  ██ ██  ██  ██  ██ ██  ██  ██", - " ██   ████   ████   ██ ██      ██", - } - return opts - end, + "folke/snacks.nvim", + opts = { + dashboard = { + preset = { + header = table.concat({ + " █████ ███████ ████████ ██████ ██████ ", + "██ ██ ██ ██ ██ ██ ██ ██", + "███████ ███████ ██ ██████ ██ ██", + "██ ██ ██ ██ ██ ██ ██ ██", + "██ ██ ███████ ██ ██ ██ ██████ ", + "", + "███  ██ ██  ██ ██ ███  ███", + "████  ██ ██  ██ ██ ████  ████", + "██ ██  ██ ██  ██ ██ ██ ████ ██", + "██  ██ ██  ██  ██  ██ ██  ██  ██", + "██   ████   ████   ██ ██      ██", + }, "\n"), + }, + }, + }, }, -- You can disable default plugins as follows: @@ -44,10 +49,12 @@ return { { "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" }) + + -- include the default astronvim config that calls the setup call + require "astronvim.plugins.configs.luasnip"(plugin, opts) end, }, diff --git a/.config/nvim/lua/plugins/zen-mode.lua b/.config/nvim/lua/plugins/zen-mode.lua deleted file mode 100644 index fd78d58..0000000 --- a/.config/nvim/lua/plugins/zen-mode.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - "folke/zen-mode.nvim", - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }, - }, -} diff --git a/.config/nvim/lua/polish.lua b/.config/nvim/lua/polish.lua index 5b65b7d..642719f 100644 --- a/.config/nvim/lua/polish.lua +++ b/.config/nvim/lua/polish.lua @@ -1,18 +1,5 @@ if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE --- This will run last in the setup process and is a good place to configure --- things like custom filetypes. This is just pure lua so anything that doesn't +-- This will run last in the setup process. +-- This is 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", - }, -}