2022-11-01 15:15:15 +00:00
|
|
|
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','<Esc>')
|
|
|
|
nmap('<leader>a', ':Ack!<Space>')
|
|
|
|
nmap('<leader>sr', ':SnipRun<cr>')
|
2022-11-01 16:22:40 +00:00
|
|
|
nmap('<leader>g', ':G<cr>')
|
2022-11-01 15:15:15 +00:00
|
|
|
|
|
|
|
-- Telescope
|
|
|
|
nmap('<leader>;', '<cmd>Telescope builtin<cr>')
|
|
|
|
nmap('<leader>ff', '<cmd>Telescope find_files<cr>')
|
|
|
|
nmap('<leader>fr', '<cmd>Telescope resume<cr>')
|
|
|
|
nmap('<leader>fb', '<cmd>Telescope buffers<cr>')
|
|
|
|
nmap('<leader>fh', '<cmd>Telescope help_tags<cr>')
|
|
|
|
nmap('<leader>fk', '<cmd>Telescope aerial<cr>')
|
|
|
|
nmap('<leader>fd', '<cmd>Telescope lsp_document_symbols<cr>')
|
|
|
|
nmap('<leader>fe', '<cmd>Telescope diagnostics<cr>')
|
|
|
|
nmap('<leader>fn', '<cmd>Telescope notify<cr>')
|
|
|
|
nmap('<leader>ft', '<cmd>Telescope treesitter<cr>')
|
|
|
|
nmap('<leader>fz', '<cmd>Telescope current_buffer_fuzzy_find<cr>')
|
|
|
|
nmap('<leader>fgr', '<cmd>Telescope live_grep<cr>')
|
|
|
|
nmap('<leader>fgf', '<cmd>Telescope git_files<cr>')
|
|
|
|
nmap('<leader>fgs', '<cmd>Telescope git_status<cr>')
|
|
|
|
nmap('<leader>fgb', '<cmd>Telescope git_branches<cr>')
|
|
|
|
|
|
|
|
-- Hop
|
|
|
|
nmap('<leader>hl', '<cmd>HopLine<cr>')
|
|
|
|
nmap('<leader>hw', '<cmd>HopWord<cr>')
|
|
|
|
|
|
|
|
-- Nvim-tree
|
|
|
|
nmap('<leader>nt', '<cmd>NvimTreeToggle<cr>')
|
|
|
|
nmap('<leader>nf', '<cmd>NvimTreeFindFile<cr>')
|