From 8eed75d67f9cbcefb91c4cb5aac0ffd013be25cc Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:28:15 +0200 Subject: refactor: use more flexible paths (#1381) --- lua/core/dashboard.lua | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'lua/core/dashboard.lua') diff --git a/lua/core/dashboard.lua b/lua/core/dashboard.lua index a613921f..aa2a7f35 100644 --- a/lua/core/dashboard.lua +++ b/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) lvim.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/lvim/sessions", + session_directory = utils.join_paths(get_cache_dir(), "sessions"), custom_header = { "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣶⣾⠿⠿⠟⠛⠛⠛⠛⠿⠿⣿⣷⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", @@ -69,15 +69,6 @@ M.setup = function() vim.g.dashboard_session_directory = lvim.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 - ) - require("core.autocmds").define_augroups { _dashboard = { -- seems to be nobuflisted that makes my stuff disappear will do more testing -- cgit v1.2.3 From d610502f91ba08c9afc6557d892f93bae2bdab13 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Thu, 16 Sep 2021 10:15:30 -0400 Subject: fix: dashboard footer seems to have disapeared --- lua/core/dashboard.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lua/core/dashboard.lua') diff --git a/lua/core/dashboard.lua b/lua/core/dashboard.lua index aa2a7f35..0ade4657 100644 --- a/lua/core/dashboard.lua +++ b/lua/core/dashboard.lua @@ -69,6 +69,8 @@ M.setup = function() vim.g.dashboard_session_directory = lvim.builtin.dashboard.session_directory + vim.g.dashboard_custom_footer = lvim.builtin.dashboard.footer + require("core.autocmds").define_augroups { _dashboard = { -- seems to be nobuflisted that makes my stuff disappear will do more testing -- cgit v1.2.3 From 254ab2102b5f8f6187321a545998ead4c3abd27a Mon Sep 17 00:00:00 2001 From: chaesngmin Date: Fri, 17 Sep 2021 04:13:52 -0700 Subject: [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 --- lua/core/dashboard.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lua/core/dashboard.lua') 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 = { -- cgit v1.2.3 From 390f277b702fe7877f0d5fabbece230528b58cb1 Mon Sep 17 00:00:00 2001 From: chaesngmin Date: Fri, 17 Sep 2021 05:14:31 -0700 Subject: fix(dashboard): hide version when no tag found (#1572) --- lua/core/dashboard.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lua/core/dashboard.lua') diff --git a/lua/core/dashboard.lua b/lua/core/dashboard.lua index 44c4e38c..505350cb 100644 --- a/lua/core/dashboard.lua +++ b/lua/core/dashboard.lua @@ -73,14 +73,19 @@ M.setup = function() 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 }, { + local footer = { "LunarVim loaded " .. num_plugins_loaded .. " plugins ", "", - "v" .. lvim_version, - "", lvim_site, - }, 0.49) -- Use 0.49 as  counts for 2 characters + } + + if lvim_version then + table.insert(footer, 2, "") + table.insert(footer, 3, "v" .. lvim_version) + end + + 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 = { -- cgit v1.2.3