diff options
author | chaesngmin <[email protected]> | 2021-09-17 04:13:52 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-17 04:13:52 -0700 |
commit | 254ab2102b5f8f6187321a545998ead4c3abd27a (patch) | |
tree | 8f329f66cc4d62c6964d3925bbb40f0988f351d3 /lua/core/dashboard.lua | |
parent | eab0369ae8688b23946a8a9e6dab6061ec0c554a (diff) |
[Feature] Add lunarvim latest release tag to dashboard (#1436)
* feat: add lunarvim latest release tag to dashboard
* Add a function to center-align text
Rename align to align_left
Rename shift_left to shift_right
* refactor(dashboard): remove unnecessary comment
* refactor(dashboard): use `home_dir` variable for `lv_path`
* refactor(dashboard): use $LUNARVIM_RUNTIME_DIR for lv_path
* feat(bootstrap): add fn that returns lvim version
* refactor(dashboard): use version, lunarvim dir with bootstrap fns
* build: add global get_version() from bootstrap
Co-authored-by: Luc Sinet <[email protected]>
Diffstat (limited to 'lua/core/dashboard.lua')
-rw-r--r-- | lua/core/dashboard.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lua/core/dashboard.lua b/lua/core/dashboard.lua index 0ade4657..44c4e38c 100644 --- a/lua/core/dashboard.lua +++ b/lua/core/dashboard.lua @@ -69,7 +69,18 @@ M.setup = function() vim.g.dashboard_session_directory = lvim.builtin.dashboard.session_directory - vim.g.dashboard_custom_footer = lvim.builtin.dashboard.footer + local lvim_site = "lunarvim.org" + local lvim_version = get_version "short" + local num_plugins_loaded = #vim.fn.globpath(get_runtime_dir() .. "/site/pack/packer/start", "*", 0, 1) + + local text = require "interface.text" + vim.g.dashboard_custom_footer = text.align_center({ width = 0 }, { + "LunarVim loaded " .. num_plugins_loaded .. " plugins ", + "", + "v" .. lvim_version, + "", + lvim_site, + }, 0.49) -- Use 0.49 as  counts for 2 characters require("core.autocmds").define_augroups { _dashboard = { |