function map(mode, shortcut, command) vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true }) end function nmap(shortcut, command) map('n', shortcut, command) end function imap(shortcut, command) map('i', shortcut, command) end vim.g.mapleader=' ' -- Misc imap('jk','') nmap('a', ':Ack!') nmap('sr', ':SnipRun') -- 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') -- Gitsigns nmap('[g', 'Gitsigns prev_hunk') nmap(']g', 'Gitsigns next_hunk')