- Notifications
You must be signed in to change notification settings - Fork1
MeanderingProgrammer/dashboard.nvim
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Neovim dashboard plugin
- Look at theOptions -> header section to get results like above
- Fully customizable header with reference for integrating with ascii art plugin
- Provide directories and this plugin will:
- Display them on the dashboard
- Make them accessible with single letter hotkey
- Input is ordered and hotkeys are generated sequentially, making for aconsistent experience
{'MeanderingProgrammer/dashboard.nvim',event='VimEnter',config=function()require('dashboard').setup({})end,}The setups below show the default values, which if used will result in an empty screen.
It is recommended to providedirectories at least, and aheader for some fun.
require('dashboard').setup({-- Sequence that determines keymapsautokeys='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',-- Dashboard headerheader= {},-- Format to display date indate_format=nil,-- List of directory paths, or functions that return pathsdirectories= {},-- Sections to add at bottom, these can be string references to-- functions in sections.lua, custom strings, or custom functionsfooter= {},-- Buffer local optionsbo= {bufhidden='wipe',buflisted=false,filetype='dashboard',swapfile=false, },-- Window local optionswo= {cursorcolumn=false,cursorline=false,number=false,relativenumber=false,spell=false,statuscolumn='',wrap=false, },-- Gets called after directory is changed and is provided with the-- directory path as an argumenton_load=function(path)-- do nothingend,-- Highlight groups to use for various componentshighlight_groups= {header='Constant',icon='Type',directory='Delimiter',hotkey='Statement', },})
By default no header is provided by the plugin. As it is just an array of stringsyou can create your own or use another plugin which provides the ascii art.
For example usingMaximilianLloyd/ascii.nviminlazy.nvim to achieve the look in the screenshots:
{'MeanderingProgrammer/dashboard.nvim',event='VimEnter',dependencies= { {'MaximilianLloyd/ascii.nvim',dependencies= {'MunifTanjim/nui.nvim'} }, },config=function()require('dashboard').setup({header=require('ascii').art.text.neovim.sharp,directories= {'~/.config','~/Documents/notes','~/dev/repos/harpoon-core.nvim','~/dev/repos/dashboard.nvim','~/dev/repos/advent-of-code', }, })end,}Using this exact setup will result in the same Dashboard as the screenshot at thetop, assuming these are valid directories on your system.
You can also use methods provided by the ascii plugin to randomize the look on everyload, for example:
require('ascii').get_random_global()
This will add the date right after the header in the format specified.
The date is static and will not be updated until the dashboard is reloaded.
This will build off of theheader option so the difference in screenshots ismore clear.
{'MeanderingProgrammer/dashboard.nvim',event='VimEnter',dependencies= { {'MaximilianLloyd/ascii.nvim',dependencies= {'MunifTanjim/nui.nvim'} }, },config=function()require('dashboard').setup({header=require('ascii').art.text.neovim.sharp,date_format='%Y-%m-%d %H:%M:%S',directories= {'~/.config','~/Documents/notes','~/dev/repos/harpoon-core.nvim','~/dev/repos/dashboard.nvim','~/dev/repos/advent-of-code', }, })end,}Resolving each value in the footer sections happens as follows:
- If the value is a string:
- If
sections.luahas a function with that name call that function and getthe result. Valid values for this areversionandstartuptime. - Otherwise use the string value as it was provided.
- If
- If the value is a function:
- Call the function, get the result, and check that it is a string.
- Otherwise print an error message
The populardashboard-nvim plugin wasused as a reference point in the development of this plugin. These plugins do verydifferent things other than sharing the concept of being a dashboard. In many waysdashboard-nvim is better and has a lot of neat features but I was looking forsomething more user defined as opposed to inferred.
About
Neovim dashboard plugin
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Contributors2
Uh oh!
There was an error while loading.Please reload this page.

