Skip to content

Instantly share code, notes, and snippets.

View juru1234's full-sized avatar

Julian Ruess juru1234

  • IBM
  • Böblingen, Germany
  • 07:56 (UTC +01:00)
View GitHub Profile
@juru1234
juru1234 / builtin-compl.lua
Created November 23, 2024 22:25 — forked from MariaSolOs/builtin-compl.lua
Built-in completion + snippet Neovim setup
---Utility for keymap creation.
---@param lhs string
---@param rhs string|function
---@param opts string|table
---@param mode? string|string[]
local function keymap(lhs, rhs, opts, mode)
opts = type(opts) == 'string' and { desc = opts }
or vim.tbl_extend('error', opts --[[@as table]], { buffer = bufnr })
mode = mode or 'n'
vim.keymap.set(mode, lhs, rhs, opts)