Attach a terminal for each buffer, now with stable toggle and astonishing cursor restoring :)
row
,col
,topline
are all kept)BufEnter
the terminal (Wow)term_mode_hl
) background color on enter termbuf insert-mode (Wow)local NOREF_NOERR_TRUNC = { noremap = true, silent = true, nowait = true }
use {
'nyngwang/NeoTerm.lua',
config = function ()
require('neo-term').setup {
-- split_on_top = true,
-- split_size = 0.5,
exclude_buftypes = { 'terminal' }, -- these two options will affect `NeoTermOpen`
exclude_filetypes = { 'neo-tree', 'dashboard' },
}
vim.keymap.set('n', '<M-Tab>', function ()
if vim.bo.buftype == 'terminal' then
vim.cmd('NeoTermClose')
else
vim.cmd('NeoTermOpen')
end
end, NOREF_NOERR_TRUNC)
vim.keymap.set('t', '<M-Tab>', function () vim.cmd('NeoTermEnterNormal') end, NOREF_NOERR_TRUNC)
end
}