local function map(mode, shortcut, command) vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true }) end local function nmap(shortcut, command) map('n', shortcut, command) end local function imap(shortcut, command) map('i', shortcut, command) end vim.g.mapleader = ' ' -- Misc imap('jk', '') nmap('hq', 'Gitsigns setqflist all') nmap('gl', 'Git pull') nmap('gp', 'Git push') nmap('cc', 'Git commit') -- Telescope nmap(';', 'Telescope builtin') nmap('ff', 'Telescope find_files') nmap('fp', 'Telescope projects') nmap('fa', 'Telescope aerial') nmap('fd', 'Telescope lsp_document_symbols') nmap('fe', 'Telescope diagnostics') nmap('ft', 'Telescope treesitter') nmap('fz', 'Telescope current_buffer_fuzzy_find') -- Hop nmap('hl', 'HopLine') nmap('hw', 'HopWord') -- Nvim-tree nmap('n', 'NvimTreeToggle') nmap('s', 'SidebarNvimToggle') -- Trouble nmap('xx', 'TroubleToggle') nmap('xw', 'TroubleToggle workspace_diagnostics') nmap('xd', 'TroubleToggle document_diagnostics') nmap('xq', 'TroubleToggle quickfix') nmap('xl', 'TroubleToggle loclist')