From 9ad8c35fb6a66d810664ca28efeb51e6546c68a1 Mon Sep 17 00:00:00 2001 From: candifloss Date: Tue, 4 Feb 2025 10:45:47 +0530 Subject: [PATCH] Modular config files --- colorscheme.lua | 33 ++++++++++++++++++ keybindings.lua | 29 ++++++++++++++++ tab_and_pane.lua | 16 +++++++++ text.lua | 11 ++++++ wezterm.lua | 90 ++++++------------------------------------------ window.lua | 20 +++++++++++ 6 files changed, 119 insertions(+), 80 deletions(-) create mode 100644 colorscheme.lua create mode 100644 keybindings.lua create mode 100644 tab_and_pane.lua create mode 100644 text.lua create mode 100644 window.lua diff --git a/colorscheme.lua b/colorscheme.lua new file mode 100644 index 0000000..cd2859e --- /dev/null +++ b/colorscheme.lua @@ -0,0 +1,33 @@ +-- Color scheme + +local colorscheme = { + background = '#101010', + foreground = '#BBBBBB', + + cursor_bg = '#22785E', + cursor_fg = '#000000', + + selection_fg = '#D3D7CF', + selection_bg = '#262626', + + tab_bar = { + active_tab = { + bg_color = "#101010", + fg_color = "#BBBBBB", + }, + inactive_tab = { + bg_color = "#232323", + fg_color = "#BBBBBB", + }, + }, + + -- #black, #red, #green, #yellow, #blue, #magenta, #cyan, #white + ansi = { + "#010101", "#d62222", "#3ba04d", "#f6e000", "#1958ff", "#b300b3", "#10bfaf", "#c6c6c6" + }, + brights = { + "#606060", "#ff4444", "#3bd04d", "#dfff1f", "#01a9ff", "#f600f6", "#10efdf", "#e9e9e9" + }, +} + +return colorscheme \ No newline at end of file diff --git a/keybindings.lua b/keybindings.lua new file mode 100644 index 0000000..5f15c7c --- /dev/null +++ b/keybindings.lua @@ -0,0 +1,29 @@ +-- Keybindings + +local wezterm = require 'wezterm' + +local keybindings = { + { + key = 'h', mods = 'CTRL', + action = wezterm.action.SplitHorizontal + { + domain = 'CurrentPaneDomain' + }, + }, + { + key = 'v', mods = 'CTRL', + action = wezterm.action.SplitVertical + { + domain = 'CurrentPaneDomain' + }, + }, + { + key = 'w', mods = 'CTRL', + action = wezterm.action.CloseCurrentPane + { + confirm = true + }, + }, +} + +return keybindings \ No newline at end of file diff --git a/tab_and_pane.lua b/tab_and_pane.lua new file mode 100644 index 0000000..f4aca6b --- /dev/null +++ b/tab_and_pane.lua @@ -0,0 +1,16 @@ +-- Setting related to tabs and panes + +local wezterm = require 'wezterm' +local machine_specific = require("machine_specific") + +local function tab_and_pane_settings(config) + config.use_fancy_tab_bar = false + config.enable_tab_bar = machine_specific.enable_tab_bar + + config.inactive_pane_hsb = { + saturation = 1.0, + brightness = 0.4, + } +end + +return tab_and_pane_settings \ No newline at end of file diff --git a/text.lua b/text.lua new file mode 100644 index 0000000..4aeb067 --- /dev/null +++ b/text.lua @@ -0,0 +1,11 @@ +-- Settings related to text and cursor + +local wezterm = require 'wezterm' + +local function text_settings(config) + config.font = wezterm.font 'IosevkaTermSlab Nerd Font Mono' + config.font_size = 11.0 + config.cursor_blink_rate = 800 +end + +return text_settings \ No newline at end of file diff --git a/wezterm.lua b/wezterm.lua index b269e2f..20f10f2 100644 --- a/wezterm.lua +++ b/wezterm.lua @@ -1,85 +1,15 @@ local wezterm = require 'wezterm' local config = {} -local machine_specific = require("machine_specific") +local keybindings = require("keybindings") +local colorscheme = require("colorscheme") +local window_settings = require("window") +local text_settings = require("text") +local tab_and_pane_settings = require("tab_and_pane") -config.font = wezterm.font 'IosevkaTermSlab Nerd Font Mono' -config.font_size = 11.0 - -config.cursor_blink_rate = 800 - -config.window_padding = { - left = "3px", - right = 0, - top = "1px", - bottom = 0, -} - -config.window_decorations = "NONE" -config.window_frame = { - inactive_titlebar_bg = '#2d2d2d', - active_titlebar_bg = '#232323', -} - -config.use_fancy_tab_bar = false -config.enable_tab_bar = machine_specific.enable_tab_bar - -config.colors = { - background = '#101010', - foreground = '#BBBBBB', - - cursor_bg = '#22785E', - cursor_fg = '#000000', - - selection_fg = '#D3D7CF', - selection_bg = '#262626', - - tab_bar = { - active_tab = { - bg_color = "#101010", - fg_color = "#BBBBBB", - }, - inactive_tab = { - bg_color = "#232323", - fg_color = "#BBBBBB", - }, - }, - - -- #black, #red, #green, #yellow, #blue, #magenta, #cyan, #white - ansi = { - "#010101", "#d62222", "#3ba04d", "#f6e000", "#1958ff", "#b300b3", "#10bfaf", "#c6c6c6" - }, - brights = { - "#606060", "#ff4444", "#3bd04d", "#dfff1f", "#01a9ff", "#f600f6", "#10efdf", "#e9e9e9" - }, -} - -config.inactive_pane_hsb = { - saturation = 1.0, - brightness = 0.4, -} - -config.keys = { - { - key = 'h', mods = 'CTRL', - action = wezterm.action.SplitHorizontal - { - domain = 'CurrentPaneDomain' - }, - }, - { - key = 'v', mods = 'CTRL', - action = wezterm.action.SplitVertical - { - domain = 'CurrentPaneDomain' - }, - }, - { - key = 'w', mods = 'CTRL', - action = wezterm.action.CloseCurrentPane - { - confirm = true - }, - }, -} +window_settings(config) +tab_and_pane_settings(config) +text_settings(config) +config.colors = colorscheme +config.keys = keybindings return config diff --git a/window.lua b/window.lua new file mode 100644 index 0000000..6181823 --- /dev/null +++ b/window.lua @@ -0,0 +1,20 @@ +-- Settings for the window + +local wezterm = require 'wezterm' + +local function window_settings(config) + config.window_padding = { + left = "3px", + right = 0, + top = "1px", + bottom = 0, + } + + config.window_decorations = "NONE" + config.window_frame = { + inactive_titlebar_bg = '#2d2d2d', + active_titlebar_bg = '#232323', + } +end + +return window_settings \ No newline at end of file