dotfiles/home/config/wezterm/wezterm.lua

125 lines
3.3 KiB
Lua
Raw Permalink Normal View History

local wezterm = require 'wezterm'
local config = {}
-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
config = wezterm.config_builder()
end
wezterm.on('update-status', function(window)
-- Grab the utf8 character for the "powerline" left facing
-- solid arrow.
local SOLID_LEFT_ARROW = utf8.char(0xe0b2)
-- Grab the current window's configuration, and from it the
-- palette (this is the combination of your chosen colour scheme
-- including any overrides).
local color_scheme = window:effective_config().resolved_palette
local bg = color_scheme.background
local fg = color_scheme.foreground
window:set_right_status(wezterm.format({
-- First, we draw the arrow...
{ Background = { Color = 'none' } },
{ Foreground = { Color = bg } },
{ Text = SOLID_LEFT_ARROW },
-- Then we draw our text
{ Background = { Color = bg } },
{ Foreground = { Color = fg } },
{ Text = ' ' .. wezterm.hostname() .. ' ' },
}))
end)
-- This is where you actually apply your config choices
config.set_environment_variables = {
PATH = '/opt/homebrew/bin:' .. os.getenv('PATH')
}
2024-08-13 20:18:43 +00:00
-- FUCK LIGATURES
config.harfbuzz_features = { 'calt=0', 'clig=0', 'liga=0' }
config.color_scheme = 'Jellybeans (Gogh)'
config.font = wezterm.font_with_fallback { 'IosevkaTerm Nerd Font' }
2024-11-01 18:52:50 +00:00
-- config.font = wezterm.font_with_fallback { 'DepartureMono' }
config.font_size = 15
config.hide_tab_bar_if_only_one_tab = true
config.window_decorations = 'RESIZE'
config.window_background_opacity = 0.8
config.macos_window_background_blur = 80
config.window_frame = {
font = wezterm.font({ family = 'IosevkaTerm Nerd Fonk', weight = 'Bold' }),
font_size = 11,
}
config.keys = {
-- Sends ESC + b and ESC + f sequence, which is used
-- for telling your shell to jump back/forward.
{
-- When the left arrow is pressed
key = 'LeftArrow',
-- With the "Option" key modifier held down
mods = 'OPT',
-- Perform this action, in this case - sending ESC + B
-- to the terminal
action = wezterm.action.SendString '\x1bb',
},
{
key = 'RightArrow',
mods = 'OPT',
action = wezterm.action.SendString '\x1bf',
},
-- Command+, for opening "settings" in nvim
{
key = ',',
mods = 'SUPER',
action = wezterm.action.SpawnCommandInNewTab {
cwd = wezterm.home_dir,
2024-08-13 20:18:43 +00:00
args = { 'nvim', wezterm.home_dir .. '/.config/wezterm/wezterm.lua' },
},
},
2024-09-30 14:21:25 +00:00
{
key = '|',
mods = 'CTRL|SHIFT|ALT',
action = wezterm.action.SplitHorizontal { },
},
{
key = '_',
mods = 'CTRL|SHIFT|ALT',
action = wezterm.action.SplitVertical { },
},
}
2024-09-30 14:21:25 +00:00
function tab_title(tab_info)
local title = tab_info.tab_title
-- if the tab title is explicitly set, take that
if title and #title > 0 then
return title
end
-- Otherwise, use the title from the active pane
-- in that tab
return tab_info.active_pane.title
end
wezterm.on(
'format-tab-title',
function(tab, tabs, panes, config, hover, max_width)
local title = tab_title(tab)
if tab.is_active then
return {
{ Background = { Color = 'purple' } },
{ Text = ' ' .. title .. ' ' },
}
end
return title
end
)
-- and finally, return the configuration to wezterm
return config
2024-09-30 14:21:25 +00:00