lazy load dashboard
This commit is contained in:
parent
dcc04837d4
commit
b42f4778f9
5 changed files with 58 additions and 42 deletions
1
init.lua
1
init.lua
|
@ -54,5 +54,4 @@ vim.api.nvim_exec(
|
|||
|
||||
require "zenmode"
|
||||
require "whichkey"
|
||||
require "dashboard"
|
||||
require("nvim_comment").setup()
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
local M = {}
|
||||
|
||||
M.config = function()
|
||||
local g = vim.g
|
||||
|
||||
g.dashboard_disable_at_vimenter = 1 -- dashboard is disabled by default
|
||||
g.dashboard_disable_statusline = 1
|
||||
g.dashboard_default_executive = "telescope"
|
||||
g.dashboard_custom_header = {
|
||||
|
@ -33,3 +37,6 @@ g.dashboard_custom_footer = {
|
|||
" ",
|
||||
"NvChad v0.5"
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -104,3 +104,10 @@ map(
|
|||
)
|
||||
|
||||
map("n", "<Leader>fm", [[<Cmd> Neoformat<CR>]], opt)
|
||||
|
||||
-- dashboard stuff
|
||||
map("n", "<Leader>fw", [[<Cmd> Telescope live_grep<CR>]], opt)
|
||||
map("n", "<Leader>fn", [[<Cmd> DashboardNewFile<CR>]], opt)
|
||||
map("n", "<Leader>bm", [[<Cmd> DashboardJumpMarks<CR>]], opt)
|
||||
map("n", "<Leader>sl", [[<Cmd> SessionLoad<CR>]], opt)
|
||||
map("n", "<Leader>ss", [[<Cmd> SessionSave<CR>]], opt)
|
||||
|
|
|
@ -83,7 +83,18 @@ return packer.startup(
|
|||
use "nvim-lua/popup.nvim"
|
||||
|
||||
-- misc
|
||||
use "glepnir/dashboard-nvim"
|
||||
use {
|
||||
"glepnir/dashboard-nvim",
|
||||
cmd = {
|
||||
"Telescope live_grep",
|
||||
"DashboardNewFile",
|
||||
"DashboardJumpMarks"
|
||||
},
|
||||
setup = function()
|
||||
require("dashboard").config()
|
||||
end
|
||||
}
|
||||
|
||||
use "tweekmonster/startuptime.vim"
|
||||
|
||||
-- load autosave plugin only if its globally enabled
|
||||
|
|
|
@ -68,14 +68,6 @@ vim.api.nvim_set_keymap(
|
|||
[[<Cmd>lua require('telescope').extensions.media_files.media_files()<CR>]],
|
||||
opt
|
||||
)
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<Leader>fb", [[<Cmd>lua require('telescope.builtin').buffers()<CR>]], opt)
|
||||
vim.api.nvim_set_keymap("n", "<Leader>fh", [[<Cmd>lua require('telescope.builtin').help_tags()<CR>]], opt)
|
||||
vim.api.nvim_set_keymap("n", "<Leader>fo", [[<Cmd>lua require('telescope.builtin').oldfiles()<CR>]], opt)
|
||||
|
||||
-- dashboard stuff
|
||||
vim.api.nvim_set_keymap("n", "<Leader>fw", [[<Cmd> Telescope live_grep<CR>]], opt)
|
||||
vim.api.nvim_set_keymap("n", "<Leader>fn", [[<Cmd> DashboardNewFile<CR>]], opt)
|
||||
vim.api.nvim_set_keymap("n", "<Leader>bm", [[<Cmd> DashboardJumpMarks<CR>]], opt)
|
||||
vim.api.nvim_set_keymap("n", "<Leader>sl", [[<Cmd> SessionLoad<CR>]], opt)
|
||||
vim.api.nvim_set_keymap("n", "<Leader>ss", [[<Cmd> SessionSave<CR>]], opt)
|
||||
|
|
Loading…
Reference in a new issue