[gnome-builder] vim: add i" i' i` for c, d and v mode



commit 384c4c0718b2c0fff81492ceeada9ea313924a22
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Sat Oct 24 00:57:57 2015 +0200

    vim: add i" i' i` for c, d and v mode
    
    the rules are the same as Vim for string text-objects:
    
    - the count is not used
    - if we are not in a string, we search one to the right
    - only the current line is taken into account

 data/keybindings/vim.css |  114 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 114 insertions(+), 0 deletions(-)
---
diff --git a/data/keybindings/vim.css b/data/keybindings/vim.css
index c348850..ed25751 100644
--- a/data/keybindings/vim.css
+++ b/data/keybindings/vim.css
@@ -774,6 +774,28 @@
                      "copy-clipboard" ()
                      "selection-theatric" (shrink)
                      "delete-selection" () };
+
+  /* ci" ci' ci` */
+    bind "quotedbl" { "begin-macro" ()
+                      "select-inner" ("\"", "\"", 1, 1)
+                      "set-mode" ("vim-insert", permanent)
+                      "copy-clipboard" ()
+                      "selection-theatric" (shrink)
+                      "delete-selection" () };
+
+    bind "apostrophe" { "begin-macro" ()
+                        "select-inner" ("'", "'", 1, 1)
+                        "set-mode" ("vim-insert", permanent)
+                        "copy-clipboard" ()
+                        "selection-theatric" (shrink)
+                        "delete-selection" () };
+
+    bind "grave" { "begin-macro" ()
+                   "select-inner" ("`", "`", 1, 1)
+                   "set-mode" ("vim-insert", permanent)
+                   "copy-clipboard" ()
+                   "selection-theatric" (shrink)
+                   "delete-selection" () };
 }
 
 @binding-set builder-vim-source-view-normal-c-a
@@ -851,6 +873,28 @@
                      "copy-clipboard" ()
                      "selection-theatric" (shrink)
                      "delete-selection" () };
+
+  /* ca" ca' ca` */
+    bind "quotedbl" { "begin-macro" ()
+                      "select-inner" ("\"", "\"", 0, 1)
+                      "set-mode" ("vim-insert", permanent)
+                      "copy-clipboard" ()
+                      "selection-theatric" (shrink)
+                      "delete-selection" () };
+
+    bind "apostrophe" { "begin-macro" ()
+                        "select-inner" ("'", "'", 0, 1)
+                        "set-mode" ("vim-insert", permanent)
+                        "copy-clipboard" ()
+                        "selection-theatric" (shrink)
+                        "delete-selection" () };
+
+    bind "grave" { "begin-macro" ()
+                   "select-inner" ("`", "`", 0, 1)
+                   "set-mode" ("vim-insert", permanent)
+                   "copy-clipboard" ()
+                   "selection-theatric" (shrink)
+                   "delete-selection" () };
 }
 
 @binding-set builder-vim-source-view-normal-d
@@ -1317,6 +1361,28 @@
                      "copy-clipboard" ()
                      "selection-theatric" (shrink)
                      "delete-selection" () };
+
+  /* di" di' di` */
+    bind "quotedbl" { "begin-macro" ()
+                      "select-inner" ("\"", "\"", 1, 1)
+                      "set-mode" ("vim-normal", permanent)
+                      "copy-clipboard" ()
+                      "selection-theatric" (shrink)
+                      "delete-selection" () };
+
+    bind "apostrophe" { "begin-macro" ()
+                        "select-inner" ("'", "'", 1, 1)
+                        "set-mode" ("vim-normal", permanent)
+                        "copy-clipboard" ()
+                        "selection-theatric" (shrink)
+                        "delete-selection" () };
+
+    bind "grave" { "begin-macro" ()
+                   "select-inner" ("`", "`", 1, 1)
+                   "set-mode" ("vim-normal", permanent)
+                   "copy-clipboard" ()
+                   "selection-theatric" (shrink)
+                   "delete-selection" () };
 }
 
 @binding-set builder-vim-source-view-normal-d-a
@@ -1394,6 +1460,28 @@
                      "copy-clipboard" ()
                      "selection-theatric" (shrink)
                      "delete-selection" () };
+
+  /* da" da' da` */
+    bind "quotedbl" { "begin-macro" ()
+                      "select-inner" ("\"", "\"", 0, 1)
+                      "set-mode" ("vim-normal", permanent)
+                      "copy-clipboard" ()
+                      "selection-theatric" (shrink)
+                      "delete-selection" () };
+
+    bind "apostrophe" { "begin-macro" ()
+                        "select-inner" ("'", "'", 0, 1)
+                        "set-mode" ("vim-normal", permanent)
+                        "copy-clipboard" ()
+                        "selection-theatric" (shrink)
+                        "delete-selection" () };
+
+    bind "grave" { "begin-macro" ()
+                   "select-inner" ("`", "`", 0, 1)
+                   "set-mode" ("vim-normal", permanent)
+                   "copy-clipboard" ()
+                   "selection-theatric" (shrink)
+                   "delete-selection" () };
 }
 
 @binding-set builder-vim-source-view-visual-g
@@ -1720,6 +1808,19 @@
     bind "greater" { "begin-macro" ()
                      "select-inner" ("<", ">", 1, 0)
                      "set-mode" ("vim-visual", permanent) };
+
+  /* vi" vi' vi` */
+    bind "quotedbl" { "begin-macro" ()
+                      "select-inner" ("\"", "\"", 1, 1)
+                      "set-mode" ("vim-visual", permanent) };
+
+    bind "apostrophe" { "begin-macro" ()
+                        "select-inner" ("'", "'", 1, 1)
+                        "set-mode" ("vim-visual", permanent) };
+
+    bind "grave" { "begin-macro" ()
+                   "select-inner" ("`", "`", 1, 1)
+                   "set-mode" ("vim-visual", permanent) };
 }
 
 @binding-set builder-vim-source-view-visual-a
@@ -1767,6 +1868,19 @@
     bind "greater" { "begin-macro" ()
                      "select-inner" ("<", ">", 0, 0)
                      "set-mode" ("vim-visual", permanent) };
+
+  /* va" va' va` */
+    bind "quotedbl" { "begin-macro" ()
+                      "select-inner" ("\"", "\"", 0, 1)
+                      "set-mode" ("vim-visual", permanent) };
+
+    bind "apostrophe" { "begin-macro" ()
+                        "select-inner" ("'", "'", 0, 1)
+                        "set-mode" ("vim-visual", permanent) };
+
+    bind "grave" { "begin-macro" ()
+                   "select-inner" ("`", "`", 0, 1)
+                   "set-mode" ("vim-visual", permanent) };
 }
 
 @binding-set builder-vim-source-view-visual-line-with-count


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