astro-nvim-v3 - change: turn off declare symbols basedpyright

This commit is contained in:
huyjaky
2025-08-10 15:18:07 +07:00
parent df896f0ab4
commit 182ad7856a
27 changed files with 1114 additions and 807 deletions

3
.luarc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"completion.autoRequire": false
}

View File

@@ -1,6 +1,7 @@
-- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution -- 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. -- 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" 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 if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then
-- stylua: ignore -- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable",
@@ -12,16 +13,17 @@ vim.opt.rtp:prepend(lazypath)
if not pcall(require, "lazy") then if not pcall(require, "lazy") then
-- stylua: ignore -- stylua: ignore
vim.api.nvim_echo( vim.api.nvim_echo(
{ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMs" } }, true, { { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMs" } },
true,
{}) {})
vim.fn.getchar() vim.fn.getchar()
vim.cmd.quit() vim.cmd.quit()
end end
-- NOTE: ENV -- NOTE: ENV
-- Disable Copilot tab mapping -- Disable Copilot tab mapping
vim.g.copilot_no_tab_map = true vim.g.copilot_no_tab_map = true
require("lazy_setup") require("lazy_setup")
require("polish") require("polish")
require("core.lsp")

View File

@@ -4,7 +4,7 @@
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
"aerial.nvim": { "branch": "master", "commit": "3284a2cb858ba009c79da87d5e010ccee3c99c4d" }, "aerial.nvim": { "branch": "master", "commit": "3284a2cb858ba009c79da87d5e010ccee3c99c4d" },
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
"astrocommunity": { "branch": "main", "commit": "b3ed1de31b0109b28668385336f84dc60c792de3" }, "astrocommunity": { "branch": "main", "commit": "8930cf06505230b710001f625052bcbc1bba04a5" },
"astrocore": { "branch": "main", "commit": "44a3dc0bf1591022b2a6bc89dccdfac1be17bec9" }, "astrocore": { "branch": "main", "commit": "44a3dc0bf1591022b2a6bc89dccdfac1be17bec9" },
"astrolsp": { "branch": "main", "commit": "909fbe64f3f87d089ff3777751261544557117cc" }, "astrolsp": { "branch": "main", "commit": "909fbe64f3f87d089ff3777751261544557117cc" },
"astrotheme": { "branch": "main", "commit": "41b7d8430a55fd771e41bd763af4c3fd1c2fc0b5" }, "astrotheme": { "branch": "main", "commit": "41b7d8430a55fd771e41bd763af4c3fd1c2fc0b5" },
@@ -12,11 +12,8 @@
"auto-save.nvim": { "branch": "main", "commit": "37c82fd548e3f5ffc2d9d020a65dac1044584f44" }, "auto-save.nvim": { "branch": "main", "commit": "37c82fd548e3f5ffc2d9d020a65dac1044584f44" },
"bamboo.nvim": { "branch": "master", "commit": "ab8393d1a314d96314605369b4b1e6bc7737f2b5" }, "bamboo.nvim": { "branch": "master", "commit": "ab8393d1a314d96314605369b4b1e6bc7737f2b5" },
"better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" }, "better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" },
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
"catppuccin": { "branch": "main", "commit": "0b5df9c9e641b1212b21a0762ccad4434fd41322" }, "catppuccin": { "branch": "main", "commit": "0b5df9c9e641b1212b21a0762ccad4434fd41322" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"code_runner.nvim": { "branch": "main", "commit": "65218f8f646fe61e506090522df357539642ae83" }, "code_runner.nvim": { "branch": "main", "commit": "65218f8f646fe61e506090522df357539642ae83" },
"copilot.vim": { "branch": "release", "commit": "51f80c0ed4f70d1c7e8c0ff11a792a9d84502c03" }, "copilot.vim": { "branch": "release", "commit": "51f80c0ed4f70d1c7e8c0ff11a792a9d84502c03" },
@@ -35,7 +32,6 @@
"lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"markview.nvim": { "branch": "main", "commit": "9a135ddc29d3659a4df765dcc379df1a16672a11" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason-null-ls.nvim": { "branch": "main", "commit": "2b8433f76598397fcc97318d410e0c4f7a4bea6a" }, "mason-null-ls.nvim": { "branch": "main", "commit": "2b8433f76598397fcc97318d410e0c4f7a4bea6a" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
@@ -57,18 +53,17 @@
"nvim-dap": { "branch": "master", "commit": "6a5bba0ddea5d419a783e170c20988046376090d" }, "nvim-dap": { "branch": "master", "commit": "6a5bba0ddea5d419a783e170c20988046376090d" },
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" }, "nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-highlight-colors": { "branch": "main", "commit": "b42a5ccec7457b44e89f7ed3b3afb1b375bb2093" }, "nvim-lsp-endhints": { "branch": "main", "commit": "0bd03846561f46d8b7d2284a02d3748c3d35621b" },
"nvim-lsp-endhints": { "branch": "main", "commit": "7917c7af1ec345ca9b33e8dbcd3723fc15d023c0" },
"nvim-lspconfig": { "branch": "master", "commit": "185b2af444b27d6541c02d662b5b68190e5cf0c4" }, "nvim-lspconfig": { "branch": "master", "commit": "185b2af444b27d6541c02d662b5b68190e5cf0c4" },
"nvim-notify": { "branch": "master", "commit": "a3020c2cf4dfc4c4f390c4a21e84e35e46cf5d17" }, "nvim-notify": { "branch": "master", "commit": "a3020c2cf4dfc4c4f390c4a21e84e35e46cf5d17" },
"nvim-spider": { "branch": "main", "commit": "6da0307421bc4be6fe02815faabde51007c4ea1a" }, "nvim-spider": { "branch": "main", "commit": "a81d07e07e279923b1a10d0146c543bf079f747e" },
"nvim-treesitter": { "branch": "master", "commit": "f8aaf5ce4e27cd20de917946b2ae5c968a2c2858" }, "nvim-treesitter": { "branch": "master", "commit": "f8aaf5ce4e27cd20de917946b2ae5c968a2c2858" },
"nvim-treesitter-context": { "branch": "master", "commit": "6853ecb2cd8b062365da1cdd1a2e6f934ad55ed6" }, "nvim-treesitter-context": { "branch": "master", "commit": "6853ecb2cd8b062365da1cdd1a2e6f934ad55ed6" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" },
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" },
"nvim_context_vt": { "branch": "master", "commit": "4ee3f8fe1b3aacacd31eaf77378dffcad0ff9465" }, "nvim_context_vt": { "branch": "master", "commit": "b69f642f7848fec8c056a7e2c9452e3dec84c2b5" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" }, "resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" },
"schemastore.nvim": { "branch": "main", "commit": "3cd1c7267282b4d89618674de36a6d866981347e" }, "schemastore.nvim": { "branch": "main", "commit": "3cd1c7267282b4d89618674de36a6d866981347e" },

25
lsp/pyrefly.lua Normal file
View File

@@ -0,0 +1,25 @@
---@brief
---
--- https://pyrefly.org/
---
---`pyrefly`, a faster Python type checker written in Rust.
--
-- `pyrefly` is still in development, so please report any errors to
-- our issues page at https://github.com/facebook/pyrefly/issues.
return {
cmd = { 'pyrefly', 'lsp' },
filetypes = { 'python' },
root_markers = {
'pyrefly.toml',
'pyproject.toml',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile',
'.git',
},
on_exit = function(code, _, _)
vim.notify('Closing Pyrefly LSP exited with code: ' .. code, vim.log.levels.INFO)
end,
}

10
lsp/ty.lua Normal file
View File

@@ -0,0 +1,10 @@
return {
cmd = { 'ty', 'server' },
filetypes = { 'python' },
root_markers = { 'ty.toml', 'pyproject.toml', '.git', 'ruff.toml' },
settings = {
ty = {
},
},
}

View File

@@ -8,7 +8,7 @@ return {
{ import = "astrocommunity.pack.lua" }, { import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.pack.json" }, { import = "astrocommunity.pack.json" },
-- { import = "astrocommunity.pack.markdown" }, -- { import = "astrocommunity.pack.markdown" },
{ import = "astrocommunity.color.nvim-highlight-colors" }, -- { import = "astrocommunity.color.nvim-highlight-colors" },
{ import = "astrocommunity.diagnostics.trouble-nvim" }, { import = "astrocommunity.diagnostics.trouble-nvim" },
-- { import = "astrocommunity.neovim-lua-development.lazydev-nvim" }, -- { import = "astrocommunity.neovim-lua-development.lazydev-nvim" },
} }

View File

@@ -4,36 +4,41 @@ vim.api.nvim_create_augroup("auto_wrap", { clear = true })
vim.api.nvim_create_augroup("disable_suspend_with_c_z", { clear = true }) vim.api.nvim_create_augroup("disable_suspend_with_c_z", { clear = true })
vim.api.nvim_create_augroup("clear_last_search", { clear = true }) vim.api.nvim_create_augroup("clear_last_search", { clear = true })
-- NOTE: Set colors for hightlights for similar words vim.g.vim_markdown_math = 1
vim.g.vim_markdown_conceal = 2
vim.g.vim_markdown_conceal_code_blocks = 0
-- NOTE: Set colors for hightlights for similar words
-- vim.api.nvim_set_hl(0, "LspReferenceRead", { fg = "#FF0000" }) -- vim.api.nvim_set_hl(0, "LspReferenceRead", { fg = "#FF0000" })
-- vim.api.nvim_set_hl(0, "LspReferenceWrite", { fg = "#FF0000" }) -- vim.api.nvim_set_hl(0, "LspReferenceWrite", { fg = "#FF0000" })
-- vim.api.nvim_set_hl(0, "LspReferenceText", { fg = "#FF0000" }) -- vim.api.nvim_set_hl(0, "LspReferenceText", { fg = "#FF0000" })
vim.api.nvim_create_autocmd("BufEnter", { vim.api.nvim_create_autocmd("BufEnter", {
desc = "Disable auto insert comment newline", desc = "Disable auto insert comment newline",
group = "disable_comment_newline", group = "disable_comment_newline",
command = "set formatoptions-=cro", command = "set formatoptions-=cro",
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
desc = "Enable wrap and spell for text like documents", desc = "Enable wrap and spell for text like documents",
group = "auto_wrap", group = "auto_wrap",
pattern = { "gitcommit", "markdown", "text", "plaintext" }, pattern = { "gitcommit", "markdown", "text", "plaintext" },
callback = function() callback = function()
vim.opt_local.wrap = true vim.opt_local.wrap = true
vim.opt_local.spell = true vim.opt_local.spell = true
end, end,
}) })
vim.api.nvim_create_autocmd("BufEnter", { vim.api.nvim_create_autocmd("BufEnter", {
desc = "Remap <C-z> to nothing so that it doesn't suspend terminal", desc = "Remap <C-z> to nothing so that it doesn't suspend terminal",
group = "disable_suspend_with_c_z", group = "disable_suspend_with_c_z",
command = "nnoremap <c-z> <nop>", command = "nnoremap <c-z> <nop>",
}) })
vim.api.nvim_create_autocmd("BufWinEnter", { vim.api.nvim_create_autocmd("BufWinEnter", {
desc = "Clear last search pattern", desc = "Clear last search pattern",
group = "clear_last_search", group = "clear_last_search",
pattern = "*", pattern = "*",
command = "let @/ = ''", command = "let @/ = ''",
}) })

1
lua/core/lsp.lua Normal file
View File

@@ -0,0 +1 @@
-- vim.lsp.enable("ty")

View File

@@ -1,223 +1,184 @@
-- Configuration documentation can be found with `:h astrolsp` -- Configuration documentation can be found with `:h astrolsp`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) -- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
-- as this provides autocomplete and documentation while editing -- as this provides autocomplete and documentation while editing
---@type LazySpec ---@type LazySpec
return { return {
"AstroNvim/astrolsp", "AstroNvim/astrolsp",
---@type AstroLSPOpts ---@type AstroLSPOpts
opts = { opts = {
-- Configuration table of features provided by AstroLSP -- Configuration table of features provided by AstroLSP
features = { features = {
autoformat = false, -- enable or disable auto formatting on start autoformat = false, -- enable or disable auto formatting on start
codelens = false, -- enable/disable codelens refresh on start codelens = true, -- enable/disable codelens refresh on start
inlay_hints = false, -- enable/disable inlay hints on start inlay_hints = false, -- enable/disable inlay hints on start
semantic_tokens = true, -- enable/disable semantic token highlighting semantic_tokens = true, -- enable/disable semantic token highlighting
}, },
-- customize lsp formatting options -- 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 -- 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"),
jedi_language_server = { servers = {},
init_options = { -- customize language server configuration options passed to `lspconfig`
completion = { ---@diagnostic disable: missing-fields
disableSnippets = true, config = {
}, -- clangd = require "plugins.configs.lsp.config.clangd",
diagnostics = { basedpyright = require("plugins.configs.lsp.config.basedpyright"),
enable = true, jedi_language_server = require("plugins.configs.lsp.config.jedi_language"),
}, pyright = require("plugins.configs.lsp.config.pyright"),
jediSettings = { ruff = require("plugins.configs.lsp.config.ruff"),
autoImportModules = { pylsp = require("plugins.configs.lsp.config.pylsp"),
"numpy", },
"pandas", -- customize how language servers are attached
"torch", handlers = {
"sklearn", -- 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
}, -- config Ty
workspace = {
environmentPath = "/home/duckq1u/miniconda3/envs/OCR3/bin/python",
ignore = { "/home/duckq1u/miniconda3/envs/OCR3/lib/python3.11/site-packages/transformers/mode ls/albert/configuration_albert.py" },
},
},
},
ruff = { -- the key is the server that is being setup with `lspconfig`
init_options = { -- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
settings = { -- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
lint = { },
unfixable = { "F401" }, -- Configure buffer local auto commands to add when attaching a language server
select = { autocmds = {
"ALL", -- first key is the `augroup` to add the auto commands to (:h augroup)
}, lsp_document_highlight = {
ignore = { -- Optional condition to create/delete auto command group
"ANN", -- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
"COM", -- condition will be resolved for each client on each execution and if it ever fails for all clients,
"C90", -- the auto commands will be deleted for that buffer
"DJ", cond = "textDocument/documentHighlight",
"EXE", -- cond = function(client, bufnr) return client.name == "lua_ls" end,
"T10", -- list of auto commands to set
"TID", {
"D100", -- events to trigger
"D101", event = { "CursorHold", "CursorHoldI" },
"D102", -- the rest of the autocmd options (:h nvim_create_autocmd)
"D103", desc = "Document Highlighting",
"D104", callback = function()
"D105", vim.lsp.buf.document_highlight()
"D106", end,
"D107", },
"D200", {
"D205", event = { "CursorMoved", "CursorMovedI", "BufLeave" },
"D212", desc = "Document Highlighting Clear",
"D400", callback = function()
"D401", vim.lsp.buf.clear_references()
"D415", end,
"E402", },
"E501", },
"ERA001", -- disable inlay hints in insert mode
"TRY003", disable_inlay_hints_on_insert = {
"TD002", -- only create for language servers that support inlay hints
"TD003", -- (and only if vim.lsp.inlay_hint is available)
"T201", cond = vim.lsp.inlay_hint and "textDocument/inlayHint" or false,
"FIX002", {
"N803", -- when going into insert mode
"PD901", event = "InsertEnter",
-- "F401", desc = "disable inlay hints on insert",
"I001", callback = function(args)
"RET504", local filter = { bufnr = args.buf }
"PLR2004", -- if the inlay hints are currently enabled
"W291", if vim.lsp.inlay_hint.is_enabled(filter) then
"PLW2901", -- disable the inlay hints
"D213", vim.lsp.inlay_hint.enable(false, filter)
"PLR0402", -- create a single use autocommand to turn the inlay hints back on
}, -- when leaving insert mode
}, vim.api.nvim_create_autocmd("InsertLeave", {
buffer = args.buf,
once = true,
callback = function()
vim.lsp.inlay_hint.enable(true, filter)
end,
})
end
end,
},
},
},
-- 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",
},
-- 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",
},
["<Leader>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,
},
},
},
-- 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
-- Disable ruff_lsp hover in favor of pyright
if client.name == "ruff" then
client.server_capabilities.hoverProvider = false
end
args = {}, -- if client.name == "pyright" then
}, -- -- disable pyright analysis features
}, -- client.server_capabilities.documentFormattingProvider = false
}, -- client.server_capabilities.hoverProvider = false
},
-- 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` -- end
-- 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,
},
},
-- disable inlay hints in insert mode
disable_inlay_hints_on_insert = {
-- only create for language servers that support inlay hints
-- (and only if vim.lsp.inlay_hint is available)
cond = vim.lsp.inlay_hint and "textDocument/inlayHint" or false,
{
-- when going into insert mode
event = "InsertEnter",
desc = "disable inlay hints on insert",
callback = function(args)
local filter = { bufnr = args.buf }
-- if the inlay hints are currently enabled
if vim.lsp.inlay_hint.is_enabled(filter) then
-- disable the inlay hints
vim.lsp.inlay_hint.enable(false, filter)
-- create a single use autocommand to turn the inlay hints back on
-- when leaving insert mode
vim.api.nvim_create_autocmd("InsertLeave", {
buffer = args.buf,
once = true,
callback = function()
vim.lsp.inlay_hint.enable(true, filter)
end,
})
end
end,
},
},
},
-- 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",
},
-- 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",
},
["<Leader>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,
},
},
},
-- 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
-- Disable ruff_lsp hover in favor of pyright
if client.name == "ruff_lsp" then
client.server_capabilities.hoverProvider = false
end
-- Disable completion feature of pyright -- Disable completion feature of pyright
if client.name == "basedpyright" then if client.name == "ty" then
client.server_capabilities.completionProvider = false client.server_capabilities.completionProvider = false
end end
end,
}, if client.name == "basedpyright" then
client.server_capabilities.completionProvider = false
client.server_capabilities.codeLensProvider = false
client.server_capabilities.colorProvider = false
client.server_capabilities.colorProvider = false
client.server_capabilities.callHierarchyProvider = false
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
client.server_capabilities.declarationProvider = false
client.server_capabilities.documentLinkProvider = false
client.server_capabilities.definitionProvider = false
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentOnTypeFormattingProvider = false
client.server_capabilities.documentLinkProvider = false
client.server_capabilities.documentSymbolProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
client.server_capabilities.hoverProvider = false
client.server_capabilities.inlineCompletionProvider = false
client.server_capabilities.inlineValueProvider = false
client.server_capabilities.notebookDocumentSync = false
client.server_capabilities.signatureHelpProvider = false
client.server_capabilities.renameProvider = false
client.server_capabilities.typeDefinitionProvider = false
client.server_capabilities.workspaceSymbolProvider = false
client.server_capabilities.monikerProvider = false
client.server_capabilities.semanticTokensProvider = false
end
end,
},
} }

View File

@@ -15,5 +15,7 @@ return {
-- Icons can be configured throughout the interface -- Icons can be configured throughout the interface
icons = require "plugins.configs.ui.icons", icons = require "plugins.configs.ui.icons",
status = require "plugins.configs.ui.status", status = require "plugins.configs.ui.status",
lazygit = false,
}, },
} }

142
lua/plugins/cmp-plugins.lua Normal file
View File

@@ -0,0 +1,142 @@
-- return {
-- {
-- "onsails/lspkind.nvim",
-- opts = {
-- symbol_map = require "plugins.configs.ui.lspkind",
-- },
-- },
-- { "hrsh7th/cmp-cmdline", event = "CmdlineEnter" },
-- { "github/copilot.vim", event = "BufRead" },
-- { "hrsh7th/cmp-buffer", event = "BufRead" },
-- { "hrsh7th/cmp-path", event = "BufRead" },
-- {
-- "hrsh7th/nvim-cmp", event = "VimEnter", depedencies = {
-- "hrsh7th/cmp-nvim-lsp",
-- },
-- opts = function(_, opts)
-- local cmp = require "cmp"
-- local luasnip = require "luasnip"
-- local function has_words_before()
-- local line, col = (unpack or table.unpack)(vim.api.nvim_win_get_cursor(0))
-- return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil
-- end
-- cmp.config.sources {
-- { name = "nvim_lsp", priority = 1000 },
-- { name = "cmdline", priority = 800 },
-- { name = "path", priority = 250 },
-- }
-- -- `:` cmdline setup.
-- cmp.setup.cmdline(":", {
-- mapping = cmp.mapping.preset.cmdline {
-- ["<CR>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.confirm { select = true }
-- vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<CR>", true, true, true), "n", true)
-- else
-- fallback()
-- end
-- end, { "i", "c" }),
-- },
-- sources = cmp.config.sources({
-- { name = "path" },
-- }, {
-- {
-- name = "cmdline",
-- option = {
-- -- code for me options for processing command when press enter
-- ignore_cmds = {
-- "q",
-- "qa",
-- "qall",
-- "quitall",
-- "quit",
-- "wall",
-- "wq",
-- },
-- },
-- },
-- }),
-- })
-- return require("astrocore").extend_tbl(opts, {
-- -- Configure window style
-- window = {
-- completion = {
-- winhighlight = "Normal:Pmenu,CursorLine:PmenuSel,Search:None",
-- -- border = "none",
-- side_padding = 0,
-- },
-- },
-- formatting = {
-- -- Show icon at the beginning and menu at the end
-- fields = { "kind", "abbr", "menu" },
-- format = function(entry, vim_item)
-- local kind = require("lspkind").cmp_format { mode = "symbol_text", maxwidth = 50 }(entry, vim_item)
-- local strings = vim.split(kind.kind, "%s", { trimetry = true })
-- kind.kind = " " .. (strings[1] or "") .. " "
-- kind.menu = " [" .. (strings[2] or "") .. "]"
-- return kind
-- end,
-- },
-- -- Always select the first option
-- completion = {
-- completeopt = "menu,menuone,noinsert",
-- },
-- -- Custom mapping
-- mapping = {
-- -- Esc to close completion menu
-- ["<Esc>"] = cmp.mapping { i = cmp.mapping.abort(), c = cmp.mapping.close() },
-- -- Tab to select completion
-- ["<Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() and has_words_before() then
-- fallback()
-- else
-- fallback()
-- end
-- end, { "i", "s" }),
-- -- Use <C-n> and <C-p> to select luasnip
-- ["<C-n>"] = cmp.mapping(function(fallback)
-- if luasnip.jumpable(1) then
-- luasnip.jump(1)
-- else
-- fallback()
-- end
-- end, { "i", "s" }),
-- ["<C-p>"] = cmp.mapping(function(fallback)
-- if luasnip.jumpable(-1) then
-- luasnip.jump(-1)
-- else
-- fallback()
-- end
-- end, { "i", "s" }),
-- -- NOTE: disable tabl when using copilot PART2
-- vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true }),
-- -- ["<C-f>"] = cmp.mapping(function(fallback)
-- -- -- Check if Copilot is suggesting something
-- -- if vim.fn["copilot#Accept"]() ~= "" then
-- -- else
-- -- fallback() -- If no suggestion, fallback to default behavior
-- -- end
-- -- end, { "i", "s" }), -- Enable in insert and command-line mode
-- },
-- experimental = {
-- ghost_text = false, -- this feature conflict with copilot.vim's preview.
-- },
-- })
-- end,
-- },
-- }
return {}

View File

@@ -1,139 +1,185 @@
local function has_words_before()
local line, col = (unpack or table.unpack)(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
return { return {
{ {
"onsails/lspkind.nvim", "github/copilot.vim",
opts = { event = "BufRead",
symbol_map = require "plugins.configs.ui.lspkind", config = function()
}, vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true })
}, end,
{ "hrsh7th/cmp-cmdline", event = "CmdlineEnter" }, },
{ "github/copilot.vim", event = "BufRead" }, -- { "hrsh7th/cmp-buffer", event = "BufRead" },
{ "hrsh7th/cmp-buffer", event = "BufRead" }, -- { "hrsh7th/cmp-path", event = "BufRead" },
{ "hrsh7th/cmp-path", event = "BufRead" }, {
{ "onsails/lspkind.nvim",
"hrsh7th/nvim-cmp", opts = {
event = "VimEnter", symbol_map = require("plugins.configs.ui.lspkind"),
depedencies = { },
"hrsh7th/cmp-nvim-lsp", },
}, {
opts = function(_, opts) "saghen/blink.cmp",
local cmp = require "cmp" event = { "InsertEnter", "CmdlineEnter", "BufEnter" },
local luasnip = require "luasnip" version = "^1",
opts_extend = { "sources.default", "cmdline.sources", "term.sources" },
opts = {
-- remember to enable your providers here
sources = {
default = { "lsp", "path", "snippets", "buffer" },
},
keymap = {
["<C-Space>"] = { "show", "show_documentation", "hide_documentation" },
["<Up>"] = { "select_prev", "fallback" },
["<Down>"] = { "select_next", "fallback" },
["<C-N>"] = { "select_next", "show" },
["<C-P>"] = { "select_prev", "show" },
["<C-J>"] = { "select_next", "fallback" },
["<C-K>"] = { "select_prev", "fallback" },
["<C-U>"] = { "scroll_documentation_up", "fallback" },
["<C-D>"] = { "scroll_documentation_down", "fallback" },
["<C-e>"] = { "hide", "fallback" },
["<CR>"] = { "accept", "fallback" },
["<C-f>"] = false,
local function has_words_before() -- vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true }),
local line, col = (unpack or table.unpack)(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil
end
cmp.config.sources { ["<Tab>"] = {
{ name = "nvim_lsp", priority = 1000 }, "select_next",
{ name = "cmdline", priority = 800 }, "snippet_forward",
{ name = "path", priority = 250 }, function(cmp)
} if has_words_before() or vim.api.nvim_get_mode().mode == "c" then
return cmp.show()
end
end,
"fallback",
},
["<S-Tab>"] = {
"select_prev",
"snippet_backward",
function(cmp)
if vim.api.nvim_get_mode().mode == "c" then
return cmp.show()
end
end,
"fallback",
},
},
completion = {
list = { selection = { preselect = true, auto_insert = false } },
ghost_text = {
enabled = false,
},
menu = {
auto_show = function(ctx)
return ctx.mode ~= "cmdline"
end,
border = "rounded",
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
draw = {
treesitter = { "lsp" },
columns = {
{ "kind_icon", "label", gap = 1 },
{ "kind" },
},
components = {
kind = {
-- (optional) use highlights from mini.icons
highlight = function(ctx)
local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
return hl
end,
},
kind_icon = {
text = function(ctx)
local icon = ctx.kind_icon
if vim.tbl_contains({ "Path" }, ctx.source_name) then
local dev_icon, _ = require("nvim-web-devicons").get_icon(ctx.label)
if dev_icon then
icon = dev_icon
end
else
icon = require("lspkind").symbolic(ctx.kind, {
mode = "symbol",
})
end
-- `:` cmdline setup. return icon .. ctx.icon_gap
cmp.setup.cmdline(":", { end,
mapping = cmp.mapping.preset.cmdline { },
["<CR>"] = cmp.mapping(function(fallback) },
if cmp.visible() then },
cmp.confirm { select = true } },
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<CR>", true, true, true), "n", true) accept = {
else auto_brackets = { enabled = true },
fallback() },
end documentation = {
end, { "i", "c" }), auto_show = true,
}, auto_show_delay_ms = 0,
sources = cmp.config.sources({ window = {
{ name = "path" }, border = "rounded",
}, { winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
{ },
name = "cmdline", },
option = { },
-- code for me options for processing command when press enter signature = {
window = {
border = "rounded",
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder",
},
},
},
specs = {
{
"L3MON4D3/LuaSnip",
optional = true,
specs = { { "Saghen/blink.cmp", opts = { snippets = { preset = "luasnip" } } } },
},
{
"AstroNvim/astrolsp",
optional = true,
opts = function(_, opts)
opts.capabilities = require("blink.cmp").get_lsp_capabilities(opts.capabilities)
ignore_cmds = { -- disable AstroLSP signature help if `blink.cmp` is providing it
"q", local blink_opts = require("astrocore").plugin_opts("blink.cmp")
"qa", if vim.tbl_get(blink_opts, "signature", "enabled") == true then
"qall", if not opts.features then
"quitall", opts.features = {}
"quit", end
"wall", opts.features.signature_help = false
"wq", end
}, end,
}, },
}, {
}), "folke/lazydev.nvim",
}) optional = true,
specs = {
return require("astrocore").extend_tbl(opts, { {
-- Configure window style "Saghen/blink.cmp",
window = { opts = function(_, opts)
completion = { if pcall(require, "lazydev.integrations.blink") then
winhighlight = "Normal:Pmenu,CursorLine:PmenuSel,Search:None", return require("astrocore").extend_tbl(opts, {
-- border = "none", sources = {
side_padding = 0, -- add lazydev to your completion providers
}, default = { "lazydev" },
}, providers = {
formatting = { lazydev = {
-- Show icon at the beginning and menu at the end name = "LazyDev",
fields = { "kind", "abbr", "menu" }, module = "lazydev.integrations.blink",
format = function(entry, vim_item) score_offset = 100,
local kind = require("lspkind").cmp_format { mode = "symbol_text", maxwidth = 50 }(entry, vim_item) },
local strings = vim.split(kind.kind, "%s", { trimetry = true }) },
kind.kind = " " .. (strings[1] or "") .. " " },
kind.menu = " [" .. (strings[2] or "") .. "]" })
return kind end
end, end,
}, },
-- Always select the first option },
completion = { },
completeopt = "menu,menuone,noinsert", -- disable built in completion plugins
}, -- { "hrsh7th/cmp-cmdline", event = "CmdlineEnter" },
-- Custom mapping },
mapping = { },
-- Esc to close completion menu
["<Esc>"] = cmp.mapping { i = cmp.mapping.abort(), c = cmp.mapping.close() },
-- Tab to select completion
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() and has_words_before() then
fallback()
else
fallback()
end
end, { "i", "s" }),
-- Use <C-n> and <C-p> to select luasnip
["<C-n>"] = cmp.mapping(function(fallback)
if luasnip.jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { "i", "s" }),
["<C-p>"] = cmp.mapping(function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
-- NOTE: disable tabl when using copilot PART2
vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true }),
-- ["<C-f>"] = cmp.mapping(function(fallback)
-- -- Check if Copilot is suggesting something
-- if vim.fn["copilot#Accept"]() ~= "" then
-- else
-- fallback() -- If no suggestion, fallback to default behavior
-- end
-- end, { "i", "s" }), -- Enable in insert and command-line mode
},
experimental = {
ghost_text = false, -- this feature conflict with copilot.vim's preview.
},
})
end,
},
} }

View File

@@ -1,74 +1,38 @@
return { return {
before_init = function(_, c) before_init = function(_, c)
if not c.settings then c.settings = {} end if not c.settings then
if not c.settings.python then c.settings.python = {} end c.settings = {}
c.settings.python.pythonPath = vim.fn.exepath "python" end
end, if not c.settings.python then
settings = { c.settings.python = {}
basedpyright = { end
disableOrganizeImports = true, c.settings.python.pythonPath = vim.fn.exepath("python")
-- disableLanguageServices = true, end,
autoImportCompletions = false, settings = {
disableTaggedHints = true, basedpyright = {
useLibraryCodeForTypes = false, disableLanguageServices = false,
analysis = { disableOrganizeImports = true,
-- diagnosticMode = "workspace", disableTaggedHints = true,
diagnosticMode = "openFilesOnly",
typeCheckingMode = "basic",
autoImportCompletions = false,
autoSearchPath = false,
indexing = false,
inlayHints = {
variableTypes = true,
functionReturnTypes = false,
callArgumentNames = false,
pytestParameters = true,
},
useLibraryCodeForTypes = false,
deprecateTypingAliases = false,
enableReachabilityAnalysis = false,
strictListInference = true, analysis = {
strictDictionaryInference = true, autoSearchPath = false,
strictSetInference = true, logLevel = "Trace",
typeCheckingMode = "standard",
analyzeUnannotatedFunctions = false, deprecateTypingAliases = false,
-- ignore = { "**/*.py" }, inlayHints = {
reportGeneralTypeIssues = false, variableTypes = true,
diagnosticSeverityOverrides = { functionReturnTypes = true,
reportUnusedImport = false, callArgumentNames = true,
reportUnusedFunction = false, pytestParameters = true,
reportUnusedVariable = false, },
reportGeneralTypeIssues = false, ignore = {
reportOptionalMemberAccess = false, "unsloth_compiled_cache",
reportOptionalSubscript = false, "__pycache__",
reportPrivateImportUsage = false, "__index__",
reportInvalidStubStatement = false, },
reportIncompleteStub = false, useLibraryCodeForTypes = true,
reportArgumentType = false, },
reportAttributeAccessIssue = false, autoImportCompletions = false,
},
-- reportCallIssue = false, },
-- reportNoOverloadImplementation = false,
-- reportOverlappingOverload = false,
-- reportInconsistentOverload = false,
-- reportUnknownMemberType = false,
-- reportFunctionMemberAccess = false,
-- reportPropertyTypeMismatch = false,
-- reportMatchNotExhaustive = false,
-- reportInvalidTypeForm = false,
-- reportAbstractUsage = false,
-- reportAssertTypeFailure = false,
-- reportAssignmentType = false,
-- reportIndexIssue = false,
-- reportInvalidTypeArguments = false,
-- reportOperatorIssue = false,
-- reportOptionalCall = false,
-- reportOptionalIterable = false,
},
},
},
},
} }

View File

@@ -0,0 +1,30 @@
return {
init_options = {
completion = {
disableSnippets = true,
},
diagnostics = {
enable = false,
},
hover = {
enable = true,
},
workspace = {
environmentPath = "/home/duckq1u/miniconda3/envs/OCR3/bin/python",
ignore = {
"/home/duckq1u/miniconda3/envs/OCR3/lib/python3.11/site-packages/transformers/mode ls/albert/configuration_albert.py",
},
},
jediSettings = {
autoImportModules = {
"numpy",
"pandas",
"torch",
-- "torchmetrics",
-- "pytorch_lightning",
},
},
},
}

View File

@@ -0,0 +1,16 @@
return {
settings = {
pylsp = {
plugins = {
pyflakes = { enabled = false }, -- disable pyflakes
pycodestyle = { enabled = false }, -- disable pycodestyle
flake8 = { enabled = false }, -- disable flake8
yapf = { enabled = false }, -- disable yapf
mcabe = { enabled = false }, -- disable mccabe
pylsp_black = { enabled = false }, -- disable black
pylsp_mypy = { enabled = false }, -- disable mypy
pylsp_isort = { enabled = false }, -- disable isort
},
},
},
}

View File

@@ -0,0 +1,26 @@
return {
before_init = function(_, c)
if not c.settings then
c.settings = {}
end
if not c.settings.python then
c.settings.python = {}
end
c.settings.python.pythonPath = vim.fn.exepath("python")
end,
settings = {
pyright = {
disableLanguageServices = false,
disableOrganizeImports = true,
analysis = {
-- diagnosticMode = "openFilesOnly",
typeCheckingMode = "standard",
autoSearchPath = true,
-- diagnosticSeverityOverrides = false,
logLevel = "Trace",
},
},
-- python = {
-- },
},
}

View File

@@ -0,0 +1,56 @@
return {
init_options = {
settings = {
lint = {
unfixable = { "F401" },
select = {
"ALL",
},
ignore = {
"ANN",
"COM",
"C90",
"DJ",
"EXE",
"T10",
"TID",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D200",
"D205",
"D212",
"D400",
"D401",
"D415",
"E402",
"E501",
"ERA001",
"TRY003",
"TD002",
"TD003",
"T201",
"FIX002",
"N803",
"PD901",
-- "F401",
"I001",
"RET504",
"PLR2004",
"W291",
"PLW2901",
"D213",
"D202",
"PLR0402",
},
},
args = {},
},
},
}

View File

@@ -1,59 +1,59 @@
return { return {
-- LSP -- LSP
ActiveLSP = "", ActiveLSP = " ",
ActiveTS = "", ActiveTS = " ",
LSPLoaded = "", LSPLoaded = " ",
LSPLoading1 = "", LSPLoading1 = " ",
LSPLoading2 = "", LSPLoading2 = " ",
LSPLoading3 = "", LSPLoading3 = " ",
LSPLoading4 = "", LSPLoading4 = " ",
LSPLoading5 = "", LSPLoading5 = " ",
LSPLoading6 = "", LSPLoading6 = " ",
LSPLoading7 = "", LSPLoading7 = " ",
LSPLoading8 = "", LSPLoading8 = " ",
LSPLoading9 = "", LSPLoading9 = " ",
LSPLoading10 = "", LSPLoading10 = " ",
-- Git -- Git
Github = "", Github = " ",
GitAdd = "", GitAdd = " ",
GitBranch = "", GitBranch = " ",
GitChange = "", GitChange = " ",
GitConflict = "", GitConflict = " ",
GitDelete = "", GitDelete = " ",
GitIgnored = "", GitIgnored = " ",
GitRenamed = "", GitRenamed = " ",
GitStaged = "", GitStaged = " ",
GitUnstaged = "", GitUnstaged = " ",
GitUntracked = "", GitUntracked = " ",
Neogit = "", Neogit = " ",
-- Files -- Files
Ellipsis = "", Ellipsis = " ",
DefaultFile = "", DefaultFile = " ",
FileModified = "", FileModified = " ",
FileReadOnly = "", FileReadOnly = " ",
FoldClosed = "", FoldClosed = " ",
FoldOpened = "", FoldOpened = " ",
FolderClosed = "", FolderClosed = " ",
FolderEmpty = "", FolderEmpty = " ",
FolderOpen = "", FolderOpen = " ",
-- DAP -- DAP
DapBreakpoint = "", DapBreakpoint = " ",
DapBreakpointCondition = "", DapBreakpointCondition = " ",
DapBreakpointRejected = "", DapBreakpointRejected = " ",
DapLogPoint = "", DapLogPoint = " ",
DapStopped = "", DapStopped = " ",
-- Diagnostics -- Diagnostics
Diagnostic = " 󰒡 ", Diagnostic = " 󰒡 ",
DiagnosticError = "", DiagnosticError = " ",
DiagnosticHint = "", DiagnosticHint = " ",
DiagnosticInfo = "󰋼", DiagnosticInfo = "󰋼 ",
DiagnosticWarn = "", DiagnosticWarn = " ",
-- Misc -- Misc
Mode = "     ", Mode = "     ",
FileEncoding = "", FileEncoding = " ",
ScrollText = "", ScrollText = " ",
TabWidth = "", TabWidth = " ",
Search = "", Search = " ",
Grapple = "󰓹", Grapple = "󰓹 ",
Codeium = "󱚝", Codeium = "󱚝 ",
} }

View File

@@ -1,38 +1,38 @@
-- LSP kind symbol map -- LSP kind symbol map
return { return {
Array = "", Array = " ",
Boolean = "", Boolean = " ",
Class = "", Class = " ",
Color = "", Color = " ",
Constant = "", Constant = " ",
Constructor = "", Constructor = " ",
Enum = "", Enum = " ",
EnumMember = "", EnumMember = " ",
Event = "", Event = " ",
Field = "", Field = " ",
File = "", File = " ",
Folder = "", Folder = " ",
Function = "", Function = "",
Interface = "", Interface = " ",
Key = "", Key = " ",
Keyword = "󰌋", Keyword = "󰌋 ",
Method = "", Method = " ",
Module = "", Module = " ",
Namespace = "", Namespace = " ",
Null = "", Null = " ",
Number = "", Number = " ",
Object = "", Object = " ",
Operator = "", Operator = " ",
Package = "", Package = " ",
Property = "", Property = " ",
Reference = "", Reference = " ",
Snippet = "󰗀", Snippet = "󰗀 ",
String = "", String = " ",
Struct = "", Struct = " ",
Text = "󰉿", Text = "󰉿 ",
TypeParameter = "", TypeParameter = " ",
Unit = "", Unit = " ",
Value = "", Value = " ",
Variable = "", Variable = " ",
} }

View File

@@ -1,58 +1,61 @@
-- Plugins to disable -- Plugins to disable
return { return {
{ "s1n7ax/nvim-window-picker", enabled = false }, { "s1n7ax/nvim-window-picker", enabled = false },
{ "akinsho/toggleterm.nvim", enabled = false }, { "akinsho/toggleterm.nvim", enabled = false },
{ "NvChad/nvim-colorizer.lua", enabled = false }, { "NvChad/nvim-colorizer.lua", enabled = false },
{ "catppuccin/nvim", name = "catppuccin", enabled = false }, { "catppuccin/nvim", name = "catppuccin", enabled = false },
{ "rebelot/kanagawa.nvim", enabled = false }, { "rebelot/kanagawa.nvim", enabled = false },
{ "folke/tokyonight.nvim", enabled = false }, { "folke/tokyonight.nvim", enabled = false },
{ "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false }, { "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false },
{ "b0o/SchemaStore.nvim", enabled = false }, { "b0o/SchemaStore.nvim", enabled = false },
{ "ray-x/lsp_signature.nvim", enabled = false }, { "ray-x/lsp_signature.nvim", enabled = false },
{ "kmontocam/nvim-conda", enabled = false }, { "kmontocam/nvim-conda", enabled = false },
{ "NMAC427/guess-indent.nvim", enabled = false }, { "NMAC427/guess-indent.nvim", enabled = false },
{ "lukas-reineke/indent-blankline.nvim", enabled = false }, { "lukas-reineke/indent-blankline.nvim", enabled = false },
{ "AstroNvim/astrotheme", enabled = false }, { "AstroNvim/astrotheme", enabled = false },
{ "scottmckendry/cyberdream.nvim", enabled = false }, { "scottmckendry/cyberdream.nvim", enabled = false },
{ "xiyaowong/transparent.nvim", enabled = false }, { "xiyaowong/transparent.nvim", enabled = false },
{ "loctvl842/monokai-pro.nvim", enabled = false }, { "loctvl842/monokai-pro.nvim", enabled = false },
{ "xiyaowong/transparent.nvim", enabled = false }, { "xiyaowong/transparent.nvim", enabled = false },
{ "iamcco/markdown-preview.nvim", enabled = false }, { "iamcco/markdown-preview.nvim", enabled = false },
{ "max397574/better-escape.nvim", enabled = false }, { "max397574/better-escape.nvim", enabled = false },
{ "hinell/duplicate.nvim", enabled = false }, { "hinell/duplicate.nvim", enabled = false },
{ "CRAG666/code_runner.nvim", enabled = false }, { "CRAG666/code_runner.nvim", enabled = false },
{ "RRethy/vim-illuminate", enabled = false }, { "RRethy/vim-illuminate", enabled = false },
{ "OXY2DEV/markview.nvim", enabled = false }, -- { "OXY2DEV/markview.nvim", enabled = false },
{ "kevinhwang91/nvim-ufo", enabled = false }, { "kevinhwang91/nvim-ufo", enabled = false },
{ "echasnovski/mini.bufremove", enabled = false }, { "echasnovski/mini.bufremove", enabled = false },
-- System { "hrsh7th/nvim-cmp", enabled = false },
{ "nvim-treesitter/nvim-treesitter-textobjects", enabled = false }, { "rcarriga/cmp-dap", enabled = false },
-- Disable Dap
{ "mfussenegger/nvim-dap", enabled = false },
{ "theHamsta/nvim-dap-virtual-text", enabled = false },
{ "rcarriga/nvim-dap-ui", enabled = false },
{ "jay-babu/mason-nvim-dap.nvim", enabled = false },
{ "jay-babu/mason-null-ls.nvim", enabled = false },
{ "b0o/schemastore.nvim", enabled = false },
{ "Wansmer/treesj", enabled = false },
-- interface -- System
-- { "HiPhish/rainbow-delimiters.nvim", enabled = true }, { "nvim-treesitter/nvim-treesitter-textobjects", enabled = false },
{ "ribru17/bamboo.nvim", enabled = true }, -- Disable Dap
{ "mfussenegger/nvim-dap", enabled = false },
{ "theHamsta/nvim-dap-virtual-text", enabled = false },
{ "rcarriga/nvim-dap-ui", enabled = false },
{ "jay-babu/mason-nvim-dap.nvim", enabled = false },
-- { "jay-babu/mason-null-ls.nvim", enabled = false },
{ "b0o/schemastore.nvim", enabled = false },
{ "Wansmer/treesj", enabled = false },
-- service -- interface
{ "stevearc/resession.nvim", enabled = true }, -- { "HiPhish/rainbow-delimiters.nvim", enabled = true },
{ "echasnovski/mini.move", enabled = true }, { "ribru17/bamboo.nvim", enabled = true },
{ "nvim-neo-tree/neo-tree.nvim", enabled = true },
{ "folke/flash.nvim", enabled = true },
{ "github/copilot.vim", enabled = true },
{ "rafamadriz/friendly-snippets", enabled = false }, -- service
{ "JoosepAlviste/nvim-ts-context-commentstring", enabled = false }, { "stevearc/resession.nvim", enabled = true },
{ "windwp/nvim-ts-autotag", enabled = false }, { "echasnovski/mini.move", enabled = true },
{ "saadparwaiz1/cmp_luasnip", enabled = false }, { "nvim-neo-tree/neo-tree.nvim", enabled = true },
{ "L3MON4D3/LuaSnip", enabled = true }, { "folke/flash.nvim", enabled = true },
{ "github/copilot.vim", enabled = true },
{ "rafamadriz/friendly-snippets", enabled = false },
{ "JoosepAlviste/nvim-ts-context-commentstring", enabled = false },
{ "windwp/nvim-ts-autotag", enabled = false },
{ "saadparwaiz1/cmp_luasnip", enabled = false },
{ "L3MON4D3/LuaSnip", enabled = true },
} }
-- if true then return {} end -- if true then return {} end

View File

@@ -10,9 +10,10 @@ return {
-- add more things to the ensure_installed table protecting against community packs modifying it -- 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, { opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
"lua_ls", "lua_ls",
"jedi_language_server", -- "jedi_language_server",
"ruff", -- "ruff",
"basedpyright", "basedpyright",
-- NOTE: "ty" is not a valid server name, so use masoninstall to install the server
}) })
end, end,
}, },

View File

@@ -1,124 +1,130 @@
return { return {
"folke/noice.nvim", "folke/noice.nvim",
event = "VeryLazy", event = "VeryLazy",
dependencies = { "MunifTanjim/nui.nvim" }, dependencies = { "MunifTanjim/nui.nvim"},
config = function() config = function()
require("noice").setup({ require("noice").setup({
-- Configuration here, or leave empty to use defaults -- Configuration here, or leave empty to use defaults
views = {}, views = {},
messages = { messages = {
enabled = false, -- disables the Noice messages UI enabled = false, -- disables the Noice messages UI
}, },
notify = { notify = {
enabled = false, -- disables Noice notifications enabled = false, -- disables Noice notifications
}, },
lsp = { lsp = {
progress = { override = {
enabled = false, ["vim.lsp.util.convert_input_to_markdown_lines"] = false,
}, ["vim.lsp.util.stylize_markdown"] = false,
hover = { ["cmp.entry.get_documentation"] = false,
enabled = true, },
silent = true, progress = {
view = "hover", enabled = true,
opts = { },
border = { hover = {
style = "rounded", enabled = true,
text = { top = " Documents ", top_align = "center" }, silent = true,
}, view = "hover",
win_options = { opts = {
wrap = true, border = {
linebreak = true, style = "rounded",
}, text = { top = " Documents ", top_align = "center" },
}, },
}, win_options = {
signature = { wrap = true,
enabled = false, -- disables Noice LSP signature help linebreak = true,
}, },
message = { },
enabled = false, },
}, signature = {
}, enabled = false, -- disables Noice LSP signature help
presets = { },
bottom_search = false, -- use a classic bottom cmdline for search message = {
command_palette = true, -- position the cmdline and popupmenu together enabled = false,
long_message_to_split = false, -- long messages will be sent to a split },
inc_rename = false, -- enables an input dialog for inc-rename.nvim },
lsp_doc_border = false, -- add a border to hover docs and signature help
},
routes = { presets = {
-- disable "written" notification bottom_search = false, -- use a classic bottom cmdline for search
{ command_palette = true, -- position the cmdline and popupmenu together
filter = { event = "msg_show", kind = "", find = "written" }, long_message_to_split = false, -- long messages will be sent to a split
opts = { skip = true }, inc_rename = false, -- enables an input dialog for inc-rename.nvim
}, lsp_doc_border = false, -- add a border to hover docs and signature help
-- disable paste/undo notification },
{
filter = { event = "msg_show", find = "^%d+ more lines" }, routes = {
opts = { skip = true }, -- disable "written" notification
}, {
-- disable delete/undo notification filter = { event = "msg_show", kind = "", find = "written" },
{ opts = { skip = true },
filter = { event = "msg_show", find = "^%d+ fewer lines" }, },
opts = { skip = true }, -- disable paste/undo notification
}, {
-- disable yank notification filter = { event = "msg_show", find = "^%d+ more lines" },
{ opts = { skip = true },
filter = { event = "msg_show", find = "^%d+ lines yanked$" }, },
opts = { skip = true }, -- disable delete/undo notification
}, {
-- disable move notification filter = { event = "msg_show", find = "^%d+ fewer lines" },
{ opts = { skip = true },
filter = { event = "msg_show", find = "^%d+ lines moved$" }, },
}, -- disable yank notification
}, {
}) filter = { event = "msg_show", find = "^%d+ lines yanked$" },
end, opts = { skip = true },
specs = { },
{ -- disable move notification
"nvim-treesitter/nvim-treesitter", {
opts = function(_, opts) filter = { event = "msg_show", find = "^%d+ lines moved$" },
if opts.ensure_installed ~= "all" then },
opts.ensure_installed = require("astrocore").list_insert_unique( },
opts.ensure_installed, })
{ "bash", "markdown", "markdown_inline", "regex", "vim" } end,
) specs = {
end {
end, "nvim-treesitter/nvim-treesitter",
}, opts = function(_, opts)
{ if opts.ensure_installed ~= "all" then
"AstroNvim/astrolsp", opts.ensure_installed = require("astrocore").list_insert_unique(
optional = true, opts.ensure_installed,
---@param opts AstroLSPOpts { "bash", "markdown", "markdown_inline", "regex", "vim", "latex", "bibtex" }
opts = function(_, opts) )
-- No need to manage lsp_handlers as noice is not handling them now end
end, end,
}, },
{ {
"heirline.nvim", "AstroNvim/astrolsp",
optional = true, optional = true,
opts = function(_, opts) ---@param opts AstroLSPOpts
local noice_opts = require("astrocore").plugin_opts("noice.nvim") opts = function(_, opts)
if vim.tbl_get(noice_opts, "lsp", "progress", "enabled") ~= false then -- check if lsp progress is enabled -- No need to manage lsp_handlers as noice is not handling them now
opts.statusline[9] = require("astroui.status").component.lsp({ lsp_progress = false }) end,
end },
end, {
}, "heirline.nvim",
{ optional = true,
"folke/edgy.nvim", opts = function(_, opts)
optional = true, local noice_opts = require("astrocore").plugin_opts("noice.nvim")
opts = function(_, opts) if vim.tbl_get(noice_opts, "lsp", "progress", "enabled") ~= false then -- check if lsp progress is enabled
if not opts.bottom then opts.statusline[9] = require("astroui.status").component.lsp({ lsp_progress = false })
opts.bottom = {} end
end end,
table.insert(opts.bottom, { },
ft = "noice", {
size = { height = 0.4 }, "folke/edgy.nvim",
filter = function(_, win) optional = true,
return vim.api.nvim_win_get_config(win).relative == "" opts = function(_, opts)
end, if not opts.bottom then
}) opts.bottom = {}
end, end
}, table.insert(opts.bottom, {
}, ft = "noice",
size = { height = 0.4 },
filter = function(_, win)
return vim.api.nvim_win_get_config(win).relative == ""
end,
})
end,
},
},
} }

View File

@@ -1,87 +1,87 @@
return { return {
{ -- {
{ -- {
"rcarriga/nvim-dap-ui", -- "rcarriga/nvim-dap-ui",
requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, -- requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
opts = { -- opts = {
eval = true, -- eval = true,
mappings = { -- mappings = {
edit = "e", -- edit = "e",
expand = { "<CR>", "<2-LeftMouse>" }, -- expand = { "<CR>", "<2-LeftMouse>" },
open = "o", -- open = "o",
remove = "d", -- remove = "d",
repl = "r", -- repl = "r",
toggle = "t", -- toggle = "t",
}, -- },
layouts = { -- layouts = {
{ -- {
elements = { -- elements = {
{ -- {
id = "repl", -- id = "repl",
size = 0.5, -- size = 0.5,
}, -- },
{ -- {
id = "console", -- id = "console",
size = 0.5, -- size = 0.5,
}, -- },
}, -- },
position = "left", -- position = "left",
size = 40, -- size = 40,
}, -- },
{ -- {
elements = { -- elements = {
{ -- {
id = "scopes", -- id = "scopes",
size = 0.25, -- size = 0.25,
}, -- },
{ -- {
id = "breakpoints", -- id = "breakpoints",
size = 0.25, -- size = 0.25,
}, -- },
-- { -- -- {
-- id = "stacks", -- -- id = "stacks",
-- size = 0.25, -- -- size = 0.25,
-- }, -- -- },
}, -- },
position = "bottom", -- position = "bottom",
size = 8, -- size = 8,
}, -- },
}, -- },
}, -- },
config = function(_, opts) -- config = function(_, opts)
local dap = require("dap") -- local dap = require("dap")
local dapui = require("dapui") -- local dapui = require("dapui")
-- Initialize dap-ui -- -- Initialize dap-ui
dapui.setup(opts) -- dapui.setup(opts)
-- Prevent UI from closing when debugging session ends -- -- Prevent UI from closing when debugging session ends
dap.listeners.after.event_terminated["dapui"] = function() -- dap.listeners.after.event_terminated["dapui"] = function()
-- Do nothing, keeping the UI open -- -- Do nothing, keeping the UI open
end -- end
dap.listeners.after.event_exited["dapui"] = function() -- dap.listeners.after.event_exited["dapui"] = function()
-- Do nothing, keeping the UI open -- -- Do nothing, keeping the UI open
end -- end
-- Optionally, open dap-ui when session starts -- -- Optionally, open dap-ui when session starts
dap.listeners.after.event_initialized["dapui"] = function() -- dap.listeners.after.event_initialized["dapui"] = function()
dapui.open() -- dapui.open()
end -- end
end, -- end,
}, -- },
{ -- {
"theHamsta/nvim-dap-virtual-text", -- "theHamsta/nvim-dap-virtual-text",
event = "User AstroFile", -- event = "User AstroFile",
opts = { -- opts = {
commented = false, -- commented = false,
enabled = true, -- enabled = true,
enabled_commands = true, -- enabled_commands = true,
show_stop_reason = true, -- show_stop_reason = true,
virt_text_pos = "eol", -- virt_text_pos = "eol",
}, -- },
}, -- },
}, -- },
{ {
"chrisgrieser/nvim-lsp-endhints", "chrisgrieser/nvim-lsp-endhints",
event = "LspAttach", event = "LspAttach",
@@ -93,7 +93,7 @@ return {
unknown = "", -- hint kind is nil unknown = "", -- hint kind is nil
}, },
label = { label = {
truncateAtChars = 20, truncateAtChars = 100,
padding = 1, padding = 1,
marginLeft = 0, marginLeft = 0,
sameKindSeparator = ", ", sameKindSeparator = ", ",

View File

@@ -2,27 +2,33 @@
---@type LazySpec ---@type LazySpec
return { return {
"nvim-treesitter/nvim-treesitter", {
opts = function(_, opts) "nvim-treesitter/nvim-treesitter",
-- add more things to the ensure_installed table protecting against community packs modifying it dependencies = {},
opts.ignore_install = { "help" } opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { -- add more things to the ensure_installed table protecting against community packs modifying it
-- "lua", opts.ignore_install = { "help" }
-- "c", opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
-- "cpp", -- "lua",
"python", -- "c",
-- "javascript", -- "cpp",
}) "python",
opts.highlight = { "latex",
enable = true, "bibtex",
disable = { "c", "rust", "tsx", "javascript" }, -- "javascript",
additional_vim_regex_highlighting = false, })
custom_captures = {
-- Highlight local variables
["variable.local"] = "Identifier",
},
}
vim.api.nvim_set_hl(0, "Identifier", { fg = "#55ffff" }) opts.highlight = {
end, enable = true,
disable = { "c", "rust", "tsx", "javascript" },
additional_vim_regex_highlighting = false,
custom_captures = {
-- Highlight local variables
["variable.local"] = "Identifier",
},
}
vim.api.nvim_set_hl(0, "Identifier", { fg = "#55ffff" })
end,
},
} }

View File

@@ -87,7 +87,7 @@ return {
-- signs = false, -- configure signs for some keywords individually -- signs = false, -- configure signs for some keywords individually
}, },
TODO = { icon = "", color = "info" }, TODO = { icon = "", color = "info" },
GOAL = { icon = "", color = "info" }, GOAL = { icon = "", color = "info", alt = { "GOALS", "TARGETS", "FIXED" } },
HACK = { icon = "", color = "warning" }, HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } }, WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },

6
package-lock.json generated Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "nvim",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}

1
package.json Normal file
View File

@@ -0,0 +1 @@
{}