A new swap_with_window mappable action
Allows visual selection of a window to swap with the current window
This commit is contained in:
parent
0de319fc73
commit
a4a7d49bed
@ -58,6 +58,7 @@ Move window forward :sc:`move_window_forward`
|
|||||||
Move window backward :sc:`move_window_backward`
|
Move window backward :sc:`move_window_backward`
|
||||||
Move window to top :sc:`move_window_to_top`
|
Move window to top :sc:`move_window_to_top`
|
||||||
Visually focus window :sc:`focus_visible_window`
|
Visually focus window :sc:`focus_visible_window`
|
||||||
|
Visually swap window :sc:`swap_with_window`
|
||||||
Focus specific window :sc:`first_window`, :sc:`second_window` ... :sc:`tenth_window`
|
Focus specific window :sc:`first_window`, :sc:`second_window` ... :sc:`tenth_window`
|
||||||
(also :kbd:`⌘+1`, :kbd:`⌘+2` ... :kbd:`⌘+9` on macOS)
|
(also :kbd:`⌘+1`, :kbd:`⌘+2` ... :kbd:`⌘+9` on macOS)
|
||||||
(clockwise from the top-left)
|
(clockwise from the top-left)
|
||||||
|
|||||||
@ -32,7 +32,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||||||
the request by default instead of denying by default. See
|
the request by default instead of denying by default. See
|
||||||
:opt:`clipboard_control` for details (:iss:`4022`)
|
:opt:`clipboard_control` for details (:iss:`4022`)
|
||||||
|
|
||||||
- A new mappable action ``select_window_in_tab`` to select a window in the current tab to switch to, by window title
|
- A new mappable action ``swap_with_window`` to swap the current window with another window in the tab, visually
|
||||||
|
|
||||||
- A new option :opt:`bell_path` to specify the path to a sound file
|
- A new option :opt:`bell_path` to specify the path to a sound file
|
||||||
to use as the bell sound
|
to use as the bell sound
|
||||||
|
|||||||
@ -3152,6 +3152,7 @@ map('Tenth window',
|
|||||||
)
|
)
|
||||||
|
|
||||||
map('Visually select focus window', 'focus_visible_window kitty_mod+f7 focus_visible_window')
|
map('Visually select focus window', 'focus_visible_window kitty_mod+f7 focus_visible_window')
|
||||||
|
map('Visually swap window with another', 'swap_with_window kitty_mod+f8 swap_with_window')
|
||||||
egr() # }}}
|
egr() # }}}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
kitty/options/types.py
generated
2
kitty/options/types.py
generated
@ -769,6 +769,8 @@ defaults.map = [
|
|||||||
KeyDefinition(False, KeyAction('tenth_window'), 1024, False, 48, ()),
|
KeyDefinition(False, KeyAction('tenth_window'), 1024, False, 48, ()),
|
||||||
# focus_visible_window
|
# focus_visible_window
|
||||||
KeyDefinition(False, KeyAction('focus_visible_window'), 1024, False, 57370, ()),
|
KeyDefinition(False, KeyAction('focus_visible_window'), 1024, False, 57370, ()),
|
||||||
|
# swap_with_window
|
||||||
|
KeyDefinition(False, KeyAction('swap_with_window'), 1024, False, 57371, ()),
|
||||||
# next_tab
|
# next_tab
|
||||||
KeyDefinition(False, KeyAction('next_tab'), 1024, False, 57351, ()),
|
KeyDefinition(False, KeyAction('next_tab'), 1024, False, 57351, ()),
|
||||||
# next_tab
|
# next_tab
|
||||||
|
|||||||
@ -572,7 +572,8 @@ class Tab: # {{{
|
|||||||
if group is not None:
|
if group is not None:
|
||||||
w = self.active_window
|
w = self.active_window
|
||||||
if w is not None and w.id != window_id:
|
if w is not None and w.id != window_id:
|
||||||
self.current_layout.move_window_to_group(self.windows, group.id)
|
if self.current_layout.move_window_to_group(self.windows, group.id):
|
||||||
|
self.relayout()
|
||||||
|
|
||||||
@ac('win', '''
|
@ac('win', '''
|
||||||
Focus a visible window by pressing the number of the window. Window numbers are displayed
|
Focus a visible window by pressing the number of the window. Window numbers are displayed
|
||||||
@ -584,6 +585,12 @@ class Tab: # {{{
|
|||||||
|
|
||||||
get_boss().visual_window_select_action(self, callback, 'Choose window to switch to')
|
get_boss().visual_window_select_action(self, callback, 'Choose window to switch to')
|
||||||
|
|
||||||
|
@ac('win', 'Swap the current window with another window in the current tab, selected visually')
|
||||||
|
def swap_with_window(self) -> None:
|
||||||
|
def callback(tab: Tab, window: Window) -> None:
|
||||||
|
tab.swap_active_window_with(window.id)
|
||||||
|
get_boss().visual_window_select_action(self, callback, 'Choose window to swap with')
|
||||||
|
|
||||||
@ac('win', 'Move active window to the top (make it the first window)')
|
@ac('win', 'Move active window to the top (make it the first window)')
|
||||||
def move_window_to_top(self) -> None:
|
def move_window_to_top(self) -> None:
|
||||||
n = self.windows.active_group_idx
|
n = self.windows.active_group_idx
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user