I want to make toggleable window with terminal buffer similar to every IDE terminal feature.
Currently i have mapped:
noremap <F4> :botright 8split term://bash<CR>
tnoremap <F4> <C-\><C-n>:q<CR>
autocmd BufEnter term://* startinsert | set wfh
but buffer is lost whenever is not active on any window (ex. on :q)
EDIT And how to reopen the same buffer whenever it already eixsts instead of creating new one every time?
:h wfh, I didn't think there was something like that built in. Nice one! – 3N4N Mar 23 '19 at 10:23:h terminalsays: 'bufhidden' defaults to "hide", so I didin't try myself – Mesco Mar 23 '19 at 10:32nvim -u NORCand opening terminal with:termand then check:set bufhidden?. I seebufhidden=, so not defaults tohide. Must be a bug. What do you see? We might need to notify neovim community to edit their help documents! – 3N4N Mar 23 '19 at 10:39terminalbuffer exists by checking for "term://" in it's bufname. I will try to provide a complete answer if you want. – 3N4N Mar 23 '19 at 10:41