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("polish")
|
||||
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" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"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
|
||||
@@ -153,21 +153,18 @@ return {
|
||||
end
|
||||
|
||||
if client.name == "basedpyright" then
|
||||
-- Tắt hết các dịch vụ, chỉ giữ lại diagnostics và inlay hints
|
||||
client.server_capabilities.completionProvider = false
|
||||
client.server_capabilities.codeLensProvider = false
|
||||
client.server_capabilities.colorProvider = false
|
||||
client.server_capabilities.colorProvider = false
|
||||
client.server_capabilities.callHierarchyProvider = false
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
client.server_capabilities.declarationProvider = false
|
||||
client.server_capabilities.documentLinkProvider = false
|
||||
client.server_capabilities.definitionProvider = false
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentOnTypeFormattingProvider = false
|
||||
client.server_capabilities.documentLinkProvider = false
|
||||
client.server_capabilities.documentSymbolProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
client.server_capabilities.hoverProvider = false
|
||||
client.server_capabilities.inlineCompletionProvider = false
|
||||
client.server_capabilities.inlineValueProvider = false
|
||||
@@ -178,6 +175,22 @@ return {
|
||||
client.server_capabilities.workspaceSymbolProvider = false
|
||||
client.server_capabilities.monikerProvider = false
|
||||
client.server_capabilities.semanticTokensProvider = false
|
||||
|
||||
-- Tắt thêm các capabilities khác có thể có
|
||||
client.server_capabilities.referencesProvider = false
|
||||
client.server_capabilities.implementationProvider = false
|
||||
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 {
|
||||
-- enable mode text with padding as well as an icon before it
|
||||
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 = {
|
||||
@@ -30,7 +30,7 @@ M.statusline = {
|
||||
},
|
||||
},
|
||||
status.component.git_branch {
|
||||
padding = { left = 2, right = 1 },
|
||||
padding = { left = 0, right = 1 },
|
||||
surround = {
|
||||
separator = "none",
|
||||
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 {
|
||||
{ "s1n7ax/nvim-window-picker", enabled = false },
|
||||
{ "akinsho/toggleterm.nvim", enabled = false },
|
||||
{ "NvChad/nvim-colorizer.lua", enabled = false },
|
||||
-- Themes and Colorschemes
|
||||
{ "catppuccin/nvim", name = "catppuccin", enabled = false },
|
||||
{ "rebelot/kanagawa.nvim", enabled = false },
|
||||
{ "folke/tokyonight.nvim", enabled = false },
|
||||
{ "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false },
|
||||
{ "b0o/SchemaStore.nvim", enabled = false },
|
||||
{ "ray-x/lsp_signature.nvim", enabled = false },
|
||||
{ "kmontocam/nvim-conda", enabled = false },
|
||||
{ "NMAC427/guess-indent.nvim", enabled = false },
|
||||
{ "lukas-reineke/indent-blankline.nvim", enabled = false },
|
||||
{ "AstroNvim/astrotheme", enabled = false },
|
||||
{ "scottmckendry/cyberdream.nvim", enabled = false },
|
||||
{ "xiyaowong/transparent.nvim", enabled = false },
|
||||
{ "loctvl842/monokai-pro.nvim", enabled = false },
|
||||
{ "xiyaowong/transparent.nvim", enabled = false },
|
||||
|
||||
-- UI and Interface
|
||||
{ "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 },
|
||||
|
||||
-- Editor Enhancements
|
||||
{ "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 },
|
||||
{ "akinsho/toggleterm.nvim", enabled = false },
|
||||
|
||||
-- Completion
|
||||
{ "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 },
|
||||
|
||||
-- System
|
||||
{ "nvim-treesitter/nvim-treesitter-textobjects", enabled = false },
|
||||
-- Disable Dap
|
||||
-- Development Tools
|
||||
{ "mfussenegger/nvim-dap", enabled = false },
|
||||
{ "theHamsta/nvim-dap-virtual-text", enabled = false },
|
||||
{ "rcarriga/nvim-dap-ui", enabled = false },
|
||||
{ "jay-babu/mason-nvim-dap.nvim", enabled = false },
|
||||
-- { "jay-babu/mason-null-ls.nvim", enabled = false },
|
||||
{ "b0o/schemastore.nvim", enabled = false },
|
||||
|
||||
-- Motion and Navigation
|
||||
{ "Wansmer/treesj", enabled = false },
|
||||
|
||||
-- interface
|
||||
{ "ribru17/bamboo.nvim", enabled = true },
|
||||
-- System
|
||||
{ "nvim-treesitter/nvim-treesitter-textobjects", enabled = false },
|
||||
{ "b0o/schemastore.nvim", enabled = false },
|
||||
|
||||
-- service
|
||||
-- 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 },
|
||||
|
||||
{ "rafamadriz/friendly-snippets", enabled = false },
|
||||
{ "JoosepAlviste/nvim-ts-context-commentstring", enabled = false },
|
||||
{ "windwp/nvim-ts-autotag", enabled = false },
|
||||
{ "saadparwaiz1/cmp_luasnip", enabled = false },
|
||||
{ "L3MON4D3/LuaSnip", enabled = true },
|
||||
}
|
||||
|
||||
-- if true then return {} end
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
-- Plugins that enhance editor experience
|
||||
-- Editor Enhancements
|
||||
return {
|
||||
-- Comment management
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
opts = {
|
||||
-- Ignore empty line
|
||||
ignore = "^$",
|
||||
},
|
||||
keys = {
|
||||
@@ -21,126 +21,130 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Built-in terminal support
|
||||
|
||||
-- Auto-save functionality
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
opts = function(_, opts)
|
||||
-- Use powershell for toggleterm on windows
|
||||
-- if vim.fn.has "win32" then opts.shell = "pwsh.exe" end
|
||||
"okuuva/auto-save.nvim",
|
||||
event = { "User AstroFile", "InsertEnter" },
|
||||
dependencies = {
|
||||
"AstroNvim/astrocore",
|
||||
opts = {
|
||||
autocmds = {
|
||||
autoformat_toggle = {
|
||||
{
|
||||
event = "User",
|
||||
desc = "Disable autoformat before saving",
|
||||
pattern = "AutoSaveWritePre",
|
||||
callback = function()
|
||||
vim.g.OLD_AUTOFORMAT = vim.g.autoformat
|
||||
vim.g.autoformat = false
|
||||
local old_autoformat_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,
|
||||
},
|
||||
-- File tagging and navigation
|
||||
-- {
|
||||
-- "cbochs/grapple.nvim",
|
||||
-- dependencies = {
|
||||
-- "nvim-lua/plenary.nvim",
|
||||
-- {
|
||||
-- "AstroNvim/astrocore",
|
||||
-- opts = function(_, opts)
|
||||
-- opts.mappings.n["<Leader><Leader>"] = { desc = require("astroui").get_icon("Grapple", 1, true) .. "Grapple" }
|
||||
-- end,
|
||||
-- },
|
||||
-- },
|
||||
-- opts = {
|
||||
-- scope = "git_branch",
|
||||
-- },
|
||||
-- cmd = { "Grapple" },
|
||||
-- keys = {
|
||||
-- { "<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" },
|
||||
-- { "<Leader><Leader>s", "<Cmd>Grapple toggle_scopes<CR>", desc = "Select a project scope" },
|
||||
-- { "<Leader><Leader>x", "<Cmd>Grapple reset<CR>", desc = "Clear tags" },
|
||||
-- { "<C-e>", "<Cmd>Grapple cycle forward<CR>", desc = "Select next tag" },
|
||||
-- { "<C-p>", "<Cmd>Grapple cycle backward<CR>", desc = "Select previous tag" },
|
||||
-- },
|
||||
-- },
|
||||
-- Better escape support
|
||||
-- {
|
||||
-- "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 = "*",
|
||||
event = "User",
|
||||
desc = "Re-enable autoformat after saving",
|
||||
pattern = "AutoSaveWritePost",
|
||||
callback = function()
|
||||
vim.g.autoformat = vim.g.OLD_AUTOFORMAT
|
||||
for _, bufnr in ipairs(vim.g.OLD_AUTOFORMAT_BUFFERS or {}) do
|
||||
vim.b[bufnr].autoformat = true
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "<C-Down>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "n", "i", "x" } },
|
||||
{ "<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "i", "x" } },
|
||||
{ "<A-LeftMouse>", "<Cmd>MultipleCursorsMouseAddDelete<CR>", mode = { "n", "i" } },
|
||||
{ "<Leader>a", "<Cmd>MultipleCursorsAddMatches<CR>", mode = { "n", "x" } },
|
||||
{ "<C-D>", "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", mode = { "n", "x" } },
|
||||
},
|
||||
|
||||
-- Indent scope highlighting
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
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
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
opts = {
|
||||
-- Add virtual text to show how many lines are folded
|
||||
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
|
||||
local newVirtText = {}
|
||||
local suffix = (" %d "):format(endLnum - lnum)
|
||||
@@ -158,7 +162,6 @@ return {
|
||||
local hlGroup = chunk[2]
|
||||
table.insert(newVirtText, { chunkText, hlGroup })
|
||||
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
-- str width returned from truncate() may less than 2nd argument, need padding
|
||||
if curWidth + chunkWidth < targetWidth then
|
||||
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
|
||||
end
|
||||
@@ -171,10 +174,11 @@ return {
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- Better split navigation and resize
|
||||
{
|
||||
"mrjones2014/smart-splits.nvim",
|
||||
event = "VeryLazy", -- load on very lazy for mux detection
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.ignored_filetypes = { "nofile", "quickfix", "qf", "prompt", "NvimTree" }
|
||||
opts.ignored_buftypes = { "nofile" }
|
||||
@@ -205,31 +209,6 @@ return {
|
||||
mode = { "n" },
|
||||
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>",
|
||||
function() require("smart-splits").resize_left() end,
|
||||
@@ -242,18 +221,23 @@ return {
|
||||
mode = { "n" },
|
||||
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 {
|
||||
-- Faster change/delete/replace delimiter pairs
|
||||
-- {
|
||||
-- "echasnovski/mini.surround",
|
||||
-- opts = { n_lines = 200 },
|
||||
-- keys = {
|
||||
-- { "sa", mode = { "n", "x" }, desc = "Add surrounding" },
|
||||
-- { "sd", mode = { "n", "x" }, desc = "Delete surrounding" },
|
||||
-- { "sr", mode = { "n", "x" }, desc = "Replace surrounding" },
|
||||
-- { "sf", mode = { "n", "x" }, desc = "Find right surrounding" },
|
||||
-- { "sF", mode = { "n", "x" }, desc = "Find left surrounding" },
|
||||
-- { "sh", mode = { "n", "x" }, desc = "Highlight surrounding" },
|
||||
-- { "sn", mode = { "n", "x" }, desc = "Update `MiniSurround.config.n_lines`" },
|
||||
-- },
|
||||
-- },
|
||||
-- Multi-cursors support
|
||||
{
|
||||
"brenton-leighton/multiple-cursors.nvim",
|
||||
version = "*",
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "<C-Down>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "n", "i", "x" } },
|
||||
{ "<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "i", "x" } },
|
||||
{ "<A-LeftMouse>", "<Cmd>MultipleCursorsMouseAddDelete<CR>", mode = { "n", "i" } },
|
||||
{ "<Leader>a", "<Cmd>MultipleCursorsAddMatches<CR>", mode = { "n", "x" } },
|
||||
{ "<C-D>", "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", mode = { "n", "x" } },
|
||||
},
|
||||
},
|
||||
|
||||
-- Alternative multi-cursor plugin
|
||||
{
|
||||
"mg979/vim-visual-multi",
|
||||
event = "BufRead",
|
||||
},
|
||||
|
||||
-- Brackets splitjoin
|
||||
{
|
||||
"Wansmer/treesj",
|
||||
@@ -26,6 +32,7 @@ return {
|
||||
{ "gs", "<Cmd>TSJToggle<CR>", mode = { "n" }, desc = "Toggle splitjoin" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Better move by word
|
||||
{
|
||||
"chrisgrieser/nvim-spider",
|
||||
@@ -37,6 +44,7 @@ return {
|
||||
{ "ge", "<Cmd>lua require('spider').motion('ge')<CR>", mode = { "n", "o", "x" }, desc = "Spider-ge" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Better character motion
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
@@ -59,6 +67,7 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Move code block
|
||||
{
|
||||
"echasnovski/mini.move",
|
||||
@@ -78,4 +87,7 @@ return {
|
||||
}
|
||||
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 {
|
||||
-- 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",
|
||||
name = "catppuccin",
|
||||
enabled = false,
|
||||
opts = {
|
||||
flavour = "mocha", -- latte, frappe, macchiato, mocha
|
||||
background = { -- :h background
|
||||
flavour = "mocha",
|
||||
background = {
|
||||
light = "latte",
|
||||
dark = "mocha",
|
||||
},
|
||||
@@ -62,18 +79,14 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
-- Using lazy.nvim
|
||||
{
|
||||
"ribru17/bamboo.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("bamboo").setup {
|
||||
-- optional configuration here
|
||||
integrations = { mini = true },
|
||||
terminal_colors = false
|
||||
}
|
||||
require("bamboo").load()
|
||||
end,
|
||||
},
|
||||
-- Disabled themes
|
||||
{ "rebelot/kanagawa.nvim", enabled = false },
|
||||
{ "folke/tokyonight.nvim", enabled = false },
|
||||
{ "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false },
|
||||
{ "AstroNvim/astrotheme", enabled = false },
|
||||
{ "scottmckendry/cyberdream.nvim", enabled = false },
|
||||
{ "loctvl842/monokai-pro.nvim", enabled = false },
|
||||
|
||||
-- Transparent background
|
||||
{ "xiyaowong/transparent.nvim", enabled = false },
|
||||
}
|
||||
@@ -1,15 +1,16 @@
|
||||
-- Plugins related to UI
|
||||
-- UI and Interface Enhancements
|
||||
return {
|
||||
-- Dashboard
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
dependencies = { "echasnovski/mini.icons" },
|
||||
opts = function(_, opts)
|
||||
-- customize the dashboard header
|
||||
opts.section.header.val = require("plugins.configs.ui.alpha")[10]
|
||||
opts.section.buttons.val = {}
|
||||
end,
|
||||
-- config = function() require("alpha").setup(require("alpha.themes.startify").config) end,
|
||||
},
|
||||
|
||||
-- Status line
|
||||
{
|
||||
"rebelot/heirline.nvim",
|
||||
opts = function(_, opts)
|
||||
@@ -17,10 +18,11 @@ return {
|
||||
opts.winbar = require("plugins.configs.ui.heirline").winbar
|
||||
end,
|
||||
},
|
||||
|
||||
-- Notifications
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
opts = function(_, opts)
|
||||
-- Do this to prevent the warning
|
||||
opts.background_colour = "#000000"
|
||||
opts.timeout = 2000
|
||||
opts.fps = 60
|
||||
@@ -29,92 +31,43 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
-- Transparent background
|
||||
-- {
|
||||
-- "xiyaowong/transparent.nvim",
|
||||
-- lazy = false,
|
||||
-- opts = function(_, opts) opts = require "plugins.configs.ui.transparent"(opts) end,
|
||||
-- keys = {
|
||||
-- { "<Leader>uT", "<Cmd>TransparentToggle<CR>", desc = "Toggle transparent" },
|
||||
-- },
|
||||
-- },
|
||||
-- {
|
||||
-- {
|
||||
-- "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 = {},
|
||||
-- },
|
||||
-- },
|
||||
-- Todo comments highlighting
|
||||
{
|
||||
"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 = {
|
||||
FIX = {
|
||||
icon = " ", -- icon used for the sign, and in search results
|
||||
icon = " ", -- icon used for the sign, and in search results
|
||||
color = "error", -- can be a hex color, or a named color (see below)
|
||||
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
|
||||
-- signs = false, -- configure signs for some keywords individually
|
||||
},
|
||||
TODO = { icon = " ", color = "info" },
|
||||
GOAL = { icon = " ", color = "info", alt = { "GOALS", "TARGETS", "FIXED" } },
|
||||
HACK = { icon = " ", color = "warning" },
|
||||
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
||||
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
||||
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
||||
TODO = { icon = " ", color = "info" },
|
||||
GOAL = { icon = " ", color = "info", alt = { "GOALS", "TARGETS", "FIXED" } },
|
||||
HACK = { icon = " ", color = "warning" },
|
||||
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
||||
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
||||
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
||||
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Smart bracket pairing
|
||||
{
|
||||
"altermo/ultimate-autopair.nvim",
|
||||
event = "InsertEnter",
|
||||
branch = "v0.6", --recommended as each new version will have breaking changes
|
||||
branch = "v0.6",
|
||||
opts = {
|
||||
-- disable autopair in the command line: https://github.com/altermo/ultimate-autopair.nvim/issues/8
|
||||
cmap = false,
|
||||
extensions = {
|
||||
cond = {
|
||||
-- disable in comments
|
||||
-- https://github.com/altermo/ultimate-autopair.nvim/blob/6fd0d6aa976a97dd6f1bed4d46be1b437613a52f/Q%26A.md?plain=1#L26
|
||||
cond = {
|
||||
function(fn)
|
||||
return not fn.in_node("comment")
|
||||
end,
|
||||
},
|
||||
},
|
||||
-- get fly mode working on strings:
|
||||
-- https://github.com/altermo/ultimate-autopair.nvim/issues/33
|
||||
fly = {
|
||||
nofilter = true,
|
||||
},
|
||||
@@ -125,7 +78,6 @@ return {
|
||||
{ "[", "]", fly = true },
|
||||
{ "{", "}", fly = true },
|
||||
{ "(", ")", fly = true },
|
||||
-- { "<", ">", fly = true },
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
@@ -169,4 +121,175 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- 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 = {
|
||||
enabled = false, -- Disable LSP progress
|
||||
},
|
||||
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,
|
||||
},
|
||||
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