Add 'old-conf/' from commit '62a64a79a8'
git-subtree-dir: old-conf git-subtree-mainline:4667974392git-subtree-split:62a64a79a8
This commit is contained in:
commit
83de52d5db
195 changed files with 13408 additions and 0 deletions
21
old-conf/hm-modules/nvim/config/lua/utils.lua
Normal file
21
old-conf/hm-modules/nvim/config/lua/utils.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
-- cool map funciton from https://vonheikemen.github.io/devlog/tools/configuring-neovim-using-lua/
|
||||
utils = {}
|
||||
utils.map = function(key)
|
||||
-- get the extra options
|
||||
local opts = {noremap = false}
|
||||
for i, v in pairs(key) do
|
||||
if (i) == 'string' then opts[i] = v end
|
||||
end
|
||||
|
||||
-- basic support for buffer-scoped keybindings
|
||||
local buffer = opts.buffer
|
||||
opts.buffer = nil
|
||||
|
||||
if buffer then
|
||||
vim.api.nvim_buf_set_keymap(0, key[1], key[2], key[3], opts)
|
||||
else
|
||||
vim.api.nvim_set_keymap(key[1], key[2], key[3], opts)
|
||||
end
|
||||
end
|
||||
|
||||
return utils
|
||||
Loading…
Add table
Add a link
Reference in a new issue