From bdf2d330635003330c12eaa145cd59e55d195acf Mon Sep 17 00:00:00 2001 From: huyjaky Date: Fri, 14 Mar 2025 10:40:27 +0700 Subject: [PATCH] astro-nvim-v3 - restructure --- .gitignore | 41 ---------------------- .neoconf.json | 20 ----------- .stylua.toml | 7 ---- lazy-lock.json | 73 ++++++++++++++++++++-------------------- lua/community.lua | 2 +- lua/plugins/astrolsp.lua | 58 ++++++++++++++++++++++--------- 6 files changed, 80 insertions(+), 121 deletions(-) delete mode 100644 .gitignore delete mode 100644 .neoconf.json delete mode 100644 .stylua.toml diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6fd0a37..0000000 --- a/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# Compiled Lua sources -luac.out - -# luarocks build files -*.src.rock -*.zip -*.tar.gz - -# Object files -*.o -*.os -*.ko -*.obj -*.elf - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo -*.def -*.exp - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - diff --git a/.neoconf.json b/.neoconf.json deleted file mode 100644 index 4da33ca..0000000 --- a/.neoconf.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "neodev": { - "library": { - "enabled": true, - "plugins": true - } - }, - "neoconf": { - "plugins": { - "lua_ls": { - "enabled": true - } - } - }, - "lspconfig": { - "lua_ls": { - "Lua.format.enable": false - } - } -} diff --git a/.stylua.toml b/.stylua.toml deleted file mode 100644 index bfcffff..0000000 --- a/.stylua.toml +++ /dev/null @@ -1,7 +0,0 @@ -column_width = 120 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferDouble" -call_parentheses = "None" -collapse_simple_statement = "Always" diff --git a/lazy-lock.json b/lazy-lock.json index 6f9bbc0..6811e31 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,16 +1,16 @@ { - "AstroNvim": { "branch": "main", "commit": "e2c4d250730da01a94177f94fcc2797036cdb051" }, + "AstroNvim": { "branch": "main", "commit": "1411df4d970e59f1b5721556a043c5c828daf5ad" }, "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, - "aerial.nvim": { "branch": "master", "commit": "1160fb7a15a34b03b7381d95d45560712b5f19d0" }, + "aerial.nvim": { "branch": "master", "commit": "3284a2cb858ba009c79da87d5e010ccee3c99c4d" }, "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, - "astrocommunity": { "branch": "main", "commit": "bac0a03e1f661600efa1e4c848416355d2ce1586" }, - "astrocore": { "branch": "main", "commit": "0fcaac66d115948605c14eaf45a41d3923eaafeb" }, - "astrolsp": { "branch": "main", "commit": "2f6b0a4059775a1dac011d2944dd41fd4a8fe7a8" }, + "astrocommunity": { "branch": "main", "commit": "3fc0c4810af9e2e66f6ade9e5fff54f7012aa41c" }, + "astrocore": { "branch": "main", "commit": "44a3dc0bf1591022b2a6bc89dccdfac1be17bec9" }, + "astrolsp": { "branch": "main", "commit": "909fbe64f3f87d089ff3777751261544557117cc" }, "astrotheme": { "branch": "main", "commit": "41b7d8430a55fd771e41bd763af4c3fd1c2fc0b5" }, - "astroui": { "branch": "main", "commit": "076766c1d422db486378354729f8fa7c1a68b745" }, + "astroui": { "branch": "main", "commit": "d7eacef8b388536390d5f91cb7cba67e52be3cfe" }, "auto-save.nvim": { "branch": "main", "commit": "29f793a3a7f98129387590269ffe3ad61ab5e509" }, - "bamboo.nvim": { "branch": "master", "commit": "0a94f81705733951be286493b8d1876d0e3d990f" }, + "bamboo.nvim": { "branch": "master", "commit": "97124a0b81f886abc0d666ebec512b92425d67b6" }, "better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" }, "catppuccin": { "branch": "main", "commit": "0b5df9c9e641b1212b21a0762ccad4434fd41322" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -20,69 +20,68 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "code_runner.nvim": { "branch": "main", "commit": "65218f8f646fe61e506090522df357539642ae83" }, - "copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" }, + "copilot.vim": { "branch": "release", "commit": "5015939f131627a6a332c9e3ecad9a7cb4c2e549" }, "cyberdream.nvim": { "branch": "main", "commit": "cd3c2e7955034a5bec0e1beb9d7cb80c639ef5d5" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "duplicate.nvim": { "branch": "main", "commit": "ab057af7872c44e6fbd48df9b03983c8e67c50a7" }, - "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, + "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" }, "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, "heirline.nvim": { "branch": "master", "commit": "cc359b628266cb9a84b2d71c883f2b99e16473a0" }, "indent-blankline.nvim": { "branch": "master", "commit": "3fe94b8034dd5241cb882bb73847303b58857ecf" }, "kanagawa.nvim": { "branch": "master", "commit": "e5f7b8a804360f0a48e40d0083a97193ee4fcc87" }, - "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "markview.nvim": { "branch": "main", "commit": "6e9f1840ba33e5318285ad97c22676f55b753479" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" }, + "markview.nvim": { "branch": "main", "commit": "9a135ddc29d3659a4df765dcc379df1a16672a11" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason-null-ls.nvim": { "branch": "main", "commit": "2b8433f76598397fcc97318d410e0c4f7a4bea6a" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, - "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "mini.bufremove": { "branch": "main", "commit": "1ee294a97e091d3cf967974df622c0d887890dc2" }, - "mini.icons": { "branch": "main", "commit": "910db5df9724d65371182948f921fce23c2c881e" }, - "mini.indentscope": { "branch": "main", "commit": "613df2830d7faeae7483ba2e736683154b95921e" }, - "mini.move": { "branch": "main", "commit": "4caa1c212f5ca3d1633d21cfb184808090ed74b1" }, + "mini.icons": { "branch": "main", "commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36" }, + "mini.indentscope": { "branch": "main", "commit": "8ce41a77eed7f4121c83c67fda5e2e86af999e6d" }, + "mini.move": { "branch": "main", "commit": "c8b30e92dd2668dd6e56a9a23cb7d4ee38c2266d" }, "monokai-pro.nvim": { "branch": "master", "commit": "4f4133601296881bb2197800bd68d2bba9eaadb9" }, - "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, - "neo-tree.nvim": { "branch": "main", "commit": "e6645ecfcba3e064446a6def1c10d788c9873f51" }, - "neoconf.nvim": { "branch": "main", "commit": "9aefba9244a9cfd42c665e5b5dab7ac8594968a5" }, - "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, + "multiple-cursors.nvim": { "branch": "main", "commit": "1ac15d047a4b265cc2389957bcc56ee561b29e02" }, + "neo-tree.nvim": { "branch": "main", "commit": "16854ed5559b940f69a6f7138906ebb22c15c553" }, + "neoconf.nvim": { "branch": "main", "commit": "7c4427112d75f866d630d3eef4c06c4e37b5d042" }, + "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, "none-ls-extras.nvim": { "branch": "main", "commit": "6557f20e631d2e9b2a9fd27a5c045d701a3a292c" }, - "none-ls.nvim": { "branch": "main", "commit": "eec6019d95353f1706bff07ab4698354d09fe062" }, + "none-ls.nvim": { "branch": "main", "commit": "f41624ea1a73f020ddbd33438f74abb95ea17d55" }, "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, - "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, - "nvim-dap": { "branch": "master", "commit": "99807078c5089ed30e0547aa4b52c5867933f426" }, - "nvim-dap-ui": { "branch": "master", "commit": "727c032a8f63899baccb42a1c26f27687e62fc5e" }, + "nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" }, + "nvim-dap": { "branch": "master", "commit": "52302f02fea3a490e55475de52fa4deb8af2eb11" }, + "nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, - "nvim-highlight-colors": { "branch": "main", "commit": "68a4df620cf58e2c7336e53738e8cf3a522ad694" }, + "nvim-highlight-colors": { "branch": "main", "commit": "a770df5fbd98abbb0fc1a95d9a3f2bb1e51e3e2c" }, "nvim-lsp-endhints": { "branch": "main", "commit": "a449f2f27b6b985ff216964572224ce432d94a86" }, - "nvim-lspconfig": { "branch": "master", "commit": "04e8eb54eb6f70cd367ae58fdafb2ce05b2650ee" }, + "nvim-lspconfig": { "branch": "master", "commit": "7af2c37192deae28d1305ae9e68544f7fb5408e1" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-notify": { "branch": "master", "commit": "a3020c2cf4dfc4c4f390c4a21e84e35e46cf5d17" }, - "nvim-spider": { "branch": "main", "commit": "2b38e3e95e143313d78ca098eeecda7aebfce925" }, - "nvim-treesitter": { "branch": "master", "commit": "dc9bf52c1f8b9abae0c10e0192baea2e720472ef" }, + "nvim-spider": { "branch": "main", "commit": "9b9a1cf88a10790de69d3b0562d7d612f23561d5" }, + "nvim-treesitter": { "branch": "master", "commit": "2cade9e3d105732b794bc37e7cb2dc53b1cf99dc" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, - "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "85b80abaa09cbbc039e3095b2f515b3cf8cadd11" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "7a578f43b7390b5135242cc0b1b70addcc53a2d2" }, "resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" }, "smart-splits.nvim": { "branch": "master", "commit": "4a231987665d3c6e02ca88833d050e918afe3e1e" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, - "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" }, + "telescope.nvim": { "branch": "master", "commit": "78857db9e8d819d3cc1a9a7bdc1d39d127a36495" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "transparent.nvim": { "branch": "main", "commit": "8a2749a2fa74f97fe6557f61b89ac7fd873f3c21" }, "treesj": { "branch": "main", "commit": "48c1a7539f376fd40ceb9cf12d697040fcf90649" }, - "trouble.nvim": { "branch": "main", "commit": "50481f414bd3c1a40122c1d759d7e424d5fafe84" }, - "ultimate-autopair.nvim": { "branch": "v0.6", "commit": "9e3209190c22953566ae4e6436ad2b4ff4dabb95" }, - "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "ultimate-autopair.nvim": { "branch": "v0.6", "commit": "b24b97c538b71b6de0ce9d84e47df27b6ecafd76" }, + "vim-illuminate": { "branch": "master", "commit": "b5713e6ca3f627b46968386d6d3f24d374d3cb17" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, - "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } + "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" } } diff --git a/lua/community.lua b/lua/community.lua index cc2cbcd..c4d37ab 100644 --- a/lua/community.lua +++ b/lua/community.lua @@ -10,5 +10,5 @@ return { -- { import = "astrocommunity.pack.markdown" }, { import = "astrocommunity.color.nvim-highlight-colors" }, { import = "astrocommunity.diagnostics.trouble-nvim" }, - { import = "astrocommunity.neovim-lua-development.lazydev-nvim" }, + -- { import = "astrocommunity.neovim-lua-development.lazydev-nvim" }, } diff --git a/lua/plugins/astrolsp.lua b/lua/plugins/astrolsp.lua index 4b8833e..10d24ef 100644 --- a/lua/plugins/astrolsp.lua +++ b/lua/plugins/astrolsp.lua @@ -9,20 +9,20 @@ return { opts = { -- Configuration table of features provided by AstroLSP features = { - autoformat = false, -- enable or disable auto formatting on start - codelens = false, -- enable/disable codelens refresh on start + autoformat = false, -- enable or disable auto formatting on start + codelens = false, -- 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 = require "plugins.configs.lsp.formatting", + formatting = require("plugins.configs.lsp.formatting"), -- enable servers that you already have installed without mason servers = {}, -- customize language server configuration options passed to `lspconfig` ---@diagnostic disable: missing-fields config = { -- clangd = require "plugins.configs.lsp.config.clangd", - basedpyright = require "plugins.configs.lsp.config.basedpyright", + basedpyright = require("plugins.configs.lsp.config.basedpyright"), jedi_language_server = { init_options = { @@ -87,7 +87,8 @@ return { "RET504", "PLR2004", "W291", - "PLW2901" + "PLW2901", + "D213", }, }, @@ -121,12 +122,16 @@ return { event = { "CursorHold", "CursorHoldI" }, -- the rest of the autocmd options (:h nvim_create_autocmd) desc = "Document Highlighting", - callback = function() vim.lsp.buf.document_highlight() end, + callback = function() + vim.lsp.buf.document_highlight() + end, }, { event = { "CursorMoved", "CursorMovedI", "BufLeave" }, desc = "Document Highlighting Clear", - callback = function() vim.lsp.buf.clear_references() end, + callback = function() + vim.lsp.buf.clear_references() + end, }, }, -- disable inlay hints in insert mode @@ -149,7 +154,9 @@ return { vim.api.nvim_create_autocmd("InsertLeave", { buffer = args.buf, once = true, - callback = function() vim.lsp.inlay_hint.enable(true, filter) end, + callback = function() + vim.lsp.inlay_hint.enable(true, filter) + end, }) end end, @@ -159,18 +166,35 @@ return { -- mappings to be set up on attaching of a language server mappings = { n = { - gh = { function() vim.lsp.buf.hover() end, desc = "Hover symbol details", cond = "textDocument/hover" }, - gl = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }, + gh = { + function() + vim.lsp.buf.hover() + end, + desc = "Hover symbol details", + cond = "textDocument/hover", + }, + 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, + function() + vim.lsp.buf.declaration() + end, desc = "Declaration of current symbol", cond = "textDocument/declaration", }, ["uY"] = { - function() require("astrolsp.toggles").buffer_semantic_tokens() end, + 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, + cond = function(client) + return client.server_capabilities.semanticTokensProvider and vim.lsp.semantic_tokens + end, }, }, }, @@ -180,10 +204,14 @@ return { -- this would disable semanticTokensProvider for all clients -- client.server_capabilities.semanticTokensProvider = nil -- Disable ruff_lsp hover in favor of pyright - if client.name == "ruff_lsp" then client.server_capabilities.hoverProvider = false end + if client.name == "ruff_lsp" then + client.server_capabilities.hoverProvider = false + end -- Disable completion feature of pyright - if client.name == "basedpyright" then client.server_capabilities.completionProvider = false end + if client.name == "basedpyright" then + client.server_capabilities.completionProvider = false + end end, }, }