Update Neovim and Emacs configurations

This commit is contained in:
Fabio Scotto di Santolo
2025-09-02 09:40:17 +02:00
parent 524fffffd5
commit 4090aa6d06
32 changed files with 2297 additions and 1415 deletions

View File

@@ -1,16 +1,16 @@
return {
"goolord/alpha-nvim",
opts = function(_, opts)
local logo = [[
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
[ @elijahmanor ]
]]
opts.section.header.val = vim.split(logo, "\n", { trimempty = true })
end,
}
return {
"goolord/alpha-nvim",
opts = function(_, opts)
local logo = [[
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
[ @elijahmanor ]
]]
opts.section.header.val = vim.split(logo, "\n", { trimempty = true })
end,
}

View File

@@ -1,96 +1,96 @@
return {
{
"mason-org/mason.nvim",
opts = {
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
ensure_installed = {
-- LSP servers
"clangd", -- C / C++
"gopls", -- Go
"python-lsp-server", -- Python
"bash-language-server", -- Bash
"zls", -- Zig
"lua-language-server", -- Lua
-- Formatters / Linters
"stylua", -- Lua formatter
"shfmt", -- Shell formatter
"black", -- Python formatter
"clang-format", -- C/C++ formatter
"goimports", -- Go formatter
},
},
},
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lua",
"saadparwaiz1/cmp_luasnip",
"L3MON4D3/LuaSnip",
"onsails/lspkind.nvim", -- icone carine nel completamento
},
opts = function(_, opts)
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- Carica snippet
require("luasnip.loaders.from_vscode").lazy_load()
opts.snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
}
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
})
opts.sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "nvim_lua" },
{ name = "buffer" },
{ name = "path" },
})
opts.formatting = {
format = lspkind.cmp_format({
mode = "symbol_text",
maxwidth = 50,
ellipsis_char = "...",
}),
}
return opts
end,
},
}
return {
{
"mason-org/mason.nvim",
opts = {
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
ensure_installed = {
-- LSP servers
"clangd", -- C / C++
"gopls", -- Go
"python-lsp-server", -- Python
"bash-language-server", -- Bash
"zls", -- Zig
"lua-language-server", -- Lua
-- Formatters / Linters
"stylua", -- Lua formatter
"shfmt", -- Shell formatter
"black", -- Python formatter
"clang-format", -- C/C++ formatter
"goimports", -- Go formatter
},
},
},
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lua",
"saadparwaiz1/cmp_luasnip",
"L3MON4D3/LuaSnip",
"onsails/lspkind.nvim", -- icone carine nel completamento
},
opts = function(_, opts)
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- Carica snippet
require("luasnip.loaders.from_vscode").lazy_load()
opts.snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
}
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
})
opts.sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "nvim_lua" },
{ name = "buffer" },
{ name = "path" },
})
opts.formatting = {
format = lspkind.cmp_format({
mode = "symbol_text",
maxwidth = 50,
ellipsis_char = "...",
}),
}
return opts
end,
},
}

View File

@@ -1,15 +1,15 @@
return {
"catppuccin/nvim",
name = "catppuccin",
lazy = false,
priority = 1000,
opts = {
flavour = "mocha",
transparent_background = false,
},
config = function(_, opts)
require("catppuccin").setup(opts)
-- vim.cmd.colorscheme("catppuccin")
vim.cmd.colorscheme("tokyonight-night")
end,
}
return {
"catppuccin/nvim",
name = "catppuccin",
lazy = false,
priority = 1000,
opts = {
flavour = "mocha",
transparent_background = false,
},
config = function(_, opts)
require("catppuccin").setup(opts)
-- vim.cmd.colorscheme("catppuccin-mocha")
vim.cmd.colorscheme("tokyonight-night")
end,
}

View File

@@ -1,108 +1,108 @@
return {
{
"mfussenegger/nvim-dap",
dependencies = {
"leoluz/nvim-dap-go",
"rcarriga/nvim-dap-ui",
"theHamsta/nvim-dap-virtual-text",
"nvim-neotest/nvim-nio",
"williamboman/mason.nvim",
"jay-babu/mason-nvim-dap.nvim", -- Dependency for managing DAP adapters with Mason
"mfussenegger/nvim-dap-python", -- Dependency for Python debugging
},
config = function()
local dap = require("dap")
local dapui = require("dapui")
local mason_dap = require("mason-nvim-dap")
-- Configure mason-nvim-dap to automatically install DAP adapters
mason_dap.setup({
ensure_installed = {
"delve", -- Go Debugger Adapter
"codelldb", -- C/C++ Debugger Adapter
"debugpy", -- Python Debugger Adapter
},
handlers = {},
})
-- Set up the DAP UI
dapui.setup()
-- Set up the Go debugging configurations
require("dap-go").setup()
-- Set up the Python debugging configurations
require("dap-python").setup()
-- Configure nvim-dap-virtual-text
require("nvim-dap-virtual-text").setup({
display_callback = function(variable)
local name = string.lower(variable.name)
local value = string.lower(variable.value)
if name:match("secret") or name:match("api") or value:match("secret") or value:match("api") then
return "*****"
end
if #variable.value > 15 then
return " " .. string.sub(variable.value, 1, 15) .. "... "
end
return " " .. variable.value
end,
})
-- Configure the CodeLLDB adapter for C/C++
dap.adapters.codelldb = {
type = "server",
port = "${port}",
executable = {
command = vim.fn.stdpath("data") .. "/mason/bin/codelldb",
args = { "--port", "${port}" },
},
}
-- Define launch configurations for C/C++
dap.configurations.c = {
{
name = "Launch C",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
},
}
dap.configurations.cpp = dap.configurations.c
-- Your keyboard shortcuts for debugging
vim.keymap.set("n", "<space>b", dap.toggle_breakpoint)
vim.keymap.set("n", "<space>gb", dap.run_to_cursor)
vim.keymap.set("n", "<space>?", function()
dapui.eval(nil, { enter = true })
end)
vim.keymap.set("n", "<F9>", dap.continue)
vim.keymap.set("n", "<F7>", dap.step_into)
vim.keymap.set("n", "<F8>", dap.step_over)
vim.keymap.set("n", "<F6>", dap.step_out)
vim.keymap.set("n", "<F5>", dap.step_back)
vim.keymap.set("n", "<F12>", dap.restart)
-- Listeners to open and close the DAP UI automatically
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
end,
},
}
return {
{
"mfussenegger/nvim-dap",
dependencies = {
"leoluz/nvim-dap-go",
"rcarriga/nvim-dap-ui",
"theHamsta/nvim-dap-virtual-text",
"nvim-neotest/nvim-nio",
"williamboman/mason.nvim",
"jay-babu/mason-nvim-dap.nvim", -- Dependency for managing DAP adapters with Mason
"mfussenegger/nvim-dap-python", -- Dependency for Python debugging
},
config = function()
local dap = require("dap")
local dapui = require("dapui")
local mason_dap = require("mason-nvim-dap")
-- Configure mason-nvim-dap to automatically install DAP adapters
mason_dap.setup({
ensure_installed = {
"delve", -- Go Debugger Adapter
"codelldb", -- C/C++ Debugger Adapter
"debugpy", -- Python Debugger Adapter
},
handlers = {},
})
-- Set up the DAP UI
dapui.setup()
-- Set up the Go debugging configurations
require("dap-go").setup()
-- Set up the Python debugging configurations
require("dap-python").setup()
-- Configure nvim-dap-virtual-text
require("nvim-dap-virtual-text").setup({
display_callback = function(variable)
local name = string.lower(variable.name)
local value = string.lower(variable.value)
if name:match("secret") or name:match("api") or value:match("secret") or value:match("api") then
return "*****"
end
if #variable.value > 15 then
return " " .. string.sub(variable.value, 1, 15) .. "... "
end
return " " .. variable.value
end,
})
-- Configure the CodeLLDB adapter for C/C++
dap.adapters.codelldb = {
type = "server",
port = "${port}",
executable = {
command = vim.fn.stdpath("data") .. "/mason/bin/codelldb",
args = { "--port", "${port}" },
},
}
-- Define launch configurations for C/C++
dap.configurations.c = {
{
name = "Launch C",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
},
}
dap.configurations.cpp = dap.configurations.c
-- Your keyboard shortcuts for debugging
vim.keymap.set("n", "<space>b", dap.toggle_breakpoint)
vim.keymap.set("n", "<space>gb", dap.run_to_cursor)
vim.keymap.set("n", "<space>?", function()
dapui.eval(nil, { enter = true })
end)
vim.keymap.set("n", "<F9>", dap.continue)
vim.keymap.set("n", "<F7>", dap.step_into)
vim.keymap.set("n", "<F8>", dap.step_over)
vim.keymap.set("n", "<F6>", dap.step_out)
vim.keymap.set("n", "<F5>", dap.step_back)
vim.keymap.set("n", "<F12>", dap.restart)
-- Listeners to open and close the DAP UI automatically
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
end,
},
}

View File

@@ -1,3 +1,3 @@
return {
{ "windwp/nvim-spectre", enabled = false },
}
return {
{ "windwp/nvim-spectre", enabled = false },
}

View File

@@ -1,57 +1,57 @@
return {
"nvimtools/none-ls.nvim",
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
-- C
null_ls.builtins.formatting.clang_format.with({
extra_args = {
"--style={BasedOnStyle: LLVM, IndentWidth: 8, TabWith: 8, UseTab: Always, BreakBeforeBraces: Linux, AllowShortIfStatementsOnASingleLine: false, AllowShortLoopsOnASingleLine: false, AllowShortFunctionsOnASingleLine: InlineOnly, ColumnLimit: 80, AlignConsecutiveDeclarations: false, AlignConsecutiveAssignments: false, AlignEscapedNewlines: Left, AlignOperands: false, IndentCaseLabels: false, SpaceBeforeParens: ControlStatements }",
},
}),
-- Go
null_ls.builtins.formatting.goimports,
-- Zig
-- null_ls.builtins.formatting.zigfmt,
-- Lua
null_ls.builtins.formatting.stylua.with({
extra_args = {
"--indent-type",
"Spaces",
"--indent-width",
"2",
"--column-width",
"120",
},
}),
-- Python
null_ls.builtins.formatting.black.with({
extra_args = { "--line-length", "79" },
}),
-- Shell
null_ls.builtins.formatting.shfmt.with({
extra_args = { "-i", "2", "-ci", "-bn", "-sr", "-p" },
}),
},
-- Auto-format on save
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ async = false })
end,
})
end
end,
})
end,
}
return {
"nvimtools/none-ls.nvim",
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
-- C
null_ls.builtins.formatting.clang_format.with({
extra_args = {
"--style={BasedOnStyle: LLVM, IndentWidth: 8, TabWith: 8, UseTab: Always, BreakBeforeBraces: Linux, AllowShortIfStatementsOnASingleLine: false, AllowShortLoopsOnASingleLine: false, AllowShortFunctionsOnASingleLine: InlineOnly, ColumnLimit: 80, AlignConsecutiveDeclarations: false, AlignConsecutiveAssignments: false, AlignEscapedNewlines: Left, AlignOperands: false, IndentCaseLabels: false, SpaceBeforeParens: ControlStatements }",
},
}),
-- Go
null_ls.builtins.formatting.goimports,
-- Zig
-- null_ls.builtins.formatting.zigfmt,
-- Lua
null_ls.builtins.formatting.stylua.with({
extra_args = {
"--indent-type",
"Spaces",
"--indent-width",
"2",
"--column-width",
"120",
},
}),
-- Python
null_ls.builtins.formatting.black.with({
extra_args = { "--line-length", "79" },
}),
-- Shell
null_ls.builtins.formatting.shfmt.with({
extra_args = { "-i", "2", "-ci", "-bn", "-sr", "-p" },
}),
},
-- Auto-format on save
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ async = false })
end,
})
end
end,
})
end,
}

View File

@@ -1,7 +1,7 @@
return {
"m4xshen/hardtime.nvim",
lazy = false,
dependencies = { "MunifTanjim/nui.nvim" },
enabled = false,
opts = {},
}
return {
"m4xshen/hardtime.nvim",
lazy = false,
dependencies = { "MunifTanjim/nui.nvim" },
enabled = false,
opts = {},
}

View File

@@ -1,5 +1,5 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
}
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
}

View File

@@ -1,58 +1,58 @@
return {
"neovim/nvim-lspconfig",
-- How to add an LSP for a specific programming language?
-- 1. Use `:Mason` to install the corresponding LSP.
-- 2. Add the configuration below. The syntax is `lspconfig.<name>.setup(...)`
-- Hint (find <name> here): https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
config = function()
-- Set different settings for different languages' LSP.
-- Support List: https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
local lspconfig = require("lspconfig")
-- Case 1. For CMake Users
-- $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
-- Case 2. For Bazel Users, use https://github.com/hedronvision/bazel-compile-commands-extractor
-- Case 3. If you don't use any build tool and all files in a project use the same build flags
-- Place your compiler flags in the compile_flags.txt file, located in the root directory
-- of your project. Each line in the file should contain a single compiler flag.
-- src: https://clangd.llvm.org/installation#compile_commandsjson
lspconfig.clangd.setup({})
lspconfig.gopls.setup({})
lspconfig.bashls.setup({})
lspconfig.zls.setup({})
lspconfig.pylsp.setup({
settings = {
-- configure plugins in pylsp
pylsp = {
plugins = {
pyflakes = { enabled = false },
pycodestyle = { enabled = false },
},
},
},
})
lspconfig.lua_ls.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim).
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global.
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files.
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier.
telemetry = {
enable = false,
},
},
},
})
end,
}
return {
"neovim/nvim-lspconfig",
-- How to add an LSP for a specific programming language?
-- 1. Use `:Mason` to install the corresponding LSP.
-- 2. Add the configuration below. The syntax is `lspconfig.<name>.setup(...)`
-- Hint (find <name> here): https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
config = function()
-- Set different settings for different languages' LSP.
-- Support List: https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
local lspconfig = require("lspconfig")
-- Case 1. For CMake Users
-- $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
-- Case 2. For Bazel Users, use https://github.com/hedronvision/bazel-compile-commands-extractor
-- Case 3. If you don't use any build tool and all files in a project use the same build flags
-- Place your compiler flags in the compile_flags.txt file, located in the root directory
-- of your project. Each line in the file should contain a single compiler flag.
-- src: https://clangd.llvm.org/installation#compile_commandsjson
lspconfig.clangd.setup({})
lspconfig.gopls.setup({})
lspconfig.bashls.setup({})
lspconfig.zls.setup({})
lspconfig.pylsp.setup({
settings = {
-- configure plugins in pylsp
pylsp = {
plugins = {
pyflakes = { enabled = false },
pycodestyle = { enabled = false },
},
},
},
})
lspconfig.lua_ls.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim).
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global.
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files.
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier.
telemetry = {
enable = false,
},
},
},
})
end,
}

View File

@@ -0,0 +1,4 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
}

View File

@@ -1,37 +1,9 @@
return {
-- Browser preview plugin
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && yarn install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
vim.g.mkdp_auto_start = 0
vim.g.mkdp_browser = "firefox" -- use your preferred browser
vim.g.mkdp_sync_scroll_type = "middle"
end,
ft = { "markdown" },
keys = {
{
"<leader>Mp",
"<cmd>MarkdownPreviewToggle<CR>",
desc = "Preview Markdown (Browser)",
},
},
},
-- Terminal-based preview with Glow
{
"ellisonleao/glow.nvim",
config = true, -- uses default config
cmd = "Glow",
ft = { "markdown" },
keys = {
{
"<leader>Mg",
"<cmd>Glow<CR>",
desc = "Preview Markdown (Glow)",
},
},
},
}
return {
"MeanderingProgrammer/render-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
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {},
}

View File

@@ -1,17 +1,17 @@
return {
"smoka7/multicursors.nvim",
event = "VeryLazy",
dependencies = {
"nvimtools/hydra.nvim",
},
opts = {},
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
keys = {
{
mode = { "v", "n" },
"<Leader>m",
"<cmd>MCstart<cr>",
desc = "Create a selection for selected text or word under the cursor",
},
},
}
return {
"smoka7/multicursors.nvim",
event = "VeryLazy",
dependencies = {
"nvimtools/hydra.nvim",
},
opts = {},
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
keys = {
{
mode = { "v", "n" },
"<Leader>m",
"<cmd>MCstart<cr>",
desc = "Create a selection for selected text or word under the cursor",
},
},
}

View File

@@ -1,4 +1,4 @@
return {
"nvim-neo-tree/neo-tree.nvim",
enabled = false,
}
return {
"nvim-neo-tree/neo-tree.nvim",
enabled = false,
}

View File

@@ -0,0 +1,522 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
bigfile = { enabled = true },
dashboard = { enabled = false },
explorer = { enabled = false },
indent = { enabled = true },
input = { enabled = true },
notifier = {
enabled = true,
timeout = 3000,
},
picker = { enabled = true },
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = true },
statuscolumn = { enabled = true },
words = { enabled = true },
styles = {
notification = {
-- wo = { wrap = true } -- Wrap notifications
},
},
},
keys = {
-- Top Pickers & Explorer
{
"<leader><space>",
function()
Snacks.picker.smart()
end,
desc = "Smart Find Files",
},
{
"<leader>,",
function()
Snacks.picker.buffers()
end,
desc = "Buffers",
},
{
"<leader>/",
function()
Snacks.picker.grep()
end,
desc = "Grep",
},
{
"<leader>:",
function()
Snacks.picker.command_history()
end,
desc = "Command History",
},
{
"<leader>n",
function()
Snacks.picker.notifications()
end,
desc = "Notification History",
},
{
"<leader>fb",
function()
Snacks.picker.buffers()
end,
desc = "Buffers",
},
{
"<leader>fc",
function()
Snacks.picker.files({ cwd = vim.fn.stdpath("config") })
end,
desc = "Find Config File",
},
{
"<leader>ff",
function()
Snacks.picker.files()
end,
desc = "Find Files",
},
{
"<leader>fg",
function()
Snacks.picker.git_files()
end,
desc = "Find Git Files",
},
{
"<leader>fp",
function()
Snacks.picker.projects()
end,
desc = "Projects",
},
{
"<leader>fr",
function()
Snacks.picker.recent()
end,
desc = "Recent",
},
-- git
{
"<leader>gb",
function()
Snacks.picker.git_branches()
end,
desc = "Git Branches",
},
{
"<leader>gl",
function()
Snacks.picker.git_log()
end,
desc = "Git Log",
},
{
"<leader>gL",
function()
Snacks.picker.git_log_line()
end,
desc = "Git Log Line",
},
{
"<leader>gs",
function()
Snacks.picker.git_status()
end,
desc = "Git Status",
},
{
"<leader>gS",
function()
Snacks.picker.git_stash()
end,
desc = "Git Stash",
},
{
"<leader>gd",
function()
Snacks.picker.git_diff()
end,
desc = "Git Diff (Hunks)",
},
{
"<leader>gf",
function()
Snacks.picker.git_log_file()
end,
desc = "Git Log File",
},
-- Grep
{
"<leader>sb",
function()
Snacks.picker.lines()
end,
desc = "Buffer Lines",
},
{
"<leader>sB",
function()
Snacks.picker.grep_buffers()
end,
desc = "Grep Open Buffers",
},
{
"<leader>sg",
function()
Snacks.picker.grep()
end,
desc = "Grep",
},
{
"<leader>sw",
function()
Snacks.picker.grep_word()
end,
desc = "Visual selection or word",
mode = { "n", "x" },
},
-- search
{
'<leader>s"',
function()
Snacks.picker.registers()
end,
desc = "Registers",
},
{
"<leader>s/",
function()
Snacks.picker.search_history()
end,
desc = "Search History",
},
{
"<leader>sa",
function()
Snacks.picker.autocmds()
end,
desc = "Autocmds",
},
{
"<leader>sb",
function()
Snacks.picker.lines()
end,
desc = "Buffer Lines",
},
{
"<leader>sc",
function()
Snacks.picker.command_history()
end,
desc = "Command History",
},
{
"<leader>sC",
function()
Snacks.picker.commands()
end,
desc = "Commands",
},
{
"<leader>sd",
function()
Snacks.picker.diagnostics()
end,
desc = "Diagnostics",
},
{
"<leader>sD",
function()
Snacks.picker.diagnostics_buffer()
end,
desc = "Buffer Diagnostics",
},
{
"<leader>sh",
function()
Snacks.picker.help()
end,
desc = "Help Pages",
},
{
"<leader>sH",
function()
Snacks.picker.highlights()
end,
desc = "Highlights",
},
{
"<leader>si",
function()
Snacks.picker.icons()
end,
desc = "Icons",
},
{
"<leader>sj",
function()
Snacks.picker.jumps()
end,
desc = "Jumps",
},
{
"<leader>sk",
function()
Snacks.picker.keymaps()
end,
desc = "Keymaps",
},
{
"<leader>sl",
function()
Snacks.picker.loclist()
end,
desc = "Location List",
},
{
"<leader>sm",
function()
Snacks.picker.marks()
end,
desc = "Marks",
},
{
"<leader>sM",
function()
Snacks.picker.man()
end,
desc = "Man Pages",
},
{
"<leader>sp",
function()
Snacks.picker.lazy()
end,
desc = "Search for Plugin Spec",
},
{
"<leader>sq",
function()
Snacks.picker.qflist()
end,
desc = "Quickfix List",
},
{
"<leader>sR",
function()
Snacks.picker.resume()
end,
desc = "Resume",
},
{
"<leader>su",
function()
Snacks.picker.undo()
end,
desc = "Undo History",
},
{
"<leader>uC",
function()
Snacks.picker.colorschemes()
end,
desc = "Colorschemes",
},
-- LSP
{
"gd",
function()
Snacks.picker.lsp_definitions()
end,
desc = "Goto Definition",
},
{
"gD",
function()
Snacks.picker.lsp_declarations()
end,
desc = "Goto Declaration",
},
{
"gr",
function()
Snacks.picker.lsp_references()
end,
nowait = true,
desc = "References",
},
{
"gI",
function()
Snacks.picker.lsp_implementations()
end,
desc = "Goto Implementation",
},
{
"gy",
function()
Snacks.picker.lsp_type_definitions()
end,
desc = "Goto T[y]pe Definition",
},
{
"<leader>ss",
function()
Snacks.picker.lsp_symbols()
end,
desc = "LSP Symbols",
},
{
"<leader>sS",
function()
Snacks.picker.lsp_workspace_symbols()
end,
desc = "LSP Workspace Symbols",
},
-- Other
{
"<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>gg",
function()
Snacks.lazygit()
end,
desc = "Lazygit",
},
{
"<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
end,
})
end,
}

View File

@@ -1,5 +1,5 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" },
}
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" },
}

View File

@@ -1,8 +1,8 @@
return {
"mikavilpas/yazi.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
keys = {
{ "<leader>e", "<cmd>Yazi<cr>", desc = "Open Yazi" },
},
}
return {
"mikavilpas/yazi.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
keys = {
{ "<leader>e", "<cmd>Yazi<cr>", desc = "Open Yazi" },
},
}