[gnome-builder/wip/slaf/vim-textobjects: 3/8] vim: add ci( ci) cib ci{ ci} ciB ci[ ci] ci< ci>



commit bd9978fc63f6e1d6798344df47eaee9ea74d3867
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Fri Oct 23 13:00:45 2015 +0200

    vim: add ci( ci) cib ci{ ci} ciB ci[ ci] ci< ci>
    
    Work like in vim and with count too

 data/keybindings/vim.css |   77 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 77 insertions(+), 0 deletions(-)
---
diff --git a/data/keybindings/vim.css b/data/keybindings/vim.css
index d4e7a97..2128e6d 100644
--- a/data/keybindings/vim.css
+++ b/data/keybindings/vim.css
@@ -704,6 +704,83 @@
                     "selection-theatric" (shrink)
                     "delete-selection" ()
                     "clear-count" () };
+
+  /* ci( , ci) , cib */
+  bind "parenleft" { "begin-macro" ()
+                     "select-inner" ("(", ")", 1)
+                     "set-mode" ("vim-insert", permanent)
+                     "copy-clipboard" ()
+                     "selection-theatric" (shrink)
+                     "delete-selection" ()
+                     "clear-count" () };
+
+  bind "parenright" { "begin-macro" ()
+                      "select-inner" ("(", ")", 1)
+                      "set-mode" ("vim-insert", permanent)
+                      "copy-clipboard" ()
+                      "selection-theatric" (shrink)
+                      "delete-selection" ()
+                      "clear-count" () };
+
+  bind "b" { "begin-macro" ()
+             "select-inner" ("(", ")", 1)
+             "set-mode" ("vim-insert", permanent)
+             "copy-clipboard" ()
+             "selection-theatric" (shrink)
+             "delete-selection" ()
+             "clear-count" () };
+
+  /* ci[ and ci] */
+  bind "bracketleft" { "begin-macro" ()
+                       "select-inner" ("[", "]", 1)
+                       "set-mode" ("vim-insert", permanent)
+                       "copy-clipboard" ()
+                       "selection-theatric" (shrink)
+                       "delete-selection" () };
+
+  bind "bracketright" { "begin-macro" ()
+                        "select-inner" ("[", "]", 1)
+                        "set-mode" ("vim-insert", permanent)
+                        "copy-clipboard" ()
+                        "selection-theatric" (shrink)
+                        "delete-selection" () };
+
+  /* ci{ , ci} , ciB */
+  bind "braceleft" { "begin-macro" ()
+                     "select-inner" ("{", "}", 1)
+                     "set-mode" ("vim-insert", permanent)
+                     "copy-clipboard" ()
+                     "selection-theatric" (shrink)
+                     "delete-selection" () };
+
+  bind "braceright" { "begin-macro" ()
+                      "select-inner" ("{", "}", 1)
+                      "set-mode" ("vim-insert", permanent)
+                      "copy-clipboard" ()
+                      "selection-theatric" (shrink)
+                      "delete-selection" () };
+
+  bind "<shift>b" { "begin-macro" ()
+                    "select-inner" ("{", "}", 1)
+                    "set-mode" ("vim-insert", permanent)
+                    "copy-clipboard" ()
+                    "selection-theatric" (shrink)
+                    "delete-selection" () };
+
+  /* ci< and ci> */
+    bind "less" { "begin-macro" ()
+                  "select-inner" ("<", ">", 1)
+                  "set-mode" ("vim-insert", permanent)
+                  "copy-clipboard" ()
+                  "selection-theatric" (shrink)
+                  "delete-selection" () };
+
+    bind "greater" { "begin-macro" ()
+                     "select-inner" ("<", ">", 1)
+                     "set-mode" ("vim-insert", permanent)
+                     "copy-clipboard" ()
+                     "selection-theatric" (shrink)
+                     "delete-selection" () };
 }
 
 @binding-set builder-vim-source-view-normal-d


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