[gnome-builder/wip/slaf/vim-textobjects: 5/8] vim: add di( di) dib di{ di} diB di[ di] di< di>



commit 3027b08f2b9092ba061dd1cb7c5823f006689472
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Fri Oct 23 14:42:52 2015 +0200

    vim: add di( di) dib di{ di} diB di[ di] di< di>
    
        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 58bf3bc..d34c6d8 100644
--- a/data/keybindings/vim.css
+++ b/data/keybindings/vim.css
@@ -1256,6 +1256,83 @@
                     "selection-theatric" (shrink)
                     "delete-selection" ()
                     "clear-count" () };
+
+  /* di( , di) , dib */
+  bind "parenleft" { "begin-macro" ()
+                     "select-inner" ("(", ")", 1)
+                     "set-mode" ("vim-normal", permanent)
+                     "copy-clipboard" ()
+                     "selection-theatric" (shrink)
+                     "delete-selection" ()
+                     "clear-count" () };
+
+  bind "parenright" { "begin-macro" ()
+                      "select-inner" ("(", ")", 1)
+                      "set-mode" ("vim-normal", permanent)
+                      "copy-clipboard" ()
+                      "selection-theatric" (shrink)
+                      "delete-selection" ()
+                      "clear-count" () };
+
+  bind "b" { "begin-macro" ()
+             "select-inner" ("(", ")", 1)
+             "set-mode" ("vim-normal", permanent)
+             "copy-clipboard" ()
+             "selection-theatric" (shrink)
+             "delete-selection" ()
+             "clear-count" () };
+
+  /* di[ and di] */
+  bind "bracketleft" { "begin-macro" ()
+                       "select-inner" ("[", "]", 1)
+                       "set-mode" ("vim-normal", permanent)
+                       "copy-clipboard" ()
+                       "selection-theatric" (shrink)
+                       "delete-selection" () };
+
+  bind "bracketright" { "begin-macro" ()
+                        "select-inner" ("[", "]", 1)
+                        "set-mode" ("vim-normal", permanent)
+                        "copy-clipboard" ()
+                        "selection-theatric" (shrink)
+                        "delete-selection" () };
+
+  /* di{ , di} , diB */
+  bind "braceleft" { "begin-macro" ()
+                     "select-inner" ("{", "}", 1)
+                     "set-mode" ("vim-normal", permanent)
+                     "copy-clipboard" ()
+                     "selection-theatric" (shrink)
+                     "delete-selection" () };
+
+  bind "braceright" { "begin-macro" ()
+                      "select-inner" ("{", "}", 1)
+                      "set-mode" ("vim-normal", permanent)
+                      "copy-clipboard" ()
+                      "selection-theatric" (shrink)
+                      "delete-selection" () };
+
+  bind "<shift>b" { "begin-macro" ()
+                    "select-inner" ("{", "}", 1)
+                    "set-mode" ("vim-normal", permanent)
+                    "copy-clipboard" ()
+                    "selection-theatric" (shrink)
+                    "delete-selection" () };
+
+  /* di< and di> */
+    bind "less" { "begin-macro" ()
+                  "select-inner" ("<", ">", 1)
+                  "set-mode" ("vim-normal", permanent)
+                  "copy-clipboard" ()
+                  "selection-theatric" (shrink)
+                  "delete-selection" () };
+
+    bind "greater" { "begin-macro" ()
+                     "select-inner" ("<", ">", 1)
+                     "set-mode" ("vim-normal", permanent)
+                     "copy-clipboard" ()
+                     "selection-theatric" (shrink)
+                     "delete-selection" () };
 }
 
 @binding-set builder-vim-source-view-visual-g


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