Browse Source

✨ Change dashboard header and footer by user (#363)

* :sparkles: ability to change dashboard header and footer.

* :sparkles: lv-settings adapted.

* comment to keep original one by default.
Francisco Suárez 4 years ago
parent
commit
db2b17be72
3 changed files with 19 additions and 13 deletions
  1. 2 12
      lua/lv-dashboard/init.lua
  2. 13 1
      lua/lv-globals.lua
  3. 4 0
      lv-settings.lua

+ 2 - 12
lua/lv-dashboard/init.lua

@@ -17,17 +17,7 @@
 --
 -- }
 
-vim.g.dashboard_custom_header = {
-
-'                 _..._                                                                           ',
-'               .\'   (_`.    _                         __     ___           ',
-'              :  .      :  | |   _   _ _ __   __ _ _ _\\ \\   / (_)_ __ ___  ',
-'              :)    ()  :  | |  | | | | \'_ \\ / _` | \'__\\ \\ / /| | \'_ ` _ \\ ',
-'              `.   .   .\'  | |__| |_| | | | | (_| | |   \\ V / | | | | | | |',
-'                `-...-\'    |_____\\__,_|_| |_|\\__,_|_|    \\_/  |_|_| |_| |_|',
-
-}
-
+vim.g.dashboard_custom_header = O.dashboard.custom_header
 
 vim.g.dashboard_default_executive = 'telescope'
 
@@ -52,4 +42,4 @@ vim.g.dashboard_custom_section = {
 -- find_history = 'SPC f h',
 
 -- vim.g.dashboard_session_directory = '~/.cache/nvim/session'
-vim.g.dashboard_custom_footer = {'chrisatmachine.com'}
+vim.g.dashboard_custom_footer = O.dashboard.footer

+ 13 - 1
lua/lv-globals.lua

@@ -61,9 +61,21 @@ O = {
 	ruby = {
 		diagnostics = {virtualtext = {spacing = 0, prefix = ""}, signs = true, underline = true},
 		filetypes = {'rb', 'erb', 'rakefile'}
-	}
+	},
     -- css = {formatter = '', autoformat = false, virtual_text = true},
     -- json = {formatter = '', autoformat = false, virtual_text = true}
+
+	dashboard = {
+		custom_header = {
+'                 _..._                                                                           ',
+'               .\'   (_`.    _                         __     ___           ',
+'              :  .      :  | |   _   _ _ __   __ _ _ _\\ \\   / (_)_ __ ___  ',
+'              :)    ()  :  | |  | | | | \'_ \\ / _` | \'__\\ \\ / /| | \'_ ` _ \\ ',
+'              `.   .   .\'  | |__| |_| | | | | (_| | |   \\ V / | | | | | | |',
+'                `-...-\'    |_____\\__,_|_| |_|\\__,_|_|    \\_/  |_|_| |_| |_|',
+		},
+		footer= {'chrisatmachine.com'}
+	}
 }
 
 DATA_PATH = vim.fn.stdpath('data')

+ 4 - 0
lv-settings.lua

@@ -13,6 +13,10 @@ O.colorscheme = 'lunar'
 O.auto_close_tree = 0
 O.wrap_lines = false
 
+-- dashboard 
+-- O.dashboard.custom_header = {""}
+-- O.dashboard.footer = {""}
+
 -- if you don't want all the parsers change this to a table of the ones you want
 O.treesitter.ensure_installed = "all"
 O.treesitter.ignore_install = {"haskell"}