Skip to content

Commit

Permalink
Feat(luatab) adding lua tab for terminal workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Gako358 committed Oct 30, 2024
1 parent 93157d8 commit b9596d1
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 28 deletions.
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@
url = "github:hoob3rt/lualine.nvim";
flake = false;
};
plugins-luatab = {
url = "github:alvarosevilla95/luatab.nvim";
flake = false;
};
plugins-noice = {
url = "github:folke/noice.nvim";
flake = false;
Expand Down Expand Up @@ -327,6 +331,7 @@
enable = true;
theme = "nightfox";
};
luatab.enable = true;
noice = {
enable = true;
};
Expand Down
71 changes: 44 additions & 27 deletions modules/gui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,51 @@ in {
};

config = mkIf (cfg.enable) {
vim.luaConfigRC.gui = nvim.dag.entryAnywhere ''
-- Neovide
if vim.g.neovide then
-- Neovide options
vim.g.neovide_fullscreen = false
vim.g.neovide_hide_mouse_when_typing = false
vim.g.neovide_refresh_rate = 165
vim.g.neovide_cursor_vfx_mode = "ripple"
vim.g.neovide_cursor_animate_command_line = true
vim.g.neovide_cursor_animate_in_insert_mode = true
vim.g.neovide_cursor_vfx_particle_lifetime = 5.0
vim.g.neovide_cursor_vfx_particle_density = 14.0
vim.g.neovide_cursor_vfx_particle_speed = 12.0
vim.g.neovide_transparency = 0.91
vim.luaConfigRC.gui =
nvim.dag.entryAnywhere
/*
lua
*/
''
-- Neovide
if vim.g.neovide then
-- Neovide options
vim.g.neovide_fullscreen = false
vim.g.neovide_hide_mouse_when_typing = false
vim.g.neovide_refresh_rate = 165
vim.g.neovide_cursor_vfx_mode = "ripple"
vim.g.neovide_cursor_animate_command_line = true
vim.g.neovide_cursor_animate_in_insert_mode = true
vim.g.neovide_cursor_vfx_particle_lifetime = 5.0
vim.g.neovide_cursor_vfx_particle_density = 14.0
vim.g.neovide_cursor_vfx_particle_speed = 12.0
vim.g.neovide_transparency = 0.91
-- Neovide Font
vim.o.guifont = "JetBrainsMono Nerd Font:h10:Medium:i"
end
-- Lua function to open terminal in new tab
function _G.OpenTerminalInNewTab()
vim.cmd("tabnew")
vim.cmd("terminal")
end
-- Neovide Font
vim.o.guifont = "JetBrainsMono Nerd Font:h10:Medium:i"
end
-- Lua function to open multiple terminals in new tab
function _G.OpenMultipleTerminalsInNewTab()
vim.cmd("tabnew")
vim.cmd("terminal")
vim.cmd("vsplit")
vim.cmd("terminal")
vim.cmd("split")
vim.cmd("terminal")
end
vim.keymap.set("t", "<ESC><ESC>", "<C-\\><C-n>", {desc = "Exit terminal mode"})
vim.keymap.set("n", "<leader>tv", ":vsplit | terminal<CR>", {desc = "Open vertical split terminal"})
vim.keymap.set("n", "<leader>th", ":split | terminal<CR>", {desc = "Open horizontal split terminal"})
vim.keymap.set("n", "<leader>tt", ":lua OpenTerminalInNewTab()<CR>", {desc = "Open terminal in new tab"})
'';
function _G.OpenDoubleTerminalsInNewTab()
vim.cmd("tabnew")
vim.cmd("terminal")
vim.cmd("vsplit")
vim.cmd("terminal")
end
vim.keymap.set("t", "<ESC><ESC>", "<C-\\><C-n>", {desc = "Exit terminal mode"})
vim.keymap.set("n", "<leader>tv", ":vsplit | terminal<CR>", {desc = "Open vertical split terminal"})
vim.keymap.set("n", "<leader>th", ":split | terminal<CR>", {desc = "Open horizontal split terminal"})
vim.keymap.set("n", "<leader>tt", ":lua OpenDoubleTerminalsInNewTab()<CR>", {desc = "Open terminal in new tab"})
vim.keymap.set("n", "<leader>tm", ":lua OpenMultipleTerminalsInNewTab()<CR>", {desc = "Open terminal in new tab"})
'';
};
}
14 changes: 13 additions & 1 deletion modules/visuals/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ in {
};
};

luatab.enable = mkEnableOption "Luatab [luatab]";
noice = {
enable = mkEnableOption "Noice configuration.";

Expand Down Expand Up @@ -329,6 +330,17 @@ in {
}
'';
})
(mkIf cfg.luatab.enable {
vim.startPlugins = ["luatab"];
vim.luaConfigRC.luatab =
nvim.dag.entryAnywhere
/*
lua
*/
''
require("luatab").setup{}
'';
})
(mkIf cfg.noice.enable {
vim.startPlugins = [
"noice"
Expand Down Expand Up @@ -410,7 +422,7 @@ in {
palettes = {
nightfox = {
bg0 = "None",
bg1 = "#1a1a1a",
bg1 = "#1f1f1f",
bg2 = "None",
bg3 = "None",
bg4 = "None",
Expand Down

0 comments on commit b9596d1

Please sign in to comment.