Add new config for neovim
This commit is contained in:
21
config/nvim/lua/user/utils.lua
Normal file
21
config/nvim/lua/user/utils.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
local M = {}
|
||||
|
||||
local function map(mode, shortcut, command)
|
||||
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
|
||||
end
|
||||
|
||||
M.nmap = function(shortcut, command)
|
||||
map("n", shortcut, command)
|
||||
end
|
||||
|
||||
M.list_includes_item = function(list, item)
|
||||
for _, value in pairs(list) do
|
||||
if value == item then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user