Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wezterm: configuration with nix #6047

Open
nikitarevenco opened this issue Nov 6, 2024 · 0 comments
Open

wezterm: configuration with nix #6047

nikitarevenco opened this issue Nov 6, 2024 · 0 comments
Assignees

Comments

@nikitarevenco
Copy link

WezTerm's configuration is in lua but it's not very complicated and can be represented with a static format. For example here is my WezTerm configuration:

local wezterm = require("wezterm")
local config = wezterm.config_builder()

config.color_scheme = "Catppuccin Mocha"
config.font_size = 13
config.font = wezterm.font("JetBrainsMono Nerd Font")
config.window_close_confirmation = "NeverPrompt"
config.window_decorations = "RESIZE"
config.automatically_reload_config = false
config.swallow_mouse_click_on_window_focus = true
config.window_padding = {
	left = 0,
	right = 0,
	top = 0,
	bottom = 0,
}

config.adjust_window_size_when_changing_font_size = false

config.keys = {
	{
		key = "F11",
		action = wezterm.action.ToggleFullScreen,
	},
	{
		key = "+",
		mods = "CTRL",
		action = wezterm.action.IncreaseFontSize,
	},
	{
		key = "-",
		mods = "CTRL",
		action = wezterm.action.DecreaseFontSize,
	},
	{
		key = "=",
		mods = "CTRL",
		action = wezterm.action.ResetFontSize,
	},
	{ key = "LeftArrow", mods = "OPT", action = wezterm.action({ SendString = "\x1bb" }) },
	{ key = "RightArrow", mods = "OPT", action = wezterm.action({ SendString = "\x1bf" }) },
	{
		key = "\\",
		mods = "CTRL",
		action = wezterm.action.ActivateCopyMode,
	},
	{
		key = "Backspace",
		mods = "CTRL",
		action = wezterm.action.SendKey({ mods = "CTRL", key = "w" }),
	},
}

config.char_select_font_size = 13
config.char_select_fg_color = "#cdd6f4"
config.char_select_bg_color = "#1e1e2e"

config.selection_word_boundary = " \t\n{}[]()\"'`,;:@│┃*…$"
config.audible_bell = "Disabled"
config.hide_tab_bar_if_only_one_tab = true

config.default_cursor_style = "SteadyBar"

return config

As you can see it's just keys and values, so generating a wezterm.lua file from a nix object shouldn't be hard, at least for the simple changes.

For more complex changes people can always use extraConfig options.

For someone who is familiar with writing Nix packages, it would be awesome if you expanded wezterm.nix: https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/wezterm.nix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants