1
0

feat: add dashboard-nvim

This commit is contained in:
Rokas Puzonas 2021-11-01 16:13:27 +02:00
parent b82109f8b2
commit 5fd0db584c
3 changed files with 50 additions and 0 deletions

41
lua/config/dashboard.lua Normal file
View File

@ -0,0 +1,41 @@
local autocmd = require 'utils.autocmd'
vim.g.dashboard_default_executive = 'telescope'
-- local function split(text)
-- local parts = {}
-- for part in text:gmatch("[^\n]+") do
-- table.insert(parts, part)
-- end
-- return parts
-- end
-- vim.g.dashboard_custom_header = split(vim.fn.system("figlet -m 2 -f slant Neovim"))
-- vim.g.dashboard_custom_header = {
-- ' ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗',
-- ' ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║',
-- ' ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║',
-- ' ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║',
-- ' ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║',
-- ' ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝',
-- }
vim.g.dashboard_custom_header = {
[[ _ __ _ ]],
[[ / | / /___ ____ _ __ (_)____ ___ ]],
[[ / |/ // _ \ / __ \ | / // // __ `__ \]],
[[ / /| // __// /_/ / |/ // // / / / / /]],
[[/_/ |_/ \___/ \____/|___//_//_/ /_/ /_/ ]],
}
autocmd('dashboard-commands', {
[[FileType dashboard nmap <buffer> <leader>ss :<C-u>SessionSave<cr>]],
[[FileType dashboard nmap <buffer> <leader>sl :<C-u>SessionLoad<CR>]],
[[FileType dashboard nnoremap <buffer> <silent> <leader>fh :DashboardFindHistory<cr>]],
[[FileType dashboard nnoremap <buffer> <silent> <leader>ff :DashboardFindFile<cr>]],
[[FileType dashboard nnoremap <buffer> <silent> <leader>tc :DashboardChangeColorscheme<cr>]],
[[FileType dashboard nnoremap <buffer> <silent> <leader>fa :DashboardFindWord<cr>]],
[[FileType dashboard nnoremap <buffer> <silent> <leader>fb :DashboardJumpMark<cr>]],
[[FileType dashboard nnoremap <buffer> <silent> <leader>cn :DashboardNewFile<cr>]],
}, true)

View File

@ -62,6 +62,12 @@ telescope.setup{
pickers = { pickers = {
find_files = { find_files = {
theme = "dropdown", theme = "dropdown",
},
marks = {
theme = "dropdown",
},
oldfiles = {
theme = "dropdown",
}, },
git_files = { git_files = {
theme = "dropdown", theme = "dropdown",

View File

@ -131,6 +131,9 @@ local function usePlugins(use, use_rocks)
config = [[require 'config.gitsigns']] config = [[require 'config.gitsigns']]
-- tag = 'release' -- To use the latest release -- tag = 'release' -- To use the latest release
} }
-- Start screen
use { 'glepnir/dashboard-nvim', config = [[require 'config.dashboard']] }
end end
-- Register custom commands for plugin manager -- Register custom commands for plugin manager