feat(nvim): added toggleterm manager

This commit is contained in:
Sergio Laín 2023-11-26 23:55:36 +01:00
parent 4280546c48
commit d5e8e84a79
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -1,48 +1,58 @@
return { return {
"akinsho/toggleterm.nvim", {
cmd = { "akinsho/toggleterm.nvim",
"ToggleTerm", cmd = {
"ToggleTermSetName", "ToggleTerm",
"ToggleTermToggleAll", "ToggleTermSetName",
"ToggleTermSendVisualLines", "ToggleTermToggleAll",
"ToggleTermSendCurrentLine", "ToggleTermSendVisualLines",
"ToggleTermSendVisualSelection", "ToggleTermSendCurrentLine",
}, "ToggleTermSendVisualSelection",
opts = { },
size = function(term) opts = {
if term.direction == "horizontal" then size = function(term)
return 15 if term.direction == "horizontal" then
elseif term.direction == "vertical" then return 30
return vim.o.columns * 0.4 elseif term.direction == "vertical" then
end return vim.o.columns * 0.4
end, end
open_mapping = [[<c-\>]], end,
hide_numbers = true, -- hide the number column in toggleterm buffers open_mapping = [[<c-\>]],
shade_filetypes = {}, hide_numbers = true, -- hide the number column in toggleterm buffers
shade_terminals = true, -- NOTE: this option takes priority over highlights specified so if you specify Normal highlights you should set this to false shade_filetypes = {},
shading_factor = "-10", -- the percentage by which to lighten terminal background, default: -30 (gets multiplied by -3 if background is light) shade_terminals = true, -- NOTE: this option takes priority over highlights specified so if you specify Normal highlights you should set this to false
start_in_insert = true, shading_factor = "-10", -- the percentage by which to lighten terminal background, default: -30 (gets multiplied by -3 if background is light)
insert_mappings = true, -- whether or not the open mapping applies in insert mode start_in_insert = true,
terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals insert_mappings = true, -- whether or not the open mapping applies in insert mode
persist_size = true, terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals
persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered persist_size = true,
direction = "float", persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered
close_on_exit = true, -- close the terminal window when the process exits direction = "float",
-- Change the default shell. Can be a string or a function returning a string close_on_exit = true, -- close the terminal window when the process exits
shell = vim.o.shell, -- Change the default shell. Can be a string or a function returning a string
-- This field is only relevant if direction is set to 'float' shell = vim.o.shell,
float_opts = { -- This field is only relevant if direction is set to 'float'
-- The border key is *almost* the same as 'nvim_open_win' float_opts = {
-- see :h nvim_open_win for details on borders however -- The border key is *almost* the same as 'nvim_open_win'
-- the 'curved' border is a custom border type -- see :h nvim_open_win for details on borders however
-- not natively supported but implemented in this plugin. -- the 'curved' border is a custom border type
border = "curved", -- not natively supported but implemented in this plugin.
-- like `size`, width and height can be a number or function which is passed the current terminal border = "curved",
highlights = { border = "Normal", background = "Normal" }, -- like `size`, width and height can be a number or function which is passed the current terminal
winblend = 3, highlights = { border = "Normal", background = "Normal" },
winblend = 3,
},
},
-- stylua: ignore
keys = {
{ [[<c-\>]], "<cmd>ToggleTerm<cr>", mode = "n", desc = "Toggle Terminal" },
}, },
}, },
keys = { {
{ [[<c-\>]], "<cmd>ToggleTerm<cr>", mode = "n", desc = "Toggle Terminal" }, "ryanmsnyder/toggleterm-manager.nvim",
opts = {},
keys = {
{ "<leader>st", "<cmd>Telescope toggleterm_manager<cr>", desc = "Terminals" },
},
}, },
} }