wezterm.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. local wezterm = require("wezterm")
  2. local theme = wezterm.plugin.require("https://github.com/neapsix/wezterm").main
  3. wezterm.on("format-window-title", function(tab, pane, tabs, panes, config)
  4. local ws = wezterm.mux.get_active_workspace()
  5. return ws
  6. end)
  7. wezterm.on("user-var-changed", function(window, pane, name, value)
  8. local overrides = window:get_config_overrides() or {}
  9. if name == "ZEN_MODE" then
  10. local incremental = value:find("+")
  11. local number_value = tonumber(value)
  12. if incremental ~= nil then
  13. while number_value > 0 do
  14. window:perform_action(wezterm.action.IncreaseFontSize, pane)
  15. number_value = number_value - 1
  16. end
  17. elseif number_value < 0 then
  18. window:perform_action(wezterm.action.ResetFontSize, pane)
  19. overrides.font_size = nil
  20. else
  21. overrides.font_size = number_value
  22. end
  23. end
  24. window:set_config_overrides(overrides)
  25. end)
  26. return {
  27. window_close_confirmation = "NeverPrompt",
  28. colors = theme.colors(),
  29. enable_tab_bar = false,
  30. font_size = 12.0,
  31. font = wezterm.font("JetBrains Mono"),
  32. window_background_opacity = 0.92,
  33. window_decorations = "NONE",
  34. keys = {},
  35. window_padding = {
  36. left = 0,
  37. right = 0,
  38. top = 0,
  39. bottom = 0,
  40. },
  41. hyperlink_rules = wezterm.default_hyperlink_rules(),
  42. mouse_bindings = {
  43. -- Disable the default click behavior
  44. {
  45. event = { Up = { streak = 1, button = "Left" } },
  46. mods = "NONE",
  47. action = wezterm.action.DisableDefaultAssignment,
  48. },
  49. -- Ctrl-click will open the link under the mouse cursor
  50. {
  51. event = { Up = { streak = 1, button = "Left" } },
  52. mods = "CTRL",
  53. action = wezterm.action.OpenLinkAtMouseCursor,
  54. },
  55. -- Disable the Ctrl-click down event to stop programs from seeing it when a URL is clicked
  56. {
  57. event = { Down = { streak = 1, button = "Left" } },
  58. mods = "CTRL",
  59. action = wezterm.action.Nop,
  60. },
  61. },
  62. }