-- https://github.com/arnvald/viml-to-lua/blob/main/lua/mappings.lua vim.cmd('noremap :noh:call clearmatches()') -- clear matches Ctrl+b 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 cmap(shortcut, command) map('c', shortcut, command) end function tmap(shortcut, command) map('t', shortcut, command) end -- PLUGINS -- Find files using Telescope command-line sugar. nmap("", "Telescope find_files") nmap("f", "Telescope live_grep") nmap("bb", "Telescope buffers") nmap("hh", "Telescope help_tags") -- LSP nmap('K', 'Lspsaga hover_doc') imap('', 'Lspsaga hover_doc') nmap('gh', 'Lspsaga lsp_finder') nmap('', 'Lspsaga show_line_diagnostics')