mirror of
https://github.com/neovim/neovim.git
synced 2024-12-21 19:55:04 -07:00
6d41f65aa4
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 }) ``` |
||
---|---|---|
.. | ||
check_urls.vim | ||
check-includes.py | ||
download-unicode-files.sh | ||
gen_filetype.lua | ||
gen_help_html.py | ||
gen_vimdoc.py | ||
genappimage.sh | ||
genvimvim.lua | ||
git-log-pretty-since.sh | ||
legacy2luatest.pl | ||
lintcommit.lua | ||
lua2dox_filter | ||
lua2dox.lua | ||
movedocs.pl | ||
pvscheck.sh | ||
release.sh | ||
shadacat.py | ||
stripdecls.py | ||
update_terminfo.sh | ||
update_version_stamp.lua | ||
vim-patch.sh | ||
vimpatch.lua | ||
windows.ti |