2021-01-30 23:58:52 +02:00
|
|
|
local function map(mode, lhs, rhs, opts)
|
|
|
|
local options = {noremap = true}
|
|
|
|
if opts then options = vim.tbl_extend('force', options, opts) end
|
|
|
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
2020-12-14 19:11:20 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Open/close nerdtree
|
|
|
|
map('n', '<C-t>', '<cmd>NERDTreeToggle<CR>')
|
|
|
|
|
|
|
|
-- FZF
|
|
|
|
map('n', '<C-f>', '<cmd>Files<CR>')
|
|
|
|
map('n', '<C-g>', '<cmd>Rg<CR>')
|
2021-01-30 22:52:22 +02:00
|
|
|
|
|
|
|
-- Completion
|
2021-01-30 23:58:52 +02:00
|
|
|
map('i', '<S-Tab>', 'pumvisible() ? "\\<C-p>" : "\\<Tab>"', {expr = true})
|
|
|
|
map('i', '<Tab>', 'pumvisible() ? "\\<C-n>" : "\\<Tab>"', {expr = true})
|