mirror of
https://github.com/LazyVim/starter.git
synced 2026-07-22 04:21:03 +00:00
Configuracion nvim
This commit is contained in:
parent
803bc181d7
commit
a0e2916d40
25 changed files with 819 additions and 201 deletions
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
.neoconf.json
Normal file → Executable file
0
.neoconf.json
Normal file → Executable file
0
LICENSE
Normal file → Executable file
0
LICENSE
Normal file → Executable file
0
README.md
Normal file → Executable file
0
README.md
Normal file → Executable file
0
init.lua
Normal file → Executable file
0
init.lua
Normal file → Executable file
59
lazy-lock.json
Executable file
59
lazy-lock.json
Executable file
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"LazyVim": { "branch": "main", "commit": "28db03f958d58dfff3c647ce28fdc1cb88ac158d" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "eed1834170f343c14a6768f085b26b3571a55302" },
|
||||
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "17083c826a004bcb87d3a830c7710d0796a73bbf" },
|
||||
"catppuccin": { "branch": "main", "commit": "da33755d00e09bff2473978910168ff9ea5dc453" },
|
||||
"conform.nvim": { "branch": "master", "commit": "1bf8b5b9caee51507aa51eaed3da5b0f2595c6b9" },
|
||||
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"fzf-lua": { "branch": "main", "commit": "6db367781c650d0aa336577aa16bbb6aeca9ddfa" },
|
||||
"git.nvim": { "branch": "main", "commit": "70ceb406568132aec754b25b46ebda1a05dd46f0" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "cdafc320f03f2572c40ab93a4eecb733d4016d07" },
|
||||
"goto-preview": { "branch": "main", "commit": "cf561d10b4b104db20375c48b86cf36af9f96e00" },
|
||||
"grug-far.nvim": { "branch": "main", "commit": "b58b2d65863f4ebad88b10a1ddd519e5380466e0" },
|
||||
"incline.nvim": { "branch": "main", "commit": "6a3b0635bcd2490dbb1fa124217d41bf69ca0fa2" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" },
|
||||
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||
"material.nvim": { "branch": "main", "commit": "8a34cb0d05e12a05b64edaf6ca1c3c7bde545628" },
|
||||
"mini.ai": { "branch": "main", "commit": "0d3c9cf22e37b86b7a0dfbe7ef129ee7a5f4f93c" },
|
||||
"mini.hipatterns": { "branch": "main", "commit": "add8d8abad602787377ec5d81f6b248605828e0f" },
|
||||
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
|
||||
"mini.nvim": { "branch": "main", "commit": "b409fd1d8b9ea7ec7c0923eb2562b52ed5d1ab0a" },
|
||||
"mini.pairs": { "branch": "main", "commit": "b316e68f2d242d5bd010deaab645daa27ed86297" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "0bf326c601063a6518aa9a039b71351debb83d2f" },
|
||||
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-dap": { "branch": "master", "commit": "5860c7c501eb428d3137ee22c522828d20cca0b3" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||
"nvim-lint": { "branch": "master", "commit": "baf7c91c2b868b12446df511d4cdddc98e9bf66e" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "d4f77e7a9a4b910622a0bc225e482c4c808e4099" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-rip-substitute": { "branch": "main", "commit": "cb41b3f155399597327c39b5d700f7c41f4c6121" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "c682a239a9404ce5f90a2d0da34790eff1ed2932" },
|
||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "227165aaeb07b567fb9c066f224816aa8f3ce63f" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "6e0e8902dac70fecbdd8ce557d142062a621ec38" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "836e07336ba523d4da480cd66f0241815393e98e" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||
"telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "83a3a713d6b2d2a408491a1b959e55a7fa8678e8" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" },
|
||||
"transparent.nvim": { "branch": "main", "commit": "8ac59883de84e9cd1850ea25cf087031c5ba7d54" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" },
|
||||
"twilight.nvim": { "branch": "main", "commit": "664e752f4a219801265cc3fc18782b457b58c1e1" },
|
||||
"vim-multiple-cursors": { "branch": "master", "commit": "6456718e1d30b42c04b920c5413ca44f68f08759" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
10
lazyvim.json
Executable file
10
lazyvim.json
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"extras": [
|
||||
|
||||
],
|
||||
"install_version": 7,
|
||||
"news": {
|
||||
"NEWS.md": "11866"
|
||||
},
|
||||
"version": 8
|
||||
}
|
||||
0
lua/config/autocmds.lua
Normal file → Executable file
0
lua/config/autocmds.lua
Normal file → Executable file
122
lua/config/eliasdev/utils.lua
Executable file
122
lua/config/eliasdev/utils.lua
Executable file
|
|
@ -0,0 +1,122 @@
|
|||
local M = {}
|
||||
|
||||
local hexChars = "0123456789abcdef"
|
||||
|
||||
function M.hex_to_rgb(hex)
|
||||
hex = string.lower(hex)
|
||||
local ret = {}
|
||||
for i = 0, 2 do
|
||||
local char1 = string.sub(hex, i * 2 + 2, i * 2 + 2)
|
||||
local char2 = string.sub(hex, i * 2 + 3, i * 2 + 3)
|
||||
local digit1 = string.find(hexChars, char1) - 1
|
||||
local digit2 = string.find(hexChars, char2) - 1
|
||||
ret[i + 1] = (digit1 * 16 + digit2) / 255.0
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
function M.rgbToHsl(r, g, b)
|
||||
local max, min = math.max(r, g, b), math.min(r, g, b)
|
||||
local h = 0
|
||||
local s = 0
|
||||
local l = 0
|
||||
|
||||
l = (max + min) / 2
|
||||
|
||||
if max == min then
|
||||
h, s = 0, 0 -- achromatic
|
||||
else
|
||||
local d = max - min
|
||||
if l > 0.5 then
|
||||
s = d / (2 - max - min)
|
||||
else
|
||||
s = d / (max + min)
|
||||
end
|
||||
if max == r then
|
||||
h = (g - b) / d
|
||||
if g < b then
|
||||
h = h + 6
|
||||
end
|
||||
elseif max == g then
|
||||
h = (b - r) / d + 2
|
||||
elseif max == b then
|
||||
h = (r - g) / d + 4
|
||||
end
|
||||
h = h / 6
|
||||
end
|
||||
|
||||
return h * 360, s * 100, l * 100
|
||||
end
|
||||
|
||||
function M.hslToRgb(h, s, l)
|
||||
local r, g, b
|
||||
|
||||
if s == 0 then
|
||||
r, g, b = l, l, l -- achromatic
|
||||
else
|
||||
function hue2rgb(p, q, t)
|
||||
if t < 0 then
|
||||
t = t + 1
|
||||
end
|
||||
if t > 1 then
|
||||
t = t - 1
|
||||
end
|
||||
if t < 1 / 6 then
|
||||
return p + (q - p) * 6 * t
|
||||
end
|
||||
if t < 1 / 2 then
|
||||
return q
|
||||
end
|
||||
if t < 2 / 3 then
|
||||
return p + (q - p) * (2 / 3 - t) * 6
|
||||
end
|
||||
return p
|
||||
end
|
||||
|
||||
local q
|
||||
if l < 0.5 then
|
||||
q = l * (1 + s)
|
||||
else
|
||||
q = l + s - l * s
|
||||
end
|
||||
local p = 2 * l - q
|
||||
|
||||
r = hue2rgb(p, q, h + 1 / 3)
|
||||
g = hue2rgb(p, q, h)
|
||||
b = hue2rgb(p, q, h - 1 / 3)
|
||||
end
|
||||
|
||||
return r * 255, g * 255, b * 255
|
||||
end
|
||||
|
||||
function M.hexToHSL(hex)
|
||||
local rgb = M.hex_to_rgb(hex)
|
||||
local h, s, l = M.rgbToHsl(rgb[1], rgb[2], rgb[3])
|
||||
|
||||
return string.format("hsl(%d, %d, %d)", math.floor(h + 0.5), math.floor(s + 0.5), math.floor(l + 0.5))
|
||||
end
|
||||
|
||||
function M.hslToHex(h, s, l)
|
||||
local r, g, b = M.hslToRgb(h / 360, s / 100, l / 100)
|
||||
|
||||
return string.format("#%02x%02x%02x", r, g, b)
|
||||
end
|
||||
|
||||
function M.replaceHexWithHSL()
|
||||
-- Get the current line number
|
||||
local line_number = vim.api.nvim_win_get_cursor(0)[1]
|
||||
|
||||
-- Get the line content
|
||||
local line_content = vim.api.nvim_buf_get_lines(0, line_number - 1, line_number, false)[1]
|
||||
|
||||
-- Find hex code patterns and replace them
|
||||
for hex in line_content:gmatch("#[0-9a-fA-F]+") do
|
||||
local hsl = M.hexToHSL(hex)
|
||||
line_content = line_content:gsub(hex, hsl)
|
||||
end
|
||||
|
||||
-- Set the line content back
|
||||
vim.api.nvim_buf_set_lines(0, line_number - 1, line_number, false, { line_content })
|
||||
end
|
||||
|
||||
return M
|
||||
40
lua/config/keymaps.lua
Normal file → Executable file
40
lua/config/keymaps.lua
Normal file → Executable file
|
|
@ -1,3 +1,37 @@
|
|||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
-- REQUIRED
|
||||
----- OIL -----
|
||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||
|
||||
-- Delete all buffers but the current one --
|
||||
-- vim.keymap.set(
|
||||
-- "n",
|
||||
-- "<leader>bq",
|
||||
-- '<Esc>:%bdelete|edit #|normal`"<Return>',
|
||||
-- { desc = "Delete other buffers but the current one" }
|
||||
-- )
|
||||
vim.keymap.set("n", "<leader>bq", function()
|
||||
local current = vim.api.nvim_get_current_buf()
|
||||
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
if buf ~= current and vim.api.nvim_buf_is_valid(buf) then
|
||||
vim.api.nvim_buf_delete(buf, { force = true })
|
||||
end
|
||||
end
|
||||
end, { desc = "Delete other buffers but the current one" })
|
||||
|
||||
-- Disable key mappings in insert mode
|
||||
vim.api.nvim_set_keymap("i", "<A-j>", "<Nop>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<A-k>", "<Nop>", { noremap = true, silent = true })
|
||||
|
||||
-- Disable key mappings in normal mode
|
||||
vim.api.nvim_set_keymap("n", "<A-j>", "<Nop>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<A-k>", "<Nop>", { noremap = true, silent = true })
|
||||
|
||||
-- Disable key mappings in visual block mode
|
||||
vim.api.nvim_set_keymap("x", "<A-j>", "<Nop>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("x", "<A-k>", "<Nop>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("x", "J", "<Nop>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("x", "K", "<Nop>", { noremap = true, silent = true })
|
||||
|
||||
-- Reducir el delay de las teclas en modo normal/visual
|
||||
vim.opt.timeoutlen = 300 -- Tiempo de espera para combinaciones de teclas (ej: mappings)
|
||||
vim.opt.ttimeoutlen = 10 -- Tiempo de espera para códigos de teclas (crítico para el key repeat)
|
||||
|
|
|
|||
7
lua/config/lazy.lua
Normal file → Executable file
7
lua/config/lazy.lua
Normal file → Executable file
|
|
@ -18,6 +18,11 @@ require("lazy").setup({
|
|||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.lang.markdown" },
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
|
|
@ -30,7 +35,7 @@ require("lazy").setup({
|
|||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
install = { colorscheme = { "catppuccin", "habamax" } },
|
||||
checker = {
|
||||
enabled = true, -- check for plugin updates periodically
|
||||
notify = false, -- notify on update
|
||||
|
|
|
|||
0
lua/config/options.lua
Normal file → Executable file
0
lua/config/options.lua
Normal file → Executable file
71
lua/plugins/colorscheme.lua
Executable file
71
lua/plugins/colorscheme.lua
Executable file
|
|
@ -0,0 +1,71 @@
|
|||
return {
|
||||
-- Material Design 3 theme
|
||||
{
|
||||
"marko-cerovac/material.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- Puedes ajustar el estilo aquí (material, darker, lighter, oceanic, palenight, deep ocean)
|
||||
vim.g.material_style = "darker" -- estilo Material Design 3 más claro
|
||||
|
||||
require("material").setup({
|
||||
lualine_style = "default",
|
||||
contrast = {
|
||||
terminal = false,
|
||||
sidebars = false,
|
||||
floating_windows = false,
|
||||
cursor_line = true,
|
||||
non_current_windows = false,
|
||||
filetypes = {},
|
||||
},
|
||||
styles = {
|
||||
comments = { italic = true },
|
||||
strings = {},
|
||||
keywords = { bold = true },
|
||||
functions = { bold = true },
|
||||
variables = {},
|
||||
operators = {},
|
||||
types = {},
|
||||
},
|
||||
plugins = {
|
||||
"gitsigns",
|
||||
"nvim-cmp",
|
||||
"nvim-tree",
|
||||
"telescope",
|
||||
"nvim-web-devicons",
|
||||
"which-key",
|
||||
"nvim-notify",
|
||||
"indent-blankline",
|
||||
"nvim-lspconfig",
|
||||
},
|
||||
disable = {
|
||||
borders = false,
|
||||
background = false, -- ← transparente si usas Kitty
|
||||
term_colors = false,
|
||||
eob_lines = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- ¡Aplicar el theme!
|
||||
vim.cmd.colorscheme("material")
|
||||
end,
|
||||
},
|
||||
|
||||
-- 🔥 Si querés transparencia real en Kitty/HYPRLAND
|
||||
{
|
||||
"xiyaowong/transparent.nvim",
|
||||
config = function()
|
||||
require("transparent").setup({
|
||||
extra_groups = { "NormalFloat", "NvimTreeNormal" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- LazyVim declarando el theme final
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "material",
|
||||
},
|
||||
},
|
||||
}
|
||||
6
lua/plugins/disabled.lua
Executable file
6
lua/plugins/disabled.lua
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
154
lua/plugins/editor.lua
Executable file
154
lua/plugins/editor.lua
Executable file
|
|
@ -0,0 +1,154 @@
|
|||
return {
|
||||
{
|
||||
"rmagatti/goto-preview",
|
||||
event = "BufEnter",
|
||||
config = true, -- necessary as per https://github.com/rmagatti/goto-preview/issues/88
|
||||
keys = {
|
||||
{
|
||||
"gpd",
|
||||
"<cmd>lua require('goto-preview').goto_preview_definition()<CR>",
|
||||
noremap = true,
|
||||
desc = "goto preview definition",
|
||||
},
|
||||
{
|
||||
"gpD",
|
||||
"<cmd>lua require('goto-preview').goto_preview_declaration()<CR>",
|
||||
noremap = true,
|
||||
desc = "goto preview declaration",
|
||||
},
|
||||
{
|
||||
"gpi",
|
||||
"<cmd>lua require('goto-preview').goto_preview_implementation()<CR>",
|
||||
noremap = true,
|
||||
desc = "goto preview implementation",
|
||||
},
|
||||
{
|
||||
"gpy",
|
||||
"<cmd>lua require('goto-preview').goto_preview_type_definition()<CR>",
|
||||
noremap = true,
|
||||
desc = "goto preview type definition",
|
||||
},
|
||||
{
|
||||
"gpr",
|
||||
"<cmd>lua require('goto-preview').goto_preview_references()<CR>",
|
||||
noremap = true,
|
||||
desc = "goto preview references",
|
||||
},
|
||||
{
|
||||
"gP",
|
||||
"<cmd>lua require('goto-preview').close_all_win()<CR>",
|
||||
noremap = true,
|
||||
desc = "close all preview windows",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-mini/mini.hipatterns",
|
||||
event = "BufReadPre",
|
||||
opts = {
|
||||
highlighters = {
|
||||
hsl_color = {
|
||||
pattern = "hsl%(%d+,? %d+,? %d+%)",
|
||||
group = function(_, match)
|
||||
local utils = require("config.eliasdev.utils")
|
||||
local h, s, l = match:match("hsl%((%d+),? (%d+),? (%d+)%)")
|
||||
h, s, l = tonumber(h), tonumber(s), tonumber(l)
|
||||
local hex_color = utils.hslToHex(h, s, l)
|
||||
return MiniHipatterns.compute_hex_color_group(hex_color, "bg")
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"dinhhuy258/git.nvim",
|
||||
event = "BufReadPre",
|
||||
opts = {
|
||||
keymaps = {
|
||||
-- Open blame window
|
||||
blame = "<Leader>gb",
|
||||
-- Open file/folder in git repository
|
||||
browse = "<Leader>go",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
opts = function(_, opts)
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
opts.defaults = {
|
||||
file_ignore_patterns = {
|
||||
"node_modules",
|
||||
"package-lock.json",
|
||||
"yarn.lock",
|
||||
"bun.lockb",
|
||||
},
|
||||
prompt_prefix = "> ", -- Set the prompt to just ">"
|
||||
layout_strategy = "horizontal", -- Use horizontal layout
|
||||
sorting_strategy = "ascending",
|
||||
|
||||
winblend = 0, -- No transparency
|
||||
results_title = false, -- Remove the "Results" title
|
||||
|
||||
borderchars = {
|
||||
prompt = { "─", " ", " ", " ", " ", " ", " ", " " }, -- Top border for the prompt only
|
||||
results = { " ", " ", " ", " ", " ", " ", " ", " " }, -- No borders for results
|
||||
preview = { "─", "│", " ", "│", "╭", "╮", "", "" }, -- Borders for the preview (top and sides)
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-Down>"] = actions.cycle_history_next,
|
||||
|
||||
["<C-Up>"] = actions.cycle_history_prev,
|
||||
["<C-f>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<C-b>"] = actions.preview_scrolling_up,
|
||||
},
|
||||
n = {
|
||||
["q"] = actions.close,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Load the fzf extension for fast searches
|
||||
require("telescope").load_extension("fzf")
|
||||
|
||||
-- Add hidden files and no-ignore options to file search and live_grep
|
||||
opts.pickers = {
|
||||
find_files = {
|
||||
find_command = { "rg", "--files", "--hidden", "--no-ignore", "--iglob", "!.git/" },
|
||||
},
|
||||
live_grep = {
|
||||
additional_args = function()
|
||||
return { "--hidden", "--no-ignore" }
|
||||
end,
|
||||
},
|
||||
}
|
||||
return opts
|
||||
end,
|
||||
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-telescope/telescope-live-grep-args.nvim",
|
||||
version = "^1.0.0",
|
||||
config = function()
|
||||
require("telescope").load_extension("live_grep_args")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
config = function()
|
||||
require("telescope").load_extension("fzf")
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("telescope").setup(opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>fg", ":lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
-- since this is just an example spec, don't actually load anything here and return an empty spec
|
||||
-- stylua: ignore
|
||||
if true then return {} end
|
||||
|
||||
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
|
||||
--
|
||||
-- In your plugin files, you can:
|
||||
-- * add extra plugins
|
||||
-- * disable/enabled LazyVim plugins
|
||||
-- * override the configuration of LazyVim plugins
|
||||
return {
|
||||
-- add gruvbox
|
||||
{ "ellisonleao/gruvbox.nvim" },
|
||||
|
||||
-- Configure LazyVim to load gruvbox
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "gruvbox",
|
||||
},
|
||||
},
|
||||
|
||||
-- change trouble config
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
-- opts will be merged with the parent spec
|
||||
opts = { use_diagnostic_signs = true },
|
||||
},
|
||||
|
||||
-- disable trouble
|
||||
{ "folke/trouble.nvim", enabled = false },
|
||||
|
||||
-- override nvim-cmp and add cmp-emoji
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = { "hrsh7th/cmp-emoji" },
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "emoji" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- change some telescope options and a keymap to browse plugin files
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
keys = {
|
||||
-- add a keymap to browse plugin files
|
||||
-- stylua: ignore
|
||||
{
|
||||
"<leader>fp",
|
||||
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
|
||||
desc = "Find Plugin File",
|
||||
},
|
||||
},
|
||||
-- change some options
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = { prompt_position = "top" },
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add pyright to lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- pyright will be automatically installed with mason and loaded with lspconfig
|
||||
pyright = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add tsserver and setup with typescript.nvim instead of lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"jose-elias-alvarez/typescript.nvim",
|
||||
init = function()
|
||||
require("lazyvim.util").lsp.on_attach(function(_, buffer)
|
||||
-- stylua: ignore
|
||||
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
|
||||
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- tsserver will be automatically installed with mason and loaded with lspconfig
|
||||
tsserver = {},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
tsserver = function(_, opts)
|
||||
require("typescript").setup({ server = opts })
|
||||
return true
|
||||
end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
|
||||
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
-- add more treesitter parsers
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
||||
-- would overwrite `ensure_installed` with the new value.
|
||||
-- If you'd rather extend the default config, use the code below instead:
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
-- add tsx and treesitter
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"tsx",
|
||||
"typescript",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- the opts function can also be used to change the default opts:
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, {
|
||||
function()
|
||||
return "😄"
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- or you can return new options to override all the defaults
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return {
|
||||
--[[add your custom lualine config here]]
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- use mini.starter instead of alpha
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
|
||||
|
||||
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
|
||||
-- add any tools you want to have installed below
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"flake8",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
21
lua/plugins/markdown.lua
Executable file
21
lua/plugins/markdown.lua
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-mini/mini.nvim" }, -- if you use the mini.nvim suite
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {
|
||||
heading = {
|
||||
enabled = true,
|
||||
sign = true,
|
||||
style = "full",
|
||||
icons = { "① ", "② ", "③ ", "④ ", "⑤ ", "⑥ " },
|
||||
left_pad = 1,
|
||||
},
|
||||
bullet = {
|
||||
enabled = true,
|
||||
icons = { "●", "○", "◆", "◇" },
|
||||
right_pad = 1,
|
||||
highlight = "render-markdownBullet",
|
||||
},
|
||||
},
|
||||
}
|
||||
1
lua/plugins/mini-icons.lua
Executable file
1
lua/plugins/mini-icons.lua
Executable file
|
|
@ -0,0 +1 @@
|
|||
return { "nvim-mini/mini.icons", version = "*" }
|
||||
3
lua/plugins/multi-line.lua
Executable file
3
lua/plugins/multi-line.lua
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"terryma/vim-multiple-cursors",
|
||||
}
|
||||
26
lua/plugins/oil.lua
Executable file
26
lua/plugins/oil.lua
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
"stevearc/oil.nvim",
|
||||
opts = {
|
||||
keymaps = {
|
||||
["g?"] = "actions.show_help",
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-M-s>"] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" },
|
||||
["<C-d>"] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" },
|
||||
["<C-t>"] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" },
|
||||
["<C-p>"] = "actions.preview",
|
||||
["<C-c>"] = "actions.close",
|
||||
["<C-l>"] = "actions.refresh",
|
||||
["-"] = "actions.parent",
|
||||
["_"] = "actions.open_cwd",
|
||||
["`"] = "actions.cd",
|
||||
["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" },
|
||||
["gs"] = "actions.change_sort",
|
||||
["gx"] = "actions.open_external",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
["g\\"] = "actions.toggle_trash",
|
||||
},
|
||||
use_default_keymaps = false,
|
||||
},
|
||||
-- Optional dependencies
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
}
|
||||
14
lua/plugins/rip.lua
Executable file
14
lua/plugins/rip.lua
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"chrisgrieser/nvim-rip-substitute",
|
||||
cmd = "RipSubstitute",
|
||||
keys = {
|
||||
{
|
||||
"<leader>fs",
|
||||
function()
|
||||
require("rip-substitute").sub()
|
||||
end,
|
||||
mode = { "n", "x" },
|
||||
desc = " rip substitute",
|
||||
},
|
||||
},
|
||||
}
|
||||
237
lua/plugins/snacks.lua
Executable file
237
lua/plugins/snacks.lua
Executable file
|
|
@ -0,0 +1,237 @@
|
|||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
bigfile = { enabled = true },
|
||||
dashboard = {
|
||||
enabled = true,
|
||||
sections = {
|
||||
{ section = "header" },
|
||||
{ icon = " ", title = "Keymaps", section = "keys", indent = 2, padding = 1 },
|
||||
{ icon = " ", title = "Recent Files", section = "recent_files", indent = 2, padding = 1 },
|
||||
{ icon = " ", title = "Projects", section = "projects", indent = 2, padding = 1 },
|
||||
{
|
||||
section = "terminal",
|
||||
cmd = "ascii-image-converter ~/.config/nvimimg.jpg -C -c",
|
||||
random = 10,
|
||||
pane = 2,
|
||||
indent = 4,
|
||||
height = 30,
|
||||
},
|
||||
},
|
||||
preset = {
|
||||
header = [[
|
||||
▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄
|
||||
█ █ █ █ █ █ █ █ ██ █ █ █ █
|
||||
█ ▄▄▄█ █ █ █ ▄ █ ▄▄▄▄▄█ █ ▄ █ ▄▄▄█ █▄█ █
|
||||
█ █▄▄▄█ █ █ █ █▄█ █ █▄▄▄▄▄ █ █ █ █ █▄▄▄█ █
|
||||
█ ▄▄▄█ █▄▄▄█ █ █▄▄▄▄▄ █▄▄▄ █ █▄█ █ ▄▄▄█ █
|
||||
█ █▄▄▄█ █ █ ▄ █▄▄▄▄▄█ █ ██ █ █▄▄▄ █ █
|
||||
█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄██▄▄▄▄▄▄██▄▄▄▄▄▄▄█ █▄▄▄█
|
||||
]],
|
||||
-- stylua: ignore
|
||||
---@type snacks.dashboard.Item[]
|
||||
keys = {
|
||||
{ icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
|
||||
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
|
||||
{ icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
|
||||
{ icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" },
|
||||
{ icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
|
||||
{ icon = " ", key = "s", desc = "Restore Session", section = "session" },
|
||||
{ icon = " ", key = "x", desc = "Lazy Extras", action = ":LazyExtras" },
|
||||
{ icon = " ", key = "l", desc = "Lazy", action = ":Lazy" },
|
||||
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
||||
},
|
||||
},
|
||||
},
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
notifier = {
|
||||
enabled = true,
|
||||
timeout = 3000,
|
||||
},
|
||||
quickfile = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
styles = {
|
||||
notification = {
|
||||
wo = { wrap = true }, -- Wrap notifications
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>z",
|
||||
function()
|
||||
Snacks.zen()
|
||||
end,
|
||||
desc = "Toggle Zen Mode",
|
||||
},
|
||||
{
|
||||
"<leader>Z",
|
||||
function()
|
||||
Snacks.zen.zoom()
|
||||
end,
|
||||
desc = "Toggle Zoom",
|
||||
},
|
||||
{
|
||||
"<leader>.",
|
||||
function()
|
||||
Snacks.scratch()
|
||||
end,
|
||||
desc = "Toggle Scratch Buffer",
|
||||
},
|
||||
{
|
||||
"<leader>S",
|
||||
function()
|
||||
Snacks.scratch.select()
|
||||
end,
|
||||
desc = "Select Scratch Buffer",
|
||||
},
|
||||
{
|
||||
"<leader>n",
|
||||
function()
|
||||
Snacks.notifier.show_history()
|
||||
end,
|
||||
desc = "Notification History",
|
||||
},
|
||||
{
|
||||
"<leader>bd",
|
||||
function()
|
||||
Snacks.bufdelete()
|
||||
end,
|
||||
desc = "Delete Buffer",
|
||||
},
|
||||
{
|
||||
"<leader>cR",
|
||||
function()
|
||||
Snacks.rename.rename_file()
|
||||
end,
|
||||
desc = "Rename File",
|
||||
},
|
||||
{
|
||||
"<leader>gB",
|
||||
function()
|
||||
Snacks.gitbrowse()
|
||||
end,
|
||||
desc = "Git Browse",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
{
|
||||
"<leader>gb",
|
||||
function()
|
||||
Snacks.git.blame_line()
|
||||
end,
|
||||
desc = "Git Blame Line",
|
||||
},
|
||||
{
|
||||
"<leader>gf",
|
||||
function()
|
||||
Snacks.lazygit.log_file()
|
||||
end,
|
||||
desc = "Lazygit Current File History",
|
||||
},
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
Snacks.lazygit()
|
||||
end,
|
||||
desc = "Lazygit",
|
||||
},
|
||||
{
|
||||
"<leader>gl",
|
||||
function()
|
||||
Snacks.lazygit.log()
|
||||
end,
|
||||
desc = "Lazygit Log (cwd)",
|
||||
},
|
||||
{
|
||||
"<leader>un",
|
||||
function()
|
||||
Snacks.notifier.hide()
|
||||
end,
|
||||
desc = "Dismiss All Notifications",
|
||||
},
|
||||
{
|
||||
"<c-/>",
|
||||
function()
|
||||
Snacks.terminal()
|
||||
end,
|
||||
desc = "Toggle Terminal",
|
||||
},
|
||||
{
|
||||
"<c-_>",
|
||||
function()
|
||||
Snacks.terminal()
|
||||
end,
|
||||
desc = "which_key_ignore",
|
||||
},
|
||||
{
|
||||
"]]",
|
||||
function()
|
||||
Snacks.words.jump(vim.v.count1)
|
||||
end,
|
||||
desc = "Next Reference",
|
||||
mode = { "n", "t" },
|
||||
},
|
||||
{
|
||||
"[[",
|
||||
function()
|
||||
Snacks.words.jump(-vim.v.count1)
|
||||
end,
|
||||
desc = "Prev Reference",
|
||||
mode = { "n", "t" },
|
||||
},
|
||||
{
|
||||
"<leader>N",
|
||||
desc = "Neovim News",
|
||||
function()
|
||||
Snacks.win({
|
||||
file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1],
|
||||
width = 0.6,
|
||||
height = 0.6,
|
||||
wo = {
|
||||
spell = false,
|
||||
wrap = false,
|
||||
signcolumn = "yes",
|
||||
statuscolumn = " ",
|
||||
conceallevel = 3,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
-- Setup some globals for debugging (lazy-loaded)
|
||||
_G.dd = function(...)
|
||||
Snacks.debug.inspect(...)
|
||||
end
|
||||
_G.bt = function()
|
||||
Snacks.debug.backtrace()
|
||||
end
|
||||
vim.print = _G.dd -- Override print to use snacks for `:=` command
|
||||
|
||||
-- Create some toggle mappings
|
||||
Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us")
|
||||
Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw")
|
||||
Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("<leader>uL")
|
||||
Snacks.toggle.diagnostics():map("<leader>ud")
|
||||
Snacks.toggle.line_number():map("<leader>ul")
|
||||
Snacks.toggle
|
||||
.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 })
|
||||
:map("<leader>uc")
|
||||
Snacks.toggle.treesitter():map("<leader>uT")
|
||||
Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map("<leader>ub")
|
||||
Snacks.toggle.inlay_hints():map("<leader>uh")
|
||||
Snacks.toggle.indent():map("<leader>ug")
|
||||
Snacks.toggle.dim():map("<leader>uD")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
3
lua/plugins/twilight.lua
Executable file
3
lua/plugins/twilight.lua
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"folke/twilight.nvim",
|
||||
}
|
||||
49
lua/plugins/ui.lua
Executable file
49
lua/plugins/ui.lua
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
return {
|
||||
-- messages, cmdline and the popupmenu
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
config = function()
|
||||
require("noice").setup({
|
||||
cmdline = {
|
||||
view = "cmdline",
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
lsp_doc_border = true,
|
||||
},
|
||||
-- views = {
|
||||
-- cmdline_popup = {
|
||||
-- filter_options = {},
|
||||
-- win_options = {
|
||||
-- winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- filename
|
||||
{
|
||||
"b0o/incline.nvim",
|
||||
event = "BufReadPre",
|
||||
priority = 1200,
|
||||
config = function()
|
||||
require("incline").setup({
|
||||
window = { margin = { vertical = 0, horizontal = 1 } },
|
||||
hide = {
|
||||
cursorline = true,
|
||||
},
|
||||
render = function(props)
|
||||
local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t")
|
||||
if vim.bo[props.buf].modified then
|
||||
filename = "[+] " .. filename
|
||||
end
|
||||
|
||||
local icon, color = require("nvim-web-devicons").get_icon_color(filename)
|
||||
return { { icon, guifg = color }, { " " }, { filename } }
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
0
stylua.toml
Normal file → Executable file
0
stylua.toml
Normal file → Executable file
Loading…
Add table
Reference in a new issue