chore: adding more disable options for basedbyright
This commit is contained in:
19
init.lua
19
init.lua
@@ -27,22 +27,3 @@ vim.g.copilot_no_tab_map = true
|
|||||||
require("lazy_setup")
|
require("lazy_setup")
|
||||||
require("polish")
|
require("polish")
|
||||||
require("core.lsp")
|
require("core.lsp")
|
||||||
|
|
||||||
|
|
||||||
-- local function silent_hover()
|
|
||||||
-- local params = vim.lsp.util.make_position_params()
|
|
||||||
-- vim.lsp.buf_request(0, 'textDocument/hover', params, function(err, result, ctx, config)
|
|
||||||
-- if err then
|
|
||||||
-- -- Silently ignore errors instead of showing them
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
-- if result and result.contents then
|
|
||||||
-- vim.lsp.util.stylize_markdown(result.contents.value or result.contents, {})
|
|
||||||
-- end
|
|
||||||
-- end)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- -- Remap K to use silent hover
|
|
||||||
-- vim.keymap.set({'n', 'v'}, 'K', silent_hover, { silent = true })
|
|
||||||
|
|
||||||
-- Keep K for documentation in normal mode, but disable in visual mode
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
"kanagawa.nvim": { "branch": "master", "commit": "e5f7b8a804360f0a48e40d0083a97193ee4fcc87" },
|
"kanagawa.nvim": { "branch": "master", "commit": "e5f7b8a804360f0a48e40d0083a97193ee4fcc87" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
|
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
|
||||||
"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" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||||
|
|||||||
94
lua/plugins/README.md
Normal file
94
lua/plugins/README.md
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
# Plugins Organization
|
||||||
|
|
||||||
|
Thư mục `plugins` đã được tổ chức lại theo chức năng để dễ quản lý và bảo trì hơn.
|
||||||
|
|
||||||
|
## Cấu trúc thư mục
|
||||||
|
|
||||||
|
### Core Files
|
||||||
|
- **`astrocore.lua`** - Cấu hình cốt lõi của AstroNvim (mappings, options, autocmds)
|
||||||
|
- **`astrolsp.lua`** - Cấu hình Language Server Protocol
|
||||||
|
- **`astroui.lua`** - Cấu hình giao diện người dùng
|
||||||
|
- **`mason.lua`** - Quản lý LSP servers, formatters, debuggers
|
||||||
|
- **`treesitter.lua`** - Cấu hình syntax highlighting
|
||||||
|
- **`whichkey.lua`** - Cấu hình key mappings
|
||||||
|
|
||||||
|
### Functional Categories
|
||||||
|
|
||||||
|
#### 🎨 **`themes.lua`** - Themes và Colorschemes
|
||||||
|
- Bamboo (main theme)
|
||||||
|
- Catppuccin (disabled)
|
||||||
|
- Các themes khác (disabled)
|
||||||
|
|
||||||
|
#### 🔧 **`completion.lua`** - Completion và AI Assistance
|
||||||
|
- GitHub Copilot
|
||||||
|
- Blink.cmp (replacement cho nvim-cmp)
|
||||||
|
- LSP Kind icons
|
||||||
|
- Các completion plugins bị disable
|
||||||
|
|
||||||
|
#### ✏️ **`editor.lua`** - Editor Enhancements
|
||||||
|
- Comment management
|
||||||
|
- Auto-save functionality
|
||||||
|
- Indent scope highlighting
|
||||||
|
- Code folding (nvim-ufo)
|
||||||
|
- Split navigation (smart-splits)
|
||||||
|
- Terminal support (disabled)
|
||||||
|
|
||||||
|
#### 🚀 **`motion.lua`** - Motion, Navigation và Multiple Cursors
|
||||||
|
- Multiple cursors support
|
||||||
|
- Brackets split/join
|
||||||
|
- Better word motion (spider)
|
||||||
|
- Flash navigation
|
||||||
|
- Code block movement
|
||||||
|
|
||||||
|
#### 🖥️ **`ui.lua`** - UI và Interface Enhancements
|
||||||
|
- Dashboard (alpha-nvim)
|
||||||
|
- Status line (heirline)
|
||||||
|
- Notifications
|
||||||
|
- Todo comments highlighting
|
||||||
|
- Smart bracket pairing
|
||||||
|
- Treesitter context
|
||||||
|
- Virtual text context
|
||||||
|
- Noice UI
|
||||||
|
|
||||||
|
#### 🛠️ **`development.lua`** - Development Tools và Debugging
|
||||||
|
- LSP End hints
|
||||||
|
- DAP UI (disabled)
|
||||||
|
- DAP Virtual Text (disabled)
|
||||||
|
- Các development plugins bị disable
|
||||||
|
|
||||||
|
#### 📝 **`formatting.lua`** - Formatting và Linting
|
||||||
|
- None-ls formatting
|
||||||
|
- Ruff formatting
|
||||||
|
- Các formatting plugins bị disable
|
||||||
|
|
||||||
|
#### 📁 **`file_explorer.lua`** - File Explorer và File Management
|
||||||
|
- Neo-tree file explorer
|
||||||
|
- Các file explorer plugins bị disable
|
||||||
|
|
||||||
|
#### 📋 **`snippets.lua`** - Snippets
|
||||||
|
- LuaSnip
|
||||||
|
- Các snippet plugins bị disable
|
||||||
|
|
||||||
|
#### ❌ **`disabled.lua`** - Disabled Plugins
|
||||||
|
- Tất cả các plugins bị disable, được tổ chức theo category
|
||||||
|
|
||||||
|
## Lợi ích của cấu trúc mới
|
||||||
|
|
||||||
|
1. **Dễ tìm kiếm**: Mỗi file có một chức năng cụ thể
|
||||||
|
2. **Dễ bảo trì**: Khi cần thay đổi một tính năng, chỉ cần sửa một file
|
||||||
|
3. **Dễ mở rộng**: Thêm plugins mới vào đúng category
|
||||||
|
4. **Rõ ràng**: Tên file cho biết ngay chức năng
|
||||||
|
5. **Tổ chức**: Các plugins liên quan được nhóm lại với nhau
|
||||||
|
|
||||||
|
## Cách thêm plugins mới
|
||||||
|
|
||||||
|
1. Xác định chức năng của plugin
|
||||||
|
2. Thêm vào file tương ứng
|
||||||
|
3. Nếu không có category phù hợp, tạo file mới
|
||||||
|
4. Cập nhật README này nếu cần
|
||||||
|
|
||||||
|
## Ghi chú
|
||||||
|
|
||||||
|
- Các plugins bị disable được giữ lại trong `disabled.lua` để dễ tham khảo
|
||||||
|
- Một số plugins có thể xuất hiện ở nhiều nơi (ví dụ: trong specs của plugin khác)
|
||||||
|
- Cấu trúc này tương thích với AstroNvim và Lazy.nvim
|
||||||
@@ -3,182 +3,195 @@
|
|||||||
-- 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 = true, -- 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 = {},
|
servers = {},
|
||||||
-- customize language server configuration options passed to `lspconfig`
|
-- customize language server configuration options passed to `lspconfig`
|
||||||
---@diagnostic disable: missing-fields
|
---@diagnostic disable: missing-fields
|
||||||
config = {
|
config = {
|
||||||
-- clangd = require "plugins.configs.lsp.config.clangd",
|
-- clangd = require "plugins.configs.lsp.config.clangd",
|
||||||
basedpyright = require("plugins.configs.lsp.config.basedpyright"),
|
basedpyright = require("plugins.configs.lsp.config.basedpyright"),
|
||||||
jedi_language_server = require("plugins.configs.lsp.config.jedi_language"),
|
jedi_language_server = require("plugins.configs.lsp.config.jedi_language"),
|
||||||
pyright = require("plugins.configs.lsp.config.pyright"),
|
pyright = require("plugins.configs.lsp.config.pyright"),
|
||||||
ruff = require("plugins.configs.lsp.config.ruff"),
|
ruff = require("plugins.configs.lsp.config.ruff"),
|
||||||
pylsp = require("plugins.configs.lsp.config.pylsp"),
|
pylsp = require("plugins.configs.lsp.config.pylsp"),
|
||||||
},
|
},
|
||||||
-- customize how language servers are attached
|
-- customize how language servers are attached
|
||||||
handlers = {
|
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
|
-- 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
|
-- function(server, opts) require("lspconfig")[server].setup(opts) end
|
||||||
-- config Ty
|
-- config Ty
|
||||||
|
|
||||||
-- the key is the server that is being setup with `lspconfig`
|
-- 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
|
-- 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
|
-- 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
|
-- Configure buffer local auto commands to add when attaching a language server
|
||||||
autocmds = {
|
autocmds = {
|
||||||
-- first key is the `augroup` to add the auto commands to (:h augroup)
|
-- first key is the `augroup` to add the auto commands to (:h augroup)
|
||||||
lsp_document_highlight = {
|
lsp_document_highlight = {
|
||||||
-- Optional condition to create/delete auto command group
|
-- 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`
|
-- 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,
|
-- 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
|
-- the auto commands will be deleted for that buffer
|
||||||
cond = "textDocument/documentHighlight",
|
cond = "textDocument/documentHighlight",
|
||||||
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
|
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
|
||||||
-- list of auto commands to set
|
-- list of auto commands to set
|
||||||
{
|
{
|
||||||
-- events to trigger
|
-- events to trigger
|
||||||
event = { "CursorHold", "CursorHoldI" },
|
event = { "CursorHold", "CursorHoldI" },
|
||||||
-- the rest of the autocmd options (:h nvim_create_autocmd)
|
-- the rest of the autocmd options (:h nvim_create_autocmd)
|
||||||
desc = "Document Highlighting",
|
desc = "Document Highlighting",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.buf.document_highlight()
|
vim.lsp.buf.document_highlight()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
event = { "CursorMoved", "CursorMovedI", "BufLeave" },
|
event = { "CursorMoved", "CursorMovedI", "BufLeave" },
|
||||||
desc = "Document Highlighting Clear",
|
desc = "Document Highlighting Clear",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.buf.clear_references()
|
vim.lsp.buf.clear_references()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- disable inlay hints in insert mode
|
-- disable inlay hints in insert mode
|
||||||
disable_inlay_hints_on_insert = {
|
disable_inlay_hints_on_insert = {
|
||||||
-- only create for language servers that support inlay hints
|
-- only create for language servers that support inlay hints
|
||||||
-- (and only if vim.lsp.inlay_hint is available)
|
-- (and only if vim.lsp.inlay_hint is available)
|
||||||
cond = vim.lsp.inlay_hint and "textDocument/inlayHint" or false,
|
cond = vim.lsp.inlay_hint and "textDocument/inlayHint" or false,
|
||||||
{
|
{
|
||||||
-- when going into insert mode
|
-- when going into insert mode
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
desc = "disable inlay hints on insert",
|
desc = "disable inlay hints on insert",
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local filter = { bufnr = args.buf }
|
local filter = { bufnr = args.buf }
|
||||||
-- if the inlay hints are currently enabled
|
-- if the inlay hints are currently enabled
|
||||||
if vim.lsp.inlay_hint.is_enabled(filter) then
|
if vim.lsp.inlay_hint.is_enabled(filter) then
|
||||||
-- disable the inlay hints
|
-- disable the inlay hints
|
||||||
vim.lsp.inlay_hint.enable(false, filter)
|
vim.lsp.inlay_hint.enable(false, filter)
|
||||||
-- create a single use autocommand to turn the inlay hints back on
|
-- create a single use autocommand to turn the inlay hints back on
|
||||||
-- when leaving insert mode
|
-- when leaving insert mode
|
||||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||||
buffer = args.buf,
|
buffer = args.buf,
|
||||||
once = true,
|
once = true,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.inlay_hint.enable(true, filter)
|
vim.lsp.inlay_hint.enable(true, filter)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- mappings to be set up on attaching of a language server
|
-- mappings to be set up on attaching of a language server
|
||||||
mappings = {
|
mappings = {
|
||||||
n = {
|
n = {
|
||||||
gh = {
|
gh = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.hover()
|
vim.lsp.buf.hover()
|
||||||
end,
|
end,
|
||||||
desc = "Hover symbol details",
|
desc = "Hover symbol details",
|
||||||
cond = "textDocument/hover",
|
cond = "textDocument/hover",
|
||||||
},
|
},
|
||||||
gl = {
|
gl = {
|
||||||
function()
|
function()
|
||||||
vim.diagnostic.open_float()
|
vim.diagnostic.open_float()
|
||||||
end,
|
end,
|
||||||
desc = "Hover diagnostics",
|
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
|
-- 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 = {
|
gD = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.declaration()
|
vim.lsp.buf.declaration()
|
||||||
end,
|
end,
|
||||||
desc = "Declaration of current symbol",
|
desc = "Declaration of current symbol",
|
||||||
cond = "textDocument/declaration",
|
cond = "textDocument/declaration",
|
||||||
},
|
},
|
||||||
["<Leader>uY"] = {
|
["<Leader>uY"] = {
|
||||||
function()
|
function()
|
||||||
require("astrolsp.toggles").buffer_semantic_tokens()
|
require("astrolsp.toggles").buffer_semantic_tokens()
|
||||||
end,
|
end,
|
||||||
desc = "Toggle LSP semantic highlight (buffer)",
|
desc = "Toggle LSP semantic highlight (buffer)",
|
||||||
cond = function(client)
|
cond = function(client)
|
||||||
return client.server_capabilities.semanticTokensProvider and vim.lsp.semantic_tokens
|
return client.server_capabilities.semanticTokensProvider and vim.lsp.semantic_tokens
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- A custom `on_attach` function to be run after the default `on_attach` function
|
-- A custom `on_attach` function to be run after the default `on_attach` function
|
||||||
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
|
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
-- this would disable semanticTokensProvider for all clients
|
-- this would disable semanticTokensProvider for all clients
|
||||||
-- client.server_capabilities.semanticTokensProvider = nil
|
-- client.server_capabilities.semanticTokensProvider = nil
|
||||||
-- Disable ruff_lsp hover in favor of pyright
|
-- Disable ruff_lsp hover in favor of pyright
|
||||||
if client.name == "ruff" then
|
if client.name == "ruff" then
|
||||||
client.server_capabilities.hoverProvider = false
|
client.server_capabilities.hoverProvider = false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- if client.name == "pyright" then
|
-- if client.name == "pyright" then
|
||||||
-- -- disable pyright analysis features
|
-- -- disable pyright analysis features
|
||||||
-- client.server_capabilities.documentFormattingProvider = false
|
-- client.server_capabilities.documentFormattingProvider = false
|
||||||
-- client.server_capabilities.hoverProvider = false
|
-- client.server_capabilities.hoverProvider = false
|
||||||
|
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
-- Disable completion feature of pyright
|
-- Disable completion feature of pyright
|
||||||
if client.name == "ty" then
|
if client.name == "ty" then
|
||||||
client.server_capabilities.completionProvider = false
|
client.server_capabilities.completionProvider = false
|
||||||
end
|
end
|
||||||
|
|
||||||
if client.name == "basedpyright" then
|
if client.name == "basedpyright" then
|
||||||
client.server_capabilities.completionProvider = false
|
-- Tắt hết các dịch vụ, chỉ giữ lại diagnostics và inlay hints
|
||||||
client.server_capabilities.codeLensProvider = false
|
client.server_capabilities.completionProvider = false
|
||||||
client.server_capabilities.colorProvider = false
|
client.server_capabilities.codeLensProvider = false
|
||||||
client.server_capabilities.colorProvider = false
|
client.server_capabilities.colorProvider = false
|
||||||
client.server_capabilities.callHierarchyProvider = false
|
client.server_capabilities.callHierarchyProvider = false
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
client.server_capabilities.documentRangeFormattingProvider = false
|
client.server_capabilities.documentRangeFormattingProvider = false
|
||||||
client.server_capabilities.declarationProvider = false
|
client.server_capabilities.declarationProvider = false
|
||||||
client.server_capabilities.documentLinkProvider = false
|
client.server_capabilities.documentLinkProvider = false
|
||||||
client.server_capabilities.definitionProvider = false
|
client.server_capabilities.definitionProvider = false
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
client.server_capabilities.documentOnTypeFormattingProvider = false
|
||||||
client.server_capabilities.documentOnTypeFormattingProvider = false
|
client.server_capabilities.documentSymbolProvider = false
|
||||||
client.server_capabilities.documentLinkProvider = false
|
client.server_capabilities.hoverProvider = false
|
||||||
client.server_capabilities.documentSymbolProvider = false
|
client.server_capabilities.inlineCompletionProvider = false
|
||||||
client.server_capabilities.documentRangeFormattingProvider = false
|
client.server_capabilities.inlineValueProvider = false
|
||||||
client.server_capabilities.hoverProvider = false
|
client.server_capabilities.notebookDocumentSync = false
|
||||||
client.server_capabilities.inlineCompletionProvider = false
|
client.server_capabilities.signatureHelpProvider = false
|
||||||
client.server_capabilities.inlineValueProvider = false
|
client.server_capabilities.renameProvider = false
|
||||||
client.server_capabilities.notebookDocumentSync = false
|
client.server_capabilities.typeDefinitionProvider = false
|
||||||
client.server_capabilities.signatureHelpProvider = false
|
client.server_capabilities.workspaceSymbolProvider = false
|
||||||
client.server_capabilities.renameProvider = false
|
client.server_capabilities.monikerProvider = false
|
||||||
client.server_capabilities.typeDefinitionProvider = false
|
client.server_capabilities.semanticTokensProvider = false
|
||||||
client.server_capabilities.workspaceSymbolProvider = false
|
|
||||||
client.server_capabilities.monikerProvider = false
|
-- Tắt thêm các capabilities khác có thể có
|
||||||
client.server_capabilities.semanticTokensProvider = false
|
client.server_capabilities.referencesProvider = false
|
||||||
end
|
client.server_capabilities.implementationProvider = false
|
||||||
end,
|
client.server_capabilities.foldingRangeProvider = false
|
||||||
},
|
client.server_capabilities.selectionRangeProvider = false
|
||||||
|
client.server_capabilities.linkedEditingRangeProvider = false
|
||||||
|
client.server_capabilities.executeCommandProvider = false
|
||||||
|
client.server_capabilities.workspace = {
|
||||||
|
workspaceFolders = { supported = false },
|
||||||
|
fileOperations = { supported = false }
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Giữ lại diagnostics và inlay hints
|
||||||
|
-- client.server_capabilities.diagnosticProvider = true (mặc định)
|
||||||
|
-- client.server_capabilities.inlayHintProvider = true (mặc định)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
return {
|
|
||||||
"okuuva/auto-save.nvim",
|
|
||||||
event = { "User AstroFile", "InsertEnter" },
|
|
||||||
dependencies = {
|
|
||||||
"AstroNvim/astrocore",
|
|
||||||
opts = {
|
|
||||||
autocmds = {
|
|
||||||
autoformat_toggle = {
|
|
||||||
-- Disable autoformat before saving
|
|
||||||
{
|
|
||||||
event = "User",
|
|
||||||
desc = "Disable autoformat before saving",
|
|
||||||
pattern = "AutoSaveWritePre",
|
|
||||||
callback = function()
|
|
||||||
-- Save global autoformat status
|
|
||||||
vim.g.OLD_AUTOFORMAT = vim.g.autoformat
|
|
||||||
vim.g.autoformat = false
|
|
||||||
|
|
||||||
local old_autoformat_buffers = {}
|
|
||||||
-- Disable all manually enabled buffers
|
|
||||||
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
|
|
||||||
if vim.b[bufnr].autoformat then
|
|
||||||
table.insert(old_autoformat_buffers, bufnr)
|
|
||||||
vim.b[bufnr].autoformat = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.g.OLD_AUTOFORMAT_BUFFERS = old_autoformat_buffers
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
-- Re-enable autoformat after saving
|
|
||||||
{
|
|
||||||
event = "User",
|
|
||||||
desc = "Re-enable autoformat after saving",
|
|
||||||
pattern = "AutoSaveWritePost",
|
|
||||||
callback = function()
|
|
||||||
-- Restore global autoformat status
|
|
||||||
vim.g.autoformat = vim.g.OLD_AUTOFORMAT
|
|
||||||
-- Re-enable all manually enabled buffers
|
|
||||||
for _, bufnr in ipairs(vim.g.OLD_AUTOFORMAT_BUFFERS or {}) do
|
|
||||||
vim.b[bufnr].autoformat = true
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
opts = {},
|
|
||||||
}
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
-- 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 {}
|
|
||||||
@@ -1,187 +0,0 @@
|
|||||||
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"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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,
|
|
||||||
|
|
||||||
-- 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
|
|
||||||
else
|
|
||||||
icon = require("lspkind").symbolic(ctx.kind, {
|
|
||||||
mode = "symbol",
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
-- 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" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
185
lua/plugins/completion.lua
Normal file
185
lua/plugins/completion.lua
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
-- Completion and AI Assistance
|
||||||
|
return {
|
||||||
|
-- GitHub Copilot
|
||||||
|
{
|
||||||
|
"github/copilot.vim",
|
||||||
|
event = "BufRead",
|
||||||
|
config = function()
|
||||||
|
vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Blink.cmp (replacement for nvim-cmp)
|
||||||
|
{
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
event = { "InsertEnter", "CmdlineEnter", "BufEnter" },
|
||||||
|
version = "^1",
|
||||||
|
opts_extend = { "sources.default", "cmdline.sources", "term.sources" },
|
||||||
|
opts = {
|
||||||
|
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,
|
||||||
|
["<Tab>"] = {
|
||||||
|
"select_next",
|
||||||
|
"snippet_forward",
|
||||||
|
function(cmp)
|
||||||
|
local has_words_before = function()
|
||||||
|
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
|
||||||
|
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 = {
|
||||||
|
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
|
||||||
|
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)
|
||||||
|
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 = {
|
||||||
|
default = { "lazydev" },
|
||||||
|
providers = {
|
||||||
|
lazydev = {
|
||||||
|
name = "LazyDev",
|
||||||
|
module = "lazydev.integrations.blink",
|
||||||
|
score_offset = 100,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- LSP Kind icons
|
||||||
|
{
|
||||||
|
"onsails/lspkind.nvim",
|
||||||
|
opts = {
|
||||||
|
symbol_map = require("plugins.configs.ui.lspkind"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Disabled completion plugins
|
||||||
|
{ "hrsh7th/nvim-cmp", enabled = false },
|
||||||
|
{ "hrsh7th/cmp-buffer", enabled = false },
|
||||||
|
{ "hrsh7th/cmp-path", enabled = false },
|
||||||
|
{ "hrsh7th/cmp-cmdline", enabled = false },
|
||||||
|
{ "rcarriga/cmp-dap", enabled = false },
|
||||||
|
{ "saadparwaiz1/cmp_luasnip", enabled = false },
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ M.statusline = {
|
|||||||
status.component.mode {
|
status.component.mode {
|
||||||
-- enable mode text with padding as well as an icon before it
|
-- enable mode text with padding as well as an icon before it
|
||||||
mode_text = {
|
mode_text = {
|
||||||
icon = { kind = "Mode", padding = { left = 0, right = 1 } },
|
icon = { kind = "Mode", padding = { left = 0, right = 0 } },
|
||||||
},
|
},
|
||||||
-- surround the component with a separators
|
-- surround the component with a separators
|
||||||
surround = {
|
surround = {
|
||||||
@@ -30,7 +30,7 @@ M.statusline = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
status.component.git_branch {
|
status.component.git_branch {
|
||||||
padding = { left = 2, right = 1 },
|
padding = { left = 0, right = 1 },
|
||||||
surround = {
|
surround = {
|
||||||
separator = "none",
|
separator = "none",
|
||||||
color = "bg",
|
color = "bg",
|
||||||
|
|||||||
106
lua/plugins/development.lua
Normal file
106
lua/plugins/development.lua
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
-- Development Tools and Debugging
|
||||||
|
return {
|
||||||
|
-- LSP End hints
|
||||||
|
{
|
||||||
|
"chrisgrieser/nvim-lsp-endhints",
|
||||||
|
event = "LspAttach",
|
||||||
|
opts = {
|
||||||
|
icons = {
|
||||||
|
type = " ",
|
||||||
|
parameter = " ",
|
||||||
|
offspec = " ", -- hint kind not defined in official LSP spec
|
||||||
|
unknown = " ", -- hint kind is nil
|
||||||
|
},
|
||||||
|
label = {
|
||||||
|
truncateAtChars = 100,
|
||||||
|
padding = 1,
|
||||||
|
marginLeft = 0,
|
||||||
|
sameKindSeparator = ", ",
|
||||||
|
},
|
||||||
|
extmark = {
|
||||||
|
priority = 50,
|
||||||
|
},
|
||||||
|
autoEnableHints = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- DAP UI (disabled)
|
||||||
|
{
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
enabled = false,
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
position = "bottom",
|
||||||
|
size = 8,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local dap = require("dap")
|
||||||
|
local dapui = require("dapui")
|
||||||
|
dapui.setup(opts)
|
||||||
|
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
|
||||||
|
dap.listeners.after.event_initialized["dapui"] = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- DAP Virtual Text (disabled)
|
||||||
|
{
|
||||||
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
|
enabled = false,
|
||||||
|
event = "User AstroFile",
|
||||||
|
opts = {
|
||||||
|
commented = false,
|
||||||
|
enabled = true,
|
||||||
|
enabled_commands = true,
|
||||||
|
show_stop_reason = true,
|
||||||
|
virt_text_pos = "eol",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Disabled development plugins
|
||||||
|
{ "mfussenegger/nvim-dap", enabled = false },
|
||||||
|
{ "jay-babu/mason-nvim-dap.nvim", enabled = false },
|
||||||
|
}
|
||||||
@@ -1,59 +1,61 @@
|
|||||||
-- Plugins to disable
|
-- Disabled Plugins
|
||||||
return {
|
return {
|
||||||
{ "s1n7ax/nvim-window-picker", enabled = false },
|
-- Themes and Colorschemes
|
||||||
{ "akinsho/toggleterm.nvim", enabled = false },
|
{ "catppuccin/nvim", name = "catppuccin", enabled = false },
|
||||||
{ "NvChad/nvim-colorizer.lua", enabled = false },
|
{ "rebelot/kanagawa.nvim", enabled = false },
|
||||||
{ "catppuccin/nvim", name = "catppuccin", enabled = false },
|
{ "folke/tokyonight.nvim", enabled = false },
|
||||||
{ "rebelot/kanagawa.nvim", enabled = false },
|
{ "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false },
|
||||||
{ "folke/tokyonight.nvim", enabled = false },
|
{ "AstroNvim/astrotheme", enabled = false },
|
||||||
{ "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false },
|
{ "scottmckendry/cyberdream.nvim", enabled = false },
|
||||||
{ "b0o/SchemaStore.nvim", enabled = false },
|
{ "loctvl842/monokai-pro.nvim", enabled = false },
|
||||||
{ "ray-x/lsp_signature.nvim", enabled = false },
|
{ "xiyaowong/transparent.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 },
|
|
||||||
{ "kevinhwang91/nvim-ufo", enabled = false },
|
|
||||||
{ "echasnovski/mini.bufremove", enabled = false },
|
|
||||||
|
|
||||||
{ "hrsh7th/nvim-cmp", enabled = false },
|
-- UI and Interface
|
||||||
{ "rcarriga/cmp-dap", enabled = false },
|
{ "s1n7ax/nvim-window-picker", enabled = false },
|
||||||
|
{ "NvChad/nvim-colorizer.lua", enabled = false },
|
||||||
|
{ "iamcco/markdown-preview.nvim", enabled = false },
|
||||||
|
{ "lukas-reineke/indent-blankline.nvim", enabled = false },
|
||||||
|
{ "lazy/nvim-ufo", enabled = false },
|
||||||
|
|
||||||
-- System
|
-- Editor Enhancements
|
||||||
{ "nvim-treesitter/nvim-treesitter-textobjects", enabled = false },
|
{ "max397574/better-escape.nvim", enabled = false },
|
||||||
-- Disable Dap
|
{ "hinell/duplicate.nvim", enabled = false },
|
||||||
{ "mfussenegger/nvim-dap", enabled = false },
|
{ "CRAG666/code_runner.nvim", enabled = false },
|
||||||
{ "theHamsta/nvim-dap-virtual-text", enabled = false },
|
{ "RRethy/vim-illuminate", enabled = false },
|
||||||
{ "rcarriga/nvim-dap-ui", enabled = false },
|
{ "echasnovski/mini.bufremove", enabled = false },
|
||||||
{ "jay-babu/mason-nvim-dap.nvim", enabled = false },
|
{ "akinsho/toggleterm.nvim", enabled = false },
|
||||||
-- { "jay-babu/mason-null-ls.nvim", enabled = false },
|
|
||||||
{ "b0o/schemastore.nvim", enabled = false },
|
|
||||||
{ "Wansmer/treesj", enabled = false },
|
|
||||||
|
|
||||||
-- interface
|
-- Completion
|
||||||
{ "ribru17/bamboo.nvim", enabled = true },
|
{ "hrsh7th/nvim-cmp", enabled = false },
|
||||||
|
{ "hrsh7th/cmp-buffer", enabled = false },
|
||||||
|
{ "hrsh7th/cmp-path", enabled = false },
|
||||||
|
{ "hrsh7th/cmp-cmdline", enabled = false },
|
||||||
|
{ "rcarriga/cmp-dap", enabled = false },
|
||||||
|
{ "saadparwaiz1/cmp_luasnip", enabled = false },
|
||||||
|
|
||||||
-- service
|
-- Development Tools
|
||||||
{ "stevearc/resession.nvim", enabled = true },
|
{ "mfussenegger/nvim-dap", enabled = false },
|
||||||
{ "echasnovski/mini.move", enabled = true },
|
{ "theHamsta/nvim-dap-virtual-text", enabled = false },
|
||||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = true },
|
{ "rcarriga/nvim-dap-ui", enabled = false },
|
||||||
{ "folke/flash.nvim", enabled = true },
|
{ "jay-babu/mason-nvim-dap.nvim", enabled = false },
|
||||||
{ "github/copilot.vim", enabled = true },
|
|
||||||
|
|
||||||
{ "rafamadriz/friendly-snippets", enabled = false },
|
-- Motion and Navigation
|
||||||
{ "JoosepAlviste/nvim-ts-context-commentstring", enabled = false },
|
{ "Wansmer/treesj", enabled = false },
|
||||||
{ "windwp/nvim-ts-autotag", enabled = false },
|
|
||||||
{ "saadparwaiz1/cmp_luasnip", enabled = false },
|
-- System
|
||||||
{ "L3MON4D3/LuaSnip", enabled = true },
|
{ "nvim-treesitter/nvim-treesitter-textobjects", enabled = false },
|
||||||
|
{ "b0o/schemastore.nvim", enabled = false },
|
||||||
|
|
||||||
|
-- Formatting and Snippets
|
||||||
|
{ "rafamadriz/friendly-snippets", enabled = false },
|
||||||
|
{ "JoosepAlviste/nvim-ts-context-commentstring", enabled = false },
|
||||||
|
{ "windwp/nvim-ts-autotag", enabled = false },
|
||||||
|
|
||||||
|
-- Services
|
||||||
|
{ "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 },
|
||||||
|
{ "L3MON4D3/LuaSnip", enabled = true },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- if true then return {} end
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
-- Plugins that enhance editor experience
|
-- Editor Enhancements
|
||||||
return {
|
return {
|
||||||
|
-- Comment management
|
||||||
{
|
{
|
||||||
"numToStr/Comment.nvim",
|
"numToStr/Comment.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
-- Ignore empty line
|
|
||||||
ignore = "^$",
|
ignore = "^$",
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
@@ -21,126 +21,130 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Built-in terminal support
|
|
||||||
|
-- Auto-save functionality
|
||||||
{
|
{
|
||||||
"akinsho/toggleterm.nvim",
|
"okuuva/auto-save.nvim",
|
||||||
opts = function(_, opts)
|
event = { "User AstroFile", "InsertEnter" },
|
||||||
-- Use powershell for toggleterm on windows
|
dependencies = {
|
||||||
-- if vim.fn.has "win32" then opts.shell = "pwsh.exe" end
|
"AstroNvim/astrocore",
|
||||||
end,
|
opts = {
|
||||||
},
|
autocmds = {
|
||||||
-- File tagging and navigation
|
autoformat_toggle = {
|
||||||
-- {
|
{
|
||||||
-- "cbochs/grapple.nvim",
|
event = "User",
|
||||||
-- dependencies = {
|
desc = "Disable autoformat before saving",
|
||||||
-- "nvim-lua/plenary.nvim",
|
pattern = "AutoSaveWritePre",
|
||||||
-- {
|
callback = function()
|
||||||
-- "AstroNvim/astrocore",
|
vim.g.OLD_AUTOFORMAT = vim.g.autoformat
|
||||||
-- opts = function(_, opts)
|
vim.g.autoformat = false
|
||||||
-- opts.mappings.n["<Leader><Leader>"] = { desc = require("astroui").get_icon("Grapple", 1, true) .. "Grapple" }
|
local old_autoformat_buffers = {}
|
||||||
-- end,
|
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
|
||||||
-- },
|
if vim.b[bufnr].autoformat then
|
||||||
-- },
|
table.insert(old_autoformat_buffers, bufnr)
|
||||||
-- opts = {
|
vim.b[bufnr].autoformat = false
|
||||||
-- scope = "git_branch",
|
end
|
||||||
-- },
|
end
|
||||||
-- cmd = { "Grapple" },
|
vim.g.OLD_AUTOFORMAT_BUFFERS = old_autoformat_buffers
|
||||||
-- keys = {
|
end,
|
||||||
-- { "<Leader><Leader>a", "<Cmd>Grapple tag<CR>", desc = "Add tag to file" },
|
},
|
||||||
-- { "<Leader><Leader>d", "<Cmd>Grapple untag<CR>", desc = "Delete tag from file" },
|
{
|
||||||
-- { "<Leader><Leader>e", "<Cmd>Grapple toggle_tags<CR>", desc = "Select from tags" },
|
event = "User",
|
||||||
-- { "<Leader><Leader>s", "<Cmd>Grapple toggle_scopes<CR>", desc = "Select a project scope" },
|
desc = "Re-enable autoformat after saving",
|
||||||
-- { "<Leader><Leader>x", "<Cmd>Grapple reset<CR>", desc = "Clear tags" },
|
pattern = "AutoSaveWritePost",
|
||||||
-- { "<C-e>", "<Cmd>Grapple cycle forward<CR>", desc = "Select next tag" },
|
callback = function()
|
||||||
-- { "<C-p>", "<Cmd>Grapple cycle backward<CR>", desc = "Select previous tag" },
|
vim.g.autoformat = vim.g.OLD_AUTOFORMAT
|
||||||
-- },
|
for _, bufnr in ipairs(vim.g.OLD_AUTOFORMAT_BUFFERS or {}) do
|
||||||
-- },
|
vim.b[bufnr].autoformat = true
|
||||||
-- Better escape support
|
end
|
||||||
-- {
|
end,
|
||||||
-- "max397574/better-escape.nvim",
|
},
|
||||||
-- opts = {
|
},
|
||||||
-- mapping = { "jj", "kk", "jk" },
|
},
|
||||||
-- },
|
},
|
||||||
-- },
|
},
|
||||||
-- Better indent blankline
|
|
||||||
-- {
|
|
||||||
-- "shellRaining/hlchunk.nvim",
|
|
||||||
-- event = { "BufReadPre", "BufNewFile" },
|
|
||||||
-- config = function(_, opts)
|
|
||||||
-- require("hlchunk").setup(require("astrocore").extend_tbl(opts, {
|
|
||||||
-- ignore = {},
|
|
||||||
-- chunk = {
|
|
||||||
-- enable = true,
|
|
||||||
-- notify = false,
|
|
||||||
-- chars = {
|
|
||||||
-- -- horizontal_line = "━",
|
|
||||||
-- -- vertical_line = "┃",
|
|
||||||
-- -- left_top = "┏",
|
|
||||||
-- -- left_bottom = "┗",
|
|
||||||
-- -- right_arrow = "➤",
|
|
||||||
-- },
|
|
||||||
-- style = "#06D001",
|
|
||||||
-- delay = 25,
|
|
||||||
-- },
|
|
||||||
-- indent = {
|
|
||||||
-- enable = false,
|
|
||||||
-- use_treesitter = true,
|
|
||||||
-- chars = {
|
|
||||||
-- "│",
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- blank = {
|
|
||||||
-- enable = false,
|
|
||||||
-- chars = {
|
|
||||||
-- " ",
|
|
||||||
-- },
|
|
||||||
-- style = {
|
|
||||||
-- { bg = "#434437" },
|
|
||||||
-- { bg = "#2f4440" },
|
|
||||||
-- { bg = "#433054" },
|
|
||||||
-- { bg = "#284251" },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- line_num = {
|
|
||||||
-- enable = false,
|
|
||||||
-- },
|
|
||||||
-- }))
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
-- AI code completion
|
|
||||||
-- {
|
|
||||||
-- "monkoose/neocodeium",
|
|
||||||
-- event = "LspAttach",
|
|
||||||
-- config = function()
|
|
||||||
-- local neocodeium = require "neocodeium"
|
|
||||||
-- neocodeium.setup()
|
|
||||||
-- vim.keymap.set("n", "<Leader>;", function() require("neocodeium.commands").toggle() end)
|
|
||||||
-- vim.keymap.set("i", "<A-a>", function() require("neocodeium").accept() end)
|
|
||||||
-- vim.keymap.set("i", "<C-Right>", function() require("neocodeium").accept_word() end)
|
|
||||||
-- vim.keymap.set("i", "<A-e>", function() require("neocodeium").accept_line() end)
|
|
||||||
-- vim.keymap.set("i", "<S-Right>", function() require("neocodeium").cycle_or_complete() end)
|
|
||||||
-- vim.keymap.set("i", "<S-Left>", function() require("neocodeium").cycle_or_complete(-1) end)
|
|
||||||
-- vim.keymap.set("i", "<C-x>", function() require("neocodeium").clear() end)
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
-- Multi-cursors support
|
|
||||||
{
|
|
||||||
"brenton-leighton/multiple-cursors.nvim",
|
|
||||||
version = "*",
|
|
||||||
opts = {},
|
opts = {},
|
||||||
keys = {
|
},
|
||||||
{ "<C-Down>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "n", "i", "x" } },
|
|
||||||
{ "<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "i", "x" } },
|
-- Indent scope highlighting
|
||||||
{ "<A-LeftMouse>", "<Cmd>MultipleCursorsMouseAddDelete<CR>", mode = { "n", "i" } },
|
{
|
||||||
{ "<Leader>a", "<Cmd>MultipleCursorsAddMatches<CR>", mode = { "n", "x" } },
|
"echasnovski/mini.indentscope",
|
||||||
{ "<C-D>", "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", mode = { "n", "x" } },
|
event = "User AstroFile",
|
||||||
|
opts = function()
|
||||||
|
vim.api.nvim_set_hl(0, "MiniIndentscopeSymbol", { fg = "#FF4500" })
|
||||||
|
return {
|
||||||
|
options = { try_as_border = true, border = "both" },
|
||||||
|
symbol = require("astrocore").plugin_opts("indent-blankline.nvim").context_char or "",
|
||||||
|
draw = {
|
||||||
|
delay = 0,
|
||||||
|
animation = function(s, n) return 10 end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = { scope = { enabled = false } },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"AstroNvim/astrocore",
|
||||||
|
opts = {
|
||||||
|
autocmds = {
|
||||||
|
mini_indentscope = {
|
||||||
|
{
|
||||||
|
event = "FileType",
|
||||||
|
desc = "Disable indentscope for certain filetypes",
|
||||||
|
callback = function(event)
|
||||||
|
if vim.b[event.buf].miniindentscope_disable == nil then
|
||||||
|
local filetype = vim.bo[event.buf].filetype
|
||||||
|
local blankline_opts = require("astrocore").plugin_opts "indent-blankline.nvim"
|
||||||
|
local ignore_filetypes = {
|
||||||
|
"aerial", "alpha", "dashboard", "help", "lazy", "mason", "neo-tree",
|
||||||
|
"NvimTree", "neogitstatus", "notify", "startify", "toggleterm", "Trouble",
|
||||||
|
}
|
||||||
|
if vim.tbl_contains(blankline_opts.filetype_exclude or ignore_filetypes, filetype) then
|
||||||
|
vim.b[event.buf].miniindentscope_disable = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
event = "BufWinEnter",
|
||||||
|
desc = "Disable indentscope for certain buftypes",
|
||||||
|
callback = function(event)
|
||||||
|
if vim.b[event.buf].miniindentscope_disable == nil then
|
||||||
|
local buftype = vim.bo[event.buf].buftype
|
||||||
|
local blankline_opts = require("astrocore").plugin_opts "indent-blankline.nvim"
|
||||||
|
local ignore_buftypes = {
|
||||||
|
"nofile", "prompt", "quickfix", "terminal",
|
||||||
|
}
|
||||||
|
if vim.tbl_contains(blankline_opts.buftype_exclude or ignore_buftypes, buftype) then
|
||||||
|
vim.b[event.buf].miniindentscope_disable = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
event = "TermOpen",
|
||||||
|
desc = "Disable indentscope for terminals",
|
||||||
|
callback = function(event)
|
||||||
|
if vim.b[event.buf].miniindentscope_disable == nil then
|
||||||
|
vim.b[event.buf].miniindentscope_disable = true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Better code folding
|
-- Better code folding
|
||||||
{
|
{
|
||||||
"kevinhwang91/nvim-ufo",
|
"kevinhwang91/nvim-ufo",
|
||||||
opts = {
|
opts = {
|
||||||
-- Add virtual text to show how many lines are folded
|
|
||||||
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
|
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
|
||||||
local newVirtText = {}
|
local newVirtText = {}
|
||||||
local suffix = (" %d "):format(endLnum - lnum)
|
local suffix = (" %d "):format(endLnum - lnum)
|
||||||
@@ -158,7 +162,6 @@ return {
|
|||||||
local hlGroup = chunk[2]
|
local hlGroup = chunk[2]
|
||||||
table.insert(newVirtText, { chunkText, hlGroup })
|
table.insert(newVirtText, { chunkText, hlGroup })
|
||||||
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||||
-- str width returned from truncate() may less than 2nd argument, need padding
|
|
||||||
if curWidth + chunkWidth < targetWidth then
|
if curWidth + chunkWidth < targetWidth then
|
||||||
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
|
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
|
||||||
end
|
end
|
||||||
@@ -171,10 +174,11 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Better split navigation and resize
|
-- Better split navigation and resize
|
||||||
{
|
{
|
||||||
"mrjones2014/smart-splits.nvim",
|
"mrjones2014/smart-splits.nvim",
|
||||||
event = "VeryLazy", -- load on very lazy for mux detection
|
event = "VeryLazy",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
opts.ignored_filetypes = { "nofile", "quickfix", "qf", "prompt", "NvimTree" }
|
opts.ignored_filetypes = { "nofile", "quickfix", "qf", "prompt", "NvimTree" }
|
||||||
opts.ignored_buftypes = { "nofile" }
|
opts.ignored_buftypes = { "nofile" }
|
||||||
@@ -205,31 +209,6 @@ return {
|
|||||||
mode = { "n" },
|
mode = { "n" },
|
||||||
desc = "Move to below split",
|
desc = "Move to below split",
|
||||||
},
|
},
|
||||||
-- {
|
|
||||||
-- "<A-Left>",
|
|
||||||
-- function() require("smart-splits").resize_left() end,
|
|
||||||
-- mode = { "n" },
|
|
||||||
-- desc = "Resize split left",
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- "<A-Right>",
|
|
||||||
-- function() require("smart-splits").resize_right() end,
|
|
||||||
-- mode = { "n" },
|
|
||||||
-- desc = "Resize split right",
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- "<A-Up>",
|
|
||||||
-- function() require("smart-splits").resize_up() end,
|
|
||||||
-- mode = { "n" },
|
|
||||||
-- desc = "Resize split up",
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- "<A-Down>",
|
|
||||||
-- function() require("smart-splits").resize_down() end,
|
|
||||||
-- mode = { "n" },
|
|
||||||
-- desc = "Resize split down",
|
|
||||||
-- },
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"<S-h>",
|
"<S-h>",
|
||||||
function() require("smart-splits").resize_left() end,
|
function() require("smart-splits").resize_left() end,
|
||||||
@@ -242,18 +221,23 @@ return {
|
|||||||
mode = { "n" },
|
mode = { "n" },
|
||||||
desc = "Resize split right",
|
desc = "Resize split right",
|
||||||
},
|
},
|
||||||
-- {
|
|
||||||
-- "<S-k>",
|
|
||||||
-- function() require("smart-splits").resize_up() end,
|
|
||||||
-- mode = { "n" },
|
|
||||||
-- desc = "Resize split up",
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- "<S-j>",
|
|
||||||
-- function() require("smart-splits").resize_down() end,
|
|
||||||
-- mode = { "n" },
|
|
||||||
-- desc = "Resize split down",
|
|
||||||
-- },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Built-in terminal support
|
||||||
|
{
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
enabled = false,
|
||||||
|
opts = function(_, opts)
|
||||||
|
-- Use powershell for toggleterm on windows
|
||||||
|
-- if vim.fn.has "win32" then opts.shell = "pwsh.exe" end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Disabled editor plugins
|
||||||
|
{ "max397574/better-escape.nvim", enabled = false },
|
||||||
|
{ "hinell/duplicate.nvim", enabled = false },
|
||||||
|
{ "CRAG666/code_runner.nvim", enabled = false },
|
||||||
|
{ "RRethy/vim-illuminate", enabled = false },
|
||||||
|
{ "echasnovski/mini.bufremove", enabled = false },
|
||||||
}
|
}
|
||||||
|
|||||||
38
lua/plugins/file_explorer.lua
Normal file
38
lua/plugins/file_explorer.lua
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
-- File Explorer and File Management
|
||||||
|
return {
|
||||||
|
-- Neo-tree file explorer
|
||||||
|
{
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
opts = {
|
||||||
|
source_selector = {
|
||||||
|
winbar = false,
|
||||||
|
},
|
||||||
|
filesystem = {
|
||||||
|
filtered_items = {
|
||||||
|
visible = true,
|
||||||
|
show_hidden_count = true,
|
||||||
|
hide_dotfiles = false,
|
||||||
|
hide_gitignored = false,
|
||||||
|
hide_by_name = {},
|
||||||
|
never_show = {},
|
||||||
|
never_show_by_pattern = {
|
||||||
|
"*.zip",
|
||||||
|
"*.rar",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
["K"] = false,
|
||||||
|
["H"] = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
enable_git_status = false,
|
||||||
|
enable_diagnostics = false,
|
||||||
|
git_status_async = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Disabled file explorer plugins
|
||||||
|
{ "s1n7ax/nvim-window-picker", enabled = false },
|
||||||
|
}
|
||||||
24
lua/plugins/formatting.lua
Normal file
24
lua/plugins/formatting.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
-- Formatting and Linting
|
||||||
|
return {
|
||||||
|
-- None-ls formatting
|
||||||
|
{
|
||||||
|
"nvimtools/none-ls.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvimtools/none-ls-extras.nvim",
|
||||||
|
"jay-babu/mason-null-ls.nvim",
|
||||||
|
},
|
||||||
|
opts = function(_, opts)
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
opts.sources = {
|
||||||
|
require("none-ls.formatting.ruff").with({ extra_args = { "--extend-select", "F" } }),
|
||||||
|
require("none-ls.formatting.ruff_format"),
|
||||||
|
}
|
||||||
|
return opts
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Disabled formatting plugins
|
||||||
|
{ "rafamadriz/friendly-snippets", enabled = false },
|
||||||
|
{ "JoosepAlviste/nvim-ts-context-commentstring", enabled = false },
|
||||||
|
{ "windwp/nvim-ts-autotag", enabled = false },
|
||||||
|
}
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
local ignore_filetypes = {
|
|
||||||
"aerial",
|
|
||||||
"alpha",
|
|
||||||
"dashboard",
|
|
||||||
"help",
|
|
||||||
"lazy",
|
|
||||||
"mason",
|
|
||||||
"neo-tree",
|
|
||||||
"NvimTree",
|
|
||||||
"neogitstatus",
|
|
||||||
"notify",
|
|
||||||
"startify",
|
|
||||||
"toggleterm",
|
|
||||||
"Trouble",
|
|
||||||
}
|
|
||||||
local ignore_buftypes = {
|
|
||||||
"nofile",
|
|
||||||
"prompt",
|
|
||||||
"quickfix",
|
|
||||||
"terminal",
|
|
||||||
}
|
|
||||||
local char = ""
|
|
||||||
|
|
||||||
return {
|
|
||||||
"echasnovski/mini.indentscope",
|
|
||||||
event = "User AstroFile",
|
|
||||||
opts = function()
|
|
||||||
vim.api.nvim_set_hl(0, "MiniIndentscopeSymbol", { fg = "#FF4500" }) -- Replace #FF4500 with your desired color
|
|
||||||
return {
|
|
||||||
options = { try_as_border = true, border = "both" },
|
|
||||||
symbol = require("astrocore").plugin_opts("indent-blankline.nvim").context_char or char,
|
|
||||||
draw = {
|
|
||||||
delay = 0,
|
|
||||||
animation = function(s, n) return 10 end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = { scope = { enabled = false } },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"AstroNvim/astrocore",
|
|
||||||
opts = {
|
|
||||||
autocmds = {
|
|
||||||
mini_indentscope = {
|
|
||||||
{
|
|
||||||
event = "FileType",
|
|
||||||
desc = "Disable indentscope for certain filetypes",
|
|
||||||
callback = function(event)
|
|
||||||
if vim.b[event.buf].miniindentscope_disable == nil then
|
|
||||||
local filetype = vim.bo[event.buf].filetype
|
|
||||||
local blankline_opts = require("astrocore").plugin_opts "indent-blankline.nvim"
|
|
||||||
if vim.tbl_contains(blankline_opts.filetype_exclude or ignore_filetypes, filetype) then
|
|
||||||
vim.b[event.buf].miniindentscope_disable = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
event = "BufWinEnter",
|
|
||||||
desc = "Disable indentscope for certain buftypes",
|
|
||||||
callback = function(event)
|
|
||||||
if vim.b[event.buf].miniindentscope_disable == nil then
|
|
||||||
local buftype = vim.bo[event.buf].buftype
|
|
||||||
local blankline_opts = require("astrocore").plugin_opts "indent-blankline.nvim"
|
|
||||||
if vim.tbl_contains(blankline_opts.buftype_exclude or ignore_buftypes, buftype) then
|
|
||||||
vim.b[event.buf].miniindentscope_disable = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
event = "TermOpen",
|
|
||||||
desc = "Disable indentscope for terminals",
|
|
||||||
callback = function(event)
|
|
||||||
if vim.b[event.buf].miniindentscope_disable == nil then
|
|
||||||
vim.b[event.buf].miniindentscope_disable = true
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,19 +1,25 @@
|
|||||||
-- Plugins related to motion
|
-- Motion, Navigation and Multiple Cursors
|
||||||
return {
|
return {
|
||||||
-- Faster change/delete/replace delimiter pairs
|
-- Multi-cursors support
|
||||||
-- {
|
{
|
||||||
-- "echasnovski/mini.surround",
|
"brenton-leighton/multiple-cursors.nvim",
|
||||||
-- opts = { n_lines = 200 },
|
version = "*",
|
||||||
-- keys = {
|
opts = {},
|
||||||
-- { "sa", mode = { "n", "x" }, desc = "Add surrounding" },
|
keys = {
|
||||||
-- { "sd", mode = { "n", "x" }, desc = "Delete surrounding" },
|
{ "<C-Down>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "n", "i", "x" } },
|
||||||
-- { "sr", mode = { "n", "x" }, desc = "Replace surrounding" },
|
{ "<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "i", "x" } },
|
||||||
-- { "sf", mode = { "n", "x" }, desc = "Find right surrounding" },
|
{ "<A-LeftMouse>", "<Cmd>MultipleCursorsMouseAddDelete<CR>", mode = { "n", "i" } },
|
||||||
-- { "sF", mode = { "n", "x" }, desc = "Find left surrounding" },
|
{ "<Leader>a", "<Cmd>MultipleCursorsAddMatches<CR>", mode = { "n", "x" } },
|
||||||
-- { "sh", mode = { "n", "x" }, desc = "Highlight surrounding" },
|
{ "<C-D>", "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", mode = { "n", "x" } },
|
||||||
-- { "sn", mode = { "n", "x" }, desc = "Update `MiniSurround.config.n_lines`" },
|
},
|
||||||
-- },
|
},
|
||||||
-- },
|
|
||||||
|
-- Alternative multi-cursor plugin
|
||||||
|
{
|
||||||
|
"mg979/vim-visual-multi",
|
||||||
|
event = "BufRead",
|
||||||
|
},
|
||||||
|
|
||||||
-- Brackets splitjoin
|
-- Brackets splitjoin
|
||||||
{
|
{
|
||||||
"Wansmer/treesj",
|
"Wansmer/treesj",
|
||||||
@@ -26,6 +32,7 @@ return {
|
|||||||
{ "gs", "<Cmd>TSJToggle<CR>", mode = { "n" }, desc = "Toggle splitjoin" },
|
{ "gs", "<Cmd>TSJToggle<CR>", mode = { "n" }, desc = "Toggle splitjoin" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Better move by word
|
-- Better move by word
|
||||||
{
|
{
|
||||||
"chrisgrieser/nvim-spider",
|
"chrisgrieser/nvim-spider",
|
||||||
@@ -37,6 +44,7 @@ return {
|
|||||||
{ "ge", "<Cmd>lua require('spider').motion('ge')<CR>", mode = { "n", "o", "x" }, desc = "Spider-ge" },
|
{ "ge", "<Cmd>lua require('spider').motion('ge')<CR>", mode = { "n", "o", "x" }, desc = "Spider-ge" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Better character motion
|
-- Better character motion
|
||||||
{
|
{
|
||||||
"folke/flash.nvim",
|
"folke/flash.nvim",
|
||||||
@@ -59,6 +67,7 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Move code block
|
-- Move code block
|
||||||
{
|
{
|
||||||
"echasnovski/mini.move",
|
"echasnovski/mini.move",
|
||||||
@@ -78,4 +87,7 @@ return {
|
|||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Disabled motion plugins
|
||||||
|
{ "Wansmer/treesj", enabled = false },
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"brenton-leighton/multiple-cursors.nvim",
|
|
||||||
event = "BufRead",
|
|
||||||
cmd = {
|
|
||||||
"MultipleCursorsAddDown",
|
|
||||||
"MultipleCursorsAddUp",
|
|
||||||
"MultipleCursorsMouseAddDelete",
|
|
||||||
"MultipleCursorsAddMatches",
|
|
||||||
"MultipleCursorsAddMatchesV",
|
|
||||||
"MultipleCursorsAddJumpNextMatch",
|
|
||||||
"MultipleCursorsJumpNextMatch",
|
|
||||||
"MultipleCursorsLock",
|
|
||||||
},
|
|
||||||
dependencies = {
|
|
||||||
"AstroNvim/astrocore",
|
|
||||||
opts = function(_, opts)
|
|
||||||
local maps = opts.mappings
|
|
||||||
for lhs, map in pairs {
|
|
||||||
["<C-Down>"] = { "<Cmd>MultipleCursorsAddDown<CR>", desc = "Add cursor down" },
|
|
||||||
["<C-Up>"] = { "<Cmd>MultipleCursorsAddUp<CR>", desc = "Add cursor up" },
|
|
||||||
["<C-LeftMouse>"] = { "<Cmd>MultipleCursorsMouseAddDelete<CR>", desc = "Add cursor with mouse" },
|
|
||||||
} do
|
|
||||||
maps.n[lhs] = map
|
|
||||||
maps.i[lhs] = map
|
|
||||||
end
|
|
||||||
local prefix = "<Leader>c"
|
|
||||||
for lhs, map in pairs {
|
|
||||||
[prefix .. "a"] = { "<Cmd>MultipleCursorsAddMatches<CR>", desc = "Add cursor matches" },
|
|
||||||
[prefix .. "A"] = {
|
|
||||||
"<Cmd>MultipleCursorsAddMatchesV<CR>",
|
|
||||||
desc = "Add cursor matches in previous visual area",
|
|
||||||
},
|
|
||||||
[prefix .. "j"] = { "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", desc = "Add cursor and jump to next match" },
|
|
||||||
[prefix .. "J"] = { "<Cmd>MultipleCursorsJumpNextMatch<CR>", desc = "Move cursor to next match" },
|
|
||||||
[prefix .. "l"] = { "<Cmd>MultipleCursorsLock<CR>", desc = "Lock virtual cursors" },
|
|
||||||
} do
|
|
||||||
maps.n[lhs] = map
|
|
||||||
maps.x[lhs] = map
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"mg979/vim-visual-multi",
|
|
||||||
event = "BufRead",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
opts = {
|
|
||||||
source_selector = {
|
|
||||||
winbar = false,
|
|
||||||
},
|
|
||||||
filesystem = {
|
|
||||||
filtered_items = {
|
|
||||||
visible = true,
|
|
||||||
show_hidden_count = true,
|
|
||||||
hide_dotfiles = false, -- always show dotfiles
|
|
||||||
hide_gitignored = false, -- always show gitignored
|
|
||||||
hide_by_name = {},
|
|
||||||
never_show = {},
|
|
||||||
never_show_by_pattern = { -- uses glob style patterns
|
|
||||||
"*.zip",
|
|
||||||
"*.rar",
|
|
||||||
-- "*.pdf",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
["K"] = false, -- disable Shift+k
|
|
||||||
["H"] = false, -- disable Shift+k
|
|
||||||
},
|
|
||||||
},
|
|
||||||
enable_git_status = false,
|
|
||||||
enable_diagnostics = false,
|
|
||||||
git_status_async = false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
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 = {
|
|
||||||
override = {
|
|
||||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
|
||||||
["vim.lsp.util.stylize_markdown"] = true,
|
|
||||||
["cmp.entry.get_documentation"] = true,
|
|
||||||
},
|
|
||||||
progress = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
hover = {
|
|
||||||
enabled = true,
|
|
||||||
silent = true,
|
|
||||||
view = nil,
|
|
||||||
opts = {
|
|
||||||
border = {
|
|
||||||
style = "rounded",
|
|
||||||
text = { top = " Documents ", top_align = "center" },
|
|
||||||
},
|
|
||||||
win_options = {
|
|
||||||
wrap = true,
|
|
||||||
linebreak = true,
|
|
||||||
},
|
|
||||||
buf_options = {
|
|
||||||
filetype = "markdown",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
signature = {
|
|
||||||
enabled = false, -- disables Noice LSP signature help
|
|
||||||
},
|
|
||||||
message = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
markdown = {},
|
|
||||||
|
|
||||||
presets = {
|
|
||||||
bottom_search = false, -- use a classic bottom cmdline for search
|
|
||||||
command_palette = true, -- position the cmdline and popupmenu together
|
|
||||||
long_message_to_split = true, -- 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,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
-- Customize None-ls sources
|
|
||||||
|
|
||||||
---@type LazySpec
|
|
||||||
return {
|
|
||||||
"nvimtools/none-ls.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvimtools/none-ls-extras.nvim",
|
|
||||||
"jay-babu/mason-null-ls.nvim",
|
|
||||||
},
|
|
||||||
opts = function(_, opts)
|
|
||||||
-- config variable is the default configuration table for the setup function call
|
|
||||||
local null_ls = require("null-ls")
|
|
||||||
|
|
||||||
opts.sources = {
|
|
||||||
require("none-ls.formatting.ruff").with({ extra_args = { "--extend-select", "F" } }),
|
|
||||||
require("none-ls.formatting.ruff_format"), -- Set a formatter
|
|
||||||
|
|
||||||
}
|
|
||||||
return opts
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
---@type LazySpec
|
|
||||||
return {
|
|
||||||
"andersevenrud/nvim_context_vt",
|
|
||||||
event = "User AstroFile",
|
|
||||||
cmd = { "NvimContextVtToggle" },
|
|
||||||
dependencies = {
|
|
||||||
"AstroNvim/astrocore",
|
|
||||||
---@type AstroCoreOpts
|
|
||||||
opts = {
|
|
||||||
mappings = {
|
|
||||||
n = {
|
|
||||||
["<Leader>uv"] = {
|
|
||||||
function()
|
|
||||||
require("nvim_context_vt").toggle()
|
|
||||||
end,
|
|
||||||
desc = "Toggle virutal text context",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
---@type LazySpec
|
|
||||||
return {
|
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
|
||||||
event = "User AstroFile",
|
|
||||||
cmd = { "TSContext" },
|
|
||||||
opts = {
|
|
||||||
-- không có option trực tiếp cho border, nên ta set highlight ở đây
|
|
||||||
on_attach = function()
|
|
||||||
vim.api.nvim_set_hl(0, "TreesitterContext", { underline = true, sp = "Red", bg = "#1e1e3f" })
|
|
||||||
end,
|
|
||||||
max_lines = 2, -- 0 means no limit
|
|
||||||
|
|
||||||
},
|
|
||||||
dependencies = {
|
|
||||||
"AstroNvim/astrocore",
|
|
||||||
---@type AstroCoreOpts
|
|
||||||
opts = {
|
|
||||||
mappings = {
|
|
||||||
n = {
|
|
||||||
["<Leader>uT"] = {
|
|
||||||
"<cmd>TSContext toggle<CR>",
|
|
||||||
desc = "Toggle treesitter context",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
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",
|
|
||||||
-- -- size = 0.25,
|
|
||||||
-- -- },
|
|
||||||
-- },
|
|
||||||
-- position = "bottom",
|
|
||||||
-- size = 8,
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- config = function(_, opts)
|
|
||||||
-- local dap = require("dap")
|
|
||||||
-- local dapui = require("dapui")
|
|
||||||
|
|
||||||
-- -- 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
|
|
||||||
|
|
||||||
-- -- 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",
|
|
||||||
opts = {
|
|
||||||
icons = {
|
|
||||||
type = " ",
|
|
||||||
parameter = " ",
|
|
||||||
offspec = " ", -- hint kind not defined in official LSP spec
|
|
||||||
unknown = " ", -- hint kind is nil
|
|
||||||
},
|
|
||||||
label = {
|
|
||||||
truncateAtChars = 100,
|
|
||||||
padding = 1,
|
|
||||||
marginLeft = 0,
|
|
||||||
sameKindSeparator = ", ",
|
|
||||||
},
|
|
||||||
extmark = {
|
|
||||||
priority = 50,
|
|
||||||
},
|
|
||||||
autoEnableHints = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
12
lua/plugins/snippets.lua
Normal file
12
lua/plugins/snippets.lua
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
-- Snippets
|
||||||
|
return {
|
||||||
|
-- LuaSnip
|
||||||
|
{
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Disabled snippet plugins
|
||||||
|
{ "rafamadriz/friendly-snippets", enabled = false },
|
||||||
|
{ "saadparwaiz1/cmp_luasnip", enabled = false },
|
||||||
|
}
|
||||||
@@ -1,10 +1,27 @@
|
|||||||
|
-- Themes and Colorschemes
|
||||||
return {
|
return {
|
||||||
|
-- Main colorscheme
|
||||||
|
{
|
||||||
|
"ribru17/bamboo.nvim",
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
require("bamboo").setup {
|
||||||
|
integrations = { mini = true },
|
||||||
|
terminal_colors = false
|
||||||
|
}
|
||||||
|
require("bamboo").load()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Alternative themes (disabled)
|
||||||
{
|
{
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
name = "catppuccin",
|
name = "catppuccin",
|
||||||
|
enabled = false,
|
||||||
opts = {
|
opts = {
|
||||||
flavour = "mocha", -- latte, frappe, macchiato, mocha
|
flavour = "mocha",
|
||||||
background = { -- :h background
|
background = {
|
||||||
light = "latte",
|
light = "latte",
|
||||||
dark = "mocha",
|
dark = "mocha",
|
||||||
},
|
},
|
||||||
@@ -61,19 +78,15 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Using lazy.nvim
|
-- Disabled themes
|
||||||
{
|
{ "rebelot/kanagawa.nvim", enabled = false },
|
||||||
"ribru17/bamboo.nvim",
|
{ "folke/tokyonight.nvim", enabled = false },
|
||||||
lazy = false,
|
{ "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false },
|
||||||
priority = 1000,
|
{ "AstroNvim/astrotheme", enabled = false },
|
||||||
config = function()
|
{ "scottmckendry/cyberdream.nvim", enabled = false },
|
||||||
require("bamboo").setup {
|
{ "loctvl842/monokai-pro.nvim", enabled = false },
|
||||||
-- optional configuration here
|
|
||||||
integrations = { mini = true },
|
-- Transparent background
|
||||||
terminal_colors = false
|
{ "xiyaowong/transparent.nvim", enabled = false },
|
||||||
}
|
|
||||||
require("bamboo").load()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
@@ -1,172 +1,295 @@
|
|||||||
-- Plugins related to UI
|
-- UI and Interface Enhancements
|
||||||
return {
|
return {
|
||||||
{
|
-- Dashboard
|
||||||
"goolord/alpha-nvim",
|
{
|
||||||
dependencies = { "echasnovski/mini.icons" },
|
"goolord/alpha-nvim",
|
||||||
opts = function(_, opts)
|
dependencies = { "echasnovski/mini.icons" },
|
||||||
-- customize the dashboard header
|
opts = function(_, opts)
|
||||||
opts.section.header.val = require("plugins.configs.ui.alpha")[10]
|
opts.section.header.val = require("plugins.configs.ui.alpha")[10]
|
||||||
opts.section.buttons.val = {}
|
opts.section.buttons.val = {}
|
||||||
end,
|
end,
|
||||||
-- config = function() require("alpha").setup(require("alpha.themes.startify").config) end,
|
},
|
||||||
},
|
|
||||||
{
|
|
||||||
"rebelot/heirline.nvim",
|
|
||||||
opts = function(_, opts)
|
|
||||||
opts.statusline = require("plugins.configs.ui.heirline").statusline
|
|
||||||
opts.winbar = require("plugins.configs.ui.heirline").winbar
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
opts = function(_, opts)
|
|
||||||
-- Do this to prevent the warning
|
|
||||||
opts.background_colour = "#000000"
|
|
||||||
opts.timeout = 2000
|
|
||||||
opts.fps = 60
|
|
||||||
opts.render = "compact"
|
|
||||||
opts.top_down = false
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Transparent background
|
-- Status line
|
||||||
-- {
|
{
|
||||||
-- "xiyaowong/transparent.nvim",
|
"rebelot/heirline.nvim",
|
||||||
-- lazy = false,
|
opts = function(_, opts)
|
||||||
-- opts = function(_, opts) opts = require "plugins.configs.ui.transparent"(opts) end,
|
opts.statusline = require("plugins.configs.ui.heirline").statusline
|
||||||
-- keys = {
|
opts.winbar = require("plugins.configs.ui.heirline").winbar
|
||||||
-- { "<Leader>uT", "<Cmd>TransparentToggle<CR>", desc = "Toggle transparent" },
|
end,
|
||||||
-- },
|
},
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- {
|
|
||||||
-- "HiPhish/rainbow-delimiters.nvim",
|
|
||||||
-- dependencies = {
|
|
||||||
-- "nvim-treesitter/nvim-treesitter",
|
|
||||||
-- {
|
|
||||||
-- "AstroNvim/astrocore",
|
|
||||||
-- opts = {
|
|
||||||
-- mappings = {
|
|
||||||
-- n = {
|
|
||||||
-- ["<Leader>u("] = {
|
|
||||||
-- function()
|
|
||||||
-- local bufnr = vim.api.nvim_get_current_buf()
|
|
||||||
-- require("rainbow-delimiters").toggle(bufnr)
|
|
||||||
-- require("astrocore").notify(
|
|
||||||
-- string.format(
|
|
||||||
-- "Buffer rainbow delimeters %s",
|
|
||||||
-- require("rainbow-delimiters").is_enabled(bufnr) and "on" or "off"
|
|
||||||
-- )
|
|
||||||
-- )
|
|
||||||
-- end,
|
|
||||||
-- desc = "Toggle rainbow delimeters (buffer)",
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- event = "User AstroFile",
|
|
||||||
-- main = "rainbow-delimiters.setup",
|
|
||||||
-- opts = {},
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
{
|
|
||||||
"folke/todo-comments.nvim",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
|
||||||
opts = {
|
|
||||||
-- your configuration comes here
|
|
||||||
-- or leave it empty to use the default settings
|
|
||||||
-- refer to the configuration section below
|
|
||||||
|
|
||||||
keywords = {
|
-- Notifications
|
||||||
FIX = {
|
{
|
||||||
icon = " ", -- icon used for the sign, and in search results
|
"rcarriga/nvim-notify",
|
||||||
color = "error", -- can be a hex color, or a named color (see below)
|
opts = function(_, opts)
|
||||||
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
|
opts.background_colour = "#000000"
|
||||||
-- signs = false, -- configure signs for some keywords individually
|
opts.timeout = 2000
|
||||||
},
|
opts.fps = 60
|
||||||
TODO = { icon = " ", color = "info" },
|
opts.render = "compact"
|
||||||
GOAL = { icon = " ", color = "info", alt = { "GOALS", "TARGETS", "FIXED" } },
|
opts.top_down = false
|
||||||
HACK = { icon = " ", color = "warning" },
|
end,
|
||||||
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
},
|
||||||
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
|
||||||
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
-- Todo comments highlighting
|
||||||
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
|
{
|
||||||
},
|
"folke/todo-comments.nvim",
|
||||||
},
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
},
|
opts = {
|
||||||
{
|
keywords = {
|
||||||
"altermo/ultimate-autopair.nvim",
|
FIX = {
|
||||||
event = "InsertEnter",
|
icon = " ", -- icon used for the sign, and in search results
|
||||||
branch = "v0.6", --recommended as each new version will have breaking changes
|
color = "error", -- can be a hex color, or a named color (see below)
|
||||||
opts = {
|
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
|
||||||
-- disable autopair in the command line: https://github.com/altermo/ultimate-autopair.nvim/issues/8
|
},
|
||||||
cmap = false,
|
TODO = { icon = " ", color = "info" },
|
||||||
extensions = {
|
GOAL = { icon = " ", color = "info", alt = { "GOALS", "TARGETS", "FIXED" } },
|
||||||
cond = {
|
HACK = { icon = " ", color = "warning" },
|
||||||
-- disable in comments
|
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
||||||
-- https://github.com/altermo/ultimate-autopair.nvim/blob/6fd0d6aa976a97dd6f1bed4d46be1b437613a52f/Q%26A.md?plain=1#L26
|
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
||||||
cond = {
|
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
||||||
function(fn)
|
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
|
||||||
return not fn.in_node("comment")
|
},
|
||||||
end,
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Smart bracket pairing
|
||||||
|
{
|
||||||
|
"altermo/ultimate-autopair.nvim",
|
||||||
|
event = "InsertEnter",
|
||||||
|
branch = "v0.6",
|
||||||
|
opts = {
|
||||||
|
cmap = false,
|
||||||
|
extensions = {
|
||||||
|
cond = {
|
||||||
|
cond = {
|
||||||
|
function(fn)
|
||||||
|
return not fn.in_node("comment")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
fly = {
|
||||||
|
nofilter = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config_internal_pairs = {
|
||||||
|
{ '"', '"', fly = true },
|
||||||
|
{ "'", "'", fly = true },
|
||||||
|
{ "[", "]", fly = true },
|
||||||
|
{ "{", "}", fly = true },
|
||||||
|
{ "(", ")", fly = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"AstroNvim/astrocore",
|
||||||
|
opts = {
|
||||||
|
mappings = {
|
||||||
|
n = {
|
||||||
|
["<Leader>ua"] = {
|
||||||
|
desc = "Toggle Ultimate Autopair",
|
||||||
|
function()
|
||||||
|
local notify = require("astrocore").notify
|
||||||
|
local function bool2str(bool)
|
||||||
|
return bool and "on" or "off"
|
||||||
|
end
|
||||||
|
local ok, ultimate_autopair = pcall(require, "ultimate-autopair")
|
||||||
|
if ok then
|
||||||
|
ultimate_autopair.toggle()
|
||||||
|
vim.g.ultimate_autopair_enabled = require("ultimate-autopair.core").disable
|
||||||
|
notify(
|
||||||
|
string.format(
|
||||||
|
"ultimate-autopair %s",
|
||||||
|
bool2str(not vim.g.ultimate_autopair_enabled)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else
|
||||||
|
notify("ultimate-autopair not available")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
specs = {
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
optional = true,
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Treesitter context
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
|
event = "User AstroFile",
|
||||||
|
cmd = { "TSContext" },
|
||||||
|
opts = {
|
||||||
|
on_attach = function()
|
||||||
|
vim.api.nvim_set_hl(0, "TreesitterContext", { underline = true, sp = "Red", bg = "#1e1e3f" })
|
||||||
|
end,
|
||||||
|
max_lines = 2,
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
"AstroNvim/astrocore",
|
||||||
|
opts = {
|
||||||
|
mappings = {
|
||||||
|
n = {
|
||||||
|
["<Leader>uT"] = {
|
||||||
|
"<cmd>TSContext toggle<CR>",
|
||||||
|
desc = "Toggle treesitter context",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Virtual text context
|
||||||
|
{
|
||||||
|
"andersevenrud/nvim_context_vt",
|
||||||
|
event = "User AstroFile",
|
||||||
|
cmd = { "NvimContextVtToggle" },
|
||||||
|
dependencies = {
|
||||||
|
"AstroNvim/astrocore",
|
||||||
|
opts = {
|
||||||
|
mappings = {
|
||||||
|
n = {
|
||||||
|
["<Leader>uv"] = {
|
||||||
|
function()
|
||||||
|
require("nvim_context_vt").toggle()
|
||||||
|
end,
|
||||||
|
desc = "Toggle virutal text context",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Noice UI
|
||||||
|
{
|
||||||
|
"folke/noice.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
dependencies = { "MunifTanjim/nui.nvim" },
|
||||||
|
config = function()
|
||||||
|
require("noice").setup({
|
||||||
|
views = {},
|
||||||
|
messages = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
notify = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
lsp = {
|
||||||
|
override = {
|
||||||
|
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||||
|
["vim.lsp.util.stylize_markdown"] = true,
|
||||||
|
["cmp.entry.get_documentation"] = true,
|
||||||
},
|
},
|
||||||
},
|
progress = {
|
||||||
-- get fly mode working on strings:
|
enabled = false, -- Disable LSP progress
|
||||||
-- https://github.com/altermo/ultimate-autopair.nvim/issues/33
|
|
||||||
fly = {
|
|
||||||
nofilter = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config_internal_pairs = {
|
|
||||||
{ '"', '"', fly = true },
|
|
||||||
{ "'", "'", fly = true },
|
|
||||||
{ "[", "]", fly = true },
|
|
||||||
{ "{", "}", fly = true },
|
|
||||||
{ "(", ")", fly = true },
|
|
||||||
-- { "<", ">", fly = true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"AstroNvim/astrocore",
|
|
||||||
opts = {
|
|
||||||
mappings = {
|
|
||||||
n = {
|
|
||||||
["<Leader>ua"] = {
|
|
||||||
desc = "Toggle Ultimate Autopair",
|
|
||||||
function()
|
|
||||||
local notify = require("astrocore").notify
|
|
||||||
local function bool2str(bool)
|
|
||||||
return bool and "on" or "off"
|
|
||||||
end
|
|
||||||
local ok, ultimate_autopair = pcall(require, "ultimate-autopair")
|
|
||||||
if ok then
|
|
||||||
ultimate_autopair.toggle()
|
|
||||||
vim.g.ultimate_autopair_enabled = require("ultimate-autopair.core").disable
|
|
||||||
notify(
|
|
||||||
string.format(
|
|
||||||
"ultimate-autopair %s",
|
|
||||||
bool2str(not vim.g.ultimate_autopair_enabled)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
else
|
|
||||||
notify("ultimate-autopair not available")
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
hover = {
|
||||||
},
|
enabled = true,
|
||||||
},
|
silent = true,
|
||||||
specs = {
|
view = nil,
|
||||||
{
|
opts = {
|
||||||
"windwp/nvim-autopairs",
|
border = {
|
||||||
optional = true,
|
style = "rounded",
|
||||||
enabled = false,
|
text = { top = " Documents ", top_align = "center" },
|
||||||
},
|
},
|
||||||
},
|
win_options = {
|
||||||
},
|
wrap = true,
|
||||||
|
linebreak = true,
|
||||||
|
},
|
||||||
|
buf_options = {
|
||||||
|
filetype = "markdown",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
signature = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
message = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
markdown = {},
|
||||||
|
presets = {
|
||||||
|
bottom_search = false,
|
||||||
|
command_palette = true,
|
||||||
|
long_message_to_split = true,
|
||||||
|
inc_rename = false,
|
||||||
|
lsp_doc_border = false,
|
||||||
|
},
|
||||||
|
routes = {
|
||||||
|
{
|
||||||
|
filter = { event = "msg_show", kind = "", find = "written" },
|
||||||
|
opts = { skip = true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filter = { event = "msg_show", find = "^%d+ more lines" },
|
||||||
|
opts = { skip = true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filter = { event = "msg_show", find = "^%d+ fewer lines" },
|
||||||
|
opts = { skip = true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filter = { event = "msg_show", find = "^%d+ lines yanked$" },
|
||||||
|
opts = { skip = true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
opts = function(_, opts)
|
||||||
|
-- No need to manage lsp_handlers as noice is not handling them now
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Disabled UI plugins
|
||||||
|
{ "s1n7ax/nvim-window-picker", enabled = false },
|
||||||
|
{ "NvChad/nvim-colorizer.lua", enabled = false },
|
||||||
|
{ "iamcco/markdown-preview.nvim", enabled = false },
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user