further fixes and mods. still not really done yet

This commit is contained in:
Adam Poniatowski 2025-04-29 17:45:34 +02:00
parent 6f352e7c11
commit 2e0d6e1637
No known key found for this signature in database
GPG Key ID: E08510DAEC63C586
9 changed files with 112 additions and 68 deletions

View File

@ -1,3 +1,4 @@
---@diagnostic disable: undefined-global
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)

View File

@ -59,6 +59,12 @@ vim.opt.list = true
-- Use a vertical bar for tabs so ibl and listchars both show vertical guides
vim.opt.listchars = { tab = '', trail = '·', nbsp = '' }
-- Set tab size and convert tabs to spaces
vim.opt.tabstop = 2 -- Number of visual spaces per TAB
vim.opt.shiftwidth = 2 -- Number of spaces to use for each step of (auto)indent
vim.opt.softtabstop = 2 -- Number of spaces that a <Tab> counts for while performing editing operations
vim.opt.expandtab = true -- Use spaces instead of tabs
-- Preview substitutions live, as you type!
vim.opt.inccommand = 'split'

View File

@ -1,3 +1,4 @@
---@diagnostic disable: undefined-global
return { -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is.

View File

@ -1,3 +1,4 @@
---@diagnostic disable: undefined-global
-- Database explorer and query runner
return {
'tpope/vim-dadbod',

View File

@ -1,3 +1,4 @@
---@diagnostic disable: undefined-global
local plugins = {}
local plugin_files = vim.fn.globpath(vim.fn.stdpath('config') .. '/lua/plugins', '*.lua', false, true)

View File

@ -1,3 +1,4 @@
---@diagnostic disable: undefined-global
-- Quick navigation plugin
return {
'ggandor/leap.nvim',

View File

@ -1,3 +1,4 @@
---@diagnostic disable: undefined-global
return {
'echasnovski/mini.sessions',
version = '*',

View File

@ -1,3 +1,4 @@
---@diagnostic disable: undefined-global
-- Import all configurations
local core = require("plugins.snacks.core")
local display = require("plugins.snacks.display")
@ -27,7 +28,6 @@ return {
"MunifTanjim/nui.nvim",
"echasnovski/mini.nvim",
},
---@type snacks.Config
opts = merge_tables(
core,
display,
@ -44,6 +44,6 @@ return {
end,
init = function()
-- Make snacks available globally for debugging
_G.Snacks = require("plugins.snacks")
_G.Snacks = require("plugins.snacks.init")
end,
}

View File

@ -6,73 +6,105 @@ return { -- Useful plugin to show you pending keybinds.
icons = {
mappings = vim.g.have_nerd_font,
keys = vim.g.have_nerd_font and {} or {
Up = '<Up> ', Down = '<Down> ', Left = '<Left> ', Right = '<Right> ',
C = '<C-…> ', M = '<M-…> ', D = '<D-…> ', S = '<S-…> ',
CR = '<CR> ', Esc = '<Esc> ', ScrollWheelDown = '<ScrollWheelDown> ',
ScrollWheelUp = '<ScrollWheelUp> ', NL = '<NL> ', BS = '<BS> ',
Space = '<Space> ', Tab = '<Tab> ', F1 = '<F1>', F2 = '<F2>',
F3 = '<F3>', F4 = '<F4>', F5 = '<F5>', F6 = '<F6>',
F7 = '<F7>', F8 = '<F8>', F9 = '<F9>', F10 = '<F10>',
F11 = '<F11>', F12 = '<F12>',
Up = '<Up> ',
Down = '<Down> ',
Left = '<Left> ',
Right = '<Right> ',
C = '<C-…> ',
M = '<M-…> ',
D = '<D-…> ',
S = '<S-…> ',
CR = '<CR> ',
Esc = '<Esc> ',
ScrollWheelDown = '<ScrollWheelDown> ',
ScrollWheelUp = '<ScrollWheelUp> ',
NL = '<NL> ',
BS = '<BS> ',
Space = '<Space> ',
Tab = '<Tab> ',
F1 = '<F1>',
F2 = '<F2>',
F3 = '<F3>',
F4 = '<F4>',
F5 = '<F5>',
F6 = '<F6>',
F7 = '<F7>',
F8 = '<F8>',
F9 = '<F9>',
F10 = '<F10>',
F11 = '<F11>',
F12 = '<F12>',
},
},
-- Document existing key chains
spec = {
{ '<leader>c', group = '[C]ode', desc = {
a = 'Code [A]ction',
f = '[F]ormat buffer',
}},
{ '<leader>d', group = '[D]ocument', desc = {
x = 'Document [D]iagnostics',
s = 'Document [S]ymbols',
[''] = 'Show diagnostic under cursor',
}},
{ '<leader>s', group = '[S]earch', desc = {
h = '[H]elp',
k = '[K]eymaps',
f = '[F]iles',
s = '[S]elect Telescope',
w = 'Current [W]ord',
g = '[G]rep',
d = '[D]iagnostics',
r = '[R]esume last search',
['/'] = 'Search in open files',
n = '[N]eovim config files',
}},
{ '<leader>l', group = '[L]SP/Language' },
{ '<leader>m', group = '[M]emory/Sessions' },
{ '<leader>D', group = '[D]atabase' },
{ '<leader>t', group = '[T]oggle', desc = {
h = 'Toggle inlay [H]ints',
}},
{ '<leader>w', group = '[W]orkspace', desc = {
s = '[S]ymbols',
}},
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
{ '<leader>g', group = '[G]it', desc = {
s = 'Status',
}},
{ '<leader>f', group = '[F]ile Explorer', desc = {
e = 'Toggle explorer',
f = 'Focus explorer',
}},
{ '<leader>n', group = '[N]otifications', desc = {
n = 'Toggle notifications',
h = 'Notification [H]istory',
c = '[C]lear notifications',
}},
{ '<leader>p', group = 'Debug/[P]rofile', desc = {
b = 'Toggle [B]reakpoint',
c = '[C]ontinue debugging',
n = 'Step over ([N]ext)',
i = 'Step [I]nto',
o = 'Step [O]ut',
r = 'Open [R]EPL',
l = 'Run [L]ast debug session',
x = 'Toggle debug UI',
}},
{ '<leader>b', group = '[B]uffer', desc = {
p = '[P]revious',
n = '[N]ext',
d = '[D]elete',
D = 'Force [D]elete',
}},
{ '<leader>q', desc = 'Open diagnostic [Q]uickfix list' },
{ '<leader>e', desc = 'Toggle file [E]xplorer' },
{ '<leader>o', desc = 'F[o]cus file explorer' },
{ '<leader>x', desc = 'Close buffer' },
{ '<leader>X', desc = 'Force close buffer' },
{ '<leader>/', desc = 'Search in current buffer' },
{ '<leader><leader>', desc = 'Find buffers' },
},
},
config = function(_, opts)
local wk = require('which-key')
wk.setup(opts)
wk.add({
{ "<leader>/", desc = "Search in current buffer" },
{ "<leader><leader>", desc = "Find buffers" },
{ "<leader>X", desc = "Force close buffer" },
{ "<leader>b", group = "[B]uffer" },
{ "<leader>bD", desc = "Force [D]elete" },
{ "<leader>bd", desc = "Delete buffer" },
{ "<leader>bn", desc = "Next buffer" },
{ "<leader>bp", desc = "Previous buffer" },
{ "<leader>c", group = "[C]ode" },
{ "<leader>ca", desc = "Code Action" },
{ "<leader>cf", desc = "Format buffer" },
{ "<leader>d", desc = "Show diagnostic under cursor" },
{ "<leader>ds", desc = "Document symbols" },
{ "<leader>dx", desc = "Document diagnostics" },
{ "<leader>e", desc = "Toggle file explorer" },
{ "<leader>f", group = "[F]ile Explorer" },
{ "<leader>fe", desc = "Toggle explorer" },
{ "<leader>ff", desc = "Focus explorer" },
{ "<leader>g", group = "[G]it" },
{ "<leader>gs", desc = "Status" },
{ "<leader>h", group = "Git [H]unk" },
{ "<leader>n", group = "[N]otifications" },
{ "<leader>nc", desc = "Clear notifications" },
{ "<leader>nh", desc = "Notification history" },
{ "<leader>nn", desc = "Toggle notifications" },
{ "<leader>o", desc = "Focus file explorer" },
{ "<leader>p", group = "Debug/[P]rofile" },
{ "<leader>pb", desc = "Toggle breakpoint" },
{ "<leader>pc", desc = "Continue debugging" },
{ "<leader>pi", desc = "Step into" },
{ "<leader>pl", desc = "Run last debug session" },
{ "<leader>pn", desc = "Step over" },
{ "<leader>po", desc = "Step out" },
{ "<leader>pr", desc = "Open REPL" },
{ "<leader>px", desc = "Toggle debug UI" },
{ "<leader>q", desc = "Open diagnostic quickfix list" },
{ "<leader>s", group = "[S]earch" },
{ "<leader>s/", desc = "Search in open files" },
{ "<leader>sd", desc = "Diagnostics" },
{ "<leader>sf", desc = "Files" },
{ "<leader>sg", desc = "Grep" },
{ "<leader>sh", desc = "Help" },
{ "<leader>sk", desc = "Keymaps" },
{ "<leader>sn", desc = "Neovim config files" },
{ "<leader>sr", desc = "Resume last search" },
{ "<leader>ss", desc = "Select Telescope" },
{ "<leader>sw", desc = "Current word" },
{ "<leader>t", group = "[T]oggle" },
{ "<leader>th", desc = "Toggle inlay hints" },
{ "<leader>w", group = "[W]orkspace" },
{ "<leader>ws", desc = "Symbols" },
{ "<leader>x", desc = "Close buffer" },
})
end,
}