[gnome-builder] libide: add rudimentary ce cw and cip support



commit 54e7f0b2c9df0658fd98778ec11dbfd5661efa54
Author: Christian Hergert <christian hergert me>
Date:   Thu Mar 5 16:35:40 2015 -0800

    libide: add rudimentary ce cw and cip support
    
    cip is too aggressive at the moment, it tries to swallow the surrounding
    empty lines. To fix this, I think we need to plumb exclusive concepts
    into movements.

 data/keybindings/vim.css |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/data/keybindings/vim.css b/data/keybindings/vim.css
index 3ba341c..639284e 100644
--- a/data/keybindings/vim.css
+++ b/data/keybindings/vim.css
@@ -111,6 +111,7 @@
                     "set-overwrite" (1) };
 
  /* jump to sub-mode */
+  bind "c" { "set-mode" ("vim-normal-c", transient) };
   bind "d" { "set-mode" ("vim-normal-d", transient) };
 
   /* delete to end of line */
@@ -166,6 +167,31 @@
   bind "<ctrl>v" { "set-mode" ("vim-visual-block", permanent) };
 }
 
+ binding-set builder-vim-source-view-normal-c
+{
+  bind "i" { "set-mode" ("vim-normal-c-i", transient) };
+
+  bind "e" { "movement" (next-word-end, 1)
+             "copy-selection" ()
+             "delete-selection" ()
+             "set-mode" ("vim-insert", permanent) };
+  bind "w" { "movement" (next-word-end, 1)
+             "copy-selection" ()
+             "delete-selection" ()
+             "set-mode" ("vim-insert", permanent) };
+}
+
+ binding-set builder-vim-source-view-normal-c-i
+{
+  /* cip */
+  bind "p" { "movement" (paragraph-start, 1)
+             "swap-selection-bounds" ()
+             "movement" (paragraph-end, 1)
+             "copy-selection" ()
+             "delete-selection" ()
+             "set-mode" ("vim-insert", permanent) };
+}
+
 @binding-set builder-vim-source-view-normal-d
 {
   bind "h" { "movement" (previous-char, 1)
@@ -452,6 +478,16 @@ IdeSourceViewMode.vim-normal {
                     builder-vim-source-view-normal;
 }
 
+IdeSourceViewMode.vim-normal-c {
+  gtk-key-bindings: builder-vim-source-view,
+                    builder-vim-source-view-normal-c;
+}
+
+IdeSourceViewMode.vim-normal-c-i {
+  gtk-key-bindings: builder-vim-source-view,
+                    builder-vim-source-view-normal-c-i;
+}
+
 IdeSourceViewMode.vim-normal-d {
   gtk-key-bindings: builder-vim-source-view,
                     builder-vim-source-view-normal-d;


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