diff options
| author | Chris <[email protected]> | 2021-07-28 17:24:05 -0400 | 
|---|---|---|
| committer | Chris <[email protected]> | 2021-07-28 17:24:05 -0400 | 
| commit | 2e3a07480f85b11d371731c34b43dbe797944ab9 (patch) | |
| tree | c52d07d4051ba595f0428a7972d85ccb983fcc73 /lua/utils | |
| parent | 15eaebff928d8d14207aba57cd23962944008237 (diff) | |
move istable and isstring to utils
Diffstat (limited to 'lua/utils')
| -rw-r--r-- | lua/utils/init.lua | 18 | 
1 files changed, 18 insertions, 0 deletions
diff --git a/lua/utils/init.lua b/lua/utils/init.lua index 94058487..fe1e09aa 100644 --- a/lua/utils/init.lua +++ b/lua/utils/init.lua @@ -102,6 +102,24 @@ function utils.check_lsp_client_active(name)    return false  end +function utils.is_table(t) +  return type(t) == "table" +end + +function utils.is_string(t) +  return type(t) == "string" +end + +function utils.has_value(tab, val) +  for _, value in ipairs(tab) do +    if value == val then +      return true +    end +  end + +  return false +end +  function utils.add_keymap(mode, opts, keymaps)    for _, keymap in ipairs(keymaps) do      vim.api.nvim_set_keymap(mode, keymap[1], keymap[2], opts)  | 
