Compare commits

...

2 commits

Author SHA1 Message Date
72bf8d000a
wezterm: Add url-opening to quickselect
Added new quickselect mode to quickly open a displayed url. Changed
original quickselect to use leader-f mapping (instead of shift+f) and
made new mode callable through the shift+f version.

Delegated scroll mode invocation to leader-b, as in original setup.
2023-01-10 13:50:35 +01:00
cb57e83540
river: Add ability to spawn floating terminal
Can spawn floating terminal with mapping: super+ctrl+return.
2023-01-10 13:49:31 +01:00
2 changed files with 21 additions and 7 deletions

View file

@ -38,6 +38,8 @@ riverctl map normal $mod+Shift C close
# Open terminal # Open terminal
riverctl map normal $mod Return spawn "$term" riverctl map normal $mod Return spawn "$term"
# Open floating terminal
riverctl map normal $mod+Control Return spawn "$term start --class float"
# Open run menu # Open run menu
riverctl map normal $mod Space spawn "bemenu-run" riverctl map normal $mod Space spawn "bemenu-run"

View file

@ -57,25 +57,37 @@ local keys = {
timeout_milliseconds = 2000, timeout_milliseconds = 2000,
replace_current = true replace_current = true
} }
}, { key = 'F', mods = 'LEADER', action = act.QuickSelect }, { }, { key = 'f', mods = 'LEADER', action = act.QuickSelect }, {
key = 'F',
mods = 'LEADER',
action = wezterm.action.QuickSelectArgs {
patterns = { "https?://\\S+" },
action = wezterm.action_callback(
function(window, pane)
local url = window:get_selection_text_for_pane(pane)
wezterm.log_info("opening: " .. url)
wezterm.open_with(url)
end)
}
}, {
key = '/', key = '/',
mods = 'LEADER', mods = 'LEADER',
action = act.Search('CurrentSelectionOrEmptyString') action = act.Search('CurrentSelectionOrEmptyString')
}, { }, {
key = 'f', key = 'b',
mods = 'LEADER', mods = 'LEADER',
action = act.ActivateKeyTable { action = act.ActivateKeyTable {
name = 'scroll_mode', name = 'scroll_mode',
one_shot = false, one_shot = false,
replace_current = true, replace_current = true,
timeout_milliseconds = 15000, timeout_milliseconds = 15000
} }
}, { key = 'e', mods = 'LEADER', action = act.EmitEvent 'edit-scrollback' }, { }, { key = 'e', mods = 'LEADER', action = act.EmitEvent 'edit-scrollback' },
{
key = 'l', key = 'l',
mods = 'LEADER', mods = 'LEADER',
action = act.EmitEvent 'ActivatePaneDirection-Right' action = act.EmitEvent 'ActivatePaneDirection-Right'
}, }, { key = 'a', mods = 'CTRL|ALT', action = act.EmitEvent 'toggle-leader' }
{ key = 'a', mods = 'CTRL|ALT', action = act.EmitEvent 'toggle-leader' }
} }
-- Leader + number to activate that tab -- Leader + number to activate that tab
@ -110,6 +122,6 @@ local key_tables = {
{ key = 'g', mods = 'CTRL', action = act.ScrollToTop }, { key = 'g', mods = 'CTRL', action = act.ScrollToTop },
{ key = 'G', mods = 'CTRL', action = act.ScrollToBottom }, { key = 'G', mods = 'CTRL', action = act.ScrollToBottom },
{ key = 'Escape', action = 'PopKeyTable' } { key = 'Escape', action = 'PopKeyTable' }
}, }
} }
return { keys = keys, key_tables = key_tables } return { keys = keys, key_tables = key_tables }