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,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("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" })
-- vim.api.nvim_set_hl(0, "LspReferenceText", { fg = "#FF0000" })
vim.api.nvim_create_autocmd("BufEnter", {
desc = "Disable auto insert comment newline",
group = "disable_comment_newline",
command = "set formatoptions-=cro",
desc = "Disable auto insert comment newline",
group = "disable_comment_newline",
command = "set formatoptions-=cro",
})
vim.api.nvim_create_autocmd("FileType", {
desc = "Enable wrap and spell for text like documents",
group = "auto_wrap",
pattern = { "gitcommit", "markdown", "text", "plaintext" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
desc = "Enable wrap and spell for text like documents",
group = "auto_wrap",
pattern = { "gitcommit", "markdown", "text", "plaintext" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
vim.api.nvim_create_autocmd("BufEnter", {
desc = "Remap <C-z> to nothing so that it doesn't suspend terminal",
group = "disable_suspend_with_c_z",
command = "nnoremap <c-z> <nop>",
desc = "Remap <C-z> to nothing so that it doesn't suspend terminal",
group = "disable_suspend_with_c_z",
command = "nnoremap <c-z> <nop>",
})
vim.api.nvim_create_autocmd("BufWinEnter", {
desc = "Clear last search pattern",
group = "clear_last_search",
pattern = "*",
command = "let @/ = ''",
desc = "Clear last search pattern",
group = "clear_last_search",
pattern = "*",
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`
-- 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",
---@type AstroLSPOpts
opts = {
-- Configuration table of features provided by AstroLSP
features = {
autoformat = false, -- enable or disable auto formatting on start
codelens = false, -- enable/disable codelens refresh on start
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"),
"AstroNvim/astrolsp",
---@type AstroLSPOpts
opts = {
-- Configuration table of features provided by AstroLSP
features = {
autoformat = false, -- enable or disable auto formatting on start
codelens = true, -- enable/disable codelens refresh on start
inlay_hints = false, -- enable/disable inlay hints on start
semantic_tokens = true, -- enable/disable semantic token highlighting
},
-- customize lsp formatting options
formatting = require("plugins.configs.lsp.formatting"),
-- enable servers that you already have installed without mason
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" },
},
},
},
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 = 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
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",
},
},
-- the key is the server that is being setup with `lspconfig`
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
},
-- Configure buffer local auto commands to add when attaching a language server
autocmds = {
-- first key is the `augroup` to add the auto commands to (:h augroup)
lsp_document_highlight = {
-- Optional condition to create/delete auto command group
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
-- condition will be resolved for each client on each execution and if it ever fails for all clients,
-- the auto commands will be deleted for that buffer
cond = "textDocument/documentHighlight",
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
-- list of auto commands to set
{
-- events to trigger
event = { "CursorHold", "CursorHoldI" },
-- the rest of the autocmd options (:h nvim_create_autocmd)
desc = "Document Highlighting",
callback = function()
vim.lsp.buf.document_highlight()
end,
},
{
event = { "CursorMoved", "CursorMovedI", "BufLeave" },
desc = "Document Highlighting Clear",
callback = function()
vim.lsp.buf.clear_references()
end,
},
},
-- 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" then
client.server_capabilities.hoverProvider = false
end
args = {},
},
},
},
},
-- 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
-- if client.name == "pyright" then
-- -- disable pyright analysis features
-- client.server_capabilities.documentFormattingProvider = false
-- client.server_capabilities.hoverProvider = false
-- the key is the server that is being setup with `lspconfig`
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
},
-- Configure buffer local auto commands to add when attaching a language server
autocmds = {
-- first key is the `augroup` to add the auto commands to (:h augroup)
lsp_document_highlight = {
-- Optional condition to create/delete auto command group
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
-- condition will be resolved for each client on each execution and if it ever fails for all clients,
-- the auto commands will be deleted for that buffer
cond = "textDocument/documentHighlight",
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
-- list of auto commands to set
{
-- events to trigger
event = { "CursorHold", "CursorHoldI" },
-- the rest of the autocmd options (:h nvim_create_autocmd)
desc = "Document Highlighting",
callback = function()
vim.lsp.buf.document_highlight()
end,
},
{
event = { "CursorMoved", "CursorMovedI", "BufLeave" },
desc = "Document Highlighting Clear",
callback = function()
vim.lsp.buf.clear_references()
end,
},
},
-- 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
-- end
-- Disable completion feature of pyright
if client.name == "basedpyright" then
client.server_capabilities.completionProvider = false
end
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 {
{
"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"
{
"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"),
},
},
{
"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" },
},
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
end
-- vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true }),
cmp.config.sources {
{ name = "nvim_lsp", priority = 1000 },
{ name = "cmdline", priority = 800 },
{ name = "path", priority = 250 },
}
["<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
else
icon = require("lspkind").symbolic(ctx.kind, {
mode = "symbol",
})
end
-- `:` 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
return icon .. ctx.icon_gap
end,
},
},
},
},
accept = {
auto_brackets = { enabled = true },
},
documentation = {
auto_show = true,
auto_show_delay_ms = 0,
window = {
border = "rounded",
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
},
},
},
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 = {
"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,
},
-- 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,
},
{
"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,
},
},
},
})
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"
end,
settings = {
basedpyright = {
disableOrganizeImports = true,
-- disableLanguageServices = true,
autoImportCompletions = false,
disableTaggedHints = true,
useLibraryCodeForTypes = false,
analysis = {
-- diagnosticMode = "workspace",
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,
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 = {
basedpyright = {
disableLanguageServices = false,
disableOrganizeImports = true,
disableTaggedHints = true,
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,
},
},
},
},
analysis = {
autoSearchPath = false,
logLevel = "Trace",
typeCheckingMode = "standard",
deprecateTypingAliases = false,
inlayHints = {
variableTypes = true,
functionReturnTypes = true,
callArgumentNames = true,
pytestParameters = true,
},
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

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

View File

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

View File

@@ -1,58 +1,61 @@
-- Plugins to disable
return {
{ "s1n7ax/nvim-window-picker", enabled = false },
{ "akinsho/toggleterm.nvim", enabled = false },
{ "NvChad/nvim-colorizer.lua", enabled = false },
{ "catppuccin/nvim", name = "catppuccin", enabled = false },
{ "rebelot/kanagawa.nvim", enabled = false },
{ "folke/tokyonight.nvim", enabled = false },
{ "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false },
{ "b0o/SchemaStore.nvim", enabled = false },
{ "ray-x/lsp_signature.nvim", enabled = false },
{ "kmontocam/nvim-conda", enabled = false },
{ "NMAC427/guess-indent.nvim", enabled = false },
{ "lukas-reineke/indent-blankline.nvim", enabled = false },
{ "AstroNvim/astrotheme", enabled = false },
{ "scottmckendry/cyberdream.nvim", enabled = false },
{ "xiyaowong/transparent.nvim", enabled = false },
{ "loctvl842/monokai-pro.nvim", enabled = false },
{ "xiyaowong/transparent.nvim", enabled = false },
{ "iamcco/markdown-preview.nvim", enabled = false },
{ "max397574/better-escape.nvim", enabled = false },
{ "hinell/duplicate.nvim", enabled = false },
{ "CRAG666/code_runner.nvim", enabled = false },
{ "RRethy/vim-illuminate", enabled = false },
{ "OXY2DEV/markview.nvim", enabled = false },
{ "kevinhwang91/nvim-ufo", enabled = false },
{ "echasnovski/mini.bufremove", enabled = false },
{ "s1n7ax/nvim-window-picker", enabled = false },
{ "akinsho/toggleterm.nvim", enabled = false },
{ "NvChad/nvim-colorizer.lua", enabled = false },
{ "catppuccin/nvim", name = "catppuccin", enabled = false },
{ "rebelot/kanagawa.nvim", enabled = false },
{ "folke/tokyonight.nvim", enabled = false },
{ "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false },
{ "b0o/SchemaStore.nvim", enabled = false },
{ "ray-x/lsp_signature.nvim", enabled = false },
{ "kmontocam/nvim-conda", enabled = false },
{ "NMAC427/guess-indent.nvim", enabled = false },
{ "lukas-reineke/indent-blankline.nvim", enabled = false },
{ "AstroNvim/astrotheme", enabled = false },
{ "scottmckendry/cyberdream.nvim", enabled = false },
{ "xiyaowong/transparent.nvim", enabled = false },
{ "loctvl842/monokai-pro.nvim", enabled = false },
{ "xiyaowong/transparent.nvim", enabled = false },
{ "iamcco/markdown-preview.nvim", enabled = false },
{ "max397574/better-escape.nvim", enabled = false },
{ "hinell/duplicate.nvim", enabled = false },
{ "CRAG666/code_runner.nvim", enabled = false },
{ "RRethy/vim-illuminate", enabled = false },
-- { "OXY2DEV/markview.nvim", enabled = false },
{ "kevinhwang91/nvim-ufo", enabled = false },
{ "echasnovski/mini.bufremove", enabled = false },
-- System
{ "nvim-treesitter/nvim-treesitter-textobjects", 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 },
{ "hrsh7th/nvim-cmp", enabled = false },
{ "rcarriga/cmp-dap", enabled = false },
-- interface
-- { "HiPhish/rainbow-delimiters.nvim", enabled = true },
{ "ribru17/bamboo.nvim", enabled = true },
-- System
{ "nvim-treesitter/nvim-treesitter-textobjects", 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 },
-- service
{ "stevearc/resession.nvim", enabled = true },
{ "echasnovski/mini.move", enabled = true },
{ "nvim-neo-tree/neo-tree.nvim", enabled = true },
{ "folke/flash.nvim", enabled = true },
{ "github/copilot.vim", enabled = true },
-- interface
-- { "HiPhish/rainbow-delimiters.nvim", enabled = true },
{ "ribru17/bamboo.nvim", 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 },
-- service
{ "stevearc/resession.nvim", enabled = true },
{ "echasnovski/mini.move", 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 },
{ "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

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

@@ -1,124 +1,130 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
dependencies = { "MunifTanjim/nui.nvim" },
config = function()
require("noice").setup({
-- Configuration here, or leave empty to use defaults
views = {},
messages = {
enabled = false, -- disables the Noice messages UI
},
notify = {
enabled = false, -- disables Noice notifications
},
lsp = {
progress = {
enabled = false,
},
hover = {
enabled = true,
silent = true,
view = "hover",
opts = {
border = {
style = "rounded",
text = { top = " Documents ", top_align = "center" },
},
win_options = {
wrap = true,
linebreak = true,
},
},
},
signature = {
enabled = false, -- disables Noice LSP signature help
},
message = {
enabled = false,
},
},
presets = {
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
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
},
"folke/noice.nvim",
event = "VeryLazy",
dependencies = { "MunifTanjim/nui.nvim"},
config = function()
require("noice").setup({
-- Configuration here, or leave empty to use defaults
views = {},
messages = {
enabled = false, -- disables the Noice messages UI
},
notify = {
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 = true,
},
hover = {
enabled = true,
silent = true,
view = "hover",
opts = {
border = {
style = "rounded",
text = { top = " Documents ", top_align = "center" },
},
win_options = {
wrap = true,
linebreak = true,
},
},
},
signature = {
enabled = false, -- disables Noice LSP signature help
},
message = {
enabled = false,
},
},
routes = {
-- disable "written" notification
{
filter = { event = "msg_show", kind = "", find = "written" },
opts = { skip = true },
},
-- disable paste/undo notification
{
filter = { event = "msg_show", find = "^%d+ more lines" },
opts = { skip = true },
},
-- disable delete/undo notification
{
filter = { event = "msg_show", find = "^%d+ fewer lines" },
opts = { skip = true },
},
-- disable yank notification
{
filter = { event = "msg_show", find = "^%d+ lines yanked$" },
opts = { skip = true },
},
-- disable move notification
{
filter = { event = "msg_show", find = "^%d+ lines moved$" },
},
},
})
end,
specs = {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if opts.ensure_installed ~= "all" then
opts.ensure_installed = require("astrocore").list_insert_unique(
opts.ensure_installed,
{ "bash", "markdown", "markdown_inline", "regex", "vim" }
)
end
end,
},
{
"AstroNvim/astrolsp",
optional = true,
---@param opts AstroLSPOpts
opts = function(_, opts)
-- No need to manage lsp_handlers as noice is not handling them now
end,
},
{
"heirline.nvim",
optional = true,
opts = function(_, opts)
local noice_opts = require("astrocore").plugin_opts("noice.nvim")
if vim.tbl_get(noice_opts, "lsp", "progress", "enabled") ~= false then -- check if lsp progress is enabled
opts.statusline[9] = require("astroui.status").component.lsp({ lsp_progress = false })
end
end,
},
{
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
if not opts.bottom then
opts.bottom = {}
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,
},
},
presets = {
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
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 = {
-- disable "written" notification
{
filter = { event = "msg_show", kind = "", find = "written" },
opts = { skip = true },
},
-- disable paste/undo notification
{
filter = { event = "msg_show", find = "^%d+ more lines" },
opts = { skip = true },
},
-- disable delete/undo notification
{
filter = { event = "msg_show", find = "^%d+ fewer lines" },
opts = { skip = true },
},
-- disable yank notification
{
filter = { event = "msg_show", find = "^%d+ lines yanked$" },
opts = { skip = true },
},
-- disable move notification
{
filter = { event = "msg_show", find = "^%d+ lines moved$" },
},
},
})
end,
specs = {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if opts.ensure_installed ~= "all" then
opts.ensure_installed = require("astrocore").list_insert_unique(
opts.ensure_installed,
{ "bash", "markdown", "markdown_inline", "regex", "vim", "latex", "bibtex" }
)
end
end,
},
{
"AstroNvim/astrolsp",
optional = true,
---@param opts AstroLSPOpts
opts = function(_, opts)
-- No need to manage lsp_handlers as noice is not handling them now
end,
},
{
"heirline.nvim",
optional = true,
opts = function(_, opts)
local noice_opts = require("astrocore").plugin_opts("noice.nvim")
if vim.tbl_get(noice_opts, "lsp", "progress", "enabled") ~= false then -- check if lsp progress is enabled
opts.statusline[9] = require("astroui.status").component.lsp({ lsp_progress = false })
end
end,
},
{
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
if not opts.bottom then
opts.bottom = {}
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 {
{
{
"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",
},
-- {
-- {
-- "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",
-- size = 0.25,
-- },
},
position = "bottom",
size = 8,
},
},
},
config = function(_, opts)
local dap = require("dap")
local dapui = require("dapui")
-- 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",
-- -- 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,27 +2,33 @@
---@type LazySpec
return {
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add more things to the ensure_installed table protecting against community packs modifying it
opts.ignore_install = { "help" }
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
-- "lua",
-- "c",
-- "cpp",
"python",
-- "javascript",
})
opts.highlight = {
enable = true,
disable = { "c", "rust", "tsx", "javascript" },
additional_vim_regex_highlighting = false,
custom_captures = {
-- Highlight local variables
["variable.local"] = "Identifier",
},
}
{
"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" }
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
-- "lua",
-- "c",
-- "cpp",
"python",
"latex",
"bibtex",
-- "javascript",
})
vim.api.nvim_set_hl(0, "Identifier", { fg = "#55ffff" })
end,
opts.highlight = {
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
},
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 @@
{}