Skip to content

How to load the mini.starter dashboard when all the buffers are either deleted/wiped out? #389

Closed Answered by echasnovski
Jarmos-san asked this question in Q&A
Discussion options

You must be logged in to vote

Yes this behavior is possible, but I'd suggest a different route then creating an autocommand.

What about creating own commands for buffer delete and wipeout? Something like this:

local open_starter_if_empty_buffer = function()
  local buf_id = vim.api.nvim_get_current_buf()
  local is_empty = vim.api.nvim_buf_get_name(buf_id) == "" and vim.bo[buf_id].filetype == ''
  if not is_empty then return end

  vim.cmd("Neotree close")
  require('mini.starter').open()
  vim.cmd(buf_id .. "bwipeout")
end

_G.my_bufdelete = function(...)
  require('mini.bufremove').delete(...)
  open_starter_if_empty_buffer()
end

_G.my_bufwipeout = function(...)
  require('mini.bufremove').wipeout(...)
  open_start…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Jarmos-san
Comment options

@Jarmos-san
Comment options

@echasnovski
Comment options

@Jarmos-san
Comment options

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment