mirror of https://github.com/LazyVim/starter
rename bash to generic shell
parent
7b3f6190df
commit
31944b41ea
|
@ -5,20 +5,20 @@ return {
|
|||
config = true,
|
||||
keys = {
|
||||
-- horizontal bash
|
||||
{ "<leader>th", "<cmd>lua TermToggleBash('horizontal')<cr>", desc = "H-Bash" },
|
||||
{ "<leader>th", "<cmd>lua TermToggleShell('horizontal')<cr>", desc = "H-Shell" },
|
||||
{
|
||||
"<a-1>",
|
||||
mode = { "n", "v", "t" },
|
||||
"<cmd> lua TermToggleBash('horizontal')<cr>",
|
||||
desc = "H-Bash",
|
||||
"<cmd> lua TermToggleShell('horizontal')<cr>",
|
||||
desc = "H-Shell",
|
||||
},
|
||||
-- float bash
|
||||
{ "<leader>tf", "<cmd>lua TermToggleBash('float')<cr>", desc = "Bash" },
|
||||
{ "<leader>tf", "<cmd>lua TermToggleShell('float')<cr>", desc = "Shell" },
|
||||
{
|
||||
"<a-2>",
|
||||
mode = { "n", "v", "t" },
|
||||
"<cmd> lua TermToggleBash('float')<cr>",
|
||||
desc = "Bash",
|
||||
"<cmd> lua TermToggleShell('float')<cr>",
|
||||
desc = "Shell",
|
||||
},
|
||||
-- containers
|
||||
{ "<leader>tc", "<cmd>lua TermToggleContainer('float')<cr>", desc = "Container" },
|
||||
|
|
|
@ -108,7 +108,7 @@ local function get_containers()
|
|||
return hosts
|
||||
end
|
||||
|
||||
local bash = {
|
||||
local shells = {
|
||||
float = {
|
||||
term = nil,
|
||||
size = -1,
|
||||
|
@ -123,10 +123,10 @@ local bash = {
|
|||
},
|
||||
}
|
||||
|
||||
function TermToggleBash(direction)
|
||||
function TermToggleShell(direction)
|
||||
direction = direction or "float"
|
||||
if bash[direction].term == nil then
|
||||
bash[direction].term = Terminal:new({
|
||||
if shells[direction].term == nil then
|
||||
shells[direction].term = Terminal:new({
|
||||
id = next_id(),
|
||||
display_name = vim.o.shell .. ":" .. direction,
|
||||
cmd = vim.o.shell,
|
||||
|
@ -134,7 +134,7 @@ function TermToggleBash(direction)
|
|||
hidden = true,
|
||||
})
|
||||
end
|
||||
bash[direction].term:toggle(bash[direction].size, direction)
|
||||
shells[direction].term:toggle(shells[direction].size, direction)
|
||||
end
|
||||
|
||||
local lazygit = nil
|
||||
|
@ -148,7 +148,7 @@ end
|
|||
local lua = nil
|
||||
function TermToggleLua()
|
||||
if lua == nil then
|
||||
lua = Terminal:new({ id = next_id(), display_name = "Lua", cmd = "lua", hidden = true })
|
||||
lua = Terminal:new({ id = next_id(), display_name = "Lua", cmd = "lua54", hidden = true })
|
||||
end
|
||||
lua:toggle()
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue