8
8
and not tag: user.vim_mode_command
9
9
"""
10
10
11
- ctx .tags = ["user.split " ]
11
+ ctx .tags = ["user.splits " ]
12
12
13
13
14
14
# https://dev.to/mr_destructive/vim-window-splits-p3p
15
15
@ctx .action_class ("user" )
16
16
class UserActions :
17
17
# ----- split creation -----
18
+
19
+ # ----- split arrangement ----
18
20
def split_move_up ():
19
21
pass
20
22
@@ -52,11 +54,17 @@ def split_focus_last():
52
54
actions .key ("ctrl-w" )
53
55
actions .key ("W" )
54
56
55
- def split_focus ( number : int ):
57
+ def split_focus_number ( index : int ):
56
58
actions .user .vim_set_normal_exterm ()
57
- actions .insert (f"{ number } " )
59
+ actions .insert (f"{ index } " )
58
60
actions .key ("ctrl-w ctrl-w" )
59
61
62
+ # FIXME: This name is subject to change pending https://github.com/talonhub/community/pull/1446 decisions
63
+ def split_focus_most_recent ():
64
+ actions .user .vim_set_normal_exterm ()
65
+ actions .key ("ctrl-w" )
66
+ actions .key ("p" )
67
+
60
68
# ----- Split resize -----
61
69
def split_shrink_width ():
62
70
actions .user .vim_set_normal_exterm ()
@@ -88,18 +96,22 @@ def split_expand_height():
88
96
89
97
# ----- Split layout -----
90
98
def split_layout_toggle ():
91
- pass
99
+ actions .user .vim_set_normal_exterm ()
100
+ actions .key ("ctrl-w" )
101
+ actions .key ("r" )
92
102
93
- def split_layout_join_two_groups ():
94
- pass
103
+ def split_clear ():
104
+ actions .user .vim_set_normal_exterm ()
105
+ actions .key ("ctrl-w" )
106
+ actions .key ("q" )
95
107
96
- def split_layout_clear ():
108
+ def split_clear_all ():
97
109
actions .user .vim_set_normal_exterm ()
98
110
actions .key ("ctrl-w" )
99
111
actions .key ("o" )
100
112
101
113
# Requirement: https://github.com/dhruvasagar/vim-zoom
102
- def split_layout_toggle_maximize ():
114
+ def split_maximize ():
103
115
actions .user .vim_run_normal_exterm_key ("ctrl-w m" )
104
116
105
117
@@ -116,3 +128,78 @@ def split_move_last_tab():
116
128
def split_move_new_tab ():
117
129
"""Move the current window to a new tab"""
118
130
actions .user .vim_run_normal_exterm_key ("ctrl-w T" )
131
+
132
+ # TEMPORARY: Once https://github.com/talonhub/community/pull/1446 is merged, this should be removed
133
+ def split_focus_right ():
134
+ """Focus on the split to the right of the current window"""
135
+
136
+ def split_focus_left ():
137
+ """Focus on the split to the left of the current window"""
138
+
139
+ def split_focus_down ():
140
+ """Focus on the split below the current window"""
141
+
142
+ def split_focus_up ():
143
+ """Focus on the split above the current window"""
144
+
145
+ def split_focus_next ():
146
+ """Goes to next split"""
147
+
148
+ def split_focus_last ():
149
+ """Goes to last split"""
150
+
151
+ def split_focus_number (index : int ):
152
+ """Navigates to the specified split"""
153
+
154
+ def split_focus_most_recent ():
155
+ """Focus on the most recently focused split"""
156
+
157
+ # Arrangement
158
+ def split_move_right ():
159
+ """Move the split to the right"""
160
+
161
+ def split_move_left ():
162
+ """Move the split to the left"""
163
+
164
+ def split_move_down ():
165
+ """Move the split down"""
166
+
167
+ def split_move_up ():
168
+ """Move the split up"""
169
+
170
+ def split_layout_toggle ():
171
+ """Flips the orientation of the active split"""
172
+
173
+ def split_center ():
174
+ """Centers the active split (eg: zen mode)"""
175
+
176
+ def split_rotate_right ():
177
+ """Rotates the splits to the right"""
178
+
179
+ def split_rotate_left ():
180
+ """Rotates the splits to the left"""
181
+
182
+ # Resizing
183
+ def split_maximize ():
184
+ """Maximizes the active split"""
185
+
186
+ def split_reset ():
187
+ """Resets all the split sizes"""
188
+
189
+ def split_expand_width ():
190
+ """Expands the split width"""
191
+
192
+ def split_expand_height ():
193
+ """Expands the split height"""
194
+
195
+ def split_shrink_width ():
196
+ """Shrinks the split width"""
197
+
198
+ def split_shrink_height ():
199
+ """Shrinks the split height"""
200
+
201
+ def split_set_width (width : int ):
202
+ """Sets the split width"""
203
+
204
+ def split_set_height (height : int ):
205
+ """Sets the split height"""
0 commit comments