require('toggleterm').setup { direction = 'horizontal', open_mapping = [[\t]], size = function (term) if term.direction == "horizontal" then return 15 elseif term.direction == "vertical" then return vim.o.columns * 0.3 end end, hide_numbers = true, -- hide the number column in toggleterm buffers persist_size = false, } function _G.set_terminal_keymaps() local opts = { buffer = 0 } vim.keymap.set('t', '', [[wincmd h]], opts) vim.keymap.set('t', '', [[wincmd j]], opts) vim.keymap.set('t', '', [[wincmd k]], opts) vim.keymap.set('t', '', [[wincmd l]], opts) end vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')