Skip to content

Instantly share code, notes, and snippets.

@cfsanderson-fulcrum
Last active September 16, 2023 21:40
Show Gist options
  • Save cfsanderson-fulcrum/c5e0fbbd42b0ff74b9e9c314adf71a26 to your computer and use it in GitHub Desktop.
Save cfsanderson-fulcrum/c5e0fbbd42b0ff74b9e9c314adf71a26 to your computer and use it in GitHub Desktop.
My Wezterm config.
--==============================================================================
-- __
-- _ _____ ____ / /____ _________ ___
-- | | /| / / _ \/_ / / __/ _ \/ ___/ __ `__ \
-- | |/ |/ / __/ / /_/ /_/ __/ / / / / / / /
-- |__/|__/\___/ /___/\__/\___/_/ /_/ /_/ /_/
--
--==============================================================================
-- @cfsanderson
local wezterm = require 'wezterm';
-- A helper function for fallback fonts
function font_with_fallback(name, params)
local names = {name, "JetBrains Mono", "Hack"}
return wezterm.font_with_fallback(names, params)
end
wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width)
local pane_title = tab.active_pane.title
local user_title = tab.active_pane.user_vars.panetitle
if user_title ~= nil and #user_title > 0 then
pane_title = user_title
end
return {
{Text=" " .. pane_title .. " "},
}
end)
return {
-- Fonts
font = font_with_fallback("FiraCode Nerd Font"),
font_rules= {
-- use JetBrains Mono for italic
{
italic = true,
font = font_with_fallback("JetBrains Mono Italic"),
},
-- use JetBrains Mono for bold italic
{
italic = true,
intensity = "Bold",
font = font_with_fallback("JetBrains Mono Bold Italic"),
},
-- For half-intensity text, use a lighter weight font
{
intensity = "Half",
font = font_with_fallback("Fira Code Light"),
},
},
font_size = 13.0,
-- Colors
bold_brightens_ansi_colors = true,
colors = {
foreground = "#e1d7c7",
background = "#0b0d0f",
cursor_bg = "#ddc7a1",
cursor_fg = "#ddc7a1",
cursor_border = "#ddc7a1",
split = "#3b4b58",
ansi = {
"#3c3836", "#b85651", "#8f9a52", "#c18f41", "#68948a", "#ab6c7d", "#72966c", "#ada291",
},
brights = {
"#5a524c", "#b85651", "#a9b665", "#d8a657", "#7daea3", "#d3869b", "#89b482", "#dcc6a3",
},
tab_bar = {
background = "#8F9A52",
active_tab = {
bg_color = "#0B0D0F",
fg_color = "#e1d7c7",
intensity = "Bold",
underline = "None",
italic = false,
strikethrough = false,
},
inactive_tab = {
bg_color = "#8F9A52",
fg_color = "#0B0D0F",
intensity = "Bold",
underline = "None",
italic = false,
strikethrough = false,
},
-- The new tab button
new_tab = {
bg_color = "#8F9A52",
fg_color = "#8F9A52",
},
},
},
-- No close prompt
window_close_confirmation = "NeverPrompt",
-- Padding
window_padding = {left = 25, right = 25, top = 0, bottom = 15},
-- No opacity
inactive_pane_hsb = {saturation = 1.0, brightness = 1.0},
-- Tabs
enable_tab_bar = true,
tab_bar_at_bottom = true,
hide_tab_bar_if_only_one_tab = true,
show_tab_index_in_tab_bar = true,
-- Initial size (not exact, just big)
initial_cols = 300,
initial_rows = 400,
-- Custom keybindings
-- ctrl + shift + opt + arrow up/down/left/right resizes current pane.
keys = {
-- switch/activate panes like Tmux (with Vim directions)
{ key = "h", mods="CTRL|SHIFT", action=wezterm.action{ActivatePaneDirection="Left"}},
{ key = "l", mods="CTRL|SHIFT", action=wezterm.action{ActivatePaneDirection="Right"}},
{ key = "k", mods="CTRL|SHIFT", action=wezterm.action{ActivatePaneDirection="Up"}},
{ key = "j", mods="CTRL|SHIFT", action=wezterm.action{ActivatePaneDirection="Down"}},
-- split panes like Tmux
{key="u", mods="CTRL|SHIFT", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}},
{key="i", mods="CTRL|SHIFT", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment