[gnome-builder/gnome-builder-3-24] emacs: use C-c C-f to activate reformatting



commit 7e3bf4d45743aec52f4c36058aa72d4fcaeeaf80
Author: Christian Hergert <chergert redhat com>
Date:   Thu Mar 30 19:07:24 2017 -0600

    emacs: use C-c C-f to activate reformatting
    
    This really belongs in an emacs mode, but we do not have support for that
    level of keybindings yet. So we'll just steal the Rust mode which uses
    C-c C-f for now.

 data/keybindings/emacs.css |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/data/keybindings/emacs.css b/data/keybindings/emacs.css
index 7c5cd6f..f0fea7c 100644
--- a/data/keybindings/emacs.css
+++ b/data/keybindings/emacs.css
@@ -55,6 +55,7 @@
                   "clear-snippets" ()
                   "hide-completion" () };
   bind "<ctrl>x" { "set-mode" ("emacs-x", transient) };
+  bind "<ctrl>c" { "set-mode" ("emacs-c", transient) };
   bind "<ctrl>underscore" { "undo" () };
   bind "<alt>x" { "action" ("win", "show-command-bar", "") };
   bind "<ctrl>r" { "action" ("frame", "find", "2") };
@@ -132,6 +133,11 @@
   bind "h" { "select-all" (1) };
 }
 
+@binding-set builder-emacs-source-view-c
+{
+  bind "<ctrl>f" { "format-selection" () };
+}
+
 /*
  * Bindings for GtkTreeView
  */
@@ -192,6 +198,12 @@ idesourceviewmode.emacs-x {
   -gtk-key-bindings: builder-emacs-source-view-x;
 }
 
+idesourceviewmode.emacs-c {
+  -IdeSourceViewMode-display-name: "C-c";
+
+  -gtk-key-bindings: builder-emacs-source-view-c;
+}
+
 treeview {
   -gtk-key-bindings: builder-emacs-tree-view;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]