[gnome-builder] vim: add partial support for ZZ



commit 34a5a5d69466be460a9b246e1f66ec5cd8f81a3d
Author: Christian Hergert <christian hergert me>
Date:   Mon May 4 18:04:22 2015 -0700

    vim: add partial support for ZZ
    
    Now that we have a 'save-all-quit' action, fairly easy to map up vim's
    ZZ which saves the buffer and quits.
    
    This is slightly different from vim currently, in that Vim only closes
    the current view and then closes it (closing Vim after the last buffer
    is hidden).

 data/keybindings/vim.css |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/data/keybindings/vim.css b/data/keybindings/vim.css
index 39a513b..4b25307 100644
--- a/data/keybindings/vim.css
+++ b/data/keybindings/vim.css
@@ -299,6 +299,7 @@
   bind "<ctrl>y" { "movement" (screen-down, 0, 0, 1)
                    "clear-count" () };
   bind "z" { "set-mode" ("vim-normal-z", transient) };
+  bind "<shift>z" { "set-mode" ("vim-normal-Z", transient) };
 
   /* macro recording! */
   bind "q" { "set-mode" ("vim-normal-q", transient) };
@@ -774,6 +775,11 @@
   bind "minus" { "movement" (scroll-screen-bottom, 0, 0, 0) };
 }
 
+ binding-set builder-vim-source-view-normal-Z
+{
+  bind "<shift>z" { "action" ("workbench", "save-all-quit", "") };
+}
+
 @binding-set builder-vim-source-view-visual-z
 {
   bind "z" { "movement" (scroll-screen-center, 1, 0, 0)
@@ -1483,6 +1489,15 @@ IdeSourceViewMode.vim-normal-z {
                     builder-vim-source-view-normal-z;
 }
 
+IdeSourceViewMode.vim-normal-Z {
+  -IdeSourceViewMode-suppress-unbound: true;
+  -IdeSourceViewMode-block-cursor: true;
+  -IdeSourceViewMode-display-name: "Z";
+
+  gtk-key-bindings: builder-vim-source-view,
+                    builder-vim-source-view-normal-Z;
+}
+
 IdeSourceViewMode.vim-insert {
   -IdeSourceViewMode-suppress-unbound: false;
   -IdeSourceViewMode-block-cursor: false;


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