blob: 1e285c2feb7ee377775479a1bcd5efb71a10d791 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
-- Provides convienent lua methods for binding keys
-- Source: Primeagen
local M = {}
local function bind(op, outer_opts)
outer_opts = outer_opts or {noremap = true}
return function(lhs, rhs, opts)
opts = vim.tbl_extend("force",
outer_opts,
opts or {}
)
vim.keymap.set(op, lhs, rhs, opts)
end
end
M.nmap = bind("n", {noremap = false})
M.nnoremap = bind("n")
M.vnoremap = bind("v")
M.xnoremap = bind("x")
M.inoremap = bind("i")
M.nnoremap("gf", function() vim.cmd([[:e <cfile>]]) end)
M.nnoremap("<Leader>qf", function() vim.cmd(':cope') end)
M.nnoremap("<leader>ef", function()
vim.cmd('Vexplore')
end)
return M
|