update nvim
This commit is contained in:
parent
3338d39206
commit
786b0e0970
31 changed files with 2204 additions and 15 deletions
14
lua/phoenix/utils/keymap.lua
Normal file
14
lua/phoenix/utils/keymap.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---@param mode string Mode short-name, see |nvim_set_keymap()|. Can also be list of modes to create mapping on multiple modes.
|
||||
---@param lhs string|table Left-hand side |{lhs}| of the mapping.
|
||||
---@param rhs string|function Right-hand side |{rhs}| of the mapping, can be a Lua function.
|
||||
---@param opts table|nil Table of |:map-arguments|. Defaults to `{noremap = true, silent = true}`.
|
||||
---@see |nvim_set_keymap()|
|
||||
local keymap = function(mode, key, action, opts)
|
||||
local options = { noremap = true, silent = true }
|
||||
if opts then
|
||||
options = vim.tbl_extend('force', options, opts)
|
||||
end
|
||||
vim.keymap.set(mode, key, action, options)
|
||||
end
|
||||
|
||||
return keymap
|
||||
Loading…
Add table
Add a link
Reference in a new issue