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 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",
@@ -12,16 +13,17 @@ vim.opt.rtp:prepend(lazypath)
if not pcall(require, "lazy") then
-- stylua: ignore
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.cmd.quit()
end
-- NOTE: ENV
-- Disable Copilot tab mapping
vim.g.copilot_no_tab_map = true
require("lazy_setup")
require("polish")
require("core.lsp")

View File

@@ -4,7 +4,7 @@
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
"aerial.nvim": { "branch": "master", "commit": "3284a2cb858ba009c79da87d5e010ccee3c99c4d" },
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
"astrocommunity": { "branch": "main", "commit": "b3ed1de31b0109b28668385336f84dc60c792de3" },
"astrocommunity": { "branch": "main", "commit": "8930cf06505230b710001f625052bcbc1bba04a5" },
"astrocore": { "branch": "main", "commit": "44a3dc0bf1591022b2a6bc89dccdfac1be17bec9" },
"astrolsp": { "branch": "main", "commit": "909fbe64f3f87d089ff3777751261544557117cc" },
"astrotheme": { "branch": "main", "commit": "41b7d8430a55fd771e41bd763af4c3fd1c2fc0b5" },
@@ -12,11 +12,8 @@
"auto-save.nvim": { "branch": "main", "commit": "37c82fd548e3f5ffc2d9d020a65dac1044584f44" },
"bamboo.nvim": { "branch": "master", "commit": "ab8393d1a314d96314605369b4b1e6bc7737f2b5" },
"better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" },
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
"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" },
"code_runner.nvim": { "branch": "main", "commit": "65218f8f646fe61e506090522df357539642ae83" },
"copilot.vim": { "branch": "release", "commit": "51f80c0ed4f70d1c7e8c0ff11a792a9d84502c03" },
@@ -35,7 +32,6 @@
"lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"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": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
@@ -57,18 +53,17 @@
"nvim-dap": { "branch": "master", "commit": "6a5bba0ddea5d419a783e170c20988046376090d" },
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-highlight-colors": { "branch": "main", "commit": "b42a5ccec7457b44e89f7ed3b3afb1b375bb2093" },
"nvim-lsp-endhints": { "branch": "main", "commit": "7917c7af1ec345ca9b33e8dbcd3723fc15d023c0" },
"nvim-lsp-endhints": { "branch": "main", "commit": "0bd03846561f46d8b7d2284a02d3748c3d35621b" },
"nvim-lspconfig": { "branch": "master", "commit": "185b2af444b27d6541c02d662b5b68190e5cf0c4" },
"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-context": { "branch": "master", "commit": "6853ecb2cd8b062365da1cdd1a2e6f934ad55ed6" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" },
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"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" },
"resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" },
"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.json" },
-- { import = "astrocommunity.pack.markdown" },
{ import = "astrocommunity.color.nvim-highlight-colors" },
-- { import = "astrocommunity.color.nvim-highlight-colors" },
{ import = "astrocommunity.diagnostics.trouble-nvim" },
-- { import = "astrocommunity.neovim-lua-development.lazydev-nvim" },
}

View File

@@ -4,6 +4,10 @@ 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("clear_last_search", { clear = true })
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, "LspReferenceWrite", { fg = "#FF0000" })
@@ -37,3 +41,4 @@ vim.api.nvim_create_autocmd("BufWinEnter", {
pattern = "*",
command = "let @/ = ''",
})

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

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

View File

@@ -1,7 +1,6 @@
-- Configuration documentation can be found with `:h astrolsp`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
-- as this provides autocomplete and documentation while editing
---@type LazySpec
return {
"AstroNvim/astrolsp",
@@ -10,103 +9,30 @@ return {
-- 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
codelens = true, -- enable/disable codelens refresh on start
inlay_hints = false, -- enable/disable inlay hints on start
semantic_tokens = true, -- enable/disable semantic token highlighting
},
-- customize lsp formatting options
formatting = 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"),
jedi_language_server = {
init_options = {
completion = {
disableSnippets = true,
},
diagnostics = {
enable = true,
},
jediSettings = {
autoImportModules = {
"numpy",
"pandas",
"torch",
"sklearn",
},
},
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 = {
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",
"PLR0402",
},
},
args = {},
},
},
},
jedi_language_server = require("plugins.configs.lsp.config.jedi_language"),
pyright = require("plugins.configs.lsp.config.pyright"),
ruff = require("plugins.configs.lsp.config.ruff"),
pylsp = require("plugins.configs.lsp.config.pylsp"),
},
-- 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
-- config Ty
-- the key is the server that is being setup with `lspconfig`
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
@@ -210,13 +136,48 @@ 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
if client.name == "ruff" then
client.server_capabilities.hoverProvider = false
end
-- if client.name == "pyright" then
-- -- disable pyright analysis features
-- client.server_capabilities.documentFormattingProvider = false
-- client.server_capabilities.hoverProvider = false
-- end
-- Disable completion feature of pyright
if client.name == "ty" then
client.server_capabilities.completionProvider = false
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 = require "plugins.configs.ui.icons",
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 {
{
"github/copilot.vim",
event = "BufRead",
config = function()
vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true })
end,
},
-- { "hrsh7th/cmp-buffer", event = "BufRead" },
-- { "hrsh7th/cmp-path", event = "BufRead" },
{
"onsails/lspkind.nvim",
opts = {
symbol_map = require "plugins.configs.ui.lspkind",
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",
"saghen/blink.cmp",
event = { "InsertEnter", "CmdlineEnter", "BufEnter" },
version = "^1",
opts_extend = { "sources.default", "cmdline.sources", "term.sources" },
opts = {
-- remember to enable your providers here
sources = {
default = { "lsp", "path", "snippets", "buffer" },
},
opts = function(_, opts)
local cmp = require "cmp"
local luasnip = require "luasnip"
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()
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
-- vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true }),
["<Tab>"] = {
"select_next",
"snippet_forward",
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
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",
},
},
},
}),
icon = require("lspkind").symbolic(ctx.kind, {
mode = "symbol",
})
end
return require("astrocore").extend_tbl(opts, {
-- Configure window style
return icon .. ctx.icon_gap
end,
},
},
},
},
accept = {
auto_brackets = { enabled = true },
},
documentation = {
auto_show = true,
auto_show_delay_ms = 0,
window = {
completion = {
winhighlight = "Normal:Pmenu,CursorLine:PmenuSel,Search:None",
-- border = "none",
side_padding = 0,
border = "rounded",
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
},
},
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
},
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)
-- disable AstroLSP signature help if `blink.cmp` is providing it
local blink_opts = require("astrocore").plugin_opts("blink.cmp")
if vim.tbl_get(blink_opts, "signature", "enabled") == true then
if not opts.features then
opts.features = {}
end
opts.features.signature_help = false
end
end,
},
-- Always select the first option
completion = {
completeopt = "menu,menuone,noinsert",
{
"folke/lazydev.nvim",
optional = true,
specs = {
{
"Saghen/blink.cmp",
opts = function(_, opts)
if pcall(require, "lazydev.integrations.blink") then
return require("astrocore").extend_tbl(opts, {
sources = {
-- add lazydev to your completion providers
default = { "lazydev" },
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
score_offset = 100,
},
-- 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
end,
},
},
},
-- disable built in completion plugins
-- { "hrsh7th/cmp-cmdline", event = "CmdlineEnter" },
},
},
}

View File

@@ -1,74 +1,38 @@
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"
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 = {
basedpyright = {
disableLanguageServices = false,
disableOrganizeImports = true,
-- disableLanguageServices = true,
autoImportCompletions = false,
disableTaggedHints = true,
useLibraryCodeForTypes = false,
analysis = {
-- diagnosticMode = "workspace",
diagnosticMode = "openFilesOnly",
typeCheckingMode = "basic",
autoImportCompletions = false,
autoSearchPath = false,
indexing = false,
logLevel = "Trace",
typeCheckingMode = "standard",
deprecateTypingAliases = false,
inlayHints = {
variableTypes = true,
functionReturnTypes = false,
callArgumentNames = false,
functionReturnTypes = true,
callArgumentNames = true,
pytestParameters = true,
},
useLibraryCodeForTypes = false,
deprecateTypingAliases = false,
enableReachabilityAnalysis = false,
strictListInference = true,
strictDictionaryInference = true,
strictSetInference = true,
analyzeUnannotatedFunctions = false,
-- ignore = { "**/*.py" },
reportGeneralTypeIssues = false,
diagnosticSeverityOverrides = {
reportUnusedImport = false,
reportUnusedFunction = false,
reportUnusedVariable = false,
reportGeneralTypeIssues = false,
reportOptionalMemberAccess = false,
reportOptionalSubscript = false,
reportPrivateImportUsage = false,
reportInvalidStubStatement = false,
reportIncompleteStub = false,
reportArgumentType = false,
reportAttributeAccessIssue = 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,
ignore = {
"unsloth_compiled_cache",
"__pycache__",
"__index__",
},
useLibraryCodeForTypes = true,
},
autoImportCompletions = 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

@@ -3,27 +3,27 @@ return {
Array = "",
Boolean = "",
Class = "",
Color = "",
Color = " ",
Constant = "",
Constructor = "",
Enum = "",
EnumMember = " ",
Event = "",
Field = "",
File = "",
File = " ",
Folder = "",
Function = "",
Function = "",
Interface = "",
Key = " ",
Keyword = "󰌋 ",
Method = "",
Module = "",
Method = " ",
Module = " ",
Namespace = "",
Null = "",
Number = "",
Object = "",
Operator = "",
Package = "",
Package = " ",
Property = "",
Reference = "",
Snippet = "󰗀 ",

View File

@@ -22,10 +22,13 @@ return {
{ "hinell/duplicate.nvim", enabled = false },
{ "CRAG666/code_runner.nvim", enabled = false },
{ "RRethy/vim-illuminate", enabled = false },
{ "OXY2DEV/markview.nvim", enabled = false },
-- { "OXY2DEV/markview.nvim", enabled = false },
{ "kevinhwang91/nvim-ufo", enabled = false },
{ "echasnovski/mini.bufremove", enabled = false },
{ "hrsh7th/nvim-cmp", enabled = false },
{ "rcarriga/cmp-dap", enabled = false },
-- System
{ "nvim-treesitter/nvim-treesitter-textobjects", enabled = false },
-- Disable Dap
@@ -33,7 +36,7 @@ return {
{ "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 },
-- { "jay-babu/mason-null-ls.nvim", enabled = false },
{ "b0o/schemastore.nvim", enabled = false },
{ "Wansmer/treesj", enabled = false },

View File

@@ -10,9 +10,10 @@ return {
-- 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, {
"lua_ls",
"jedi_language_server",
"ruff",
-- "jedi_language_server",
-- "ruff",
"basedpyright",
-- NOTE: "ty" is not a valid server name, so use masoninstall to install the server
})
end,
},

View File

@@ -13,8 +13,13 @@ return {
enabled = false, -- disables Noice notifications
},
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = false,
["vim.lsp.util.stylize_markdown"] = false,
["cmp.entry.get_documentation"] = false,
},
progress = {
enabled = false,
enabled = true,
},
hover = {
enabled = true,
@@ -38,6 +43,7 @@ return {
enabled = false,
},
},
presets = {
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
@@ -81,7 +87,7 @@ return {
if opts.ensure_installed ~= "all" then
opts.ensure_installed = require("astrocore").list_insert_unique(
opts.ensure_installed,
{ "bash", "markdown", "markdown_inline", "regex", "vim" }
{ "bash", "markdown", "markdown_inline", "regex", "vim", "latex", "bibtex" }
)
end
end,

View File

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

View File

@@ -2,7 +2,9 @@
---@type LazySpec
return {
{
"nvim-treesitter/nvim-treesitter",
dependencies = {},
opts = function(_, opts)
-- add more things to the ensure_installed table protecting against community packs modifying it
opts.ignore_install = { "help" }
@@ -11,8 +13,11 @@ return {
-- "c",
-- "cpp",
"python",
"latex",
"bibtex",
-- "javascript",
})
opts.highlight = {
enable = true,
disable = { "c", "rust", "tsx", "javascript" },
@@ -25,4 +30,5 @@ return {
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
},
TODO = { icon = "", color = "info" },
GOAL = { icon = "", color = "info" },
GOAL = { icon = "", color = "info", alt = { "GOALS", "TARGETS", "FIXED" } },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
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 @@
{}