first commit

config imported from personal dotfiles aleee-idk/dots
This commit is contained in:
Alexander Navarro 2024-08-05 14:51:17 -04:00
commit d3a88cbb28
85 changed files with 5236 additions and 0 deletions

View file

@ -0,0 +1,26 @@
-- Loadnoptions before anything
require("aleidk.options")
-- Init PLugins
-- Install package manager https://github.com/folke/lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- Load plugins
require("lazy").setup("aleidk.plugins")
-- Rest of configuratin
require("aleidk.keymaps")
require("aleidk.autocmds")

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,68 @@
-- [[ Basic Keymaps ]]
function MAP(mode, l, r, desc)
vim.keymap.set(mode, l, r, { desc = desc, silent = true })
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>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>bA", "<Cmd>bufdo bd<CR>", default("Close all buffers"))

View file

@ -0,0 +1,76 @@
-- [[ Setting options ]]
-- See `:help vim.o`
-- Set <space> as the leader key
vim.g.mapleader = " "
vim.g.maplocalleader = " "
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 })
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"
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",
},
})

View file

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

View file

@ -0,0 +1,19 @@
return {
"cbochs/grapple.nvim",
dependencies = {
{ "nvim-tree/nvim-web-devicons", lazy = true },
},
lazy = false,
cmd = "Grapple",
keys = {
{ "<leader><leader>a", "<cmd>Grapple toggle<cr>", desc = "Toggle bookmark for current file" },
{ "<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", "<cmd>Grapple select index=1<cr>", desc = "bookmark 1" },
{ "<leader><leader>k", "<cmd>Grapple select index=2<cr>", desc = "bookmark 2" },
{ "<leader><leader>l", "<cmd>Grapple select index=3<cr>", desc = "bookmark 3" },
{ "<leader><leader>ñ", "<cmd>Grapple select index=4<cr>", desc = "bookmark 4" },
},
}

View file

@ -0,0 +1,39 @@
return { -- Change colors.none if not using a transparent background
"catppuccin/nvim",
priority = 1000,
lazy = false,
opts = {
flavour = "macchiato",
transparent_background = true,
integrations = {
cmp = true,
notify = true,
harpoon = false,
mason = true,
neogit = true,
noice = true,
hop = true,
lsp_trouble = true,
indent_blankline = {
enabled = 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 },
}
end,
},
config = function(_, opts)
require("catppuccin").setup(opts)
vim.cmd.colorscheme("catppuccin")
end,
}

View file

@ -0,0 +1,34 @@
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",
event = "VeryLazy",
config = function()
require("comment-box").setup({
outer_blank_lines = true,
})
local cb = require("comment-box")
-- left aligned fixed size box with left aligned text
MAP({ "n", "v" }, "gcb", cb.lcbox, "Create a comment box")
-- centered adapted box with centered text
MAP({ "n", "v" }, "gll", cb.cline, "Create a comment line")
end,
},
}

View file

@ -0,0 +1,94 @@
---@diagnostic disable: missing-fields
return {
"hrsh7th/nvim-cmp",
version = false, -- last release is way too old
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"petertriho/cmp-git",
"hrsh7th/cmp-cmdline",
"saadparwaiz1/cmp_luasnip",
"L3MON4D3/LuaSnip",
"windwp/nvim-autopairs",
},
config = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
local cmp = require("cmp")
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
local defaults = require("cmp.config.default")()
local window_opts = {
border = "rounded",
side_padding = 1,
-- fix colors for catppuccin colorscheme
winhighlight = "Normal:Pmenu,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
}
local opts = {
visible_docs = false,
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-u>"] = cmp.mapping.scroll_docs(-4),
["<C-d>"] = cmp.mapping.scroll_docs(4),
["<C-o>"] = function()
if cmp.visible_docs() then
cmp.close_docs()
else
cmp.open_docs()
end
end,
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<BR>"] = cmp.mapping.abort(),
["<C-CR>"] = cmp.mapping.confirm({ select = false }), -- Confirm only if selected an item
["<CR>"] = cmp.mapping.confirm({
-- Auto confirms first item
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
}),
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(_, item)
local icons = require("aleidk.constants").icons.kinds
if icons[item.kind] then
item.kind = icons[item.kind] .. item.kind
end
return item
end,
},
window = {
completion = cmp.config.window.bordered(window_opts),
documentation = cmp.config.window.bordered(window_opts),
},
experimental = {
ghost_text = {
hl_group = "CmpGhostText",
},
},
sorting = defaults.sorting,
}
cmp.setup(opts)
end,
}

View file

@ -0,0 +1,35 @@
return {
"goolord/alpha-nvim",
lazy = false,
opts = function()
local dashboard = require("alpha.themes.dashboard")
dashboard.section.header.val = {
" ████ ███ █████ █████ ",
" ░░███ ░░░ ░░███ ░░███ ",
" ██████ ░███ ██████ ████ ███████ ░███ █████",
" ░░░░░███ ░███ ███░░███░░███ ███░░███ ░███░░███ ",
" ███████ ░███ ░███████ ░███ ░███ ░███ ░██████░ ",
" ███░░███ ░███ ░███░░░ ░███ ░███ ░███ ░███░░███ ",
"░░████████ █████░░██████ █████░░████████ ████ █████",
" ░░░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░░░░ ░░░░ ░░░░░ ",
}
dashboard.section.header.opts.hl = "DashboardHeader"
dashboard.section.buttons.val = {
dashboard.button("LDR f f", " Find File ", "<leader>ff"),
dashboard.button("LDR LDR t", " Bookmars", "<leader><leader>t"),
dashboard.button("LDR g g", " Git ", "<leader>gg"),
}
dashboard.section.footer.val =
{ " ", " ", " ", "Nvim loaded " .. require("lazy").stats().count .. " plugins " }
dashboard.section.footer.opts.hl = "DashboardFooter"
dashboard.config.layout[1].val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) })
dashboard.config.layout[3].val = 5
dashboard.config.opts.noautocmd = true
return dashboard.opts
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,10 @@
return {
-- better imputs
"stevearc/dressing.nvim",
opts = {
input = {
-- handle by noice
enabled = false,
},
},
}

View file

@ -0,0 +1,66 @@
return {
"rolv-apneseth/tfm.nvim",
lazy = false,
opts = {
-- TFM to use
-- Possible choices: "ranger" | "nnn" | "lf" | "vifm" | "yazi" (default)
file_manager = "yazi",
-- Replace netrw entirely
-- Default: false
replace_netrw = true,
-- Enable creation of commands
-- Default: false
-- Commands:
-- Tfm: selected file(s) will be opened in the current window
-- TfmSplit: selected file(s) will be opened in a horizontal split
-- TfmVsplit: selected file(s) will be opened in a vertical split
-- TfmTabedit: selected file(s) will be opened in a new tab page
enable_cmds = true,
-- Custom keybindings only applied within the TFM buffer
-- Default: {}
keybindings = {
["<ESC>"] = "q",
},
-- Customise UI. The below options are the default
ui = {
border = "rounded",
height = 1,
width = 1,
x = 0.5,
y = 0.5,
},
},
keys = {
{
"<leader>e",
function()
require("tfm").open()
end,
desc = "TFM",
},
{
"<leader>mh",
function()
local tfm = require("tfm")
tfm.open(nil, tfm.OPEN_MODE.split)
end,
desc = "TFM - horizontal split",
},
{
"<leader>mv",
function()
local tfm = require("tfm")
tfm.open(nil, tfm.OPEN_MODE.vsplit)
end,
desc = "TFM - vertical split",
},
{
"<leader>mt",
function()
local tfm = require("tfm")
tfm.open(nil, tfm.OPEN_MODE.tabedit)
end,
desc = "TFM - new tab",
},
},
}

View file

@ -0,0 +1,25 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {
label = {
rainbow = {
enabled = true,
},
},
modes = {
search = {
enabled = false, -- actibable with require("flash").toggle(),
},
},
},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
}

View file

@ -0,0 +1,56 @@
return {
"stevearc/conform.nvim",
event = "VeryLazy",
opts = {
-- 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 sub-list 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 = { { "prettierd", "prettier" } },
html = { "prettierd" },
javascript = { { "prettierd", "prettier" } },
javascriptreact = { { "prettierd", "prettier" } },
json = { { "prettierd", "prettier" } },
jsonc = { { "prettierd", "prettier" } },
lua = { "stylua" },
markdown = { "markdownlint" },
nim = { "nimpretty" },
php = { "pint" },
python = { "blue" },
scss = { { "prettierd", "prettier" } },
sh = { "shfmt" },
typescript = { { "prettierd", "prettier" } },
typescriptreact = { { "prettierd", "prettier" } },
zsh = { "shfmt" },
go = { { "gofumpt", "goimports_reviser", "golines" } },
xml = { "lemminx" }
},
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
return
end
vim.b.disable_autoformat = not vim.b.disable_autoformat
end
MAP("n", "<leader>uf", toggleAutoFormat, "Toggle auto format")
end,
}

View file

@ -0,0 +1,87 @@
return {
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
-- See `:help gitsigns.txt`
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
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", "d", gs.diffthis, "Diff This")
end,
},
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim", -- required
"nvim-telescope/telescope.nvim", -- optional
"sindrets/diffview.nvim", -- optional
},
config = true,
opts = {
disable_line_numbers = false,
console_timeout = 8000,
graph_style = "unicode",
kind = "tab",
ignored_settings = {
"NeogitPushPopup--force",
"NeogitPullPopup--rebase",
"NeogitCommitPopup--allow-empty",
"NeogitCommitPopup--reuse-message",
"NeogitRevertPopup--no-edit",
},
},
keys = {
{
"<leader>gg",
function()
require("neogit").open()
end,
desc = "Neogit",
},
{
"<leader>gc",
function()
require("neogit").open({ "commit" })
end,
desc = "Commit",
},
{
"<leader>gp",
function()
require("neogit").open({ "pull" })
end,
desc = "Pull",
},
{
"<leader>gP",
function()
require("neogit").open({ "push" })
end,
desc = "Push",
},
},
},
}

View file

@ -0,0 +1,30 @@
return {
-- Add indentation guides even on blank lines
"lukas-reineke/indent-blankline.nvim",
event = { "BufReadPost", "BufNewFile" },
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,69 @@
return {
-- Detect tabstop and shiftwidth automatically
"tpope/vim-sleuth",
{ "nvim-tree/nvim-web-devicons", lazy = true },
{
"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" },
},
},
{
-- Highlight word under cursor
"RRethy/vim-illuminate",
event = { "BufReadPost", "BufNewFile" },
opts = { delay = 200 },
config = function(_, opts)
require("illuminate").configure(opts)
end,
},
{
-- Color Picker
"uga-rosa/ccc.nvim",
event = "VeryLazy",
opts = {
auto_enable = true,
lsp = true,
},
},
-- Dotfiles management
{
"xvzc/chezmoi.nvim",
dependencies = { "nvim-lua/plenary.nvim", "alker0/chezmoi.vim" },
config = function()
require("chezmoi").setup({
{
edit = {
watch = false,
force = false,
},
notification = {
on_open = true,
on_apply = true,
on_watch = false,
},
telescope = {
select = { "<CR>" },
},
},
})
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
-- INFO: this should be the same as $(chezmoi source-path)
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/chezmoi/*" },
callback = function()
vim.schedule(require("chezmoi.commands.__edit").watch)
end,
})
local telescope = require("telescope")
telescope.load_extension("chezmoi")
vim.keymap.set("n", "<leader>fz", telescope.extensions.chezmoi.find_files, { desc = "Find dotfile" })
end,
},
}

View file

@ -0,0 +1,75 @@
return {
"echasnovski/mini.clue",
version = "*",
event = "VeryLazy",
config = function()
local miniclue = require("mini.clue")
miniclue.setup({
triggers = {
-- Leader triggers
{ mode = "n", 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>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" },
},
-- 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,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 = {
javascript = { "eslint_d" },
typescript = { "eslint_d" },
javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" },
-- astro = { "eslint_d" },
python = { "pylint" },
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,183 @@
return {
-- LSP Configuration & Plugins
"neovim/nvim-lspconfig",
event = { "BufReadPost", "BufNewFile", "BufWritePre" },
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ "williamboman/mason.nvim" },
"williamboman/mason-lspconfig.nvim",
-- Additional lua configuration, makes nvim stuff amazing!
{ "folke/neodev.nvim", opts = {} },
},
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")
-- 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: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
local servers = {
astro = {},
bashls = {},
cssls = {},
dockerls = {},
emmet_ls = {},
html = {},
marksman = {},
pyright = {},
phpactor = {},
gopls = {
settings = {
gopls = {
completeUnimported = true,
usePlaceholders = true,
analyses = {
unusedparams = true,
},
},
},
},
rust_analyzer = {
settings = {
["rust-analyzer"] = {
imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = true,
},
},
},
},
sqlls = {},
yamlls = {},
tsserver = {
init_options = {
preferences = {
disableSuggestions = true,
},
},
},
lua_ls = {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
},
},
},
},
},
}
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup({
ensure_installed = vim.tbl_keys(servers),
})
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,
}),
},
}
require("lspconfig")[server_name].setup(
vim.tbl_deep_extend("force", default_config, servers[server_name] or {})
)
end,
})
vim.diagnostic.config({
underline = true,
update_in_insert = false,
virtual_text = false,
-- virtual_text = {
-- spacing = 1,
-- source = "if_many",
-- prefix = " ●",
-- suffix = " ",
-- -- this will set set the prefix to a function that returns the diagnostics icon based on the severity
-- -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
-- -- prefix = "icons",
-- },
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,164 @@
return {
"nvim-lualine/lualine.nvim",
lazy = false,
dependencies = {
"nvim-tree/nvim-web-devicons",
"cbochs/grapple.nvim",
},
opts = function()
local icons = require("aleidk.constants").icons
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
return {
options = {
theme = "auto",
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 },
{
"overseer",
},
{
-- 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,
},
},
lualine_x = {
{
function()
return require("grapple").statusline()
end,
},
},
lualine_y = {
{ "searchcount" },
{ "location" },
{
"progress",
fmt = position_scrollbar,
separator = " ",
padding = 0,
},
},
lualine_z = {},
},
winbar = {
lualine_b = {
{
"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_y = {
{
"diff",
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
source = diff_source,
},
{
"diagnostics",
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
},
},
inactive_winbar = {
lualine_b = {
{
"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_y = {
{
"diff",
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
source = diff_source,
},
{
"diagnostics",
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
},
},
extensions = {
"neo-tree",
"lazy",
"fugitive",
"fzf",
"man",
"mason",
"nvim-tree",
"quickfix",
"symbols-outline",
"trouble",
},
}
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,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
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons
opts = {
sign = {
enabled = false,
},
},
},
}

View file

@ -0,0 +1,22 @@
return {
"williamboman/mason.nvim",
cmd = "Mason",
keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
build = ":MasonUpdate",
opts = {
ensure_installed = {
"blue",
"pylint",
"eslint_d",
"markdownlint",
"nimlsp",
"prettierd",
"shellcheck",
"stylua",
"gofumpt",
"golines",
"goimports-reviser",
"gopls"
},
},
}

View file

@ -0,0 +1,123 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
},
opts = {
presets = {
bottom_search = true,
-- command_palette = true,
long_message_to_split = true,
inc_rename = true,
},
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
routes = {
{
filter = {
event = "msg_show",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
},
},
view = "mini",
},
{
filter = {
event = "msg_show",
kind = "search_count",
},
opts = { skip = true },
},
},
views = {
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" },
},
},
notify = {
enabled = false,
},
messages = {
enabled = false,
},
},
},
-- stylua: ignore
keys = {
{
"<S-Enter>",
function() require("noice").redirect(vim.fn.getcmdline()) end,
mode = "c",
desc =
"Redirect Cmdline"
},
{
"<leader>unl",
function() require("noice").cmd("last") end,
desc =
"Noice Last Message"
},
{
"<leader>unh",
function() require("noice").cmd("history") end,
desc =
"Noice History"
},
{ "<leader>una", function() require("noice").cmd("all") end, desc = "Noice All" },
{ "<leader>und", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
{
"<c-f>",
function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end,
silent = true,
expr = true,
desc =
"Scroll forward",
mode = {
"i", "n", "s" }
},
{
"<c-b>",
function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end,
silent = true,
expr = true,
desc =
"Scroll backward",
mode = {
"i", "n", "s" }
},
},
}

View file

@ -0,0 +1,42 @@
return {
"anuvyklack/pretty-fold.nvim",
opts = {
sections = {
left = {
"+",
function()
return string.rep("-", vim.v.foldlevel)
end,
" ",
"content",
" ",
"number_of_folded_lines",
" ",
function()
return string.rep("-", vim.v.foldlevel)
end,
"+",
},
},
fill_char = " ",
-- Possible values:
-- "delete" : Delete all comment signs from the fold string.
-- "spaces" : Replace all comment signs with equal number of spaces.
-- false : Do nothing with comment signs.
process_comment_signs = "delete",
-- List of patterns that will be removed from content foldtext section.
stop_words = {
"@brief%s*", -- (for C++) Remove '@brief' and all spaces after.
},
matchup_patterns = {
{ "{", "}" },
{ "%(", ")" }, -- % to escape lua pattern char
{ "%[", "]" }, -- % to escape lua pattern char
},
ft_ignore = { "neorg" },
},
}

View file

@ -0,0 +1,89 @@
return {
{
"kevinhwang91/nvim-bqf",
event = "VeryLazy",
dependencies = {},
config = function()
local fn = vim.fn
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
vim.o.qftf = "{info -> v:lua._G.qftf(info)}"
-- Adapt fzf's delimiter in nvim-bqf
require("bqf").setup({
filter = {
fzf = {
extra_opts = { "--bind", "ctrl-o:toggle-all", "--delimiter", "" },
},
},
})
local toggle_qf = function()
local qf_open = false
for _, win in pairs(vim.fn.getwininfo()) do
if win["quickfix"] == 1 then
qf_open = true
end
end
if qf_open == true then
vim.cmd("cclose")
return
end
if not vim.tbl_isempty(vim.fn.getqflist()) then
vim.cmd("copen")
end
end
MAP("n", "<Leader>fQ", toggle_qf, "Toggle quickfix")
end,
},
}

View file

@ -0,0 +1,15 @@
return {
-- sessions
"rmagatti/auto-session",
config = function()
---@diagnostic disable-next-line: missing-fields
require("auto-session").setup({
log_level = "error",
auto_session_suppress_dirs = { "~/", "~/Downloads", "/", "~/.config/**", "~/.local/share/chezmoi/" },
bypass_session_save_file_types = {
"NeogitStatus",
"Lazy",
},
})
end,
}

View file

@ -0,0 +1,65 @@
-- Move to windows with Ctrl and hjkl
-- Resize to windows with Alt and hjkl
-- Tmux aware
return {
"mrjones2014/smart-splits.nvim",
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,90 @@
-- Fuzzy Finder (files, lsp, etc)
return {
"nvim-telescope/telescope.nvim",
version = "*",
event = "VeryLazy",
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 = "vertical",
layout_config = { vertical = { height = 0.99, mirror = true, prompt_position = "top" } },
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>"] = function(...)
return require("trouble.providers.telescope").open_with_trouble(...)
end,
["<a-t>"] = function(...)
return require("trouble.providers.telescope").open_selected_with_trouble(...)
end,
},
},
},
}
telescope.setup(opts)
-- Enable telescope fzf native, if installed
pcall(telescope.load_extension, "fzf")
-- Find files
vim.keymap.set(
"n",
"<leader>fe",
":Telescope file_browser path=%:p:h select_buffer=true<CR>",
{ desc = "File Explorer" }
)
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,13 @@
return {
"folke/todo-comments.nvim",
cmd = { "TodoTrouble", "TodoTelescope" },
event = { "BufReadPost", "BufNewFile" },
config = true,
-- stylua: ignore
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,98 @@
return {
-- Highlight, edit, and navigate code
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile", "BufWritePre", "VeryLazy" },
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
"windwp/nvim-ts-autotag",
"JoosepAlviste/nvim-ts-context-commentstring",
"nvim-treesitter/nvim-treesitter-context",
},
build = ":TSUpdate",
config = function()
---@diagnostic disable-next-line: missing-fields
require("nvim-treesitter.configs").setup({
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = {
"bash",
"c",
"cpp",
"go",
"lua",
"markdown",
"markdown_inline",
"python",
"regex",
"rust",
"sql",
"tsx",
"javascript",
"typescript",
"vim",
"vimdoc",
},
-- 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_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
},
autotag = { enable = true },
})
require('ts_context_commentstring').setup {
enable_autocmd = false,
}
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,24 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
cmd = { "TroubleToggle", "Trouble" },
keys = {
{ "<leader>fq", "<CMD>TroubleToggle<CR>", desc = "Toggle trouble" },
{ "<leader>fd", "<CMD>TroubleToggle workspace_diagnostics<CR>", desc = "Find diagnostics" },
{
"<leader>fD",
"<CMD>TroubleToggle document_diagnostics<CR>",
desc = "Find diagnostics in workspace",
},
},
config = function()
require("trouble").setup({
mode = "document_diagnostics",
action_keys = {
open_split = "s",
open_vsplit = "v",
open_tab = "t",
},
})
end,
}

View file

@ -0,0 +1,23 @@
return {
{
"ckolkey/ts-node-action",
dependencies = { "nvim-treesitter" },
event = "VeryLazy",
config = function()
require("ts-node-action").setup({})
vim.keymap.set({ "n" }, "<leader>lA", require("ts-node-action").node_action, { desc = "Node Action" })
end,
},
{
"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,81 @@
return {
"folke/zen-mode.nvim",
dependencies = {
{
"folke/twilight.nvim",
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
},
},
keys = {
{
"<leader>uz",
function()
require("zen-mode").toggle({})
end,
desc = "Toggle zen mode",
},
},
opts = {
window = {
backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
-- height and width can be:
-- * an absolute number of cells when > 1
-- * a percentage of the width / height of the editor when <= 1
-- * a function that returns the width or the height
width = 0.8, -- width of the Zen window
height = 1, -- height of the Zen window
-- by default, no options are changed for the Zen window
-- uncomment any of the options below, or add other vim.wo options you want to apply
options = {
-- signcolumn = "no", -- disable signcolumn
-- number = false, -- disable number column
-- relativenumber = false, -- disable relative numbers
cursorline = false, -- disable cursorline
-- cursorcolumn = false, -- disable cursor column
-- foldcolumn = "0", -- disable fold column
list = false, -- disable whitespace characters
},
},
plugins = {
-- disable some global vim options (vim.o...)
-- comment the lines to not apply the options
options = {
enabled = true,
ruler = true, -- disables the ruler text in the cmd line area
showcmd = false, -- disables the command in the last line of the screen
-- you may turn on/off statusline in zen mode by setting 'laststatus'
-- statusline will be shown only if 'laststatus' == 3
laststatus = 0, -- turn off the statusline in zen mode
},
twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
gitsigns = { enabled = false }, -- disables git signs
tmux = { enabled = true }, -- disables the tmux statusline
-- this will change the font size on kitty when in zen mode
-- to make this work, you need to set the following kitty options:
-- - allow_remote_control socket-only
-- - listen_on unix:/tmp/kitty
kitty = {
enabled = true,
font = "+8", -- font size increment
},
-- this will change the font size on alacritty when in zen mode
-- requires Alacritty Version 0.10.0 or higher
-- uses `alacritty msg` subcommand to change font size
alacritty = {
enabled = true,
font = "14", -- font size
},
-- this will change the font size on wezterm when in zen mode
-- See else also the Plugins/Wezterm section in this projects README
wezterm = {
enabled = true,
-- can be either an absolute font size or the number of incremental steps
font = "+4", -- (10% increase per step)
},
},
},
}

View file

@ -0,0 +1,2 @@
{}

View file

@ -0,0 +1,2 @@
{{ .chezmoi.sourceDir }}/dot_config/nvim/original_lazy-lock.json