Compare commits

..

5 Commits

Author SHA1 Message Date
fzechert d92312b83c add keybinds to jump between buffers 2026-07-05 01:15:25 +02:00
fzechert a83481d10d fix keymaps 2026-07-03 23:36:51 +02:00
fzechert 9810b20e0b configure LSP, codelens, and trouble 2026-06-28 20:52:55 +02:00
fzechert d256020251 configure trouble plugin 2026-06-28 20:15:04 +02:00
fzechert 9c48b3b3a0 add which-key plugin 2026-06-28 02:05:01 +02:00
10 changed files with 173 additions and 11 deletions
+34 -1
View File
@@ -46,9 +46,10 @@ create_cmd("TextYankPost", {
create_cmd("FileType", { create_cmd("FileType", {
desc = "Disable list characters for some filetypes", desc = "Disable list characters for some filetypes",
group = create_group("cmd-disable-listchars", { clear = true }), group = create_group("cmd-disable-listchars", { clear = true }),
pattern = { "netrw" }, pattern = { "netrw", "trouble" },
callback = function(args) callback = function(args)
vim.opt_local.list = false vim.opt_local.list = false
vim.opt.textwidth = 0
end end
}) })
@@ -113,3 +114,35 @@ create_cmd({"InsertLeave", "CmdlineLeave", "TermLeave", "BufEnter", "WinEnter" }
trailing_hl_match_ids[window] = vim.fn.matchadd("TrailingWhitespace", [[\s\+$]]) trailing_hl_match_ids[window] = vim.fn.matchadd("TrailingWhitespace", [[\s\+$]])
end end
}) })
-- Open Trouble Quickfix list automatically
create_cmd("QuickFixCmdPost", {
desc = "Automatically open Quickfix List in Trouble",
group = create_group("cmd-quickfix-open-trouble", { clear = true }),
callback = function()
vim.cmd([[Trouble qflist open]])
end
})
-- Automatically open diagnostic float when hovering with cursor
create_cmd("CursorHold", {
desc = "Automatically open Diagnostic Float",
group = create_group("cmd-auto-open-diagnostic-float", { clear = true }),
callback = function()
-- If any floating window exists, do nothing
for _, win in ipairs(vim.api.nvim_list_wins()) do
local cfg = vim.api.nvim_win_get_config(win)
if cfg.relative ~= "" then
return
end
end
-- Only open if there is a diagnostic under cursor
local diags = vim.diagnostic.get(0, { lnum = vim.fn.line('.') - 1 })
if #diags == 0 then
return
end
vim.diagnostic.open_float(nil, { focus = false, scope = "cursor" })
end,
})
+3 -3
View File
@@ -31,15 +31,15 @@
]] ]]
vim.diagnostic.config({ vim.diagnostic.config({
update_in_insert = true, update_in_insert = false,
severity_sort = true, severity_sort = true,
float = { float = {
border = vim.g.ui.popupborder, border = vim.g.ui.popupborder,
source = true, source = true,
}, },
underline = true, -- underline = true,
-- underline only from a specified severity level -- underline only from a specified severity level
-- underline = { severity = { min = vim.diagnostic.severity.WARN } }, underline = { severity = { min = vim.diagnostic.severity.WARN } },
virtual_text = { virtual_text = {
prefix = vim.g.ui.symbols.diagnostic.virtual_text_prefix, prefix = vim.g.ui.symbols.diagnostic.virtual_text_prefix,
severity = nil, -- show all severities severity = nil, -- show all severities
+34
View File
@@ -97,3 +97,37 @@ map("n", "<leader>bd", smart_buffer_delete, { desc = "Close Current Buffer" })
map("n", "<leader>bw", smart_buffer_wipeout, { desc = "Wipeout Current Buffer" }) map("n", "<leader>bw", smart_buffer_wipeout, { desc = "Wipeout Current Buffer" })
map("n", "<leader>bD", delete_other_buffers, { desc = "Close All Other Buffers" }) map("n", "<leader>bD", delete_other_buffers, { desc = "Close All Other Buffers" })
map("n", "<leader>bW", wipeout_other_buffers, { desc = "Wipeout All Other Buffers" }) map("n", "<leader>bW", wipeout_other_buffers, { desc = "Wipeout All Other Buffers" })
for i = 1, 10 do
map("n", "<Leader>b" .. (i%10), "<Cmd>LualineBuffersJump! " .. i .. "<Cr>", { desc = "Jump to Buffer " .. i })
end
-- Trouble Keybinds
-- open diagnostics window
map("n", "<leader>xd", [[<Cmd>Trouble diagnostics toggle focus=false filter.buf=0<CR>]], { desc = "Toggle diagnostic message for current buffer" })
map("n", "<leader>xD", [[<Cmd>Trouble diagnostics toggle focus=false<CR>]], { desc = "Toggle diagnostic message for project" })
map("n", "grl", [[<Cmd>Trouble lsp toggle focus=false win.position=right win.relative=win pinned=true<CR>]], { desc = "Open LSP Info" })
map("n", "grt", [[<Cmd>Trouble symbols toggle focus=false<CR>]], { desc = "Open TreeSitter Symbols" })
map("n", "grs", [[<Cmd>Trouble lsp_document_symbols toggle focus=false<CR>]], { desc = "Open LSP Document Symbols", silent = true, noremap = true })
map("n", "grD", [[<Cmd>Trouble lsp_declarations toggle<CR>]], { desc = "Show LSP Declarations", silent = true, noremap = true })
map("n", "grd", [[<Cmd>Trouble lsp_definitions toggle<CR>]], { desc = "Show LSP Definitions", silent = true, noremap = true })
map("n", "gri", [[<Cmd>Trouble lsp_implementations toggle<CR>]], { desc = "Show LSP Implementations", silent = true, noremap = true })
map("n", "grc", [[<Cmd>Trouble lsp_incoming_calls toggle<CR>]], { desc = "Show LSP incoming calls", silent = true, noremap = true })
map("n", "grC", [[<Cmd>Trouble lsp_outgoing_calls toggle<CR>]], { desc = "Show LSP outgoing calls", silent = true, noremap = true })
map("n", "grr", [[<Cmd>Trouble lsp_references toggle<CR>]], { desc = "Show LSP references", silent = true, noremap = true })
map("n", "<leader>xq", [[<Cmd>Trouble qflist toggle focus=false<CR>]], { desc = "Show Quickfix List" })
map("n", "<leader>xl", [[<Cmd>Trouble loclist toggle focus=false<CR>]], { desc = "Show Location List" })
map("n", "grn", vim.lsp.buf.rename, { desc = "Rename", silent = true, noremap = true })
map({"n", "v"}, "gra", vim.lsp.buf.code_action, { desc = "Action", silent = true, noremap = true })
map("n", "gl", vim.diagnostic.open_float, { desc = "Open Diagnostic Float" })
map("n", "grx", vim.lsp.codelens.run, { desc = "Run Codelens Operation" })
-- Toggle Codelens
map("n", "<leader>tc", function()
vim.g.codelens_enabled = not vim.g.codelens_enabled
vim.lsp.codelens.enable(vim.g.codelens_enabled)
end, { desc = "Toggle Code Lens" })
-- Open Signature Help
map("i", "<C-s>", function()
vim.lsp.buf.signature_help()
end, { desc = "Show signature help" })
+2 -2
View File
@@ -50,12 +50,12 @@ vim.g.ui = {
linebreak = "", linebreak = "",
windowborder = "single", windowborder = "single",
popupborder = "single", popupborder = "single",
custom_highlights = function(colors, utils) custom_highlights = function(colors, _)
return { return {
whitespace = { fg = colors.overlay0 }, whitespace = { fg = colors.overlay0 },
TrailingWhitespace = { fg = colors.red }, TrailingWhitespace = { fg = colors.red },
LineNr = { fg = colors.overlay0 }, LineNr = { fg = colors.overlay0 },
CursorLineNR = { fg = colors.peach }, CursorLineNr = { fg = colors.peach },
} }
end, end,
symbols = { symbols = {
+7 -2
View File
@@ -167,7 +167,7 @@ local function show_lsp_details()
table.insert(lines, "") table.insert(lines, "")
table.insert(lines, "Health Check (vim.treesitter):") table.insert(lines, "Health Check (vim.treesitter):")
table.insert(lines, "=======================") table.insert(lines, "=======================")
local health_lines = run_healthcheck("vim.treesitter") health_lines = run_healthcheck("vim.treesitter")
for _, l in ipairs(health_lines) do for _, l in ipairs(health_lines) do
table.insert(lines, " " .. l) table.insert(lines, " " .. l)
end end
@@ -198,6 +198,11 @@ local function show_lsp_details()
end, { buffer = popup_buffer, nowait = true, desc = "Close Window" }) end, { buffer = popup_buffer, nowait = true, desc = "Close Window" })
end end
vim.keymap.set("n", "<leader>li", show_lsp_details, { vim.keymap.set("n", "<leader>xi", show_lsp_details, {
desc = "Show detailed LSP info in a float" desc = "Show detailed LSP info in a float"
}) })
vim.g.codelens_enabled = true
vim.lsp.codelens.enable(vim.g.codelens_enable)
+1
View File
@@ -32,5 +32,6 @@
require("plugins/catppuccin") require("plugins/catppuccin")
require("plugins/lualine") require("plugins/lualine")
require("plugins/trouble")
require("plugins/whichkey") require("plugins/whichkey")
+78
View File
@@ -0,0 +1,78 @@
--[[
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣷⣦⣄⡀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠚⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠗⢀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣄⡉⠓⠦⣌⡙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⢋⣡⠴⠚⢉⣠⣤⣀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⣶⣿⣿⣿⣿⣿⣷⣦⣄⡉⠓⠦⣌⡙⠻⢿⣿⣿⣿⣿⣿⣿⡿⠟⢋⣡⠴⠚⢉⣠⣴⣾⣿⣿⣿⣿⣿⣶⣤
⠀⠀⠀⠀⠀⠀⠀⠀⠐⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠓⠦⣌⡙⠻⠟⢋⣡⠴⠚⢉⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⠂
⠀⠀⠀⠀⢀⣠⣴⣆⡈⠻⢿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠃⠘⢉⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢁⣰⣦⣄⡀
⠀⠀⠐⠾⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠷⠂
⠀⢸⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⡇
⠀⢸⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⣦⣄⡉⠛⠿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⡇
⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⡆⢰⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠃⠘⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⡇⢸⣿⣿⣿⣿⠿⠛⠉
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⡇⢸⠿⠛⠉
__ _ _
/ _|___ ___| |_ __ _ ___| | __
| ||_ /____/ __| __/ _` |/ __| |/ /
| _/ /_____\__ \ || (_| | (__| <
|_|/___| |___/\__\__,_|\___|_|\_\
Neovim v0.12 configuration
(C) Frank Zechert 2026
]]
vim.pack.add({
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
{ src = "https://github.com/folke/trouble.nvim" },
})
local trouble = require("trouble")
trouble.setup({
auto_preview = true,
auto_refresh = true,
auto_jump = false,
auto_close = true,
modes = {
diagnostics = {
preview = {
type = "split",
relative = "win",
position = "right",
size = 0.4
},
},
lsp_declarations = {
preview = {
type = "split",
relative = "win",
position = "right",
size = 0.4
},
},
lsp_definitions = {
preview = {
type = "split",
relative = "win",
position = "right",
size = 0.4
},
},
lsp_references = {
preview = {
type = "split",
relative = "win",
position = "right",
size = 0.4
},
},
},
})
+8 -3
View File
@@ -36,7 +36,12 @@ vim.pack.add({
local wk = require("which-key") local wk = require("which-key")
wk.setup({}) wk.setup({
wk.add({ preset = "modern"
{ "<leader>b", group = "Buffers" }, })
wk.add({
{ "<leader>b", group = "Buffers..." },
{ "<leader>x", group = "Trouble..." },
{ "gr", group = "LSP...", mode = {"n","v"} },
{ "<leader>t", group = "Toggle..." },
}) })
+4
View File
@@ -16,6 +16,10 @@
"rev": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c", "rev": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c",
"src": "https://github.com/nvim-tree/nvim-web-devicons" "src": "https://github.com/nvim-tree/nvim-web-devicons"
}, },
"trouble.nvim": {
"rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a",
"src": "https://github.com/folke/trouble.nvim"
},
"which-key.nvim": { "which-key.nvim": {
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
"src": "https://github.com/folke/which-key.nvim" "src": "https://github.com/folke/which-key.nvim"
+2
View File
@@ -1,4 +1,6 @@
git git
make
unzip
tree-sitter-cli tree-sitter-cli
fzf fzf
ripgrep ripgrep