Skip to content

Write autoclose command in lua #1115

Answered by kyazdani42
zakissimo asked this question in Q&A

You must be logged in to vote

with 0.7:

vim.api.nvim_create_autocmd("BufEnter", {
  nested = true,
  callback = function()
    if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then
      vim.cmd "quit"
    end
  end
})

Replies: 3 comments 10 replies

You must be logged in to vote
5 replies
@nshen

@nshen

@zakissimo

@alex-courtis

@mamaraddio

Answer selected by zakissimo

You must be logged in to vote
2 replies
@kyazdani42

@msva

You must be logged in to vote
3 replies
@alex-courtis

@dmitry-semenov

@alex-courtis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants