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 function vmap(shortcut, command) map('v', shortcut, command) end function xmap(shortcut, command) map('x', shortcut, command) end nmap("","") nmap("", ":noh") nmap("",":ToggleTerm direction=float") imap("",":ToggleTerm direction=float") nmap("",":ToggleTerm direction=horizontal size=10") imap("",":ToggleTerm direction=horizontal size=10") xmap("p",'\"_dP') nmap("fg", "lua require('telescope.builtin').live_grep()") nmap("fb", "lua require('telescope.builtin').buffers()") nmap("fh", "lua require('telescope.builtin').help_tags()") nmap("ff", "lua require('telescope.builtin').find_files()") nmap("b","lua require('telescope.builtin').buffers()") nmap("",":NvimTreeToggle") nmap("r",":NvimTreeRefresh") nmap("n",":NvimTreeToggle") nmap("zn","zf%") nmap("y",'\"+y') vmap("y",'\"+y')