change dotfile manager to tuckr

This commit is contained in:
Alexander Navarro 2025-04-07 13:04:13 -04:00
parent 5efa1c4ce5
commit f181cd388a
206 changed files with 18 additions and 1329 deletions

View file

@ -0,0 +1,9 @@
(directive) @function
(directive_start) @function
(directive_end) @function
(comment) @comment
((parameter) @include (#set! "priority" 110))
((php_only) @include (#set! "priority" 110))
((bracket_start) @function (#set! "priority" 120))
((bracket_end) @function (#set! "priority" 120))
(keyword) @function

View file

@ -0,0 +1,3 @@
((php) @injection.content
(#set! injection.combined)
(#set! injection.language php))

View file

@ -0,0 +1,7 @@
-- Loadnoptions before anything
require("aleidk.options")
require("aleidk.lazy")
require("aleidk.keymaps")
require("aleidk.autocmds")

View file

@ -0,0 +1,57 @@
{
"LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" },
"blink.cmp": { "branch": "main", "commit": "81069e3955a8b4d5063287a2a6a47a844e9ca2cb" },
"blink.compat": { "branch": "main", "commit": "08943fdf2eb00432d6205db6d0239434135416bd" },
"catppuccin": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" },
"ccc.nvim": { "branch": "main", "commit": "7c639042583c7bdc7ce2e37e5a0e0aa6d0659c6a" },
"comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" },
"conform.nvim": { "branch": "master", "commit": "a203480a350b03092e473bf3001733d547160a73" },
"copilot-lualine": { "branch": "main", "commit": "f40450c3e138766026327e7807877ea860618258" },
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" },
"indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" },
"lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" },
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "43894adcf10bb1190c2184bd7c1750e8ea2b3dce" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.clue": { "branch": "main", "commit": "8e329f586a7cfd06085859066a4b60965fc4ecce" },
"mini.comment": { "branch": "main", "commit": "03c13e37318bdb18481311c0ac1adc9ed731caf1" },
"mini.surround": { "branch": "main", "commit": "0e67c4bc147f2a15cee94e7c94dcc0e115b9f55e" },
"neogen": { "branch": "main", "commit": "dc50715c009f89b8111197fd2f282f6042daa7ea" },
"noice.nvim": { "branch": "main", "commit": "c6f6fb178ebe9b4fd90383de743c3399f8c3a37c" },
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
"nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" },
"nvim-lspconfig": { "branch": "master", "commit": "4ae9796c4e95ca84ec77946a9f9089b8f1a3eec9" },
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
"nvim-treesitter": { "branch": "master", "commit": "8d4fdc5e47e2a4e00179e43f56221250ce365973" },
"nvim-treesitter-context": { "branch": "master", "commit": "6b081ea63a3711243d11540ce28ccdb6f35ecd33" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" },
"nvim-web-devicons": { "branch": "master", "commit": "edbe0a65cfacbbfff6a4a1e98ddd60c28c560509" },
"overseer.nvim": { "branch": "master", "commit": "10ee48ff96c8d1049efb278ea4c8cf9f3b0e4326" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"remote-nvim.nvim": { "branch": "main", "commit": "66fc20fd259401c7bb6ac5189ecb6283c2eb65d2" },
"remote-sshfs.nvim": { "branch": "main", "commit": "03f6c40c4032eeb1ab91368e06db9c3f3a97a75d" },
"render-markdown": { "branch": "main", "commit": "6096cf3608b576a38fd1396227dbc0473091714d" },
"smart-splits.nvim": { "branch": "master", "commit": "fc7bb00fe67ab504356bed4310d23c2e4cb4b06b" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"treesj": { "branch": "main", "commit": "03415ac60791d48e120a80d37e080744faf3ac15" },
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
"ts-node-action": { "branch": "master", "commit": "6d3b60754fd87963d70eadaa2f77873b447eac26" },
"typescript-tools.nvim": { "branch": "master", "commit": "346062e8cd06e82776b60785a040dfbbdcb6de77" },
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
"vim-dadbod": { "branch": "master", "commit": "fe5a55e92b2dded7c404006147ef97fb073d8b1b" },
"vim-dadbod-completion": { "branch": "master", "commit": "da0e75c09c27a82aad078d993bb1b2f4afd43427" },
"vim-dadbod-ui": { "branch": "master", "commit": "28a16902cb2134c934b85da5250033ee43b0dee5" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"yazi.nvim": { "branch": "main", "commit": "053867916a9be3cb46f84b6f095ee731bbddd213" }
}

View file

@ -0,0 +1,10 @@
-- Highlight on yank
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = "*",
})

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,77 @@
-- [[ Basic Keymaps ]]
function MAP(mode, l, r, desc)
vim.keymap.set(mode, l, r, { desc = desc, silent = true })
end
function ReloadModule(module)
package.loaded[module] = nil
require(module)
end
local function default(desc)
return {
silent = true,
desc = desc,
}
end
local function fixIndentation()
local indent = 2
vim.opt.tabstop = indent
vim.opt.shiftwidth = indent
vim.opt.softtabstop = indent
vim.cmd("retab")
end
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
-- vim.keymap.set("n", "<C-s>", "<CMD>w<CR>", default("Keep cursor centered while junping"))
-- Remap for dealing with word wrap
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.keymap.set("n", "J", "mzJ`z", default("Keep cursor in column while joining lines"))
vim.keymap.set("n", "|", ":vs<CR>", default("Open vsplit"))
vim.keymap.set("n", "°", ":sp<CR>", default("Open split"))
vim.keymap.set("n", "<C-d>", "<C-d>zz", default("Keep cursor centered while junping"))
vim.keymap.set("n", "<C-u>", "<C-u>zz", default("Keep cursor centered while junping"))
vim.keymap.set("n", "n", "nzzzv", default("Keep cursor centered while searching"))
vim.keymap.set("n", "N", "Nzzzv", default("Keep cursor centered while searching"))
vim.keymap.set("n", "Q", "<nop>", {})
vim.keymap.set(
"n",
"<leader>rw",
[[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
default("Search and replace current word")
)
-- vim.keymap.set("n", "<leader>rR", ":s/", default("Search and replace inline"))
-- vim.keymap.set("n", "<leader>rr", ":%s/", default("Search and replace globally"))
-- vim.keymap.set("v", "<leader>r", ":s/", default("Search and replace in selection"))
vim.keymap.set("v", "p", [["_dP]], default("Paste without lossing yanked text"))
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", default("Move selection down"))
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", default("Move selection up"))
vim.keymap.set("n", "<Leader>uI", fixIndentation, default("Fix indentation"))
vim.keymap.set("n", "<Leader>uO", function() ReloadModule('aleidk.options') end,
default("Reload the options configuration"))
vim.keymap.set("n", "<Leader>uh", ":nohl<CR>", default("Remove search highlight"))
vim.keymap.set("t", "<ESC>", "<C-\\><C-n>", default("Exit insert mode on terminal"))
vim.keymap.set("n", "<leader>bc", "<Cmd>bd<CR>", default("Close buffer"))
vim.keymap.set("n", "<leader>bh", "<Cmd>bp<CR>", default("Prev buffer"))
vim.keymap.set("n", "<leader>bl", "<Cmd>bn<CR>", default("Next buffer"))
vim.keymap.set("n", "<leader>bA", "<Cmd>bufdo bd<CR>", default("Close all buffers"))

View file

@ -0,0 +1,35 @@
-- Bootstrap lazy.nvim
-- Load this file after options has been set
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)
-- enabled_plugins is injected as a local variable in the top of the file by the dotfile manager
-- See: .dotter/global.toml inside [nvim.files] & [nvim.variables] table
require("lazy").setup({
spec = {
{ import = "aleidk.plugins-core" },
{ import = "aleidk.plugins-base" },
{ import = "aleidk.plugins-ide" },
},
install = { colorscheme = { "catppuccin" } },
-- checker = { enabled = true },
})
return {
enabled_plugins
}

View file

@ -0,0 +1,135 @@
-- [[ 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
-- stylua: ignore
opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
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 = "nosplit" -- preview incremental substitute
opt.laststatus = 0
opt.list = true -- Show some invisible characters (tabs...
opt.mouse = "a" -- Enable mouse mode
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.shortmess:append({ W = true, I = true, c = true }) -- INFO: this control the format of some messages
opt.showmode = false -- Dont 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.timeoutlen = 300
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.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
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",
},
})

View file

@ -0,0 +1,6 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
opts = {}, -- this is equalent to setup({}) function
}

View file

@ -0,0 +1,38 @@
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 },
},
lazy = false,
cmd = "Grapple",
config = function()
local telescope = require("telescope")
telescope.load_extension("grapple")
end,
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,28 @@
return {
{
"echasnovski/mini.comment",
version = "*",
event = "VeryLazy",
dependencies = {
{ "nvim-treesitter/nvim-treesitter-context" },
},
opts = {
options = {
custom_commentstring = function()
return require("ts_context_commentstring.internal").calculate_commentstring()
or vim.bo.commentstring
end,
},
},
},
{
"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" }, } },
},
},
}

View file

@ -0,0 +1,33 @@
return {
"mikavilpas/yazi.nvim",
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,30 @@
return {
-- Add indentation guides even on blank lines
"lukas-reineke/indent-blankline.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter" },
main = "ibl",
opts = {
-- char = "▏",
indent = {
char = "",
tab_char = "",
},
scope = {
enabled = true,
},
exclude = {
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
},
},
}

View file

@ -0,0 +1,90 @@
return {
-- Highlight, edit, and navigate code
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile", "BufWritePre", "VeryLazy" },
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
"JoosepAlviste/nvim-ts-context-commentstring",
"nvim-treesitter/nvim-treesitter-context",
{ "windwp/nvim-ts-autotag", opts = {} },
},
build = ":TSUpdate",
config = function()
---@diagnostic disable-next-line: missing-fields
require("nvim-treesitter.configs").setup({
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_previous = { -- current or last start of object
["[["] = { query = "@local.scope", query_group = "locals", desc = "Next scope" },
["[f"] = "@function.outer",
["[c"] = "@class.outer",
},
goto_next = { -- next object end
["]]"] = { query = "@local.scope", query_group = "locals", desc = "Next scope" },
["]f"] = "@function.outer", -- current function end
["]c"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = {
["<leader>ln"] = "@parameter.inner",
},
swap_previous = {
["<leader>lN"] = "@parameter.inner",
},
},
},
-- autotag = { enable = true },
})
require('ts_context_commentstring').setup {
enable_autocmd = false,
}
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_next)
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_previous)
-- Optionally, make builtin f, F, t, T also repeatable with ; and ,
vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f_expr, { expr = true })
vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F_expr, { expr = true })
vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t_expr, { expr = true })
vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T_expr, { expr = true })
vim.keymap.set("n", "[u", function()
require("treesitter-context").go_to_context()
end, { silent = true, noremap = true, desc = "Go up when context is out of view" })
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
-- Uncoment this line to disable auto folding on file open
vim.cmd("set nofoldenable")
end,
}

View file

@ -0,0 +1,217 @@
local icons = require("aleidk.constants").icons
return {
{
"rcarriga/nvim-notify",
opts = {
render = "compact",
fps = "60",
timeout = 2000,
stages = "slide",
icons = {
DEBUG = "",
TRACE = "",
ERROR = icons.diagnostics.Error,
INFO = icons.diagnostics.Info,
WARN = icons.diagnostics.Warn,
}
}
},
{
-- better imputs
"stevearc/dressing.nvim",
opts = {
input = {
-- handle by noice
enabled = false,
},
},
},
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
---@type NoiceConfig
opts = {
presets = {
bottom_search = true,
long_message_to_split = true,
inc_rename = true,
lsp_doc_border = true,
},
lsp = {
override = {
-- override the default lsp markdown formatter with Noice
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
-- override the lsp markdown formatter with Noice
["vim.lsp.util.stylize_markdown"] = true,
-- override cmp documentation with Noice (needs the other options to work)
["cmp.entry.get_documentation"] = true,
},
message = {
view = "mini",
view_search = false,
},
progress = {
view = "mini_left"
}
},
---@type NoiceRouteConfig[]
routes = {
{
-- Don't show these messages
opts = { skip = true },
filter = {
any = {
{
event = "msg_show",
kind = "search_count",
},
{
event = "msg_show",
kind = "",
find = "written", -- file saved msg
},
{
event = "msg_show",
kind = "",
find = "yazi.nvim",
},
{
event = "msg_show",
kind = "",
find = "%d+ (more|fewer) lines", -- undo/redo msg
},
}
},
},
{
filter = {
event = "notify",
min_height = 15
},
view = 'popup',
},
{
filter = {
event = "notify",
kind = "info"
},
view = 'mini'
},
},
---@type NoiceConfigViews
views = {
notify = {
merge = true
},
cmdline_popup = {
position = {
row = 5,
col = "50%",
},
size = {
width = 60,
height = "auto",
},
},
popupmenu = {
relative = "editor",
position = {
row = 8,
col = "50%",
},
size = {
width = 60,
height = 10,
},
border = {
style = "rounded",
padding = { 0, 1 },
},
win_options = {
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
},
},
mini_left = {
backend = "mini",
relative = "editor",
align = "left",
timeout = 2000,
reverse = true,
focusable = false,
position = {
row = -1,
col = 0,
},
size = {
width = "auto",
height = "auto",
max_height = 10,
},
border = {
style = "none",
},
zindex = 60,
win_options = {
winbar = "",
foldenable = false,
winblend = 30,
winhighlight = {
Normal = "NoiceMini",
IncSearch = "",
CurSearch = "",
Search = "",
},
},
},
},
},
-- stylua: ignore
keys = {
{
"<S-Enter>",
function() require("noice").redirect(vim.fn.getcmdline()) end,
mode = "c",
desc =
"Redirect Cmdline"
},
{
"<leader>um",
function() require("noice").cmd("last") end,
desc =
"Messages last"
},
{
"<leader>uM",
function() require("noice").cmd("history") end,
desc =
"Messages all"
},
{ "<leader>uX", function() require("noice").cmd("dismiss") end, desc = "Message dismiss all" },
{
"<c-d>",
function() if not require("noice.lsp").scroll(4) then return "<c-d>" end end,
silent = true,
expr = true,
desc =
"Scroll forward",
mode = {
"i", "n", "s" }
},
{
"<c-u>",
function() if not require("noice.lsp").scroll(-4) then return "<c-u>" end end,
silent = true,
expr = true,
desc =
"Scroll backward",
mode = {
"i", "n", "s" }
},
},
}
}

View file

@ -0,0 +1,13 @@
return {
{
"mbbill/undotree",
config = function()
vim.g.undotree_WindowLayout = 2
vim.g.undotree_ShortIndicators = 1
vim.g.undotree_SetFocusWhenToggle = 1
end,
keys = {
{ "<leader>fu", vim.cmd.UndotreeToggle, desc = "Undo tree" },
},
},
}

View file

@ -0,0 +1,57 @@
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,
},
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 },
}
end,
}
require("catppuccin").setup(opts)
vim.cmd.colorscheme("catppuccin-macchiato")
end,
}

View file

@ -0,0 +1,22 @@
return {
-- Detect tabstop and shiftwidth automatically
"tpope/vim-sleuth",
{ "nvim-tree/nvim-web-devicons", lazy = true },
{
-- Highlight word under cursor
"RRethy/vim-illuminate",
event = { "BufReadPost", "BufNewFile" },
opts = {
delay = 200,
filetypes_denylist = {
'dirbuf',
'dirvish',
'fugitive',
'aerial',
},
},
config = function(_, opts)
require("illuminate").configure(opts)
end,
},
}

View file

@ -0,0 +1,85 @@
return {
"echasnovski/mini.clue",
version = "*",
event = "VeryLazy",
config = function()
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>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>un", desc = "+Noice" },
{ 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>",
},
})
end,
}

View file

@ -0,0 +1,189 @@
return {
"nvim-lualine/lualine.nvim",
lazy = false,
dependencies = {
"nvim-tree/nvim-web-devicons",
"cbochs/grapple.nvim",
{ 'AndreM222/copilot-lualine' }
},
opts = function()
local icons = require("aleidk.constants").icons
local palete = require("catppuccin.palettes").get_palette "macchiato"
local function diff_source()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end
local function position_scrollbar(str)
local sbar = { "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
local curr_line = vim.api.nvim_win_get_cursor(0)[1]
local lines = vim.api.nvim_buf_line_count(0)
local i = math.floor((curr_line - 1) / lines * #sbar) + 1
return str .. " " .. sbar[i]
end
local codecompanion_status = require("lualine.component"):extend()
codecompanion_status.processing = false
codecompanion_status.spinner_index = 1
local spinner_symbols = require("copilot-lualine.spinners").bouncing_bar
-- Initializer
function codecompanion_status:init(options)
codecompanion_status.super.init(self, options)
local group = vim.api.nvim_create_augroup("CodeCompanionHooks", {})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "CodeCompanionRequest*",
group = group,
callback = function(request)
if request.match == "CodeCompanionRequestStarted" then
self.processing = true
elseif request.match == "CodeCompanionRequestFinished" then
self.processing = false
end
end,
})
end
-- Function that runs every time statusline is updated
function codecompanion_status:update_status()
if self.processing then
self.spinner_index = (self.spinner_index % #spinner_symbols) + 1
return spinner_symbols[self.spinner_index]
else
return nil
end
end
return {
options = {
theme = "catppuccin",
globalstatus = true,
disabled_filetypes = { statusline = { "dashboard", "alpha" } },
component_separators = "",
section_separators = "",
},
sections = {
lualine_a = {
{
"mode",
padding = 0,
fmt = function()
return " "
end,
},
},
lualine_b = {},
lualine_c = {
{ "branch", icon = icons.git.branch },
{
"diff",
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
source = diff_source,
},
{ codecompanion_status },
{
"diagnostics",
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
"filetype",
{
"filename",
path = 1,
symbols = {
modified = "", -- Text to show when the buffer is modified
alternate_file = "#", -- Text to show to identify the alternate file
directory = "", -- Text to show when the buffer is a directory
},
},
},
lualine_x = {
{
"overseer",
},
{
function()
return require("grapple").statusline()
end,
},
{
"copilot",
cond = function()
return vim.bo.filetype ~= "codecompanion"
end,
show_colors = true,
symbols = {
status = {
icons = {
enabled = "",
sleep = "", -- auto-trigger disabled
disabled = "",
warning = "",
unknown = ""
},
hl = {
enabled = palete.teal,
sleep = palete.lavender,
disabled = palete.subtext0,
warning = palete.peach,
unknown = palete.red
}
},
spinners = spinner_symbols,
spinner_color = palete.mauve
},
},
},
lualine_y = {
{
-- Macro recording status
function()
return require("noice").api.status.mode.get()
end,
cond = function()
return package.loaded["noice"] and require("noice").api.status.mode.has()
end,
},
{ "searchcount" },
{ "location" },
{
"progress",
fmt = position_scrollbar,
separator = " ",
padding = 0,
},
},
lualine_z = {},
},
extensions = {
"lazy",
"fzf",
"man",
"mason",
"quickfix",
"trouble",
"toggleterm",
},
}
end,
}

View file

@ -0,0 +1,15 @@
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
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons
opts = {
file_types = { 'markdown', 'copilot-chat' },
sign = {
enabled = false,
},
},
},
}

View file

@ -0,0 +1,67 @@
-- Move to windows with Ctrl and hjkl
-- Resize to windows with Alt and hjkl
-- Tmux aware
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,6 @@
return {
"echasnovski/mini.surround",
disabled = true,
version = "*",
opts = {},
}

View file

@ -0,0 +1,83 @@
-- Fuzzy Finder (files, lsp, etc)
return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{
-- Blazingly Fast Fuzzy Finder Algorithm for Telescope
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
cond = function()
return vim.fn.executable("make") == 1
end,
},
},
config = function()
local actions = require("telescope.actions")
local telescope = require("telescope")
local builtin = require("telescope.builtin")
local opts = {
defaults = {
prompt_prefix = "",
selection_caret = "",
layout_strategy = "flex",
mappings = {
i = {
["<c-u>"] = actions.preview_scrolling_up,
["<c-d>"] = actions.preview_scrolling_down,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-s>"] = actions.file_vsplit,
["<C-v>"] = actions.file_split,
["<ESC>"] = actions.close,
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
["<c-t>"] = require("trouble.sources.telescope").open,
["<a-t>"] = require("trouble.sources.telescope").open,
["<M-h>"] = actions.which_key,
},
},
},
pickers = {
find_files = {
hidden = true,
},
},
}
telescope.setup(opts)
-- Enable telescope fzf native, if installed
pcall(telescope.load_extension, "fzf")
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Find buffers" })
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find files" })
vim.keymap.set("n", "<leader>fF", function()
builtin.find_files({ hidden = true, no_ignore = true })
end, { desc = "Find all files" })
-- Search inside files
vim.keymap.set("n", "<leader>fw", builtin.grep_string, { desc = "Find word under cursor" })
vim.keymap.set("n", "<leader>fW", builtin.live_grep, { desc = "Find word (live grep)" })
-- Help
vim.keymap.set("n", "<leader>fc", builtin.command_history, { desc = "Find in commands history" })
vim.keymap.set("n", "<leader>fC", builtin.commands, { desc = "Find a command" })
vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Find Help" })
vim.keymap.set("n", "<leader>fk", builtin.keymaps, { desc = "Find Keymaps" })
-- Git
vim.keymap.set("n", "<leader>gb", builtin.git_branches, { desc = "Change branch" })
-- Diagnosticos
-- Disabled, handle by trouble
-- vim.keymap.set("n", "<leader>fD", function()
-- builtin.diagnostics({ bufnr = 0 })
-- end, { desc = "Find diagnostics (Telescope)" })
-- vim.keymap.set("n", "<leader>fD", function()
-- builtin.diagnostics({ bufnr = nil })
-- end, { desc = "Find diagnostics in workspace (Telescope)" })
-- vim.keymap.set("n", "<leader>fz", builtin.spell_suggest, { desc = "Find spell suggestion" })
end,
}

View file

@ -0,0 +1,12 @@
return {
"folke/todo-comments.nvim",
cmd = { "TodoTrouble", "TodoTelescope" },
event = { "BufReadPost", "BufNewFile" },
config = true,
keys = {
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
{ "<leader>ft", "<cmd>TodoTrouble<cr>", desc = "Find todos (Trouble)" },
{ "<leader>fT", "<cmd>TodoTelescope<cr>", desc = "Find todos (Telescope)" },
},
}

View file

@ -0,0 +1,14 @@
return {
{
-- Color Picker
"uga-rosa/ccc.nvim",
opts = {
auto_enable = true,
lsp = true,
},
keys = {
{ "<leader>uc", "<CMD>CccPick<CR>", desc = "Open Color picker" },
{ "<leader>uC", "<CMD>CccHighlighterToggle<CR>", desc = "Toggle Color highlight" },
},
},
}

View file

@ -0,0 +1,92 @@
return {
"saghen/blink.cmp",
lazy = false,
version = "*",
dependencies = {
"rafamadriz/friendly-snippets",
"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 {
sources = {
providers = {
dadbod = { name = "Dadbod", module = "vim_dadbod_completion.blink" },
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,
},
},
},
-- nvim-cmp sources
compat = {},
completion = {
enabled_providers = {
"lsp",
"path",
"snippets",
"buffer",
"dadbod",
"lazydev",
},
},
},
accept = {
auto_brackets = { enabled = true },
expand_snippet = function(snippet) require('luasnip').lsp_expand(snippet) end,
},
-- trigger = { signature_help = { 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' },
},
highlight = {
-- sets the fallback highlight groups to nvim-cmp's highlight groups
-- useful for when your theme doesn't support blink.cmp
-- will be removed in a future release, assuming themes add support
use_nvim_cmp_as_default = false,
},
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- adjusts spacing to ensure icons are aligned
nerd_font_variant = "mono",
windows = {
autocomplete = vim.tbl_extend("force", window_options, {
selection = "manual",
---@type blink.cmp.Draw
draw = {
components = {
kind_icon = {
text = function(ctx)
return ctx.kind_icon .. ctx.icon_gap
end,
}
}
}
}),
documentation = vim.tbl_extend("force", window_options, {
auto_show = true,
winblend = 0,
}),
ghost_text = {
enabled = true,
},
},
kind_icons = require("aleidk.constants").icons.kinds,
}
end
}

View file

@ -0,0 +1,44 @@
return {
"kristijanhusak/vim-dadbod-ui",
dependencies = {
{ "tpope/vim-dadbod", lazy = true },
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
},
cmd = {
"DBUI",
"DBUIToggle",
"DBUIAddConnection",
"DBUIFindBuffer",
},
keys = {
{ "<Leader>ud", "<CMD>DBUIToggle<CR>", desc = "Toggle DB UI" },
},
init = function()
-- Your DBUI configuration
vim.g.db_ui_use_nerd_fonts = 1
vim.g.db_ui_force_echo_notifications = 1
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"sql",
"mysql",
"plsql",
},
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"sql",
"mysql",
"plsql",
},
callback = function()
---@diagnostic disable-next-line: missing-fields
require("cmp").setup.buffer({
sources = { { name = "vim-dadbod-completion" }, { name = "buffer" } },
})
end,
})
end,
}

View file

@ -0,0 +1,15 @@
return {
"danymat/neogen",
opts = { snippet_engine = "luasnip" },
dependencies = { "nvim-treesitter/nvim-treesitter" },
version = "*", -- stable releases
keys = {
{
"gcd",
function()
require("neogen").generate()
end,
desc = "Generate comment docstring",
},
},
}

View file

@ -0,0 +1,124 @@
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
opts = {
-- log_level = vim.log.levels.DEBUG,
-- See aviable 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 formatter
-- 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" },
nim = { "nimpretty" },
php = { "pint" },
python = { "ruff_format", "ruff_organize_imports" },
scss = { "prettierd", "prettier", stop_after_first = true },
sh = { "shfmt" },
toml = { "taplo" },
typescript = { "biome" },
typescriptreact = { "biome" },
xml = { "lemminx" },
zsh = { "shfmt" },
sql = { "sleek" }
},
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
MAP("n", "<leader>uf", toggleAutoFormat, "Toggle auto format")
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,52 @@
local const = require("aleidk.constants")
return {
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
-- See `:help gitsigns.txt`
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
signs = {
add = { text = const.icons.git.added },
change = { text = const.icons.git.modified },
delete = { text = const.icons.git.removed },
topdelete = { text = const.icons.git.removed },
changedelete = { text = const.icons.git.removed },
untracked = { text = "" },
},
signs_staged = {
add = { text = const.icons.git.added },
change = { text = const.icons.git.modified },
delete = { text = const.icons.git.removed },
topdelete = { text = const.icons.git.removed },
changedelete = { text = const.icons.git.removed },
untracked = { text = "" },
},
on_attach = function(buffer)
local gs = package.loaded.gitsigns
local function map(mode, l, r, desc)
vim.keymap.set(mode, "<leader>g" .. l, r, { buffer = buffer, desc = desc })
end
-- stylua: ignore start
map("n", "j", gs.next_hunk, "Next Hunk")
map("n", "k", gs.prev_hunk, "Prev Hunk")
map({ "n", "v" }, "s", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
map({ "n", "v" }, "r", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
map("n", "u", gs.undo_stage_hunk, "Undo Stage Hunk")
map("n", "R", gs.reset_buffer, "Reset Buffer")
map("n", "<TAB>", gs.preview_hunk, "Preview Hunk")
map("n", "l", function() gs.blame_line({ full = true }) end, "Blame Line")
map("n", "L", gs.toggle_current_line_blame, "Toggle current line blame")
map("n", "d", gs.toggle_word_diff, "Toggle word diff")
map("n", "h", "<CMD>diffget<CR>", "Diff This with last commit")
map("n", "l", "<CMD>diffput<CR>", "Diff This with last commit")
end,
},
},
}

View file

@ -0,0 +1,21 @@
return {
{
"ckolkey/ts-node-action",
dependencies = { "nvim-treesitter" },
opts = {},
keys = {
{ "<leader>ls", function() require("ts-node-action").node_action() end, desc = "Node Action" }
}
},
{
"Wansmer/treesj",
cmd = { "TSJToggle" },
keys = {
{ "<leader>lm", "<CMD>TSJToggle<CR>", desc = "Toggle treesitter join" },
},
dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = {
use_default_keymaps = true,
},
},
}

View file

@ -0,0 +1,25 @@
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" },
}
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
require("lint").try_lint()
end,
})
end,
}

View file

@ -0,0 +1,229 @@
return {
-- LSP Plugins
{
-- `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 = 'luvit-meta/library', words = { 'vim%.uv' } },
},
},
},
{ "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings
{
-- LSP Configuration & Plugins
"neovim/nvim-lspconfig",
event = { "BufReadPost", "BufNewFile", "BufWritePre" },
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ "williamboman/mason.nvim", config = true },
"williamboman/mason-lspconfig.nvim",
{ 'saghen/blink.cmp' } -- autocompletion
},
config = function()
-- LSP settings.
local on_attach = function(_, bufnr)
local nmap = function(keys, func, desc)
if desc then
desc = "LSP: " .. desc
end
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
end
nmap("<leader>lr", vim.lsp.buf.rename, "Rename")
-- stylua: ignore
vim.keymap.set({ "n", "x", "v" }, "<leader>la", vim.lsp.buf.code_action, { buffer = bufnr, desc = "Code Action" })
nmap("<leader>ld", vim.lsp.buf.type_definition, "Go to type definition")
nmap("<leader>lf", function()
vim.lsp.buf.format()
end, "Format")
nmap("gd", vim.lsp.buf.definition, "Go to definition")
nmap("gr", require("telescope.builtin").lsp_references, "Goto References")
nmap("gI", vim.lsp.buf.implementation, "Go to Implementation")
-- See `:help K` for why this keymap
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
-- nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
-- Lesser used LSP functionality
nmap("gD", vim.lsp.buf.declaration, "Goto Declaration")
nmap("<leader>lj", vim.diagnostic.goto_next, "Go to next diagnostic")
nmap("<leader>lk", vim.diagnostic.goto_prev, "Go to prev diagnostic")
nmap("<leader>lK", function()
-- execute twice to enter the float inmediatly
vim.diagnostic.open_float()
vim.diagnostic.open_float()
end, "Hover current diagnostic")
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
vim.lsp.buf.format()
end, { desc = "Format current buffer with LSP" })
end
-- Enable the following language servers
-- To see options and cofigurations `:help lspconfig-all`
local servers = {
astro = {},
bashls = {},
biome = {
single_file_support = true,
},
cssls = {},
dockerls = {},
emmet_ls = {
filetypes = {
"astro",
"css",
"eruby",
"html",
"htmldjango",
"javascriptreact",
"less",
"pug",
"sass",
"scss",
"svelte",
"typescriptreact",
"vue",
"htmlangular",
"php",
"blade"
},
},
harper_ls = {},
html = {},
hyprls = {},
marksman = {},
phpactor = {},
gopls = {
settings = {
gopls = {
completeUnimported = true,
usePlaceholders = true,
analyses = {
unusedparams = true,
},
},
},
},
ruff = {},
rust_analyzer = {
settings = {
["rust-analyzer"] = {
imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = true,
},
},
},
},
sqlls = {},
taplo = {},
yamlls = {
settings = {
yaml = {
schemas = {},
customTags = {
"!vault" -- ansible encrypted vars support
}
}
},
},
lua_ls = {
settings = {
Lua = {
completion = {
callSnippet = 'Replace',
},
diagnostics = { disable = { 'missing-fields' } },
},
},
},
}
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("blink.cmp").get_lsp_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup({
ensure_installed = vim.tbl_keys(servers),
automatic_installation = false,
})
mason_lspconfig.setup_handlers({
function(server_name)
local _border = "single"
local default_config = {
capabilities = capabilities,
on_attach = on_attach,
handlers = {
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = _border,
}),
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = _border,
max_width = 200,
max_height = 200,
focus = true,
}),
},
}
require("lspconfig")[server_name].setup(
vim.tbl_deep_extend("force", default_config, servers[server_name] or {})
)
end,
})
vim.diagnostic.config({
update_in_insert = false,
underline = true,
float = {
source = true
},
virtual_text = {
severity = vim.diagnostic.severity.ERROR,
source = true,
spacing = -1,
prefix = nil,
format = function(diagnostic)
-- show small error code instead of whole error that probably won't fit in the screen
-- to see the whole error use other keybindings
return tostring(diagnostic.code)
end,
virt_text_hide = true
},
severity_sort = true,
})
-- Customize gutter icons
local signs = require("aleidk.constants").icons.diagnostics
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
end,
},
}

View file

@ -0,0 +1,27 @@
return {
"L3MON4D3/LuaSnip",
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true,
silent = true,
mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
}

View file

@ -0,0 +1,59 @@
return {
{
"nosduco/remote-sshfs.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
cmd = { "RemoteSSHFSConnect" },
config = function()
require("remote-sshfs").setup({})
require("telescope").load_extension("remote-sshfs")
end,
},
{
"amitds1997/remote-nvim.nvim",
version = "*", -- Pin to GitHub releases
dependencies = {
"nvim-lua/plenary.nvim", -- For standard functions
"MunifTanjim/nui.nvim", -- To build the plugin UI
"nvim-telescope/telescope.nvim", -- For picking b/w different remote methods
},
opts = {
remote = {
copy_dirs = {
data = {
base = vim.fn.stdpath("data"), -- Path from where data has to be copied. You can choose to copy entire path or subdirectories inside using `dirs`
dirs = { "lazy" }, -- Directories inside `base` to copy over. If this is set to string "*"; it means entire `base` should be copied over
compression = {
enabled = true, -- Should data be compressed before uploading
additional_opts = { "--exclude-vcs" }, -- Any arguments that can be passed to `tar` for compression can be specified here to improve your compression
},
},
-- cache = {
-- base = vim.fn.stdpath("cache"),
-- dirs = {},
-- compression = {
-- enabled = true,
-- },
-- },
state = {
base = vim.fn.stdpath("state"),
dirs = {},
compression = {
enabled = true,
},
},
},
},
client_callback = function(port, workspace_config)
local cmd = ("tmux new-window 'nvim --server localhost:%s --remote-ui' && tmux select-window -t:$"):format(port)
vim.fn.jobstart(cmd, {
detach = true,
on_exit = function(job_id, exit_code, event_type)
-- This function will be called when the job exits
print("Client", job_id, "exited with code", exit_code, "Event type:", event_type)
end,
})
end,
},
config = true,
}
}

View file

@ -0,0 +1,171 @@
local function term_get_effective_line_count(bufnr)
local linecount = vim.api.nvim_buf_line_count(bufnr)
local non_blank_lines = linecount
for i = linecount, 1, -1 do
local line = vim.api.nvim_buf_get_lines(bufnr, i - 1, i, true)[1]
non_blank_lines = i
if line ~= "" then
break
end
end
return non_blank_lines
end
-- This is a copy of the original util function of overseer with the change that
-- vim.api.nvim_win_set_cursor(winid, { lnum, 0 }) column is set to 0 so the output is visible
-- the rest is the same
local scroll_to_end = function(winid)
winid = winid or 0
local bufnr = vim.api.nvim_win_get_buf(winid)
local lnum = vim.api.nvim_buf_line_count(bufnr)
-- Hack: terminal buffers add a bunch of empty lines at the end. We need to ignore them so that
-- we don't end up scrolling off the end of the useful output.
local not_much_output = lnum < vim.o.lines + 6
if vim.bo[bufnr].buftype == "terminal" and not_much_output then
lnum = term_get_effective_line_count(bufnr)
end
local scrolloff = vim.api.nvim_get_option_value("scrolloff", { scope = "local", win = winid })
vim.api.nvim_set_option_value("scrolloff", 0, { scope = "local", win = winid })
vim.api.nvim_win_set_cursor(winid, { lnum, 0 })
vim.api.nvim_set_option_value("scrolloff", scrolloff, { scope = "local", win = winid })
end
local open_split = function(task, horizontal)
local original_window = vim.api.nvim_get_current_win()
if horizontal then
-- horizontal split across all vertical splits
vim.cmd([[botright split]])
else
-- vertical split across all horizontal splits
vim.cmd([[vert botright split]])
end
-- Update tasks buffer options
vim.api.nvim_win_set_buf(0, task:get_bufnr())
vim.api.nvim_set_option_value("number", false, { scope = "local", win = 0 })
vim.api.nvim_set_option_value("relativenumber", false, { scope = "local", win = 0 })
vim.api.nvim_set_option_value("signcolumn", "no", { scope = "local", win = 0 })
scroll_to_end(0)
-- Go back to the original window
vim.api.nvim_set_current_win(original_window)
end
return {
"stevearc/overseer.nvim",
keys = {
{ "<leader>pO", "<CMD>OverseerQuickAction hsplit<CR>", desc = "Open task in a hsplit" },
{
"<leader>pQ",
"<CMD>OverseerQuickAction close win<CR><CMD>OverseerQuickAction dispose<CR>",
desc = "Close and dispose task's windows",
},
{ "<leader>pW", "<CMD>OverseerQuickAction unwatch<CR>", desc = "Unwatch task" },
{ "<leader>pf", "<CMD>OverseerQuickAction open float<CR>", desc = "Open task in a float window" },
{ "<leader>pl", "<CMD>OverseerLoadBundle<CR>", desc = "Load tasks" },
{ "<leader>pm", "<CMD>OverseerTaskAction<CR>", desc = "Manage task" },
{ "<leader>po", "<CMD>OverseerQuickAction vsplit<CR>", desc = "Open task in a vsplit" },
{ "<leader>pp", "<CMD>OverseerRun<CR>", desc = "Run task" },
{
"<leader>pP",
function()
local overseer = require('overseer')
overseer.run_template({}, function(task)
if task then
task:add_components({ "restart_on_save" })
overseer.run_action(task, "hsplit")
end
end)
end,
desc = "Run task and watch it"
},
{ "<leader>pq", "<CMD>OverseerQuickAction close win<CR>", desc = "Close task's windows" },
{ "<leader>ps", "<CMD>OverseerSaveBundle<CR>", desc = "Save tasks" },
{ "<leader>pt", "<CMD>OverseerToggle<CR>", desc = "Toggle tasks list" },
{ "<leader>pw", "<CMD>OverseerQuickAction watch<CR>", desc = "Watch task" },
},
opts = {
templates = {
"cargo",
"cargo-make",
"composer",
"deno",
"just",
"mage",
"make",
"mix",
"npm",
"rake",
"task",
"tox",
"vscode",
},
actions = {
["hsplit"] = {
desc = "open terminal in a horizontal split",
condition = function(task)
local bufnr = task:get_bufnr()
return bufnr and vim.api.nvim_buf_is_valid(bufnr)
end,
run = function(task)
open_split(task, true)
end,
},
["vsplit"] = {
desc = "open terminal in a vertical split",
condition = function(task)
local bufnr = task:get_bufnr()
return bufnr and vim.api.nvim_buf_is_valid(bufnr)
end,
run = function(task)
open_split(task, false)
end,
},
["close win"] = {
desc = "open terminal in a vertical split",
condition = function(task)
local bufnr = task:get_bufnr()
return bufnr and vim.api.nvim_buf_is_valid(bufnr)
end,
run = function(task)
local buf = task:get_bufnr()
-- iterar sobre todas las windows y ver si la window tiene attach el buf que quiero cerrar
for _, win in ipairs(vim.api.nvim_list_wins()) do
if buf == vim.api.nvim_win_get_buf(win) then
vim.api.nvim_win_close(win, false)
end
end
end,
},
},
task_list = {
direction = "bottom",
bindings = {
["?"] = "ShowHelp",
["g?"] = "ShowHelp",
["<CR>"] = "RunAction",
["<C-e>"] = "Edit",
["o"] = "Open",
["<C-v>"] = "OpenVsplit",
["<C-s>"] = "OpenSplit",
["<C-f>"] = "OpenFloat",
["<C-q>"] = "OpenQuickFix",
["<TAB>"] = "TogglePreview",
["p"] = "TogglePreview",
["<C-l>"] = "IncreaseAllDetail",
["<C-h>"] = "DecreaseAllDetail",
["L"] = "IncreaseDetail",
["H"] = "DecreaseDetail",
["["] = "DecreaseWidth",
["]"] = "IncreaseWidth",
["{"] = "PrevTask",
["}"] = "NextTask",
["<C-u>"] = "ScrollOutputUp",
["<C-d>"] = "ScrollOutputDown",
["q"] = "Close",
["d"] = "<CMD>OverseerQuickAction dispose<CR>",
},
},
},
}

View file

@ -0,0 +1,93 @@
---@module 'trouble'
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
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()
---@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,18 @@
return {
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
opts = {
init_options = {
preferences = {
disableSuggestions = true,
},
},
settings = {
-- array of strings("fix_all"|"add_missing_imports"|"remove_unused"|
-- "remove_unused_imports"|"organize_imports") -- or string "all"
-- to include all supported code actions
-- specify commands exposed as code_actions
expose_as_code_action = "all",
},
},
}

View file

@ -0,0 +1,7 @@
local M = {}
function M.plugin_should_be_enabled()
print("Plugin should be enabled")
end
return M