Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Neovim dashboard plugin

License

NotificationsYou must be signed in to change notification settings

MeanderingProgrammer/dashboard.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim dashboard plugin

Preview

Features

  • 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

Install

lazy.nvim

{'MeanderingProgrammer/dashboard.nvim',event='VimEnter',config=function()require('dashboard').setup({})end,}

Setup

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',    },})

Options

header

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()

date_format

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,}

Preview with Date

footer

Resolving each value in the footer sections happens as follows:

  • If the value is a string:
    • Ifsections.lua has a function with that name call that function and getthe result. Valid values for this areversion andstartuptime.
    • Otherwise use the string value as it was provided.
  • If the value is a function:
    • Call the function, get the result, and check that it is a string.
  • Otherwise print an error message

Acknowledgements

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp