2023-11-06 20:11:34 +00:00
|
|
|
require("toggleterm").setup {
|
|
|
|
size = function(term)
|
|
|
|
if term.direction == "horizontal" then
|
2023-12-29 15:52:19 +00:00
|
|
|
return 10
|
2023-11-06 20:11:34 +00:00
|
|
|
elseif term.direction == "vertical" then
|
2023-12-29 15:52:19 +00:00
|
|
|
return vim.o.columns * 0.3
|
2023-11-06 20:11:34 +00:00
|
|
|
end
|
|
|
|
end,
|
|
|
|
|
|
|
|
hide_numbers = true,
|
2023-11-27 10:36:35 +00:00
|
|
|
persist_size = false,
|
2023-11-06 20:11:34 +00:00
|
|
|
persist_mode = true,
|
|
|
|
close_on_exit = true,
|
|
|
|
auto_scroll = true,
|
|
|
|
shell = vim.o.shell,
|
|
|
|
|
|
|
|
float_opts = {
|
|
|
|
border = 'curved',
|
2023-12-29 15:52:19 +00:00
|
|
|
width = vim.o.columns * 0.8,
|
|
|
|
height = vim.o.lines * 0.8,
|
2023-11-06 20:11:34 +00:00
|
|
|
winblend = 3,
|
|
|
|
zindex = 50,
|
|
|
|
},
|
|
|
|
|
2023-12-29 15:52:19 +00:00
|
|
|
-- direction = 'horizontal'
|
|
|
|
direction = 'float'
|
2023-11-06 20:11:34 +00:00
|
|
|
}
|
|
|
|
|
2023-11-27 10:36:35 +00:00
|
|
|
-- ToggleTerm non terminal mode keybinds
|
2023-11-06 20:11:34 +00:00
|
|
|
vim.keymap.set("n", "<leader>t", "<cmd>ToggleTerm<CR>")
|
2023-11-27 10:36:35 +00:00
|
|
|
vim.keymap.set("n", "<leader>vl", "<cmd>ToggleTermCurrentLine<CR>")
|
|
|
|
vim.keymap.set("n", "<leader>vv", "<cmd>ToggleTermVisualLines<CR>")
|
|
|
|
vim.keymap.set("n", "<leader>vs", "<cmd>ToggleTermVisualSelection<CR>")
|
|
|
|
|
|
|
|
-- ToggleTerm terminal mode keybinds
|
|
|
|
vim.keymap.set("t", "<esc>", "<C-\\><C-n>")
|