summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/core/dashboard.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/core/dashboard.lua')
-rw-r--r--.config/nvim/lua/core/dashboard.lua24
1 files changed, 15 insertions, 9 deletions
diff --git a/.config/nvim/lua/core/dashboard.lua b/.config/nvim/lua/core/dashboard.lua
index 70e862e..8df581e 100644
--- a/.config/nvim/lua/core/dashboard.lua
+++ b/.config/nvim/lua/core/dashboard.lua
@@ -1,5 +1,5 @@
local M = {}
-local home_dir = vim.loop.os_homedir()
+local utils = require "utils"
M.config = function(config)
options.builtin.dashboard = {
@@ -7,7 +7,7 @@ M.config = function(config)
on_config_done = nil,
search_handler = "telescope",
disable_at_vim_enter = 0,
- session_directory = home_dir .. "/.cache/options/sessions",
+ session_directory = utils.join_paths(get_cache_dir(), "sessions"),
custom_header = {
" ##############..... ############## ",
" ##############......############## ",
@@ -67,15 +67,21 @@ M.setup = function()
vim.g.dashboard_session_directory = options.builtin.dashboard.session_directory
- vim.cmd "let packages = len(globpath('~/.local/share/lunarvim/site/pack/packer/start', '*', 0, 1))"
-
- vim.api.nvim_exec(
- [[
- let g:dashboard_custom_footer = ['LunarVim loaded '..packages..' plugins  ']
-]],
- false
+ local num_plugins_loaded = #vim.fn.globpath(
+ get_runtime_dir() .. "/site/pack/packer/start",
+ "*",
+ 0,
+ 1
)
+ local footer = {
+ "nvim loaded " .. num_plugins_loaded .. " plugins ",
+ "",
+ }
+
+ local text = require "interface.text"
+ vim.g.dashboard_custom_footer = text.align_center({ width = 0 }, footer, 0.49) -- Use 0.49 as  counts for 2 characters
+
require("core.autocmds").define_augroups {
_dashboard = {
-- seems to be nobuflisted that makes my stuff disappear will do more testing