dotfiles/conf.d/nvim/dashboard.lua

74 lines
3.8 KiB
Lua
Raw Normal View History

2022-07-18 15:36:58 +00:00
local home = os.getenv('HOME')
local db = require('dashboard')
-- 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
local dotfiles = home .. '/dotfiles'
2022-07-19 22:58:49 +00:00
db.custom_header = {
'',
' ⣿⣿⣷⡁⢆⠈⠕⢕⢂⢕⢂⢕⢂⢔⢂⢕⢄⠂⣂⠂⠆⢂⢕⢂⢕⢂⢕⢂⢕⢂ ',
' ⣿⣿⣿⡷⠊⡢⡹⣦⡑⢂⢕⢂⢕⢂⢕⢂⠕⠔⠌⠝⠛⠶⠶⢶⣦⣄⢂⢕⢂⢕ ',
' ⣿⣿⠏⣠⣾⣦⡐⢌⢿⣷⣦⣅⡑⠕⠡⠐⢿⠿⣛⠟⠛⠛⠛⠛⠡⢷⡈⢂⢕⢂ ',
' ⠟⣡⣾⣿⣿⣿⣿⣦⣑⠝⢿⣿⣿⣿⣿⣿⡵⢁⣤⣶⣶⣿⢿⢿⢿⡟⢻⣤⢑⢂ ',
' ⣾⣿⣿⡿⢟⣛⣻⣿⣿⣿⣦⣬⣙⣻⣿⣿⣷⣿⣿⢟⢝⢕⢕⢕⢕⢽⣿⣿⣷⣔ ',
' ⣿⣿⠵⠚⠉⢀⣀⣀⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⢕⢕⢕⢕⢕⢕⣽⣿⣿⣿⣿ ',
' ⢷⣂⣠⣴⣾⡿⡿⡻⡻⣿⣿⣴⣿⣿⣿⣿⣿⣿⣷⣵⣵⣵⣷⣿⣿⣿⣿⣿⣿⡿ ',
' ⢌⠻⣿⡿⡫⡪⡪⡪⡪⣺⣿⣿⣿⣿⣿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ',
' ⠣⡁⠹⡪⡪⡪⡪⣪⣾⣿⣿⣿⣿⠋⠐⢉⢍⢄⢌⠻⣿⣿⣿⣿⣿⣿⣿⣿⠏⠈ ',
' ⡣⡘⢄⠙⣾⣾⣾⣿⣿⣿⣿⣿⣿⡀⢐⢕⢕⢕⢕⢕⡘⣿⣿⣿⣿⣿⣿⠏⠠⠈ ',
' ⠌⢊⢂⢣⠹⣿⣿⣿⣿⣿⣿⣿⣿⣧⢐⢕⢕⢕⢕⢕⢅⣿⣿⣿⣿⡿⢋⢜⠠⠈ ',
' ⠄⠁⠕⢝⡢⠈⠻⣿⣿⣿⣿⣿⣿⣿⣷⣕⣑⣑⣑⣵⣿⣿⣿⡿⢋⢔⢕⣿⠠⠈ ',
' ⠨⡂⡀⢑⢕⡅⠂⠄⠉⠛⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⢔⢕⢕⣿⣿⠠⠈ ',
' ⠄⠪⣂⠁⢕⠆⠄⠂⠄⠁⡀⠂⡀⠄⢈⠉⢍⢛⢛⢛⢋⢔⢕⢕⢕⣽⣿⣿⠠⠈ ',
'',
}
2022-07-18 15:36:58 +00:00
db.custom_center = {
{
icon = nil,
desc = 'Nouveau fichier ',
action = 'DashboardNewFile',
shortcut = 'SPC f n'
},
{
desc = 'Trouver un fichier ',
action = "lua require('telescope.builtin').find_files()",
shortcut = 'SPC f f'
},
{
desc = 'Fichiers récemment ouverts ',
2022-07-19 22:58:49 +00:00
action = "lua require('telescope.builtin').oldfiles()",
2022-07-18 15:36:58 +00:00
shortcut = 'SPC f h'
},
{
desc = 'Parcourir les dotfiles ',
2022-07-19 22:58:49 +00:00
action = "lua require('telescope.builtin').find_files({ cwd = \'" .. dotfiles .. "\' })",
2022-07-18 15:36:58 +00:00
shortcut = 'SPC f d'
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