diff options
author | tamton-aquib <[email protected]> | 2021-10-06 18:55:51 +0530 |
---|---|---|
committer | tamton-aquib <[email protected]> | 2021-10-06 18:56:42 +0530 |
commit | df57521572afd04e31b016a17c9328e0be4b61e6 (patch) | |
tree | 2b4fbba3fc2d9bfd4b414cae3bb442905c7821bf /lua/startup/utils.lua | |
parent | 5f791209522895abd0ee9f951f8b8f4f2e8502b3 (diff) |
structural changes
Diffstat (limited to 'lua/startup/utils.lua')
-rw-r--r-- | lua/startup/utils.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lua/startup/utils.lua b/lua/startup/utils.lua new file mode 100644 index 0000000..8498b1f --- /dev/null +++ b/lua/startup/utils.lua @@ -0,0 +1,31 @@ +U = {} +local colors = require("startup.config").colors + +function U.spaces(amount) + return string.rep(" ", amount) +end + +function U.longest_line(lines) + local longest = 0 + for _, line in ipairs(lines) do + if line:len() > longest then + longest = line:len() + end + end + return longest +end + +function U.create_hls() + vim.cmd( "hi StartupHeading guifg=" .. colors.heading_fg) + vim.cmd( "hi StartupTools guifg=" .. colors.tools_fg) +end + +function U.set_buf_options() + vim.api.nvim_buf_set_option(0, "bufhidden", "wipe") + vim.api.nvim_buf_set_option(0, "buftype", "nofile") + vim.api.nvim_buf_set_option(0, "filetype", "dashboard") + vim.api.nvim_buf_set_option(0, "swapfile", false) + vim.cmd [[setlocal nonu nornu]] +end + +return U |