aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-03-06 22:57:30 -0800
committerGravatar Tom Willemse2026-03-06 22:57:30 -0800
commit77be880a690fd2fdd8196c3c4579cf8d4ac8b918 (patch)
treebe58b8782f1b086e6bdd5985b04ba1b8bc6476ff
parent13da87e2b4663639156d949339469991ed657b0a (diff)
downloadnew-dotfiles-77be880a690fd2fdd8196c3c4579cf8d4ac8b918.tar.gz
new-dotfiles-77be880a690fd2fdd8196c3c4579cf8d4ac8b918.zip
glide: Convert some keybindings to excmds
This way they look nicer in ‘:map’, ‘:’, and can be reused.
-rw-r--r--glide/.config/glide/glide.ts44
1 files changed, 26 insertions, 18 deletions
diff --git a/glide/.config/glide/glide.ts b/glide/.config/glide/glide.ts
index 1e70be9..045cb50 100644
--- a/glide/.config/glide/glide.ts
+++ b/glide/.config/glide/glide.ts
@@ -80,8 +80,24 @@ glide.keymaps.set('normal', '<A-x>', 'commandline_show');
glide.keymaps.set('normal', 't', 'commandline_show tab_new ');
glide.keymaps.del('normal', ':');
+const keyboard_quit = glide.excmds.create({
+ name: "keyboard_quit",
+ description: 'Cancel whatever is going on and return to normal',
+}, () => {
+ if (glide.findbar.is_open()) {
+ glide.findbar.close();
+ }
+
+ glide.excmds.execute('mode_change normal');
+});
+
+glide.keymaps.set('insert', '<C-g>', 'keyboard_quit');
+
// Search
-glide.keymaps.set('normal', '<C-s>', function() {
+const search_next = glide.excmds.create({
+ name: "search_next",
+ description: "Open search or find the next result",
+}, () => {
if (glide.findbar.is_focused()) {
glide.findbar.next_match();
}
@@ -90,7 +106,11 @@ glide.keymaps.set('normal', '<C-s>', function() {
glide.excmds.execute('mode_change insert');
}
});
-glide.keymaps.set('normal', '<C-r>', function() {
+
+const search_prev = glide.excmds.create({
+ name: "search_prev",
+ description: "Open search of find the previous result",
+}, () => {
if (glide.findbar.is_focused()) {
glide.findbar.previous_match();
}
@@ -99,23 +119,11 @@ glide.keymaps.set('normal', '<C-r>', function() {
glide.excmds.execute('mode_change insert');
}
});
-glide.keymaps.set('insert', '<C-s>', function() {
- if (glide.findbar.is_focused()) {
- glide.findbar.next_match();
- }
-});
-glide.keymaps.set('insert', '<C-r>', function() {
- if (glide.findbar.is_focused()) {
- glide.findbar.previous_match();
- }
-});
-glide.keymaps.set('insert', '<C-g>', function() {
- if (glide.findbar.is_open()) {
- glide.findbar.close();
- }
- glide.excmds.execute('mode_change normal');
-});
+glide.keymaps.set('normal', '<C-s>', 'search_next');
+glide.keymaps.set('normal', '<C-r>', 'search_prev');
+glide.keymaps.set('insert', '<C-s>', 'search_next');
+glide.keymaps.set('insert', '<C-r>', 'search_prev');
async function installPuntAddons() {
await glide.addons.install("https://addons.mozilla.org/firefox/downloads/file/4677239/1password_x_password_manager-8.12.1.3.xpi");