Skip to content

Instantly share code, notes, and snippets.

View MariaSolOs's full-sized avatar
👩‍💻
Only pragmatic programmers will get it.

Maria José Solano MariaSolOs

👩‍💻
Only pragmatic programmers will get it.
View GitHub Profile
@MariaSolOs
MariaSolOs / builtin-compl.lua
Last active June 26, 2024 08:42
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)