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('sr', ':SnipRun') nmap('gf', ':Git fetch') nmap('gp', ':Git pull') nmap('gP', ':Git push') -- Telescope nmap(';', 'Telescope builtin') nmap('ff', 'Telescope find_files') nmap('fr', 'Telescope resume') nmap('fb', 'Telescope buffers') nmap('fh', 'Telescope help_tags') nmap('fk', 'Telescope aerial') nmap('fd', 'Telescope lsp_document_symbols') nmap('fe', 'Telescope diagnostics') nmap('fn', 'Telescope notify') nmap('ft', 'Telescope treesitter') nmap('fz', 'Telescope current_buffer_fuzzy_find') nmap('fg', 'Telescope live_grep') -- Hop nmap('hl', 'HopLine') nmap('hw', 'HopWord') -- Nvim-tree nmap('nt', 'NvimTreeToggle') nmap('nf', 'NvimTreeFindFile') -- Trouble nmap('tq', 'TroubleToggle quickfix') nmap('tl', 'TroubleToggle loclist') nmap('tr', 'TroubleToggle lsp_references') nmap('td', 'TroubleToggle lsp_definitions') nmap('tt', 'TroubleToggle lsp_type_definitions') nmap('ti', 'TroubleToggle lsp_implementations') nmap('tdd', 'TroubleToggle document_diagnostics') nmap('twd', 'TroubleToggle workspace_diagnostics')