From f93bad12f1b4feeeee007ceab4a350eb1aa26c1e Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 25 Aug 2021 23:27:45 +0200 Subject: Updates from lvim, remove legacy --- .config/nvim/lua/core/dashboard.lua | 39 ++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to '.config/nvim/lua/core/dashboard.lua') diff --git a/.config/nvim/lua/core/dashboard.lua b/.config/nvim/lua/core/dashboard.lua index efbb790..f9eec22 100644 --- a/.config/nvim/lua/core/dashboard.lua +++ b/.config/nvim/lua/core/dashboard.lua @@ -1,8 +1,12 @@ local M = {} -M.config = function() + +M.config = function(config) options.builtin.dashboard = { active = false, + on_config_done = nil, search_handler = "telescope", + disable_at_vim_enter = 0, + session_directory = os.getenv "HOME" .. "/.cache/options/sessions", custom_header = { " ##############..... ############## ", " ##############......############## ", @@ -30,23 +34,27 @@ M.config = function() command = "Telescope find_files", }, b = { + description = { " Recent Projects " }, + command = "Telescope projects", + }, + c = { description = { " Recently Used Files" }, command = "Telescope oldfiles", }, - c = { + d = { description = { " Find Word " }, command = "Telescope live_grep", }, - d = { - description = { " Settings " }, - command = ":e ~/.config/nvim/config.lua", + e = { + description = { " Configuration " }, + command = ":e " .. config.path, }, }, } end M.setup = function() - vim.g.dashboard_disable_at_vimenter = 0 + vim.g.dashboard_disable_at_vimenter = options.builtin.dashboard.disable_at_vim_enter vim.g.dashboard_custom_header = options.builtin.dashboard.custom_header @@ -56,26 +64,17 @@ M.setup = function() options.builtin.which_key.mappings[";"] = { "Dashboard", "Dashboard" } - -- f = { - -- description = { " Neovim Config Files" }, - -- command = "Telescope find_files cwd=" .. CoptionsFIG_PATH, - -- }, - -- e = {description = {' Marks '}, command = 'Telescope marks'} + vim.g.dashboard_session_directory = options.builtin.dashboard.session_directory - vim.cmd "let g:dashboard_session_directory = $HoptionsE..'/.config/nvim/.sessions'" - vim.cmd "let packages = len(globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1))" + vim.cmd "let packages = len(globpath('~/.local/share/lunarvim/site/pack/packer/start', '*', 0, 1))" vim.api.nvim_exec( [[ - let g:dashboard_custom_footer = ['LuaJIT loaded '..packages..' builtins'] + let g:dashboard_custom_footer = ['LunarVim loaded '..packages..' plugins  '] ]], false ) - -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'}, - - -- vim.g.dashboard_session_directory = CACHE_PATH..'/session' - -- vim.g.dashboard_custom_footer = optionsdashboard.footer require("core.autocmds").define_augroups { _dashboard = { -- seems to be nobuflisted that makes my stuff disappear will do more testing @@ -93,6 +92,10 @@ M.setup = function() { "FileType", "dashboard", "nnoremap q :q" }, }, } + + if options.builtin.dashboard.on_config_done then + options.builtin.dashboard.on_config_done() + end end return M -- cgit v1.2.3-70-g09d2