Skip to content

Instantly share code, notes, and snippets.

@ilmax
Created July 17, 2024 15:32
Show Gist options
  • Select an option

  • Save ilmax/9fa5825f627c58ff08efdf984a826501 to your computer and use it in GitHub Desktop.

Select an option

Save ilmax/9fa5825f627c58ff08efdf984a826501 to your computer and use it in GitHub Desktop.
-- Right click copy and paste
config.mouse_bindings = {
{
event = { Down = { streak = 1, button = "Right" } },
mods = "NONE",
action = wezterm.action_callback(function(window, pane)
local has_selection = window:get_selection_text_for_pane(pane) ~= ""
if has_selection then
window:perform_action(act.CopyTo("ClipboardAndPrimarySelection"), pane)
window:perform_action(act.ClearSelection, pane)
else
window:perform_action(act({ PasteFrom = "Clipboard" }), pane)
end
end),
},
}
-- This will create a new vertical split
config.keys = {
{
key = 'd',
mods = 'CMD',
action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' },
},
-- This will create a new horizontal split
{
key = '\\',
mods = 'CMD',
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
},
-- This will allow closing a single pane
{
key = 'w',
mods = 'CMD',
action = wezterm.action.CloseCurrentPane { confirm = true },
},
-- Make Option-Left equivalent to Alt-b which many line editors interpret as backward-word
{
key="LeftArrow",
mods="OPT",
action = wezterm.action { SendString="\x1bb" },
},
-- Make Option-Right equivalent to Alt-f; forward-word
{
key="RightArrow",
mods="OPT",
action = wezterm.action { SendString="\x1bf" }
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment