refactor(neovim): switch to new vim.keymap.set API

This commit is contained in:
Felix Schröter 2022-05-03 20:40:33 +02:00
parent c95fe27950
commit 050586cfa3
Signed by: felschr
GPG key ID: 671E39E6744C807D
5 changed files with 32 additions and 43 deletions

View file

@ -1,11 +1,9 @@
-- TODO vim.keymap.set not yet supported on stable neovim
-- see gitsigns repo for sample when migrating to vim.keymap.set
require("gitsigns").setup {
on_attach = function(bufnr)
local function map(mode, lhs, rhs, opts)
opts = vim.tbl_extend('force', {noremap = true, silent = true}, opts or {})
vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts)
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation