nvim-config/lua/config/mappings.lua
2026-02-24 11:55:27 +03:00

31 lines
853 B
Lua

local opts = { noremap = true, silent = true }
---Make string like ':cmd<CR>'
---@param cmd string
---@return string
local function auto(cmd)
return string.format(':%s<CR>', cmd)
end
---Make string like '<Leader>cmd'
---@param cmd string
---@return string
local function ld(cmd)
return string.format('<Leader>%s', cmd)
end
return {
n = {
{ ld('ev'), auto('vsplit $MYVIMRC'), opts },
{ ld('sv'), auto('source $MYVIMRC'), opts },
{ ld('n'), auto('Telescope find_files'), opts },
{ ld('h'), auto('Telescope help_tags'), opts },
{ ld('/'), auto('Telescope live_grep'), opts },
{ ld('t'), auto('Trouble diagnostics'), opts },
{ ld('ds'), ':GdbStart rust-gdb -q target/debug/', opts },
--{ ld('?'), function() require("which-key").show({ global = false }) end, opts },
},
i = {
{ 'jk', '<Esc>', opts },
},
}