Created
December 17, 2025 16:31
-
-
Save Cicolas/f0bf20b36bf31d6c86a4bff65ded7e7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Pull in the wezterm API | |
| local wezterm = require 'wezterm' | |
| -- This will hold the configuration. | |
| local config = wezterm.config_builder() | |
| -- This is where you actually apply your config choices | |
| -- For example, changing the color scheme: | |
| config.color_scheme = 'Pro' | |
| config.font = wezterm.font 'CaskaydiaCove Nerd Font' | |
| config.window_padding = { | |
| left = 2, | |
| right = 0, | |
| top = 0, | |
| bottom = 0, | |
| } | |
| config.cursor_blink_rate = 800 | |
| config.freetype_load_target = "Normal" | |
| config.font_size = 10 | |
| config.use_fancy_tab_bar = false | |
| config.show_new_tab_button_in_tab_bar = false | |
| config.hide_tab_bar_if_only_one_tab = true | |
| config.tab_max_width = 50 | |
| config.show_tab_index_in_tab_bar = false | |
| config.switch_to_last_active_tab_when_closing_tab = true | |
| config.window_decorations = "RESIZE" | |
| config.window_close_confirmation = "NeverPrompt" | |
| config.tab_bar_at_bottom = false | |
| config.keys = { | |
| { | |
| key = 'w', | |
| mods = 'CTRL|SHIFT', | |
| action = wezterm.action.CloseCurrentTab { confirm = false }, | |
| }, | |
| { | |
| key = 'LeftArrow', | |
| mods = 'SUPER', | |
| action = wezterm.action.SplitPane { | |
| direction = 'Left', | |
| size = { Percent = 50 }, | |
| }, | |
| }, | |
| { | |
| key = 'RightArrow', | |
| mods = 'SUPER', | |
| action = wezterm.action.SplitPane { | |
| direction = 'Right', | |
| size = { Percent = 50 }, | |
| }, | |
| }, | |
| { | |
| key = 'UpArrow', | |
| mods = 'SUPER', | |
| action = wezterm.action.SplitPane { | |
| direction = 'Up', | |
| size = { Percent = 50 }, | |
| }, | |
| }, | |
| { | |
| key = 'DownArrow', | |
| mods = 'SUPER', | |
| action = wezterm.action.SplitPane { | |
| direction = 'Down', | |
| size = { Percent = 50 }, | |
| }, | |
| }, | |
| { | |
| key = 'w', | |
| mods = 'SUPER', | |
| action = wezterm.action.CloseCurrentPane { confirm = false }, | |
| }, | |
| } | |
| wezterm.on( | |
| 'format-tab-title', | |
| function(tab, tabs, panes, config, hover, max_width) | |
| local title = tab.tab_title | |
| local pane = tab.active_pane | |
| local hostname = string.match(pane.title, "^([%w._-]+@[%w._-]+): ") .. ': ' | |
| local path = string.gsub(pane.title, hostname, "") | |
| local str = '' | |
| if hostname == 'nicolas@notebook: ' then | |
| hostname = '' | |
| end | |
| local prefix = '' | |
| if tab.tab_index ~= -1 then | |
| prefix = '\x1b[32m#'..'\x1b[0m' .. tab.tab_index .. ': ' .. hostname | |
| end | |
| if (#prefix + #path) > config.tab_max_width then | |
| offset = (config.tab_max_width - #prefix) | |
| prefix = prefix .. '***' | |
| path = path:sub(#path - (offset - 3), 1000) | |
| end | |
| str = prefix .. path .. ' ' | |
| return str | |
| end | |
| ) | |
| -- and finally, return the configuration to wezterm | |
| return config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment