Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Close A Neovim Window With The API

-- doesn't force close
vim.api.nvim_win_close(WINDOW_ID, {})
-- forces close
vim.api.nvim_win_close(WINDOW_ID, { force=true })
-- (get the id with `vim.api.nvim_set_current_win()`
-- Closes the window (like |:close| with a |window-ID|).

nvim_win_close({window}, {force})  


Attributes: 
    not allowed when |textlock| is active

Parameters: 
    {window}  Window handle, or 0 for current window
    {force}   Behave like ``:close!`` The last window of a
              buffer with unwritten changes can be closed. The
              buffer will become hidden, even if 'hidden' is
              not set.

Footnotes And References