refactor(plugins): streamline Neovim plugin configuration and keybindings
This commit is contained in:
1 parent
32f43b8335
commit
8372131167
9 files changed
+32
-156
No files matched your search
@@ -153,8 +153,7 @@ return {
|
|||||||
},
|
},
|
||||||
ignore = {
|
ignore = {
|
||||||
-- golangci_lint_ls roots at the nearest go.mod, not the repo
|
-- golangci_lint_ls roots at the nearest go.mod, not the repo
|
||||||
-- dev-tools attaches with an empty root_dir which rooter treats as "/"
|
servers = { "golangci_lint_ls" },
|
||||||
servers = { "golangci_lint_ls", "dev-tools" },
|
|
||||||
dirs = {},
|
dirs = {},
|
||||||
},
|
},
|
||||||
autochdir = true,
|
autochdir = true,
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
-- Native supermaven source for blink.cmp (mirrors the astrocommunity blink-copilot pattern).
|
|
||||||
-- Inline ghost text + <C-l> accept come from `astrocommunity.completion.supermaven-nvim`;
|
|
||||||
-- this additionally surfaces supermaven suggestions in the blink menu so <Tab>/<CR> work.
|
|
||||||
return {
|
|
||||||
"Huijiro/blink-cmp-supermaven",
|
|
||||||
lazy = true,
|
|
||||||
specs = {
|
|
||||||
{
|
|
||||||
"saghen/blink.cmp",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
sources = {
|
|
||||||
default = { "supermaven" },
|
|
||||||
providers = {
|
|
||||||
supermaven = {
|
|
||||||
name = "supermaven",
|
|
||||||
module = "blink-cmp-supermaven",
|
|
||||||
score_offset = 100,
|
|
||||||
async = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -7,8 +7,8 @@ return {
|
|||||||
opts = {
|
opts = {
|
||||||
modes = {
|
modes = {
|
||||||
char = {
|
char = {
|
||||||
-- normal-mode `f` is the Vimium-style word jump and `F` is the
|
-- normal-mode `f` is the Vimium-style word jump and `F` toggles a
|
||||||
-- search-style jump below, so flash's char mode must not rebind
|
-- fold (plugins/astrocore.lua), so flash's char mode must not rebind
|
||||||
-- them; t/T/;/, stay enhanced
|
-- them; t/T/;/, stay enhanced
|
||||||
keys = { "t", "T", ";", "," },
|
keys = { "t", "T", ";", "," },
|
||||||
-- show jump labels on the char-motion matches (t/T)
|
-- show jump labels on the char-motion matches (t/T)
|
||||||
@@ -35,7 +35,7 @@ return {
|
|||||||
desc = "Jump to word (Vimium-style)",
|
desc = "Jump to word (Vimium-style)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"F",
|
"g/",
|
||||||
mode = "n",
|
mode = "n",
|
||||||
function()
|
function()
|
||||||
-- Search-style flash: type a regex pattern and labels appear on
|
-- Search-style flash: type a regex pattern and labels appear on
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
|
||||||
|
|
||||||
-- Customize Mason
|
|
||||||
|
|
||||||
---@type LazySpec
|
|
||||||
return {
|
|
||||||
-- use mason-tool-installer for automatically installing Mason packages
|
|
||||||
{
|
|
||||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
|
||||||
-- overrides `require("mason-tool-installer").setup(...)`
|
|
||||||
opts = {
|
|
||||||
-- Make sure to use the names found in `:Mason`
|
|
||||||
ensure_installed = {
|
|
||||||
-- install language servers
|
|
||||||
"lua-language-server",
|
|
||||||
|
|
||||||
-- install formatters
|
|
||||||
"stylua",
|
|
||||||
|
|
||||||
-- install debuggers
|
|
||||||
"debugpy",
|
|
||||||
|
|
||||||
-- install any other package
|
|
||||||
"tree-sitter-cli",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
|
||||||
|
|
||||||
-- Customize None-ls sources
|
|
||||||
|
|
||||||
---@type LazySpec
|
|
||||||
return {
|
|
||||||
"nvimtools/none-ls.nvim",
|
|
||||||
opts = function(_, opts)
|
|
||||||
-- opts variable is the default configuration table for the setup function call
|
|
||||||
-- local null_ls = require "null-ls"
|
|
||||||
|
|
||||||
-- Check supported formatters and linters
|
|
||||||
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
|
||||||
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
|
||||||
|
|
||||||
-- Only insert new sources, do not replace the existing ones
|
|
||||||
-- (If you wish to replace, use `opts.sources = {}` instead of the `list_insert_unique` function)
|
|
||||||
opts.sources = require("astrocore").list_insert_unique(opts.sources, {
|
|
||||||
-- Set a formatter
|
|
||||||
-- null_ls.builtins.formatting.stylua,
|
|
||||||
-- null_ls.builtins.formatting.prettier,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
--- <C-h/j/k/l> pane navigation that follows whatever multiplexer Neovim is
|
--- <C-h/j/k/l> pane navigation that follows whatever multiplexer Neovim is
|
||||||
--- running under (herdr, tmux, or bare kitty) — see config.pane_nav.
|
--- running under (herdr, tmux, or bare kitty) — see config.pane_nav.
|
||||||
---
|
---
|
||||||
--- This replaces AstroNvim's smart-splits mappings on the same keys (which only
|
--- This replaces AstroNvim's smart-splits mappings (which only know
|
||||||
--- know tmux/wezterm/kitty and would move the wrong layer inside herdr).
|
--- tmux/wezterm/kitty and would move the wrong layer inside herdr). The plugin
|
||||||
--- smart-splits itself stays for the <C-Up/Down/Left/Right> resize mappings.
|
--- is disabled in plugins/user.lua; its <C-Up/Down/Left/Right> resize binds
|
||||||
|
--- are plain :resize here.
|
||||||
|
|
||||||
local nav = require "config.pane_nav"
|
local nav = require "config.pane_nav"
|
||||||
|
|
||||||
@@ -16,6 +17,14 @@ local moves = {
|
|||||||
["<C-L>"] = "right",
|
["<C-L>"] = "right",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--- AstroNvim's key spelling again, overriding the smart-splits resize entries.
|
||||||
|
local resizes = {
|
||||||
|
["<C-Up>"] = { "resize +2", "Resize split taller" },
|
||||||
|
["<C-Down>"] = { "resize -2", "Resize split shorter" },
|
||||||
|
["<C-Left>"] = { "vertical resize -2", "Resize split narrower" },
|
||||||
|
["<C-Right>"] = { "vertical resize +2", "Resize split wider" },
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"AstroNvim/astrocore",
|
"AstroNvim/astrocore",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
@@ -27,5 +36,8 @@ return {
|
|||||||
maps.x[key] = maps.n[key]
|
maps.x[key] = maps.n[key]
|
||||||
maps.t[key] = { nav.terminal(dir), desc = desc }
|
maps.t[key] = { nav.terminal(dir), desc = desc }
|
||||||
end
|
end
|
||||||
|
for key, spec in pairs(resizes) do
|
||||||
|
maps.n[key] = { "<Cmd>" .. spec[1] .. "<CR>", desc = spec[2] }
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
|
||||||
|
|
||||||
-- Customize Treesitter
|
|
||||||
-- --------------------
|
|
||||||
-- Treesitter customizations are handled with AstroCore
|
|
||||||
-- as nvim-treesitter simply provides a download utility for parsers
|
|
||||||
|
|
||||||
---@type LazySpec
|
|
||||||
return {
|
|
||||||
"AstroNvim/astrocore",
|
|
||||||
---@type AstroCoreOpts
|
|
||||||
opts = {
|
|
||||||
treesitter = {
|
|
||||||
highlight = true, -- enable/disable treesitter based highlighting
|
|
||||||
indent = true, -- enable/disable treesitter based indentation
|
|
||||||
auto_install = true, -- enable/disable automatic installation of detected languages
|
|
||||||
ensure_installed = {
|
|
||||||
"lua",
|
|
||||||
"vim",
|
|
||||||
-- add more arguments for adding more treesitter parsers
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
--- tv.nvim: television channels in a floating terminal
|
|
||||||
--- <C-t> picks from the file/editor cable channels in the dotfiles
|
|
||||||
--- (~/.config/television/cable) only. Their cable `enter` actions would spawn
|
|
||||||
--- an editor inside the float, so each gets Neovim-side handlers: tv.nvim
|
|
||||||
--- passes handler keys as `--expect`, which wins over cable keybindings.
|
|
||||||
--- `:Tv <channel>` still reaches any channel.
|
|
||||||
--- @module plugins.tv
|
|
||||||
|
|
||||||
local OPEN = { "files", "git-files", "recent-files", "dotfiles", "git-diff" }
|
|
||||||
local GREP = { "text", "todo-comments" }
|
|
||||||
|
|
||||||
---@type LazySpec
|
|
||||||
return {
|
|
||||||
"alexpasmantier/tv.nvim",
|
|
||||||
cmd = "Tv",
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<C-t>",
|
|
||||||
function()
|
|
||||||
vim.ui.select(vim.list_extend(vim.list_extend({}, OPEN), GREP), { prompt = "Television" }, function(choice)
|
|
||||||
if choice then require("tv").tv_channel(choice) end
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
desc = "Television file channels",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local h = require("tv").handlers
|
|
||||||
local channels = {}
|
|
||||||
-- no <C-s>/<C-x>: tv uses them for cycle_sources / the action picker
|
|
||||||
for _, name in ipairs(OPEN) do
|
|
||||||
channels[name] = {
|
|
||||||
handlers = { ["<CR>"] = h.open_as_files, ["<C-q>"] = h.send_to_quickfix, ["<C-v>"] = h.open_in_vsplit },
|
|
||||||
}
|
|
||||||
end
|
|
||||||
for _, name in ipairs(GREP) do
|
|
||||||
channels[name] = { handlers = { ["<CR>"] = h.open_at_line, ["<C-q>"] = h.send_to_quickfix } }
|
|
||||||
end
|
|
||||||
|
|
||||||
require("tv").setup {
|
|
||||||
global_keybindings = { channels = false }, -- <C-t> lives in `keys` above
|
|
||||||
channels = channels,
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
+13
-1
@@ -42,11 +42,23 @@ end
|
|||||||
|
|
||||||
---@type LazySpec
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
{ "sphamba/smear-cursor.nvim", opts = {} },
|
{ "sphamba/smear-cursor.nvim", event = "VeryLazy", opts = {} },
|
||||||
|
|
||||||
-- terminals are handled by kitty now
|
-- terminals are handled by kitty now
|
||||||
{ "akinsho/toggleterm.nvim", enabled = false },
|
{ "akinsho/toggleterm.nvim", enabled = false },
|
||||||
|
|
||||||
|
-- conform owns formatting (plugins/conform.lua). AstroNvim's none-ls ships
|
||||||
|
-- with mason-null-ls `handlers = {}`, which auto-registers every mason tool
|
||||||
|
-- (biome, goimports, buf, ...) as a second formatter/linter client.
|
||||||
|
{ "nvimtools/none-ls.nvim", enabled = false },
|
||||||
|
{ "jay-babu/mason-null-ls.nvim", enabled = false },
|
||||||
|
|
||||||
|
-- <C-h/j/k/l> is config.pane_nav; resize binds are native (plugins/pane-nav.lua)
|
||||||
|
{ "mrjones2014/smart-splits.nvim", enabled = false },
|
||||||
|
|
||||||
|
-- lsp_signature.nvim is gone; astrolsp's own signature help replaces it
|
||||||
|
{ "AstroNvim/astrolsp", opts = { features = { signature_help = true } } },
|
||||||
|
|
||||||
{
|
{
|
||||||
"folke/snacks.nvim",
|
"folke/snacks.nvim",
|
||||||
---@type snacks.Config
|
---@type snacks.Config
|
||||||
|
|||||||
Reference in new issue
Block a user