Skip to content

Instantly share code, notes, and snippets.

@chergert
Created March 12, 2015 09:48
Show Gist options
  • Save chergert/4d32467855cf408eba06 to your computer and use it in GitHub Desktop.
Save chergert/4d32467855cf408eba06 to your computer and use it in GitHub Desktop.
example of repeated insert though indirection keypress (i) followed by modifier key (-)
diff --git a/data/keybindings/emacs.css b/data/keybindings/emacs.css
index 907fe49..f114148 100644
--- a/data/keybindings/emacs.css
+++ b/data/keybindings/emacs.css
@@ -58,6 +58,34 @@
bind "<shift><ctrl>j" { "action" ("editor-view", "toggle-split", "") };
bind "<ctrl><alt>Page_Up" { "action" ("stack", "previous-document", "") };
bind "<ctrl><alt>Page_Down" { "action" ("stack", "next-document", "") };
+
+ bind "<alt>1" { "append-to-count" (1) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>2" { "append-to-count" (2) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>3" { "append-to-count" (3) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>4" { "append-to-count" (4) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>5" { "append-to-count" (5) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>6" { "append-to-count" (6) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>7" { "append-to-count" (7) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>8" { "append-to-count" (8) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>9" { "append-to-count" (9) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>0" { "append-to-count" (0) "set-mode" ("emacs-with-numbers", transient) };
+}
+
+@binding-set builder-emacs-source-view-with-numbers
+{
+ bind "<alt>1" { "append-to-count" (1) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>2" { "append-to-count" (2) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>3" { "append-to-count" (3) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>4" { "append-to-count" (4) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>5" { "append-to-count" (5) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>6" { "append-to-count" (6) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>7" { "append-to-count" (7) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>8" { "append-to-count" (8) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>9" { "append-to-count" (9) "set-mode" ("emacs-with-numbers", transient) };
+ bind "<alt>0" { "append-to-count" (0) "set-mode" ("emacs-with-numbers", transient) };
+
+ bind "i" { "capture-modifier" ()
+ "insert-modifier" (1) };
}
@binding-set builder-emacs-source-view-x
@@ -100,6 +128,12 @@ IdeSourceViewMode.default
gtk-key-bindings: builder-emacs-text-entry, builder-emacs-source-view, builder-emacs-text-view;
}
+GtkSourceView,
+IdeSourceViewMode.emacs-with-numbers
+{
+ gtk-key-bindings: builder-emacs-text-entry, builder-emacs-source-view-with-numbers, builder-emacs-source-view, builder-emacs-text-view;
+}
+
IdeSourceViewMode.emacs-x {
gtk-key-bindings: builder-emacs-source-view-x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment