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