migrate to dotter

This commit is contained in:
Alexander Navarro 2025-09-01 12:10:36 -04:00
parent c5618f2f2c
commit 2da5ffd1f4
265 changed files with 62 additions and 3123 deletions

View file

@ -0,0 +1,35 @@
local rust = vim.cmd.RustLsp
-- Override some LSP mappings
local function opts(desc)
return {
silent = true,
buffer = vim.api.nvim_get_current_buf(),
desc = desc
}
end
vim.keymap.set("n", "<leader>la", function() rust('codeAction') end, opts("Code action"))
vim.keymap.set("n", "<leader>lj", function() rust({ 'renderDiagnostic', "cycle" }) end, opts("Next diagnostic"))
vim.keymap.set("n", "<leader>lk", function() rust({ 'renderDiagnostic', "cycle_prev" }) end, opts("Prev diagnostic"))
vim.keymap.set("n", "<leader>ld", function() rust({ 'renderDiagnostic', "current" }) end, opts("Current diagnostic"))
vim.keymap.set("n", "K", function() rust({ 'hover', 'actions' }) end, opts("Lsp hover"))
vim.keymap.set("n", "J", function() rust("joinLines") end, opts("Keep cursor in column while joining lines"))
vim.keymap.set("v", "J", function() rust({ "moveItem", "down" }) end, opts("Move line down"))
vim.keymap.set("v", "K", function() rust({ "moveItem", "up" }) end, opts("Move line up"))
vim.keymap.set("n", "<leader>lq", function()
vim.ui.select({
{ label = "Expand macro", cmd = { "expandMacro", } },
{ label = "Explain error under cursor", cmd = { "explainError", "current" } },
{ label = "Go to related diagnostic", cmd = { "relatedDiagnostics", } },
{ label = "Open cargo.toml", cmd = { "openCargo", } },
{ label = "Open docs.rs of symbol", cmd = { "openDocs", } },
{ label = "Go to parent module", cmd = { "parentModule", } },
}, { prompt = "RustLsp: ", format_item = function(item) return item.label end }, function(opt)
if opt == nil then return end
rust(opt.cmd)
end)
end, opts("Execute RustLsp action"))

33
configs/nvim/init.lua Normal file
View file

@ -0,0 +1,33 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("aleidk.options")
require("aleidk.autocmds")
require("aleidk.keymaps")
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "aleidk/plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
-- checker = { enabled = true },
})

View file

@ -0,0 +1,38 @@
{
"blink.cmp": { "branch": "main", "commit": "81069e3955a8b4d5063287a2a6a47a844e9ca2cb" },
"blink.compat": { "branch": "main", "commit": "08943fdf2eb00432d6205db6d0239434135416bd" },
"catppuccin": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" },
"comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" },
"conform.nvim": { "branch": "master", "commit": "a203480a350b03092e473bf3001733d547160a73" },
"flatten.nvim": { "branch": "main", "commit": "72527798e75b5e34757491947c2cb853ce21dc0e" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"fzf-lua": { "branch": "main", "commit": "758173f499d15410ecb50c5519a41b27c33e645d" },
"grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" },
"hardtime.nvim": { "branch": "main", "commit": "3541ad24faff78274669eceaf130502eb7f1261a" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" },
"neogen": { "branch": "main", "commit": "dc50715c009f89b8111197fd2f282f6042daa7ea" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-dap": { "branch": "master", "commit": "5dd4d50f2e6a2eaf9e57fad023d294ef371bda35" },
"nvim-dap-view": { "branch": "main", "commit": "390dae6bf67f3342ebb481159932ef0fe54822ba" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" },
"nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" },
"nvim-treesitter": { "branch": "master", "commit": "8d4fdc5e47e2a4e00179e43f56221250ce365973" },
"nvim-treesitter-context": { "branch": "master", "commit": "6b081ea63a3711243d11540ce28ccdb6f35ecd33" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" },
"nvim-web-devicons": { "branch": "master", "commit": "edbe0a65cfacbbfff6a4a1e98ddd60c28c560509" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"render-markdown": { "branch": "main", "commit": "6096cf3608b576a38fd1396227dbc0473091714d" },
"rustaceanvim": { "branch": "master", "commit": "66398662c07d265b226897500ed50eafba3dffb4" },
"smart-splits.nvim": { "branch": "master", "commit": "fc7bb00fe67ab504356bed4310d23c2e4cb4b06b" },
"transfer.nvim": { "branch": "main", "commit": "ab12253c09f83a5b0b6ee108fc131be45abe446a" },
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
"ts-node-action": { "branch": "master", "commit": "6d3b60754fd87963d70eadaa2f77873b447eac26" },
"typescript-tools.nvim": { "branch": "master", "commit": "3c501d7c7f79457932a8750a2a1476a004c5c1a9" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"yazi.nvim": { "branch": "main", "commit": "053867916a9be3cb46f84b6f095ee731bbddd213" }
}

View file

@ -0,0 +1,34 @@
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if not client then
return
end
vim.bo[args.buf].omnifunc = 'v:lua.MiniCompletion.completefunc_lsp'
-- Prefer LSP folding if client supports it
if client:supports_method('textDocument/foldingRange') then
local win = vim.api.nvim_get_current_win()
vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()'
end
vim.keymap.set({ "n", "x", "v" }, "<leader>la", vim.lsp.buf.code_action, { buffer = args.buf, desc = "Code Action" })
vim.keymap.set({ "n", "x", "v" }, "<leader>ld", vim.diagnostic.open_float, { desc = "Show diagnostic under cursor" })
vim.keymap.set({ "n", "x", "v" }, "<leader>lc", function()
local curpos = vim.fn.getcurpos()
local diagnostics = vim.diagnostic.get(0, { lnum = curpos[2] - 1 })
if #diagnostics == 0 then
vim.notify("No diagnostic under cursor")
return
end
local diagnostic = diagnostics[1]
local msg = string.format("%s [%s]: %s", diagnostic.source, diagnostic.code, diagnostic.message)
vim.fn.setreg("+", msg)
vim.notify("Diagnostic saved to clipboard:\n\n" .. msg)
end, { buffer = args.buf, desc = "Copy diagnostic to clipboard" })
end,
})

View file

@ -0,0 +1,63 @@
return {
icons = {
misc = {
pint = "",
},
dap = {
Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" },
Breakpoint = "",
BreakpointCondition = "",
BreakpointRejected = { "", "DiagnosticError" },
LogPoint = ".>",
},
diagnostics = {
Error = "",
Warn = "",
Hint = "",
Info = "",
},
git = {
added = "",
modified = "",
removed = "",
branch = "",
},
kinds = {
Array = "",
Boolean = "",
Class = "",
Color = "",
Constant = "",
Constructor = "",
Copilot = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = "",
Function = "",
Interface = "",
Key = "",
Keyword = "",
Method = "",
Module = "",
Namespace = "",
Null = "",
Number = "",
Object = "",
Operator = "",
Package = "",
Property = "",
Reference = "",
Snippet = "",
String = "",
Struct = "",
Text = "",
TypeParameter = "",
Unit = "",
Value = "",
Variable = "",
},
},
}

View file

@ -0,0 +1,40 @@
-- stylua: ignore start
-- QoL normalization's
vim.keymap.set("n", "Q", "<nop>", {})
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { desc = "Prevent cursor movement", silent = true })
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'",
{ desc = "Move cursor regardless of word wrap", expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'",
{ desc = "Move cursor regardless of word wrap", expr = true, silent = true })
vim.keymap.set("n", "J", "mzJ`z", { desc = "Keep cursor in column while joining lines", silent = true })
-- vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Keep cursor centered while junping", silent = true })
-- vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Keep cursor centered while junping", silent = true })
-- vim.keymap.set("n", "n", "nzzzv", { desc = "Keep cursor centered while searching", silent = true })
-- vim.keymap.set("n", "N", "Nzzzv", { desc = "Keep cursor centered while searching", silent = true })
-- Utils
vim.keymap.set("n", "|", ":vs<CR>", { desc = "Create vsplit", silent = true })
vim.keymap.set("n", "°", ":sp<CR>", { desc = "Create split", silent = true })
vim.keymap.set("v", "p", [["_dP]], { desc = "Paste without lossing yanked text", silent = true })
vim.keymap.set("n", "<Leader>uh", ":nohl<CR>", { desc = "Remove search highlight", silent = true })
-- Buffer manipulation
vim.keymap.set("n", "<leader>bc", "<Cmd>bd<CR>", { desc = "Close buffer", silent = true })
vim.keymap.set("n", "<leader>bh", "<Cmd>bp<CR>", { desc = "Prev buffer", silent = true })
vim.keymap.set("n", "<leader>bl", "<Cmd>bn<CR>", { desc = "Next buffer", silent = true })
vim.keymap.set("n", "<leader>bA", "<Cmd>bufdo bd<CR>", { desc = "Close all buffers", silent = true })
vim.keymap.set("n", "<C-h>", "<C-w>h", { desc = "Move to left window", silent = true })
vim.keymap.set("n", "<C-j>", "<C-w>j", { desc = "Move to bottom window", silent = true })
vim.keymap.set("n", "<C-k>", "<C-w>k", { desc = "Move to top window", silent = true })
vim.keymap.set("n", "<C-l>", "<C-w>l", { desc = "Move to right window", silent = true })
-- LSP
vim.keymap.set("n", "<leader>lf", vim.lsp.buf.format, { desc = "Format document with LSP", silent = true })
vim.keymap.set("n", "<leader>lj", function() vim.diagnostic.jump({ count = 1 }) end,
{ desc = "Go to next diagnostic", silent = true })
vim.keymap.set("n", "<leader>lk", function() vim.diagnostic.jump({ count = -1 }) end,
{ desc = "Go to next diagnostic", silent = true })

View file

@ -0,0 +1,180 @@
-- [[ Setting options ]]
-- See `:help vim.o`
-- Set <space> as the leader key
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.o.diffopt = "vertical,closeoff,filler"
local opt = vim.opt
vim.schedule(function()
vim.opt.clipboard = 'unnamedplus'
end)
-- opt.shortmess:append({ W = true, I = true, c = true }) -- INFO: this control the format of some messages
-- vim.o.exrc = true
-- vim.opt.list = true -- Sets how neovim will display certain whitespace characters in the editor.
-- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
opt.autowrite = true -- Enable auto write
opt.breakindent = true -- Every wrapped line will continue visually indented
opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 2 -- Hide * markup for bold and italic
opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
opt.formatoptions = "jcroqlnt" -- tcqj
opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
opt.inccommand = 'split' -- Preview substitutions live, as you type!
opt.mouse = "a" -- Enable mouse mode
opt.nrformats = 'blank,bin,hex'
opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup
-- opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 15 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.showmode = false -- Don't show mode since we have a statusline
opt.sidescrolloff = 8 -- Columns of context
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.spelllang = { "en" }
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.wildmode = "longest,list:full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap
vim.o.completeopt = 'noselect,menu,menuone,noinsert,popup'
vim.o.winborder = 'rounded'
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
-- Nice and simple folding:
vim.o.foldenable = true
vim.o.foldlevel = 99
vim.o.foldmethod = "expr"
vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.fillchars:append({ fold = " " })
local fn = vim.fn
-- Quickfix customization
function _G.qftf(info)
local items
local ret = {}
-- The name of item in list is based on the directory of quickfix window.
-- Change the directory for quickfix window make the name of item shorter.
-- It's a good opportunity to change current directory in quickfixtextfunc :)
--
-- local alterBufnr = fn.bufname('#') -- alternative buffer is the buffer before enter qf window
-- local root = getRootByAlterBufnr(alterBufnr)
-- vim.cmd(('noa lcd %s'):format(fn.fnameescape(root)))
--
if info.quickfix == 1 then
items = fn.getqflist({ id = info.id, items = 0 }).items
else
items = fn.getloclist(info.winid, { id = info.id, items = 0 }).items
end
local limit = 31
local fnameFmt1, fnameFmt2 = "%-" .. limit .. "s", "…%." .. (limit - 1) .. "s"
local validFmt = "%s │%5d:%-3d│%s %s"
for i = info.start_idx, info.end_idx do
local e = items[i]
local fname = ""
local str
if e.valid == 1 then
if e.bufnr > 0 then
fname = fn.bufname(e.bufnr)
if fname == "" then
fname = "[No Name]"
else
fname = fname:gsub("^" .. vim.env.HOME, "~")
end
-- char in fname may occur more than 1 width, ignore this issue in order to keep performance
if #fname <= limit then
fname = fnameFmt1:format(fname)
else
fname = fnameFmt2:format(fname:sub(1 - limit))
end
end
local lnum = e.lnum > 99999 and -1 or e.lnum
local col = e.col > 999 and -1 or e.col
local qtype = e.type == "" and "" or " " .. e.type:sub(1, 1):upper()
str = validFmt:format(fname, lnum, col, qtype, e.text)
else
str = e.text
end
table.insert(ret, str)
end
return ret
end
-- TODO: how to customize?
vim.o.qftf = "{info -> v:lua._G.qftf(info)}"
vim.filetype.add({
-- Detect and assign filetype based on the extension of the filename
extension = {
mdx = "mdx",
log = "log",
conf = "conf",
env = "dotenv",
},
-- Detect and apply filetypes based on the entire filename
filename = {
[".env"] = "dotenv",
["env"] = "dotenv",
["tsconfig.json"] = "jsonc",
},
-- Detect and apply filetypes based on certain patterns of the filenames
pattern = {
-- INFO: Match filenames like - ".env.example", ".env.local" and so on
["%.env%.[%w_.-]+"] = "dotenv",
[".*%.blade%.php"] = "blade",
[".*%.hurl.*"] = "hurl",
[".*/hypr/.*%.conf"] = "hyprlang",
},
})
-- ╭─────────────────────────────────────────────────────────╮
-- │ LSP │
-- ╰─────────────────────────────────────────────────────────╯
vim.lsp.config("rust-analyzer", {
tools = {
code_actions = {
ui_select_fallback = true
}
}
})
vim.lsp.enable({
"bashls",
"biome",
"fish_lsp",
"hyprls",
"intelephense",
"jsonls",
"lua_ls",
"nushell",
"pyright",
"ruff",
-- "rust_analyzer", -- managed by rustacean.nvim
})
vim.lsp.inlay_hint.enable(true)
vim.diagnostic.config({
virtual_lines = { current_line = true },
})

View file

@ -0,0 +1,33 @@
local function select_or_create(search)
local grapple = require("grapple")
if grapple.exists(search) then
grapple.select(search)
else
grapple.tag()
end
end
return {
"cbochs/grapple.nvim",
dependencies = {
{ "nvim-tree/nvim-web-devicons", lazy = true },
},
cmd = "Grapple",
keys = {
{ "<leader><leader>a", "<cmd>Grapple toggle<cr>", desc = "Toggle bookmark for current file" },
{ "<leader><leader>D", "<cmd>Grapple reset<cr>", desc = "Delete all bookmarks" },
{ "<leader><leader>t", "<cmd>Grapple toggle_tags<cr>", desc = "Toggle bookmarks window" },
{ "<leader><leader>T", "<cmd>Grapple toggle_scopes<cr>", desc = "Toggle scopes window" },
{ "<leader><leader>n", "<cmd>Grapple cycle forward<cr>", desc = "Next bookmark" },
{ "<leader><leader>N", "<cmd>Grapple cycle backward<cr>", desc = "Prev bookmark" },
{ "<leader><leader>j", function() select_or_create({ index = 1 }) end, desc = "Go or create bookmark 1" },
{ "<leader><leader>k", function() select_or_create({ index = 2 }) end, desc = "Go or create bookmark 2" },
{ "<leader><leader>l", function() select_or_create({ index = 3 }) end, desc = "Go or create bookmark 3" },
{ "<leader><leader>ñ", function() select_or_create({ index = 4 }) end, desc = "Go or create bookmark 4" },
{ "<leader><leader>J", "<cmd>Grapple tag index=1<cr>", desc = "Override bookmark 1" },
{ "<leader><leader>K", "<cmd>Grapple tag index=2<cr>", desc = "Override bookmark 2" },
{ "<leader><leader>L", "<cmd>Grapple tag index=3<cr>", desc = "Override bookmark 3" },
{ "<leader><leader>Ñ", "<cmd>Grapple tag index=4<cr>", desc = "Override bookmark 4" },
},
}

View file

@ -0,0 +1,66 @@
return { -- Change colors.none if not using a transparent background
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
config = function()
local utils = require("catppuccin.utils.colors")
local opts = {
flavour = "macchiato",
transparent_background = true,
integrations = {
aerial = true,
blink_cmp = true,
cmp = true,
gitsigns = true,
indent_blankline = { enabled = true, scope_color = "text", },
lsp_trouble = true,
mason = true,
noice = true,
notify = true,
mini = {
enabled = true,
indentscope_color = "",
},
},
custom_highlights = function(colors)
return {
-- Fix colors for cmp
Pmenu = { bg = colors.none, blend = 0 },
FloatBorder = { bg = colors.none },
CmpItemMenu = { fg = colors.text, bg = colors.none },
-- dadbod-ui
NotificationInfo = { bg = colors.none, fg = colors.text },
NotificationWarning = { bg = colors.none, fg = colors.yellow },
NotificationError = { bg = colors.none, fg = colors.red },
-- for word diff in previews
GitSignsAddInline = {
fg = colors.teal,
bg = utils.darken(colors.teal, 0.4),
style = { "bold" },
},
GitSignsDeleteInline = {
fg = colors.red,
bg = utils.darken(colors.red, 0.4),
style = { "bold" },
},
GitSignsChangeInline = {
fg = colors.mauve,
bg = utils.darken(colors.mauve, 0.4),
style = { "bold" },
},
GitSignsDeleteVirtLn = { bg = colors.none, fg = colors.red },
MiniJump2dDim = { fg = colors.surface1 },
MiniJump2dSpot = { bg = colors.base, fg = colors.teal, style = { "bold", "underline" } },
MiniJump2dSpotAhead = { bg = colors.base, fg = colors.teal, style = { "bold", "underline" } },
MiniJump2dSpotUnique = { bg = colors.base, fg = colors.teal, style = { "bold", "underline" } },
}
end,
}
require("catppuccin").setup(opts)
vim.cmd.colorscheme("catppuccin-macchiato")
end,
}

View file

@ -0,0 +1,27 @@
return {
{
"LudoPinelli/comment-box.nvim",
opts = {
outer_blank_lines = true,
},
keys = {
{ "gcb", function() require("comment-box").lcbox() end, { desc = "Create a comment box", mode = { "n", "v" }, } },
{ "gcl", function() require("comment-box").llline() end, { desc = "Create a comment line", mode = { "n", "v" }, } },
},
},
{
"danymat/neogen",
opts = { snippet_engine = "nvim" },
dependencies = { "nvim-treesitter/nvim-treesitter" },
version = "*", -- stable releases
keys = {
{
"gcd",
function()
require("neogen").generate()
end,
desc = "Generate comment docstring",
},
},
}
}

View file

@ -0,0 +1,64 @@
return {
"saghen/blink.cmp",
lazy = false,
version = "*",
dependencies = {
"neovim/nvim-lspconfig",
"echasnovski/mini.nvim",
"folke/lazydev.nvim",
{ "saghen/blink.compat", version = "*", },
},
opts = function()
local window_options = {
border = "rounded",
winblend = vim.o.pumblend,
}
---@module 'blink.cmp'
---@type blink.cmp.Config
return {
appearance = {
nerd_font_variant = 'mono'
},
completion = {
accept = { auto_brackets = { enabled = true }, },
-- Show documentation when selecting a completion item
documentation = { auto_show = true, auto_show_delay_ms = 500 },
-- Display a preview of the selected item on the current line
ghost_text = { enabled = true },
},
keymap = {
preset = "enter",
["<C-j>"] = { 'select_next', 'fallback' },
["<C-k>"] = { 'select_prev', 'fallback' },
["<C-u>"] = { 'scroll_documentation_up', 'fallback' },
["<C-d>"] = { 'scroll_documentation_down', 'fallback' },
},
sources = {
providers = {
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink" },
luasnip = {
name = 'luasnip',
module = 'blink.compat.source',
score_offset = -3,
opts = {
use_show_condition = false,
show_autosnippets = true,
},
},
},
default = {
"lsp",
"path",
"snippets",
"buffer",
"lazydev",
},
per_filetype = {
sql = { 'snippets', 'dadbod', 'buffer' },
},
},
}
end
}

View file

@ -0,0 +1,98 @@
return {
{
"mfussenegger/nvim-dap",
dependencies = {
{
"igorlfs/nvim-dap-view",
---@module 'dap-view'
---@type dapview.Config
opts = {
auto_toggle = true,
switchbuf = "useopen,uselast",
winbar = {
sections = { "watches", "scopes", "breakpoints", "repl", "console" },
controls = {
enabled = true,
},
},
windows = {
terminal = {
start_hidden = true,
}
}
},
},
},
config = function()
local dap = require("dap")
dap.adapters.codelldb = {
type = "executable",
command = "codelldb",
}
dap.listeners.before['event_initialized']['toggle_lsp_virtual_text'] = function()
vim.lsp.inlay_hint.enable(false)
end
dap.listeners.after['event_terminated']['toggle_lsp_virtual_text'] = function()
vim.lsp.inlay_hint.enable(true)
end
require("nvim-dap-virtual-text").setup()
end,
keys = {
{
"<leader>dd",
function()
local dap = require("dap")
if dap.status() == "" then
dap.run_last()
else
dap.restart()
end
end,
desc = "Run last or restart debugger"
},
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle breakpoint" },
{
"<leader>dB",
function()
vim.ui.input({ prompt = "Breakpoint condition: " }, function(input)
require("dap").set_breakpoint(input)
end)
end,
desc = "Conditional Breakpoint",
},
{ "<leader>dw", function() require("dap-view").add_expr() end, desc = "Watch expresion under cursor", mode = { "n", "v" } },
{
"<leader>dW",
function()
vim.ui.input({ prompt = "Watch expresion: " }, function(input)
require("dap-view").add_expr(input)
end)
end,
desc = "Watch expression",
},
{ "<leader>dj", function() require("dap").step_over() end, desc = "Step over" },
{ "<leader>dJ", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>dl", function() require("dap").step_into() end, desc = "Step into" },
{ "<leader>dk", function() require("dap").step_out() end, desc = "Step out" },
{ "<leader>dh", function() require("dap.ui.widgets").hover() end, desc = "Show expresion under cursor" },
{ "<leader>dx", function() require("dap").clear_breakpoints() end, desc = "Clear breakpoint" },
{ "<leader>dX", function() require("dap").terminate() end, desc = "Terminate" },
{ "<leader>ud", function() require("dap-view").toggle(true) end, desc = "Toggle dap-view" },
}
},
{
"theHamsta/nvim-dap-virtual-text",
dependencies = { "mfussenegger/nvim-dap", "nvim-treesitter/nvim-treesitter" },
config = function()
require('nvim-dap-virtual-text').setup({
only_first_definition = false,
all_references = true,
virt_text_pos = "eol",
})
end
},
}

View file

@ -0,0 +1,43 @@
return {
"mikavilpas/yazi.nvim",
event = "VeryLazy",
dependencies = {
{ "nvim-lua/plenary.nvim", lazy = true },
},
-- 👇 if you use `open_for_directories=true`, this is recommended
init = function()
-- More details: https://github.com/mikavilpas/yazi.nvim/issues/802
-- vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
end,
keys = {
{
"<leader>e",
"<cmd>Yazi<cr>",
desc = "Open yazi at the current file",
},
-- {
-- -- Open in the current working directory
-- "<leader>E",
-- "<cmd>Yazi cwd<cr>",
-- desc = "Open the file manager in nvim's working directory",
-- },
},
opts = {
-- if you want to open yazi instead of netrw, see below for more info
open_for_directories = true,
open_multiple_tabs = true,
floating_window_scaling_factor = 1,
keymaps = {
show_help = '<f1>',
open_file_in_vertical_split = '<c-v>',
open_file_in_horizontal_split = '<c-s>',
open_file_in_tab = '<c-t>',
grep_in_directory = '<c-w>',
cycle_open_buffers = '<tab>',
copy_relative_path_to_selected_files = '<c-y>',
send_to_quickfix_list = '<c-q>',
change_working_directory = "<c-\\>",
},
},
}

View file

@ -0,0 +1,122 @@
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
opts = {
-- See available formatters in: https://github.com/stevearc/conform.nvim#formatters
-- Formatters can be installed by mason
formatters_by_ft = {
-- Conform will run multiple formatters sequentially
-- Use a stop_after_first = true to run only the first available formatters
-- Use the "_" filetype to run formatters on filetypes that don't
-- have other formatters configured.
["_"] = { "trim_whitespace" },
blade = { "blade-formatter" },
css = { "biome" },
go = { "gofumpt", "goimports_reviser", "golines" },
html = { "djlint", "prettierd", stop_after_first = true },
htmldjango = { "djlint", stop_after_first = true },
javascript = { "biome" },
javascriptreact = { "biome" },
json = { "biome" },
jsonc = { "biome" },
lua = { "stylua" },
markdown = { "markdownlint" },
php = { "pint" },
python = { "ruff_format", "ruff_organize_imports" },
rust = { "rustfmt" },
scss = { "biome", "prettierd", "prettier", stop_after_first = true },
sh = { "shfmt" },
sql = { "sleek" },
toml = { "taplo" },
typescript = { "biome" },
typescriptreact = { "biome" },
xml = { "lemminx" },
zsh = { "shfmt" },
},
formatters = {
djlint = {
prepend_args = {
"--format-css",
"--indent-css",
"2",
"--format-js",
"--indent-js",
"2",
"--indent",
"2",
"--preserve-blank-lines",
"--quiet"
}
}
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 2000, lsp_fallback = true }
end,
},
config = function(_, opts)
require("conform").setup(opts)
local function toggleAutoFormat()
-- to make this global, change b to g
if vim.b.disable_autoformat == nil then
vim.b.disable_autoformat = true
print("Autoformat set to: " .. tostring(not vim.b.disable_autoformat))
return
end
vim.b.disable_autoformat = not vim.b.disable_autoformat
print("Autoformat set to: " .. tostring(not vim.b.disable_autoformat))
end
vim.keymap.set("n", "<leader>uf", toggleAutoFormat, { desc = "Toggle auto format", silent = true })
vim.api.nvim_create_user_command("Fmt", function(args)
local range = nil
if args.count ~= -1 then
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
range = {
start = { args.line1, 0 },
["end"] = { args.line2, end_line:len() },
}
end
local function callback(err, did_edit)
if not did_edit then
vim.notify("The file was not formatted:\n" .. tostring(err), vim.log.levels.ERROR)
return
end
if args.bang then
vim.cmd("w")
end
end
require("conform").format(
{
async = true,
lsp_format = "fallback",
range = range,
formatters = args.fargs
},
callback
)
end, {
range = true,
bang = true,
force = true,
desc = "Format the document",
nargs = '*',
-- complete = function()
-- local formatters = require('conform').formatters_by_ft
--
-- return vim.tbl_keys(formatters)
-- end
})
end,
}

View file

@ -0,0 +1,35 @@
return {
"ibhagwan/fzf-lua",
lazy = false, -- Required to register vim.ui.select() wrapper
dependencies = { "echasnovski/mini.nvim" },
config = function()
require("fzf-lua").setup({
winopts = {
height = 0.85,
width = 0.90,
},
files = {
-- path_shorten = true,
cwd_prompt = false,
-- formatter = "path.filename_first",
},
})
require("fzf-lua").register_ui_select()
end,
keys = {
{ "<leader>ff", function() require("fzf-lua").files() end, desc = "Find files" },
{ "<leader>fb", function() require("fzf-lua").buffers() end, desc = "Find buffers" },
{ "<leader>fw", function() require("fzf-lua").grep_cword() end, desc = "Find word under cursor" },
{ "<leader>fW", function() require("fzf-lua").live_grep_native() end, desc = "Find word (live grep)" },
{ "<leader>fw", function() require("fzf-lua").grep_visual() end, desc = "Find selection", mode = { "v" } },
{ "<leader>fw", function() require("fzf-lua").grep_cword() end, desc = "Find word under cursor" },
{ "<leader>fg", function() require("fzf-lua").git_bcommits() end, desc = "Find commit log for current buffer" },
{ "<leader>fl", function() require("fzf-lua").lsp_document_symbols() end, desc = "Find LSP Symbols" },
{ "<leader>fr", function() require("fzf-lua").registers() end, desc = "Find registers" },
{ "<leader>fk", function() require("fzf-lua").keymaps() end, desc = "Find keymaps" },
{ "<leader>fh", function() require("fzf-lua").helptags() end, desc = "Find help tags" },
}
}

View file

@ -0,0 +1,29 @@
return {
'neovim/nvim-lspconfig',
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
{
"mason-org/mason.nvim",
opts = {}
},
{
"ckolkey/ts-node-action",
dependencies = { "nvim-treesitter" },
opts = {},
keys = {
{ "<leader>ls", function() require("ts-node-action").node_action() end, desc = "Node Action" }
}
},
{
-- allow to reuse the same nvim instance when opening files in the same terminal context
"willothy/flatten.nvim",
opts = {
integrations = {
kitty = true,
wezterm = false,
},
},
-- Ensure that it runs first to minimize delay when opening file from terminal
lazy = false,
priority = 1001,
},
}

View file

@ -0,0 +1,24 @@
return {
{
'mrcjkb/rustaceanvim',
version = '^6', -- Recommended
lazy = false, -- This plugin is already lazy
},
{
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } }
},
},
},
{
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
opts = {},
}
}

View file

@ -0,0 +1,29 @@
return {
"mfussenegger/nvim-lint",
event = "VeryLazy",
config = function()
local lint = require("lint")
lint.linters.gitlint.stdin = true
lint.linters.gitlint.args = { "--contrib", "contrib-title-conventional-commits", "--msg-filename", "-" }
lint.linters_by_ft = {
-- astro = { "eslint_d" },
python = { "ruff" },
sh = { "shellcheck" },
NeogitCommitMessage = { "gitlint" },
gitcommit = { "gitlint" },
markdown = { "markdownlint" },
javascript = { "biomejs" },
typescript = { "biomejs" },
javascriptreact = { "biomejs" },
typescriptreact = { "biomejs" },
}
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
require("lint").try_lint()
end,
})
end,
}

View file

@ -0,0 +1,14 @@
return {
{
"MeanderingProgrammer/markdown.nvim",
name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
opts = {
file_types = { 'markdown' },
sign = {
enabled = false,
},
},
},
}

View file

@ -0,0 +1,248 @@
return {
'echasnovski/mini.nvim',
version = '*',
dependencies = {
"rafamadriz/friendly-snippets",
},
config = function()
require('mini.icons').setup()
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DapBreakpoint" })
vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "DapBreakpointCondition" })
vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "DapBreakpointRejected" })
vim.fn.sign_define("DapLogPoint", { text = ".>", texthl = "DapLogPoint" })
vim.fn.sign_define("DapStopped", { text = "󰁕 ", texthl = "DapStopped", numhl = "debugPC" })
require('mini.bracketed').setup({
diagnostic = { options = { severity = vim.diagnostic.severity.ERROR } },
})
require("mini.ai").setup({})
require('mini.cursorword').setup() -- Highlight word under cursor
require('mini.extra').setup()
require('mini.jump').setup({
mappings = {
repeat_jump = ""
}
}) -- Extend f, F, t, T
require('mini.jump2d').setup(
{
spotter = require('mini.jump2d').gen_pattern_spotter('[^%s%p]+', 'start'),
view = {
dim = true,
n_steps_ahead = 2
},
allowed_lines = {
blank = false,
cursor_at = false
},
}
)
require('mini.surround').setup()
require('mini.operators').setup()
require('mini.pairs').setup({
modes = { command = true }
})
require('mini.splitjoin').setup()
require("mini.align").setup({})
-- require('mini.animate').setup()
require('mini.notify').setup()
vim.notify = require('mini.notify').make_notify()
vim.keymap.set('n', '<Leader>un', require('mini.notify').show_history, { desc = 'Show notifications', silent = true })
require('mini.statusline').setup()
require('mini.diff').setup({ view = { style = 'sign' } })
require('mini.git').setup({})
vim.keymap.set({ 'n', 'x' }, '<Leader>gs', '<Cmd>lua MiniGit.show_at_cursor()<CR>',
{ desc = 'Show at cursor', silent = true })
local starter = require('mini.starter')
starter.setup({
footer = '',
evaluate_single = true,
items = {
starter.sections.recent_files(10, true),
starter.sections.sessions(5, true),
starter.sections.pick(),
starter.sections.builtin_actions(),
},
content_hooks = {
starter.gen_hook.adding_bullet(),
starter.gen_hook.indexing('all', { 'Builtin actions' }),
starter.gen_hook.aligning("center", "center"),
},
})
require('mini.indentscope').setup({
draw = {
animation = require('mini.indentscope').gen_animation.none(),
},
})
require('mini.move').setup({
mappings = {
-- Move visual selection in Visual mode
left = 'H',
right = 'L',
down = 'J',
up = 'K',
-- Move current line in Normal mode
line_left = '',
line_right = '',
line_down = '',
line_up = '',
},
})
require('mini.comment').setup({
options = {
-- Whether to ignore blank lines when commenting
ignore_blank_line = true,
-- Whether to ignore blank lines in actions and textobject
start_of_line = true,
},
})
local gen_loader = require('mini.snippets').gen_loader
require('mini.snippets').setup({
snippets = {
-- Load custom file with global snippets first (adjust for Windows)
gen_loader.from_file('~/.config/nvim-unstable/snippets/global.json'),
-- Load snippets based on current language by reading files from
-- "snippets/" subdirectories from 'runtimepath' directories.
gen_loader.from_lang(),
},
})
local miniclue = require("mini.clue")
miniclue.setup({
triggers = {
-- Leader triggers
{ mode = "n", keys = "<Leader>" },
{ mode = "v", keys = "<Leader>" },
{ mode = "x", keys = "<Leader>" },
-- Built-in completion
{ mode = "i", keys = "<C-x>" },
-- `g` key
{ mode = "n", keys = "g" },
{ mode = "x", keys = "g" },
-- Marks
{ mode = "n", keys = "'" },
{ mode = "n", keys = "`" },
{ mode = "x", keys = "'" },
{ mode = "x", keys = "`" },
-- Registers
{ mode = "n", keys = '"' },
{ mode = "x", keys = '"' },
{ mode = "i", keys = "<C-r>" },
{ mode = "c", keys = "<C-r>" },
-- Window commands
{ mode = "n", keys = "<C-w>" },
-- `z` key
{ mode = "n", keys = "z" },
{ mode = "x", keys = "z" },
},
-- Add a "postkeys" value to activate those keys after others
clues = {
miniclue.gen_clues.builtin_completion(),
miniclue.gen_clues.g(),
miniclue.gen_clues.marks(),
miniclue.gen_clues.registers(),
miniclue.gen_clues.windows(),
miniclue.gen_clues.z(),
{ mode = "n", keys = "<Leader><Leader>", desc = "+Bookmarks" },
{ mode = "n", keys = "<Leader><Leader>n", postkeys = "<Leader><Leader>" },
{ mode = "n", keys = "<Leader><Leader>N", postkeys = "<Leader><Leader>" },
{ mode = "n", keys = "<Leader>b", desc = "+Buffers" },
{ mode = "n", keys = "<Leader>bh", postkeys = "<Leader>b" },
{ mode = "n", keys = "<Leader>bl", postkeys = "<Leader>b" },
{ mode = "n", keys = "<Leader>d", desc = "+Debugger" },
{ mode = "n", keys = "<Leader>dh", postkeys = "<Leader>d" },
{ mode = "n", keys = "<Leader>dJ", postkeys = "<Leader>d" },
{ mode = "n", keys = "<Leader>dj", postkeys = "<Leader>d" },
{ mode = "n", keys = "<Leader>dk", postkeys = "<Leader>d" },
{ mode = "n", keys = "<Leader>dl", postkeys = "<Leader>d" },
{ mode = "n", keys = "<Leader>f", desc = "+Find" },
{ mode = "n", keys = "<Leader>g", desc = "+Git" },
{ mode = "n", keys = "<Leader>l", desc = "+LSP" },
{ mode = "n", keys = "<Leader>r", desc = "+Replace" },
{ mode = "n", keys = "<Leader>u", desc = "+UI & Config" },
{ mode = "n", keys = "<Leader>w", desc = "+Workspace" },
{ mode = "n", keys = "<Leader>p", desc = "+Run stuff" },
{ mode = "n", keys = "<Leader>z", desc = "+ZK" },
{ mode = "v", keys = "<Leader>z", desc = "+ZK" },
{ mode = "v", keys = "<Leader>a", desc = "+AI" },
{ mode = "n", keys = "<Leader>a", desc = "+AI" },
{ mode = "n", keys = "g?", desc = "+Print Debug" },
},
-- Clue window settings
window = {
-- Floating window config
config = {
width = "auto",
},
-- Delay before showing clue window
delay = 200,
-- Keys to scroll inside the clue window
scroll_down = "<C-d>",
scroll_up = "<C-u>",
},
})
local hipatterns = require('mini.hipatterns')
hipatterns.setup({
highlighters = {
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' },
hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' },
todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' },
note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' },
-- Highlight hex color strings (`#rrggbb`) using that color
hex_color = hipatterns.gen_highlighter.hex_color(),
},
})
require('mini.sessions').setup({
autowrite = false
})
vim.keymap.set('n', '<Leader>us', function()
local default_name = require('mini.sessions').get_latest() or "Session.vim"
vim.ui.input({ prompt = "Session name: ", default = default_name }, function(input)
if input == nil then
return
end
require('mini.sessions').write(input)
end)
end,
{ desc = 'Save session', silent = true })
vim.keymap.set('n', '<Leader>uS', function() require('mini.sessions').read() end,
{ desc = 'Load session (latest)', silent = true })
vim.api.nvim_create_user_command("SessionSelect", function()
require('mini.sessions').select('read')
end, {})
vim.api.nvim_create_user_command("SessionDelete", function()
require('mini.sessions').select('delete')
end, {})
vim.keymap.set('n', '<Leader>uz', function()
require('mini.misc').zoom()
end,
{ desc = 'Toggle zoom', silent = true })
end
}

View file

@ -0,0 +1,46 @@
return {
{
"coffebar/transfer.nvim",
cmd = { "TransferInit", "DiffRemote", "TransferUpload", "TransferDownload", "TransferDirDiff", "TransferRepeat" },
opts = {},
keys = {
{ "<leader>xx", function() vim.cmd("TransferRepeat") end, desc = "Repeat last transfer" },
{ "<leader>xc", function() vim.cmd("TransferInit") end, desc = "Config transfer.nvim" },
{ "<leader>xj", function() vim.cmd("TransferDownload") end, desc = "Download current file with transfer.nvim" },
{ "<leader>xJ", function() vim.cmd("TransferDownload " .. vim.uv.cwd()) end, desc = "Download root dir with transfer.nvim" },
{ "<leader>xk", function() vim.cmd("TransferUpload") end, desc = "Upload current file with transfer.nvim" },
{ "<leader>xK", function() vim.cmd("TransferUpload " .. vim.uv.cwd()) end, desc = "Upload root dir with transfer.nvim" },
{ "<leader>xd", function() vim.cmd("DiffRemote") end, desc = "Diff current file with transfer.nvim" },
{ "<leader>xD", function() vim.cmd("TransferDirDiff " .. vim.uv.cwd()) end, desc = "Diff root dir with transfer.nvim" },
},
config = function(_, opts)
require("transfer").setup(opts)
require("yazi").config.forwarded_dds_events = {
"TransferUpload",
"TransferDownload",
"DiffRemote",
"TransferDirDiff",
}
vim.api.nvim_create_autocmd("User", {
pattern = "YaziDDSCustom",
callback = function(event)
-- vim.print(event.data);
local data = vim.json.decode(event.data.raw_data)
if event.data.type == "DiffRemote" or event.data.type == "TransferDirDiff" then
local response = vim.system({ "ya", "emit-to", "0", "close" }, { timeout = 1000 }):wait()
if response.stderr ~= "" then
vim.notify(response.stderr, vim.log.levels.ERROR)
return
end
end
vim.iter(data):each(function(path) vim.cmd(string.format("%s %s", event.data.type, path)) end)
end,
})
end
},
}

View file

@ -0,0 +1,64 @@
return {
"mrjones2014/smart-splits.nvim",
lazy = false,
build = './kitty/install-kittens.bash',
opts = { ignored_filetypes = { "nofile", "quickfix", "qf", "prompt" }, ignored_buftypes = { "nofile" } },
keys = {
{
"<C-h>",
function()
require("smart-splits").move_cursor_left()
end,
desc = "Move to left window",
},
{
"<C-j>",
function()
require("smart-splits").move_cursor_down()
end,
desc = "Move to bottom window",
},
{
"<C-k>",
function()
require("smart-splits").move_cursor_up()
end,
desc = "Move to upper window",
},
{
"<C-l>",
function()
require("smart-splits").move_cursor_right()
end,
desc = "Move to right window",
},
{
"<A-h>",
function()
require("smart-splits").resize_left()
end,
desc = "Move to left window",
},
{
"<A-j>",
function()
require("smart-splits").resize_down()
end,
desc = "Move to bottom window",
},
{
"<A-k>",
function()
require("smart-splits").resize_up()
end,
desc = "Move to upper window",
},
{
"<A-l>",
function()
require("smart-splits").resize_right()
end,
desc = "Move to right window",
},
},
}

View file

@ -0,0 +1,14 @@
return {
{
"m4xshen/hardtime.nvim",
lazy = false,
dependencies = { "MunifTanjim/nui.nvim" },
keys = {
{ "<leader>uH", "<CMD>Hardtime toggle<CR>", desc = "Toggle hardtime" }
},
opts = {
max_count = 10,
disable_mouse = false,
},
},
}

View file

@ -0,0 +1,50 @@
return {
{
"nvim-treesitter/nvim-treesitter",
lazy = false,
branch = "master",
dependencies = {
{
"JoosepAlviste/nvim-ts-context-commentstring",
opts = {
enable_autocmd = false,
},
},
{ "nvim-treesitter/nvim-treesitter-context" },
},
build = ":TSUpdate",
opts = {
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
},
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
dependencies = { "nvim-treesitter", },
config = function()
require 'nvim-treesitter.configs'.setup({
textobjects = {
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next = {
["]]"] = { query = { "@block.outer", "@function.outer", "@class.outer", } },
},
goto_previous = {
["[["] = { query = { "@block.outer", "@function.outer", "@class.outer", } },
}
},
},
})
local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move"
-- Repeat movement with ; and ,
-- ensure ; goes forward and , goes backward regardless of the last direction
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_previous)
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_next)
end
}
}

View file

@ -0,0 +1,97 @@
---@module 'trouble'
return {
"folke/trouble.nvim",
dependencies = { "echasnovski/mini.nvim", "ibhagwan/fzf-lua" },
cmd = { "Trouble" },
keys = {
{
"<leader>fD",
"<cmd>Trouble diagnostics open<cr>",
desc = "Find diagnostics (Trouble)",
},
{
"<leader>fd",
"<cmd>Trouble diagnostics open filter.buf=0<cr>",
desc = "Find buffer diagnostics (Trouble)",
},
{
"<leader>ll",
"<cmd>Trouble symbols open<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>li",
"<cmd>Trouble lsp open<cr>",
desc = "LSP info of node (Trouble)",
},
{
"<leader>fq",
"<cmd>Trouble qflist open<cr>",
desc = "Quickfix List (Trouble)",
},
},
opts = function()
local config = require("fzf-lua.config")
local actions = require("trouble.sources.fzf").actions
config.defaults.actions.files["ctrl-t"] = actions.open
---@type trouble.Window.opts
local win_opts = {
-- size = { width = 30, height = 0.5 },
minimal = true,
border = "rounded",
position = "bottom",
}
---@type trouble.Config
return {
focus = true,
---@type trouble.Window.opts
preview = {
type = "split",
relative = "win",
position = "top",
},
---@type table<string, trouble.Action.spec|false>
keys = {
["<s-cr>"] = "jump_close",
["<cr>"] = "jump",
["<2-leftmouse>"] = "jump",
["<c-v>"] = "jump_split_close",
["<c-s>"] = "jump_vsplit_close",
["v"] = "jump_split_close",
["s"] = "jump_vsplit_close",
["<c-k>"] = "cancel", -- hack to fool myself into thinking I move to the avobe window
["a"] = function(view, ctx)
-- TODO: this is not possible until this issue is solved
-- https://github.com/neovim/neovim/issues/31206
local trouble = require("trouble")
view:action("jump_only")
vim.lsp.buf.code_action()
trouble.focus(view, ctx)
end,
},
win = win_opts,
---@type table<string, trouble.Mode>
modes = {
symbols = {
focus = true,
win = win_opts
},
lsp_references = {
focus = true,
win = win_opts
},
lsp = {
focus = true,
win = win_opts
},
}
}
end
}

View file

@ -0,0 +1,11 @@
{
"Basic": { "prefix": "ba", "body": "T1=$1 T2=$2 T0=$0" },
"Placeholders": { "prefix": "pl", "body": "T1=${1:aa}\nT2=${2:<$1>}" },
"Choices": { "prefix": "ch", "body": "T1=${1|a,b|} T2=${2|c,d|}" },
"Linked": { "prefix": "li", "body": "T1=$1\n\tT1=$1" },
"Variables": { "prefix": "va", "body": "Runtime: $VIMRUNTIME\n" },
"Complex": {
"prefix": "co",
"body": ["T1=${1:$RANDOM}", "T3=${3:$1_${2:$1}}", "T2=$2"]
}
}