nvimdev / dashboard-nvim

vim dashboard
MIT License
2.3k stars 187 forks source link

Improve the dashboard buffer name and make it customizable #326

Closed j-xella closed 1 year ago

j-xella commented 1 year ago

Dashboard creates a scratch buffer, named 'Scratch' by default. Not very intuitive.

This does not matter much if status/window/tab lines are hidden, the default behaviour. But may not look nice otherwise.

glepnir commented 1 year ago

sorry i don't get the point.

j-xella commented 1 year ago

In my environment, I prefer the tabline to be visible, and dashboard to appear every time I open a new tab. Config like this:

 db.setup( {                                            
   theme = 'hyper',                                     
   hide = {                                             
     tabline = false                                    
   },                                                   
   config = {                                           
     -- disable_move = true,                            
   }                                                    
 } )                                                    

 vim.api.nvim_create_autocmd('TabNewEntered', {         
   desc = "Open dashboard-nvim on new tab",             
   callback = function() require('dashboard'):instance()
 })                                                     

This causes the dashboard on a new tab to look like this:

image

Note that the name of the new tab where the dashboard is opened is shown as Scratch. Dashboard creates a temporary buffer, and it is called "Scratch" by default. So wherever the current buffer name can be displayed, this word "Scratch" appears. This is not a big deal, just a cosmetic issue, but it does not look nice, IMO.

With my fix, it looks like this:

image

I have opened several new tabs in parallel to show how the fix behaves when multiple dashboards are opened