diff --git a/README.asciidoc b/README.asciidoc index 734b7517a..87f4d0add 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -157,6 +157,7 @@ windows are: |Previous window | {sc_previous_window} |Move window forward | {sc_move_window_forward} |Move window backward | {sc_move_window_backward} +|Move window to top | {sc_move_window_to_top} |Focus specific window (windows are counted clockwise from the top left corner) | {sc_first_window}, {sc_second_window} ... {sc_tenth_window} |=== diff --git a/kitty/kitty.conf b/kitty/kitty.conf index 551f0c5be..17958cd29 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -1,4 +1,4 @@ -# vim:fileencoding=utf-8:ft=config +# vim:fileencoding=utf-8:ft=conf # Font family font_family monospace @@ -145,6 +145,7 @@ map ctrl+shift+] next_window map ctrl+shift+[ previous_window map ctrl+shift+f move_window_forward map ctrl+shift+b move_window_backward +map ctrl+shift+` move_window_to_top map ctrl+shift+1 first_window map ctrl+shift+2 second_window map ctrl+shift+3 third_window diff --git a/kitty/tabs.py b/kitty/tabs.py index 8a83cc1ad..25dffa3fe 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -144,13 +144,16 @@ class Tab: self._next_window(-1) def move_window(self, delta=1): - if len(self.windows) > 1: + if len(self.windows) > 1 and abs(delta) > 0: idx = self.active_window_idx nidx = (idx + len(self.windows) + delta) % len(self.windows) self.windows[nidx], self.windows[idx] = self.windows[idx], self.windows[nidx] self.active_window_idx = nidx self.relayout() + def move_window_to_top(self): + self.move_window(-self.active_window_idx) + def move_window_forward(self): self.move_window()