local opts = { noremap = true, silent = true } local map = vim.keymap.set local nmap = function(from, to) map('n', from, to, opts) end local cmd = function(content) return '' .. content .. '' end -- terminal map('t', '', '', opts) nmap('tm', ':belowright 7sp:termA') -- off search highlight when escape is pressed nmap('', ':noh') -- telescope nmap('ff', cmd('Telescope find_files')) nmap('fg', cmd('Telescope live_grep')) nmap('fb', cmd('Telescope buffers')) nmap('fh', cmd('Telescope help_tags')) -- explorer nmap('e', cmd('Neotree toggle')) -- lsp (universal) nmap('E', vim.diagnostic.open_float) nmap('[d', vim.diagnostic.goto_prev) nmap(']d', vim.diagnostic.goto_next) nmap('q', vim.diagnostic.setloclist)