From dd71a7282c840086c9d5638f3804965fb81aec2d Mon Sep 17 00:00:00 2001 From: Julius Riegel Date: Wed, 20 Mar 2024 14:43:19 +0100 Subject: [PATCH] Improve wezterm config --- content/config/helix/config.toml | 5 ++ content/config/nushell/scripts/ci.nu | 12 ++- content/config/wezterm/wezterm.lua.tmpl | 100 ++++++++++++++++++------ silo.config.lua | 1 + 4 files changed, 92 insertions(+), 26 deletions(-) diff --git a/content/config/helix/config.toml b/content/config/helix/config.toml index f76001f..fb6f8dd 100644 --- a/content/config/helix/config.toml +++ b/content/config/helix/config.toml @@ -32,10 +32,15 @@ rainbow = "dim" tab = "all" nbsp = "all" +[keys.insert] +esc = ["collapse_selection", "normal_mode"] + [keys.normal] +esc = ["collapse_selection", "keep_primary_selection"] C-j = "half_page_down" C-k = "half_page_up" [keys.select] +esc = ["collapse_selection", "keep_primary_selection", "normal_mode"] C-j = "half_page_down" C-k = "half_page_up" diff --git a/content/config/nushell/scripts/ci.nu b/content/config/nushell/scripts/ci.nu index 78fc41e..23c9137 100644 --- a/content/config/nushell/scripts/ci.nu +++ b/content/config/nushell/scripts/ci.nu @@ -1,6 +1,6 @@ # notify when the latest ci pipeline completes export def notify [] { - while (info | get status) == "running" { + while (info | get status) in ["running", "queued"] { sleep 1sec; }; let name = ($env.PWD | path basename) @@ -21,7 +21,15 @@ export def info [] { if (get-ci) == "gitlab" { glab ci get -F json | from json } else { - gh run list --json conclusion,name,startedAt,status | from json | first + (gh run list --json conclusion,name,startedAt,status | from json | first + | { + name: $in.name, + conclusion: $in.conclusion, + status: (match $in.status { + "in_progress" => {"running"}, + _ => $in.status + }), + }) } } diff --git a/content/config/wezterm/wezterm.lua.tmpl b/content/config/wezterm/wezterm.lua.tmpl index fabae5c..154d4ed 100644 --- a/content/config/wezterm/wezterm.lua.tmpl +++ b/content/config/wezterm/wezterm.lua.tmpl @@ -1,6 +1,6 @@ local wezterm = require 'wezterm' local act = wezterm.action -local config = {} +local config = wezterm.config_builder() config.enable_scroll_bar = true config.scrollback_lines = 12000 @@ -20,36 +20,88 @@ config.window_background_gradient = { '#1A002A', }, } + +config.inactive_pane_hsb = { + saturation = 0.9, + brightness = 0.65, +} config.window_frame = { - active_titlebar_bg = '#1A002A', - inactive_titlebar_bg = '#1A002A', + active_titlebar_bg = '#090909', + -- inactive_titlebar_bg = '#1A002A', } + + + config.colors = { tab_bar = { - active_tab = { - bg_color = '#4383a7', - fg_color = '#FFFFFF', - }, - inactive_tab = { - bg_color = '#46007c', - fg_color = '#FFFFFF', - }, - inactive_tab_hover = { - bg_color = '#58008f', - fg_color = '#FFFFFF', - }, - new_tab = { - bg_color = '#46007c', - fg_color = '#FFFFFF', - }, - new_tab_hover = { - bg_color = '#57008f', - fg_color = '#FFFFFF', - }, - } + background = '#3A2A4D', + + new_tab = { + bg_color = '#3A2A4D', + fg_color = '#ffffff', + }, + new_tab_hover = { + bg_color = '#2B1C3D', + fg_color = '#ffffff', + italic = false, + }, }, } +config.window_padding = { left = 10, right = 10, top = 10, bottom = 10 } +config.use_fancy_tab_bar = false +config.tab_max_width = 32 + +local function tab_title(tab) + local title = tab.tab_title + -- if the tab title is explicitly set, take that + if title and #title > 0 then + return title + end + local panetitle = tab.active_pane.title + if panetitle and #panetitle > 0 then + return panetitle + end + -- Otherwise, use the default title. + return "Tab #" .. tab.tab_index + 1 +end + +wezterm.on("format-tab-title", function(tab, _, _, _, _, max_width) + local solid_left_arrow = "" + local solid_right_arrow = "" + local bg_color = "#3A2A4D" + local bg_active_color = "#2B1C3D" + local fg_color = "#FFFFFF" + local fg_active_color = "#FFFFFF" + + -- Edge icon color + local edge_icon_bg = bg_color + local edge_icon_fg = bg_color + + -- Inactive tab + local tab_bg_color = bg_active_color + local tab_fg_color = fg_color + + if tab.is_active then + tab_bg_color = fg_active_color + tab_fg_color = bg_color + end + + edge_icon_fg = tab_bg_color + local title = wezterm.truncate_right(tab_title(tab), max_width - 4) + title = " "..title.." " + return { + { Background = { Color = edge_icon_bg } }, + { Foreground = { Color = edge_icon_fg } }, + { Text = solid_left_arrow }, + { Background = { Color = tab_bg_color } }, + { Foreground = { Color = tab_fg_color } }, + { Text = title }, + { Background = { Color = edge_icon_bg } }, + { Foreground = { Color = edge_icon_fg } }, + { Text = solid_right_arrow }, + } +end) -- keybinds, mostly inspired by konsole config.keys = { { diff --git a/silo.config.lua b/silo.config.lua index 7a4337e..c936d22 100644 --- a/silo.config.lua +++ b/silo.config.lua @@ -55,6 +55,7 @@ config.modules = { 'pueue', 'onefetch', 'efm-langserver', + 'gitlint', }, gui = mod { 'kdePackages.breeze-icons',