47 lines
1.5 KiB
Lua
47 lines
1.5 KiB
Lua
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>')
|
|
|
|
-- 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>')
|
|
|
|
-- Gitsigns
|
|
nmap('[g', '<cmd>Gitsigns prev_hunk<cr>')
|
|
nmap(']g', '<cmd>Gitsigns next_hunk<cr>')
|