dotfiles/home/.config/nvim/lua/keybinds.lua

17 lines
508 B
Lua
Raw Normal View History

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)
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})