summaryrefslogtreecommitdiff
path: root/neovim/lua/vimrc/utils.lua
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2022-11-28 20:35:27 +0100
committerMike Vink <mike1994vink@gmail.com>2022-11-28 20:35:27 +0100
commit20f9f6f51b3cb17c8ad202b9fc1ea3a1f62eefdb (patch)
tree4ba278b6d0fa522878fd57ed60ff545f38080f57 /neovim/lua/vimrc/utils.lua
parent9c198c6dbc818710c5206fd812a25510e43e221a (diff)
move out neovim
Diffstat (limited to 'neovim/lua/vimrc/utils.lua')
-rw-r--r--neovim/lua/vimrc/utils.lua70
1 files changed, 0 insertions, 70 deletions
diff --git a/neovim/lua/vimrc/utils.lua b/neovim/lua/vimrc/utils.lua
deleted file mode 100644
index 386efd2..0000000
--- a/neovim/lua/vimrc/utils.lua
+++ /dev/null
@@ -1,70 +0,0 @@
-local vim = vim
-local cmd = vim.cmd
-local M = {}
-
--- paths {{{
--- }}}
---
--- logging {{{
-function M.log_error(msg, source, persist)
- if source then
- msg = "[" .. source .. "] " .. msg
- end
- cmd [[echohl ErrorMsg]]
- if persist then
- cmd("echomsg '" .. msg .. "'")
- else
- cmd("echo '" .. msg .. "'")
- end
- cmd [[echohl Normal]]
-end
-
-function M.log_warning(msg, source, persist)
- if source then
- msg = "[" .. source .. "]" .. msg
- end
- msg = string.gsub(msg, "'", '"')
- cmd [[echohl WarningMsg]]
- if persist then
- cmd("echomsg '" .. msg .. "'")
- else
- cmd("echo '" .. msg .. "'")
- end
- cmd [[echohl Normal]]
-end
--- }}}
-
--- tables {{{
-function table.filter()
- print"hi"
-end
-
-function table.keys(tbl)
- local k = {}
- for key, val in pairs(tbl) do
- table.insert(k, key)
- end
- return k
-end
-
--- }}}
-
--- string {{{
-function string.join(str, join_token)
- local j = ""
- local join = join_token or ""
- if #str == 1 then
- return str[1]
- end
- for i, token in ipairs(str) do
- if i > 1 then
- j = j .. join .. token
- else
- j = j .. token
- end
- end
- return j
-end
--- }}}
-return M
--- vim: fdm=marker