Advertisement
voyeg3r

map helper function for neovim

Jul 28th, 2022
1,348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. -- map helper function
  2. local function map(mode, lhs, rhs, opts)
  3.     local options = { noremap = true, silent = true }
  4.     if opts then
  5.         if opts.desc then
  6.             opts.desc = "keymaps.lua: " .. opts.desc
  7.         end
  8.         options = vim.tbl_extend('force', options, opts)
  9.     end
  10.     vim.keymap.set(mode, lhs, rhs, options)
  11. end
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement