local map = require 'std.map' local auto = require 'std.auto' return { 'akinsho/toggleterm.nvim', version = '2.*', keys = { '', }, cmd = { 'ToggleTerm', 'TermExec', }, opts = { open_mapping = '', direction = 'float', float_opts = { border = vim.g.border_style, }, size = function ( term ) if term.direction == 'horizontal' then return 18 elseif term.direction == 'vertical' then return vim.o.columns * 0.42 end end, }, config = function ( _, opts ) local toggleterm = require 'toggleterm' toggleterm.setup( opts ) local set_terminal_keymaps = function () map.terminal { description = 'Quit insert mode', category = 'terminal', keys = '', buffer = true, command = [[ ]], } vim.opt_local.spell = false end auto 'normalize_terminal_windows' { description = 'Make terminal windows behave more normally.', events = 'TermOpen', pattern = 'term://*', command = set_terminal_keymaps, } end, }