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('g', ':G') -- 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('fgr', 'Telescope live_grep') nmap('fgf', 'Telescope git_files') nmap('fgs', 'Telescope git_status') nmap('fgb', 'Telescope git_branches') -- 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')