feat: new setup using fewer plugins, more reliant on snacks, better completions (#1)

Massively reworked the plugin setup, switched to a simpler completions setup using blink.cmp

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2026-07-06 09:51:06 +02:00
parent d460e9de6f
commit be88287383
32 changed files with 661 additions and 984 deletions
+8
View File
@@ -3,13 +3,21 @@ This repository contains my NeoVim configs, including some of my snippets.
It uses Lazy.nvim as the plugin manager, lspconfig for the language server configuration, none-ls for formatting, telescope, tree-sitter and many other plugins. Partially documented and fairly well organized
## Update
A new version of these configs is in the works, removing many plugins that are now all consolidated in Snacks
Lazy.nvim might be replaced with NeoVim's native 0.12+ package manager
## Linter configs
You may find the linter configs and setup-scripts for some linters that require some extra setup [here](https://git.janishutz.com/janishutz/dotfiles/)
# Lua notes
To get your luarocks packages to be picked up by the language server, it is currently configured to only look at the `cwd` that nvim is open in.
I may expand that in the future to do a proper search for all open buffers, but that would require a language server restart to apply on every buffer add
# Issues with jdtls
Ensure you have jdk21-opnejdk or newer installed. On Arch (and derivatives) you can switch the preferred java version using `archlinux-java set <version name>`
+10 -10
View File
@@ -18,22 +18,22 @@ cp ./lazy-conf-pager.lua ~/.config/nvimpager/lua/lazy-conf.lua
cd ~/.config/nvimpager/
rm -rf ./lua/plugins/lsp
rm -rf ./lua/plugins/testing
rm -rf ./lua/plugins/nav/telescope
rm -rf ./lua/plugins/snacks
rm -rf ./ftplugin
# Remove specific plugins
rm -rf ./lua/plugins/nav/neotree.lua
rm -rf ./lua/plugins/nav/toggleterm.lua
rm -rf ./lua/plugins/style/startup.lua
rm -rf ./lua/plugins/util/autotag.lua
rm -rf ./lua/plugins/nav/bufferline.lua
rm -rf ./lua/plugins/nav/gitsigns.lua
rm -rf ./lua/plugins/nav/navbuddy.lua
rm -rf ./lua/plugins/style/navbuddy.lua
rm -rf ./lua/plugins/util/autopairs.lua
rm -rf ./lua/plugins/util/autotag.lua
rm -rf ./lua/plugins/util/comment-box.lua
rm -rf ./lua/plugins/util/comment.lua
rm -rf ./lua/plugins/util/colour-picker.lua
rm -rf ./lua/plugins/util/indent-blankline.lua
rm -rf ./lua/plugins/util/diffview.lua
rm -rf ./lua/plugins/util/markdown-preview.lua
rm -rf ./lua/plugins/util/neogen.lua
rm -rf ./lua/plugins/util/move.lua
rm -rf ./lua/plugins/util/neogen.lua
rm -rf ./lua/plugins/util/surround.lua
rm -rf ./lua/plugins/util/scratch.lua
rm -rf ./lua/plugins/util/multicrsors.lua
rm -rf ./lua/plugins/util/diff
rm -rf ./lua/plugins/util/wakapi.lua
-2
View File
@@ -124,8 +124,6 @@ keymap.set({ "n", "v" }, "<leader>P", '"+P', opts("PASTE from system clipboard")
keymap.set({ "n", "v" }, "<leader><leader>d", '"+d', opts("yank to system clipboard and delete"))
keymap.set({ "n", "v" }, "<leader><leader>D", '"+D', opts("YANK to system clipboard and DELETE"))
keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey"))
-- Toggle relative line numbers
keymap.set(
"n",
+1 -1
View File
@@ -14,10 +14,10 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = "plugins.nav" },
{ import = "plugins.snacks" },
{ import = "plugins.lsp" },
{ import = "plugins.style" },
{ import = "plugins.util" },
{ import = "plugins.util.diff" },
{ import = "plugins.testing" },
},
change_detection = {
+18 -24
View File
@@ -8,21 +8,6 @@ M.on_attach = function(client, bufnr)
opts.buffer = bufnr
-- set keybinds
opts.desc = "Show LSP references"
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts)
opts.desc = "Go to declaration"
keymap.set("n", "gD", ":lua vim.lsp.buf.declaration", opts)
opts.desc = "Show LSP definitions"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts)
opts.desc = "Show LSP type definitions"
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
@@ -32,17 +17,26 @@ M.on_attach = function(client, bufnr)
opts.desc = "Smart rename"
keymap.set("n", "<leader>n", vim.lsp.buf.rename, opts)
opts.desc = "Show buffer diagnostics"
keymap.set("n", "ga", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
opts.desc = "Show line diagnostics"
keymap.set("n", "gA", ":lua vim.diagnostic.open_float()<CR>", opts)
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
keymap.set("n", "[d", function()
vim.diagnostic.jump({
count = -1,
on_jump = function()
vim.diagnostic.open_float()
end,
})
end, opts)
keymap.set("n", "<leader>?", vim.diagnostic.open_float, opts)
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
keymap.set("n", "]d", function()
vim.diagnostic.jump({
count = 1,
on_jump = function()
vim.diagnostic.open_float()
end,
})
end, opts)
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts)
@@ -65,7 +59,7 @@ end
-- used to enable autocompletion (assign to every lsp server config)
-- local capabilities = cmp_nvim_lsp.default_capabilities()
M.capabilities = vim.lsp.protocol.make_client_capabilities()
M.capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
return M
-130
View File
@@ -1,130 +0,0 @@
return {
-- competion
"hrsh7th/nvim-cmp",
event = { "InsertEnter", "LspAttach" },
dependencies = {
{ "hrsh7th/cmp-buffer" }, -- source for text in buffer
{ "hrsh7th/cmp-path" }, -- source for file system paths
{ "L3MON4D3/LuaSnip" }, -- snippet engine
{ "saadparwaiz1/cmp_luasnip" }, -- for autocompletion
{ "rafamadriz/friendly-snippets" }, -- useful snippets
{ "onsails/lspkind.nvim" }, -- icons for cmp
},
config = function()
local cmp = require("cmp")
local lspkind = require("lspkind")
local luasnip = require("luasnip")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").load({ paths = { "~/.config/nvim/snippets" } })
luasnip.setup({})
-- luasnip.filetype_extend("htmldjango", { "html" })
cmp.setup({
completion = {
completeopt = "menu,menuone,preview,noselect",
},
window = {
documentation = cmp.config.window.bordered({
border = { "", "", "", "", "", "", "", "" },
}),
completion = cmp.config.window.bordered({
border = { "", "", "", "", "", "", "", "" },
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
}),
},
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.ConfirmBehavior.Select }), -- next suggestion
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.ConfirmBehavior.Select }), -- prev suggestion
["<C-S-J>"] = cmp.mapping.scroll_docs(4, { behavior = cmp.ConfirmBehavior.Select }), -- docs forward
["<C-S-K>"] = cmp.mapping.scroll_docs(-4, { behavior = cmp.ConfirmBehavior.Select }), -- docs back
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-q>"] = cmp.mapping.abort(), -- close completion window
["<CR>"] = cmp.mapping.confirm({ select = false }), -- autocomplete if selected
-- Mapping for Tab key
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })
else
-- Otherwise, fallback (insert a tab character)
fallback()
end
end, { "i", "s" }),
-- Mapping for jumping in snippets
["<C-p>"] = cmp.mapping(function(fallback)
if require("luasnip").jumpable() then
-- Jump backwards if inside a snippet
require("luasnip").jump()
else
-- Otherwise, fallback (insert a tab character)
fallback()
end
end, { "i", "s" }),
-- Mapping for jumping backwards in snippets
["<C-S-p>"] = cmp.mapping(function(fallback)
if require("luasnip").jumpable() then
-- Jump backwards if inside a snippet
require("luasnip").jump()
else
-- Otherwise, fallback (insert a tab character)
fallback()
end
end, { "i", "s" }),
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "nvim_lsp" }, -- lsp
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
}),
formatting = {
fields = { "icon", "abbr", "menu" },
format = lspkind.cmp_format({
mode = "symbol", -- show only symbol annotations
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
-- can also be a function to dynamically calculate max width such as
-- maxwidth = function() return math.floor(0.45 * vim.o.columns) end,
ellipsis_char = "", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
show_labelDetails = true, -- show labelDetails in menu. Disabled by default
-- The function below will be called before any actual modifications from lspkind
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
before = function(entry, vim_item)
return vim_item
end,
}),
},
})
local opts = { silent = true }
opts.desc = "next snippet placeholder"
vim.keymap.set({ "i", "s" }, "<C-,>", function()
luasnip.jump(1)
end, opts)
opts.desc = "previous snippet placeholder"
vim.keymap.set({ "i", "s" }, "<C-.>", function()
luasnip.jump(-1)
end, opts)
opts.desc = "LuaSnip unlink"
vim.keymap.set({ "i", "n" }, "<C-s>", function()
luasnip.unlink_current()
end, opts)
end,
}
+67
View File
@@ -0,0 +1,67 @@
return {
"saghen/blink.cmp",
-- optional: provides snippets for the snippet source
dependencies = { "rafamadriz/friendly-snippets", "L3MON4D3/LuaSnip" },
-- use a release tag to download pre-built binaries
version = "1.*",
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- All presets have the following mappings:
-- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true)
--
-- See :h blink-cmp-config-keymap for defining your own keymap
keymap = {
preset = "super-tab",
["<C-k>"] = { "select_prev", "fallback" },
["<C-j>"] = { "select_next", "fallback" },
["<C-n>"] = { "show_documentation", "hide_documentation" },
["<C-S-j>"] = { "scroll_documentation_down", "scroll_signature_down" },
["<C-S-k>"] = { "scroll_documentation_up", "scroll_signature_up" },
["<C-,>"] = { "snippet_backward", "fallback" },
["<C-.>"] = { "snippet_forward", "fallback" },
["<C-s>"] = { "show_signature", "hide_signature", "fallback" },
},
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- Adjusts spacing to ensure icons are aligned
nerd_font_variant = "mono",
},
-- (Default) Only show the documentation popup when manually triggered
completion = {
documentation = { auto_show = false },
list = {
cycle = { from_top = true, from_bottom = true },
selection = {
auto_insert = false
}
},
},
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = { "lsp", "path", "snippets", "buffer" },
},
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
--
-- See the fuzzy documentation for more information
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
}
+1 -1
View File
@@ -9,9 +9,9 @@ local on_attach = require("lsp-options").on_attach
lsp.config("qmlls", {
capabilities = capabilities,
on_attach = on_attach,
cmd = { "qmlls6" },
})
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("qmlls")
+2 -2
View File
@@ -6,7 +6,7 @@ local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("sqlls", {
lsp.config("postgres_lsp", {
capabilities = capabilities,
on_attach = on_attach,
})
@@ -14,4 +14,4 @@ lsp.config("sqlls", {
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("sqlls")
enable("postgres_lsp")
-16
View File
@@ -1,16 +0,0 @@
return {
---------- for lsp diagnostic lines ----------
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
event = "LspAttach",
config = function()
require("lsp_lines").setup()
vim.diagnostic.config({ virtual_lines = false })
local lsplines = false
vim.keymap.set("n", "<Leader>L", function()
lsplines = not lsplines
vim.diagnostic.config({ virtual_text = not lsplines })
vim.diagnostic.config({ virtual_lines = lsplines })
end, { desc = "Toggle lsp_lines" })
end,
}
+8 -1
View File
@@ -6,7 +6,6 @@ return {
-- lsp configuration
"neovim/nvim-lspconfig",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
{ "antosha417/nvim-lsp-file-operations", config = true },
"mfussenegger/nvim-jdtls",
},
@@ -18,6 +17,13 @@ return {
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
local luasnip = require("luasnip")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").load({ paths = { "~/.config/nvim/snippets" } })
luasnip.setup({})
-- ───────────────────────────────────────────────────────────────────
-- ╭───────────────────────────────────────────────╮
-- │ Import configs from other files │
@@ -33,6 +39,7 @@ return {
require("plugins.lsp.ls.low-level")
require("plugins.lsp.ls.luals")
require("plugins.lsp.ls.pyright")
require("plugins.lsp.ls.qml")
require("plugins.lsp.ls.rust-analyzer")
require("plugins.lsp.ls.ruby")
require("plugins.lsp.ls.sql")
+1 -1
View File
@@ -40,10 +40,10 @@ return {
"jsonls",
"marksman",
"lua_ls",
"postgres_lsp",
"pyright",
"rust_analyzer",
"ruby_lsp",
"sqlls",
"verible",
"vtsls",
"vue_ls",
+1 -1
View File
@@ -14,7 +14,7 @@ return {
indicator = { style = "underline" },
offsets = {
{
filetype = "neo-tree",
filetype = "snacks_picker_list",
text = " ",
text_align = "center",
separator = true,
-333
View File
@@ -1,333 +0,0 @@
return {
"nvim-neo-tree/neo-tree.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
},
keys = {
{ "<leader>e", "<Cmd>Neotree<CR>", desc = "Open Neotree" },
{
"<leader><leader>gg",
"<Cmd>Neotree source=git_status position=float<CR>",
desc = "Open git view",
},
},
opts = {
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
use_default_mappings = false,
open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
open_files_using_relative_paths = false,
sort_case_insensitive = false, -- used when sorting files and directories in the tree
-- sort_function = nil, -- use a custom function for sorting files and directories in the tree
sort_function = function(a, b) -- natural sort
if a.type == b.type then
local ap = a.path:lower()
local bp = b.path:lower()
if ap == bp then
return false
end
for i = 1, math.max(string.len(ap), string.len(bp)), 1 do
local l = string.sub(ap, i, -1)
local r = string.sub(bp, i, -1)
if
type(tonumber(string.sub(l, 1, 1))) == "number"
and type(tonumber(string.sub(r, 1, 1))) == "number"
then
local l_number = tonumber(string.match(l, "^[0-9]+"))
local r_number = tonumber(string.match(r, "^[0-9]+"))
if l_number ~= r_number then
return l_number < r_number
end
elseif string.sub(l, 1, 1) ~= string.sub(r, 1, 1) then
return l < r
end
end
else
return a.type < b.type
end
end,
default_component_configs = {
container = {
enable_character_fade = true,
},
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = "",
last_indent_marker = "",
highlight = "NeoTreeIndentMarker",
-- expander config, needed for nesting files
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "󰜌",
provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available
if node.type == "file" or node.type == "terminal" then
local success, web_devicons = pcall(require, "nvim-web-devicons")
local name = node.type == "terminal" and "terminal" or node.name
if success then
local devicon, hl = web_devicons.get_icon(name)
icon.text = devicon or icon.text
icon.highlight = hl or icon.highlight
end
end
end,
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "*",
highlight = "NeoTreeFileIcon",
},
modified = {
symbol = "[+]",
highlight = "NeoTreeModified",
},
name = {
trailing_slash = true,
use_git_status_colors = true,
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
-- Change type
added = "+", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "", -- this can only be used in the git_status source
renamed = "󰁕", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "󰄱",
staged = "",
conflict = "",
},
},
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
file_size = {
enabled = true,
width = 12, -- width of the column
required_width = 64, -- min width of window required to show this column
},
type = {
enabled = true,
width = 10, -- width of the column
required_width = 122, -- min width of window required to show this column
},
last_modified = {
enabled = true,
width = 20, -- width of the column
required_width = 88, -- min width of window required to show this column
},
created = {
enabled = true,
width = 20, -- width of the column
required_width = 110, -- min width of window required to show this column
},
symlink_target = {
enabled = false,
},
},
-- A list of functions, each representing a global custom command
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
-- see `:h neo-tree-custom-commands-global`
commands = {},
window = {
position = "left",
width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
["<2-LeftMouse>"] = "open",
["<cr>"] = "open",
["o"] = "open",
["<esc>"] = "cancel", -- close preview or floating neo-tree window
["P"] = { "toggle_preview", config = { use_float = true, use_image_nvim = true } },
-- Read `# Preview Mode` for more information
["l"] = "focus_preview",
["S"] = "open_split",
["v"] = "open_vsplit",
["t"] = "open_tabnew",
["w"] = "open_with_window_picker",
["C"] = "close_node",
-- ['C'] = 'close_all_subnodes',
["z"] = "close_all_nodes",
--["Z"] = "expand_all_nodes",
["q"] = "close_window",
["R"] = "refresh",
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
["i"] = "show_file_details",
},
},
nesting_rules = {},
filesystem = {
scan_mode = "deep",
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,
hide_gitignored = true,
hide_ignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
--"node_modules"
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
--".gitignored",
},
always_show_by_pattern = { -- uses glob style patterns
--".env*",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
--".null-ls_*",
},
},
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
window = {
mappings = {
["a"] = {
"add",
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none", -- "none", "relative", "absolute"
},
},
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
["d"] = "delete",
["r"] = "rename",
["b"] = "rename_basename",
["y"] = "copy_to_clipboard",
["x"] = "cut_to_clipboard",
["p"] = "paste_from_clipboard",
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
["<bs>"] = "navigate_up",
["."] = "set_root",
["H"] = "toggle_hidden",
["/"] = "fuzzy_finder",
["D"] = "fuzzy_finder_directory",
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
-- ["D"] = "fuzzy_sorter_directory",
["f"] = "filter_on_submit",
["<c-x>"] = "clear_filter",
["[g"] = "prev_git_modified",
["]g"] = "next_git_modified",
["s"] = {
"show_help",
nowait = false,
config = { title = "Order by", prefix_key = "s" },
},
["sc"] = { "order_by_created", nowait = false },
["sd"] = { "order_by_diagnostics", nowait = false },
["sg"] = { "order_by_git_status", nowait = false },
["sm"] = { "order_by_modified", nowait = false },
["sn"] = { "order_by_name", nowait = false },
["ss"] = { "order_by_size", nowait = false },
["st"] = { "order_by_type", nowait = false },
-- ['<key>'] = function(state) ... end,
},
fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode
["<down>"] = "move_cursor_down",
["<C-n>"] = "move_cursor_down",
["<up>"] = "move_cursor_up",
["<C-p>"] = "move_cursor_up",
["<esc>"] = "close",
-- ['<key>'] = function(state, scroll_padding) ... end,
},
},
commands = {}, -- Add a custom command or override a global one using the same function name
},
buffers = {
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
["d"] = "buffer_delete",
["bd"] = "buffer_delete",
["<bs>"] = "navigate_up",
["."] = "set_root",
["s"] = {
"show_help",
nowait = false,
config = { title = "Order by", prefix_key = "s" },
},
["sc"] = { "order_by_created", nowait = false },
["sd"] = { "order_by_diagnostics", nowait = false },
["sm"] = { "order_by_modified", nowait = false },
["sn"] = { "order_by_name", nowait = false },
["ss"] = { "order_by_size", nowait = false },
["st"] = { "order_by_type", nowait = false },
},
},
},
git_status = {
window = {
position = "float",
mappings = {
["A"] = "git_add_all",
["u"] = "git_unstage_file",
["a"] = "git_add_file",
["r"] = "git_revert_file",
["c"] = "git_commit",
["p"] = "git_push",
["g"] = "git_commit_and_push",
["s"] = {
"show_help",
nowait = false,
config = { title = "Order by", prefix_key = "s" },
},
["sc"] = { "order_by_created", nowait = false },
["sd"] = { "order_by_diagnostics", nowait = false },
["sm"] = { "order_by_modified", nowait = false },
["sn"] = { "order_by_name", nowait = false },
["ss"] = { "order_by_size", nowait = false },
["st"] = { "order_by_type", nowait = false },
},
},
},
},
}
-157
View File
@@ -1,157 +0,0 @@
return {
-- fuzzy finder
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-live-grep-args.nvim",
-- This will not install any breaking changes.
-- For major updates, this must be adjusted manually.
version = "^1.0.0",
},
},
event = { "LspAttach" },
keys = {
{
"<leader>ff",
function()
require("telescope.builtin").find_files()
end,
desc = "Telescope find files",
},
{
"<leader>fu",
function()
require("telescope.builtin").lsp_references()
end,
desc = "Telescope Usage (references)",
},
{
"<leader>flg",
function()
require("telescope.builtin").live_grep()
end,
desc = "Telescope live grep",
},
{
"<leader>fg",
function()
require("telescope").extensions.live_grep_args.live_grep_args()
end,
desc = "Telescope live grep args",
},
{
"<leader>fb",
function()
require("telescope.builtin").buffers()
end,
desc = "Telescope buffers",
},
{
"<leader>fh",
function()
require("telescope.builtin").help_tags()
end,
desc = "Telescope nvim functions",
},
{ "<leader>ft", ":TodoTelescope<CR>", desc = "Telescope TODOs" },
-- Git
{
"<leader>fld",
function()
require("telescope.builtin").git_status()
end,
desc = "Telescope git diff",
},
{
"<leader>flc",
function()
require("telescope.builtin").git_commits()
end,
desc = "Telescope git commits",
},
{
"<leader>flf",
function()
require("telescope.builtin").git_files()
end,
desc = "Telescope git files",
},
-- Recent Commands
{ "<leader>foc", ":Telescope command_history<CR>", desc = "Telescope recent commands" },
-- Recent Searches
{ "<leader>fos", ":Telescope search_history<CR>", desc = "Telescope recent searches" },
-- Old Files
{
"<leader>fr",
function()
require("telescope.builtin").oldfiles()
end,
desc = "Telescope recent files",
},
-- Quickfix Items
{ "<leader>fq", ":Telescope quickfix<CR>", desc = "Telescope quickfix items" },
-- Spell Suggestions
{ "<leader>fs", ":Telescope spell_suggest<CR>", desc = "Telescope spellsuggestions" },
-- Diagnostics
{ "<leader>fd", ":Telescope diagnostics<CR>", desc = "Telescope Diagnostics" },
-- Notifications
{ "<leader>fn", ":Telescope notify<CR>", desc = "Telescope Notifications" },
-- Implementations
{ "<leader>fi", ":Telescope lsp_implementations<CR>", desc = "Telescope lsp implementations" },
-- References
{
"<leader>fu",
function()
require("telescope.builtin").lsp_references()
end,
desc = "Telescope Usage (references)",
},
},
config = function()
local actions = require("telescope.actions")
local telescope = require("telescope")
local lga_actions = require("telescope-live-grep-args.actions")
telescope.setup({
defaults = {
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-q>"] = actions.smart_add_to_qflist,
["<C-A-q>"] = actions.smart_send_to_qflist,
["<C-Space>"] = lga_actions.quote_prompt(),
},
},
path_display = { "truncate" },
},
extensions = {
frecency = {
db_safe_mode = false,
matcher = "fuzzy",
},
},
})
telescope.load_extension("live_grep_args")
end,
}
-18
View File
@@ -1,18 +0,0 @@
return {
-- literally the name, quick term toggle
"akinsho/toggleterm.nvim",
version = "*",
opts = {
insert_mappings = false,
terminal_mappings = false,
open_mapping = "<leader>t",
direction = "float",
float_opts = {
border = "curved",
},
},
keys = {
{ "<S-Esc>", "<CMD>ToggleTerm<CR>", desc = "Close Terminal", mode = "t" }, -- close terminal wih esc
{ "<leader>t", "<CMD>ToggleTerm<CR>", desc = "Open Terminal" }, -- close terminal wih esc
},
}
+13 -1
View File
@@ -6,5 +6,17 @@ return {
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
opts = {},
opts = {
preset = "modern"
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Start Which-Key",
mode = "n"
},
},
}
+33
View File
@@ -0,0 +1,33 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
animate = { enabled = true },
bigfile = { enabled = true },
bufdelete = { enabled = true },
dashboard = require("plugins.snacks.modules.dashboard"),
indent = {
enabled = true,
indent = {
enabled = true,
priority = 1,
char = "",
},
animate = {
enabled = false,
},
scope = {
char = "",
},
},
terminal = require("plugins.snacks.modules.terminal"),
lazygit = { enabled = true },
picker = { enabled = true },
quickfile = { enabled = true },
statuscolumn = { enabled = true },
scope = { enabled = true },
},
keys = require("plugins.snacks.keys.keys"),
}
+260
View File
@@ -0,0 +1,260 @@
return {
-- Git
{
"<leader><leader>gl",
function()
Snacks.lazygit()
end,
desc = "Open LazyGit",
mode = "n",
},
{
"<leader><leader>gb",
function()
Snacks.git.blame_line()
end,
desc = "Open Git Blame for this line",
mode = "n",
},
-- Colours
{
"<leader>fcs",
function()
Snacks.picker.highlights({ pattern = "hl_group:^Snacks" })
end,
desc = "Show Snacks highlights",
mode = "n",
},
{
"<leader>fca",
function()
Snacks.picker.highlights()
end,
desc = "Show highlight groups",
mode = "n",
},
{
"<leader>fci",
function()
Snacks.picker.icons()
end,
desc = "Show icons",
mode = "n",
},
-- Terminal
{
"<leader>t",
function()
Snacks.terminal()
end,
desc = "Open terminal",
},
-- Tree
{
"<leader>e",
function()
Snacks.explorer()
end,
desc = "Open File Tree",
mode = "n",
},
-- Pickers
{
"<leader>ff",
function()
Snacks.picker.files()
end,
desc = "Find file",
mode = "n",
},
{
"<leader>fg",
function()
Snacks.picker.grep()
end,
desc = "Find file content using grep",
mode = "n",
},
{
"<leader>fb",
function()
Snacks.picker.buffers()
end,
desc = "Show all buffers",
mode = "n",
},
{
"<leader>fch",
function()
Snacks.picker.command_history()
end,
desc = "Show command history",
mode = "n",
},
{
"<leader>fd",
function()
Snacks.picker.diagnostics()
end,
desc = "Show diagnostics",
mode = "n",
},
{
"<leader>fm",
function()
Snacks.picker.git_diff()
end,
desc = "Show uncommitted diffs",
mode = "n",
},
{
"<leader>fh",
function()
Snacks.picker.help()
end,
desc = "Show nvim help pages",
mode = "n",
},
{
"<leader>fj",
function()
Snacks.picker.jumps()
end,
desc = "Show available jumps",
mode = "n",
},
{
"<leader>fk",
function()
Snacks.picker.keymaps()
end,
desc = "Show keymaps",
mode = "n",
},
{
"<leader>flc",
function()
Snacks.picker.lsp_config()
end,
desc = "Show LSP configs",
mode = "n",
},
{
"gd",
function()
Snacks.picker.lsp_definitions()
end,
desc = "Goto definitions",
mode = "n",
},
{
"gi",
function()
Snacks.picker.lsp_implementations()
end,
desc = "Goto implementations",
mode = "n",
},
{
"gR",
function()
Snacks.picker.lsp_references()
end,
desc = "Goto references",
mode = "n",
},
{
"gD",
function()
Snacks.picker.lsp_declarations()
end,
desc = "Goto declaration",
mode = "n",
},
{
"gy",
function()
Snacks.picker.lsp_type_definitions()
end,
desc = "Goto T[y]pe Definition",
},
{
"gai",
function()
Snacks.picker.lsp_incoming_calls()
end,
desc = "C[a]lls Incoming",
},
{
"gao",
function()
Snacks.picker.lsp_outgoing_calls()
end,
desc = "C[a]lls Outgoing",
},
{
"gs",
function()
Snacks.picker.lsp_symbols()
end,
desc = "Show LSP symbols",
mode = "n",
},
{
"<leader>fn",
function()
Snacks.picker.noice()
end,
desc = "Show notifications",
mode = "n",
},
{
"<leader>fp",
function()
Snacks.picker.projects()
end,
desc = "Show recent projects",
mode = "n",
},
{
"<leader>fr",
function()
Snacks.picker.recent()
end,
desc = "Show recent files",
mode = "n",
},
{
"<leader>fs",
function()
Snacks.picker.spelling()
end,
desc = "Show spelling suggestions",
mode = "n",
},
{
"zs",
function()
Snacks.picker.spelling()
end,
desc = "Show spelling suggestions",
mode = "n",
},
{
"<leader>fo",
function()
Snacks.picker.treesitter()
end,
desc = "Show treesitter details",
mode = "n",
},
-- Close buffer
{
"<C-x>",
function()
Snacks.bufdelete()
end,
desc = "Close buffer",
mode = "n",
},
}
@@ -0,0 +1,48 @@
return {
enabled = true,
sections = {
{ section = "header", hl = "SnacksDashboardHeader" },
{
pane = 2,
section = "terminal",
cmd = "colorscript -e square",
height = 5,
padding = 1,
},
{ section = "keys", hl = "SnacksDashboardPrimary", gap = 1, padding = 1 },
{
pane = 2,
icon = "",
title = "Recent Files (in project)",
section = "recent_files",
indent = 2,
limit = 5,
padding = 1,
cwd = true,
},
{
pane = 2,
icon = "",
title = "Projects",
section = "projects",
indent = 2,
padding = 1,
limit = 4,
},
{
pane = 2,
icon = "",
title = "Git Status",
section = "terminal",
enabled = function()
return Snacks.git.get_root() ~= nil
end,
cmd = "git status --short --branch --renames",
height = 5,
padding = 1,
ttl = 5 * 60,
indent = 3,
},
{ section = "startup" },
},
}
@@ -0,0 +1,5 @@
return {
sources = {
explorer = {}
}
}
@@ -0,0 +1,7 @@
return {
win = {
style = "terminal",
position = "float",
border = "rounded",
},
}
+3
View File
@@ -44,6 +44,7 @@ return {
bg2 = "#1b211e", -- Lighter bg (colorcolm folds)
bg3 = "#252b28", -- Lighter bg (cursor line)
bg4 = "#303633", -- Conceal, border fg
bgDark = "#0c0c0c",
fg0 = "#dee4df", -- Lighter fg
fg1 = "#dee4df", -- Default fg
@@ -127,6 +128,8 @@ return {
SnacksDashboardHeader = { fg = "palette.darkred" },
SnacksDashboardTitle = { fg = "palette.turquoise" },
SnacksIndentScope = { fg = "palette.lightblue" },
NormalFloat = { bg = "palette.bgDark" },
Directory = { fg = "palette.cyan" }
},
},
})
+1 -1
View File
@@ -21,7 +21,7 @@ return {
statusline = {},
winbar = {},
},
ignore_focus = { "neo-tree", "TelescopePrompt", "neo-tree-popup" },
ignore_focus = { "snacks_picker_list", "snacks_input" },
always_divide_middle = true,
globalstatus = false,
refresh = {
-2
View File
@@ -15,11 +15,9 @@ return {
})
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
},
progress = {
format = "lsp_progress",
+16
View File
@@ -68,4 +68,20 @@ return {
},
},
},
keys = {
{
"<leader>ft",
function()
Snacks.picker.todo_comments()
end,
desc = "Todo",
},
{
"<leader>fT",
function()
Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } })
end,
desc = "Todo/Fix/Fixme",
},
},
}
-8
View File
@@ -1,8 +0,0 @@
return {
-- similar to sticky scroll in vscode
"nvim-treesitter/nvim-treesitter-context",
event = "BufRead",
opts = {
max_lines = 4
}
}
-10
View File
@@ -1,10 +0,0 @@
return {
-- Diffview
"sindrets/diffview.nvim",
keys = {
{ "<leader><leader>gd", ":DiffviewOpen<CR>", desc = "Open diffview" },
{ "<leader><leader>gf", ":DiffviewFileHistory<CR>", desc = "View file history" },
{ "<leader><leader>gc", ":DiffviewClose<CR>", desc = "Close diffview" },
{ "<leader><leader>gr", ":DiffviewRefresh<CR>", desc = "Refresh diffview" },
},
}
+10
View File
@@ -0,0 +1,10 @@
return {
-- Diffview
"sindrets/diffview.nvim",
keys = {
{ "<leader><leader>gdd", ":DiffviewOpen<CR>", desc = "Open diffview" },
{ "<leader><leader>gdh", ":DiffviewFileHistory<CR>", desc = "View file history" },
{ "<leader><leader>gdc", ":DiffviewClose<CR>", desc = "Close diffview" },
{ "<leader><leader>gdr", ":DiffviewRefresh<CR>", desc = "Refresh diffview" },
},
}
-17
View File
@@ -1,17 +0,0 @@
local utils = require("utils")
return {
"smoka7/multicursors.nvim",
dependencies = {
"nvimtools/hydra.nvim",
},
opts = {},
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
keys = {
{
mode = { "v", "n" },
"<leader><leader>c",
utils.run_vim_cmd("MCstart"),
desc = "Create a selection for selected text or word under the cursor",
},
},
}
-114
View File
@@ -1,114 +0,0 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
animate = { enabled = true },
bigfile = { enabled = true },
bufdelete = { enabled = true },
dashboard = {
enabled = true,
sections = {
{ section = "header", hl = "SnacksDashboardHeader" },
{
pane = 2,
section = "terminal",
cmd = "colorscript -e square",
height = 5,
padding = 1,
},
{ section = "keys", hl = "SnacksDashboardPrimary", gap = 1, padding = 1 },
{
pane = 2,
icon = "",
title = "Recent Files (in project)",
section = "recent_files",
indent = 2,
limit = 5,
padding = 1,
cwd = true,
},
{
pane = 2,
icon = "",
title = "Projects",
section = "projects",
indent = 2,
padding = 1,
limit = 4,
},
{
pane = 2,
icon = "",
title = "Git Status",
section = "terminal",
enabled = function()
return Snacks.git.get_root() ~= nil
end,
cmd = "git status --short --branch --renames",
height = 5,
padding = 1,
ttl = 5 * 60,
indent = 3,
},
{ section = "startup" },
},
},
indent = {
enabled = true,
indent = {
enabled = true,
priority = 1,
char = "",
},
animate = {
enabled = false,
},
scope = {
char = "",
},
},
lazygit = { enabled = true },
picker = { enabled = true },
quickfile = { enabled = true },
statuscolumn = { enabled = true },
},
keys = {
{
"<leader><leader>gl",
function()
Snacks.lazygit()
end,
desc = "Open LazyGit",
mode = "n",
},
{
"<leader>fcs",
function()
Snacks.picker.highlights({ pattern = "hl_group:^Snacks" })
end,
desc = "Show Snacks highlights",
mode = "n",
},
{
"<leader>fca",
function()
Snacks.picker.highlights()
end,
desc = "Show highlight groups",
mode = "n",
},
{
"<C-x>",
function()
Snacks.bufdelete()
end,
desc = "Close buffer",
mode = "n",
},
},
}
+14
View File
@@ -95,6 +95,20 @@
],
"description": "Prepares to write a LaTeX CheatSheet"
},
"glossary-entry": {
"prefix": "glossary-entry",
"body": [
"\\newglossaryentry{$1}{",
"\tname={$2},",
"\tdescription={$3}\n}"
]
},
"acronym": {
"prefix": "acronym",
"body": [
"\\newacronym{$1:id}{$2:abb}{$3:expanded}"
]
},
"Fancy table": {
"prefix": "table",
"body": [