aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-03-06 23:55:50 -0800
committerGravatar Tom Willemse2026-03-08 14:25:30 -0700
commiteb58cfd9a9fa70388707377b2476a8ef5a96295b (patch)
tree884b7fc46ca7b45077d4e83a848a9736ea141a1a
parent2d1ebd9f20f2d668d72ae549c59341f8d48ff2a1 (diff)
downloadnew-dotfiles-eb58cfd9a9fa70388707377b2476a8ef5a96295b.tar.gz
new-dotfiles-eb58cfd9a9fa70388707377b2476a8ef5a96295b.zip
glide: Add some window splitting functions
-rw-r--r--glide/.config/glide/glide.ts42
1 files changed, 42 insertions, 0 deletions
diff --git a/glide/.config/glide/glide.ts b/glide/.config/glide/glide.ts
index 045cb50..c505eab 100644
--- a/glide/.config/glide/glide.ts
+++ b/glide/.config/glide/glide.ts
@@ -424,3 +424,45 @@ glide.keymaps.set('normal', 'kb', async () => {
})),
});
});
+
+
+// Split windows
+
+const split_window = glide.excmds.create({
+ name: 'split_window',
+ description: 'Ask for a tab and show it in a split with this window',
+}, async () => {
+ const activeTab = await glide.tabs.active();
+ const tabs = await glide.tabs.query({});
+
+ glide.commandline.show({
+ title: "Show other",
+ options: tabs.map(t => ({
+ label: t.title,
+ async execute() {
+ glide.unstable.split_views.create([activeTab.id, t.id]);
+ }
+ })),
+ });
+});
+
+const unsplit_window = glide.excmds.create({
+ name: 'unsplit_window',
+ description: 'Remove the current split of windows',
+}, ({ tab_id }) => {
+ glide.unstable.split_views.separate(tab_id);
+});
+
+const other_window = glide.excmds.create({
+ name: 'other_window',
+ description: 'Focus other window',
+}, async ({ tab_id }) => {
+ const split_tabs = await glide.unstable.split_views.get(tab_id);
+ const other_tab = split_tabs.tabs.filter(t => t.id !== tab_id)[0];
+
+ await browser.tabs.update(other_tab.id, { active: true });
+});
+
+glide.keymaps.set('normal', '<C-x>4b', 'split_window');
+glide.keymaps.set('normal', '<C-x>1', 'unsplit_window');
+glide.keymaps.set('normal', '<A-o>', 'other_window');