aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
diff options
context:
space:
mode:
authorshadmansaleh <13149513+shadmansaleh@users.noreply.github.com>2021-12-30 13:30:49 +0600
committershadmansaleh <13149513+shadmansaleh@users.noreply.github.com>2022-01-04 22:31:59 +0600
commit6d41f65aa45f10a93ad476db01413abaac21f27d (patch)
treee83abc5fb3f7f878c02c1628bef0c1e1775bbc11 /src/nvim/lua/executor.c
parent3fd454bd4a6ceb1989d15cf2d3d5e11d7a253b2d (diff)
downloadrneovim-6d41f65aa45f10a93ad476db01413abaac21f27d.tar.gz
rneovim-6d41f65aa45f10a93ad476db01413abaac21f27d.tar.bz2
rneovim-6d41f65aa45f10a93ad476db01413abaac21f27d.zip
feat(lua): add vim.keymap
This introduces two new functions `vim.keymap.set` & `vim.keymap.del` differences compared to regular set_keymap: - remap is used as opposite of noremap. By default it's true for <Plug> keymaps and false for others. - rhs can be lua function. - mode can be a list of modes. - replace_keycodes option for lua function expr maps. (Default: true) - handles buffer specific keymaps Examples: ```lua vim.keymap.set('n', 'asdf', function() print("real lua function") end) vim.keymap.set({'n', 'v'}, '<leader>lr', vim.lsp.buf.references, {buffer=true}) vim.keymap.set('n', '<leader>w', "<cmd>w<cr>", {silent = true, buffer = 5 }) vim.keymap.set('i', '<Tab>', function() return vim.fn.pumvisible() == 1 and "<C-n>" or "<Tab>" end, {expr = true}) vim.keymap.set('n', '[%', '<Plug>(MatchitNormalMultiBackward)') vim.keymap.del('n', 'asdf') vim.keymap.del({'n', 'i', 'v'}, '<leader>w', {buffer = 5 }) ```
Diffstat (limited to 'src/nvim/lua/executor.c')
0 files changed, 0 insertions, 0 deletions