dotfiles/conf.d/nvim/dashboard.lua

89 lines
4.2 KiB
Lua
Raw Normal View History

2022-07-21 23:48:28 +00:00
--[[--
File : dashboard.lua
Author : Jeff LANCE <email@jefflance.me>
Date : 20.07.2022
Last Modified Date: 22.07.2022
Last Modified By : Jeff LANCE <email@jefflance.me>
db.custom_header -- type can be nil,table or function(must be return table in function)
-- if not config will use default banner
db.custom_center -- table type and in this table you can set icon,desc,shortcut,action keywords. desc must be exist and type is string
-- icon type is nil or string
-- shortcut type is nil or string also like icon
-- action type can be string or function or nil.
-- if you don't need any one of icon shortcut action ,you can ignore it.
db.custom_footer -- type can be nil,table or function(must be return table in function)
db.preview_file_Path -- string or function type that mean in function you can dynamic generate height width
db.preview_file_height -- number type
db.preview_file_width -- number type
db.preview_command -- string type
db.hide_statusline -- boolean default is true.it will hide statusline in dashboard buffer and auto open in other buffer
db.hide_tabline -- boolean default is true.it will hide tabline in dashboard buffer and auto open in other buffer
db.session_directory -- string type the directory to store the session file
db.header_pad -- number type default is 1
db.center_pad -- number type default is 1
db.footer_pad -- number type default is 1
--]]--
2022-07-18 15:36:58 +00:00
local home = os.getenv('HOME')
local db = require('dashboard')
2022-07-21 18:15:31 +00:00
local dotfiles = '\'' .. home .. '/dotfiles\''
2022-07-18 15:36:58 +00:00
2022-07-21 23:48:28 +00:00
db.preview_command = 'cat | lolcat -a'
2022-07-21 18:15:31 +00:00
db.preview_file_path = home .. '/.config/nvim/header1.cat'
2022-07-21 23:48:28 +00:00
db.preview_file_height = 20
2022-07-21 18:15:31 +00:00
db.preview_file_width = 32
-- db.custom_header = {
-- '',
-- ' ⣿⣿⣷⡁⢆⠈⠕⢕⢂⢕⢂⢕⢂⢔⢂⢕⢄⠂⣂⠂⠆⢂⢕⢂⢕⢂⢕⢂⢕⢂ ',
-- ' ⣿⣿⣿⡷⠊⡢⡹⣦⡑⢂⢕⢂⢕⢂⢕⢂⠕⠔⠌⠝⠛⠶⠶⢶⣦⣄⢂⢕⢂⢕ ',
-- ' ⣿⣿⠏⣠⣾⣦⡐⢌⢿⣷⣦⣅⡑⠕⠡⠐⢿⠿⣛⠟⠛⠛⠛⠛⠡⢷⡈⢂⢕⢂ ',
-- ' ⠟⣡⣾⣿⣿⣿⣿⣦⣑⠝⢿⣿⣿⣿⣿⣿⡵⢁⣤⣶⣶⣿⢿⢿⢿⡟⢻⣤⢑⢂ ',
-- ' ⣾⣿⣿⡿⢟⣛⣻⣿⣿⣿⣦⣬⣙⣻⣿⣿⣷⣿⣿⢟⢝⢕⢕⢕⢕⢽⣿⣿⣷⣔ ',
-- ' ⣿⣿⠵⠚⠉⢀⣀⣀⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⢕⢕⢕⢕⢕⢕⣽⣿⣿⣿⣿ ',
-- ' ⢷⣂⣠⣴⣾⡿⡿⡻⡻⣿⣿⣴⣿⣿⣿⣿⣿⣿⣷⣵⣵⣵⣷⣿⣿⣿⣿⣿⣿⡿ ',
-- ' ⢌⠻⣿⡿⡫⡪⡪⡪⡪⣺⣿⣿⣿⣿⣿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ',
-- ' ⠣⡁⠹⡪⡪⡪⡪⣪⣾⣿⣿⣿⣿⠋⠐⢉⢍⢄⢌⠻⣿⣿⣿⣿⣿⣿⣿⣿⠏⠈ ',
-- ' ⡣⡘⢄⠙⣾⣾⣾⣿⣿⣿⣿⣿⣿⡀⢐⢕⢕⢕⢕⢕⡘⣿⣿⣿⣿⣿⣿⠏⠠⠈ ',
-- ' ⠌⢊⢂⢣⠹⣿⣿⣿⣿⣿⣿⣿⣿⣧⢐⢕⢕⢕⢕⢕⢅⣿⣿⣿⣿⡿⢋⢜⠠⠈ ',
-- ' ⠄⠁⠕⢝⡢⠈⠻⣿⣿⣿⣿⣿⣿⣿⣷⣕⣑⣑⣑⣵⣿⣿⣿⡿⢋⢔⢕⣿⠠⠈ ',
-- ' ⠨⡂⡀⢑⢕⡅⠂⠄⠉⠛⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⢔⢕⢕⣿⣿⠠⠈ ',
-- ' ⠄⠪⣂⠁⢕⠆⠄⠂⠄⠁⡀⠂⡀⠄⢈⠉⢍⢛⢛⢛⢋⢔⢕⢕⢕⣽⣿⣿⠠⠈ ',
-- '',
-- }
2022-07-19 22:58:49 +00:00
2022-07-18 15:36:58 +00:00
db.custom_center = {
{
icon = nil,
desc = 'Nouveau fichier ',
action = 'DashboardNewFile',
2022-07-21 18:15:31 +00:00
shortcut = ';fn'
2022-07-18 15:36:58 +00:00
},
{
desc = 'Trouver un fichier ',
action = "lua require('telescope.builtin').find_files()",
2022-07-21 18:15:31 +00:00
shortcut = ';ff'
2022-07-18 15:36:58 +00:00
},
{
desc = 'Fichiers récemment ouverts ',
2022-07-19 22:58:49 +00:00
action = "lua require('telescope.builtin').oldfiles()",
2022-07-21 23:48:28 +00:00
shortcut = ';fh'
2022-07-18 15:36:58 +00:00
},
{
desc = 'Parcourir les dotfiles ',
2022-07-21 18:15:31 +00:00
-- action = "lua require('telescope.builtin').find_files({ cwd = " .. dotfiles .. " })",
action = 'Telescope dotfiles path=' .. dotfiles,
shortcut = ';fd'
2022-07-19 22:58:49 +00:00
},
2022-07-18 15:36:58 +00:00
}
-- Highlight Group
-- DashboardHeader DashboardCenter DashboardCenterIcon DashboardShortCut DashboardFooter
-- Command
-- DashboardNewFile -- if you like use `enew` to create file,Please use this command,it's wrap enew and restore the statsuline and tabline
-- SessionSave,SessionLoad