[gnome-builder] vim: add minimal ctrl+t/ctrl+d in insert mode



commit b983e137ce56bf17f9ffc4c1d6bc40bb2aa70ae5
Author: Christian Hergert <chergert redhat com>
Date:   Fri Aug 30 13:37:35 2019 -0700

    vim: add minimal ctrl+t/ctrl+d in insert mode
    
    This isn't perfect, because we don't place the cursor on the exact
    location due to how cursor saving is done. We might be able to fix that
    by using a new mark, but we need to see if that messes anything else up
    in the process.
    
    Fixes #1019

 src/plugins/vim/keybindings/vim.css | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/src/plugins/vim/keybindings/vim.css b/src/plugins/vim/keybindings/vim.css
index 5782be4d5..08676b442 100644
--- a/src/plugins/vim/keybindings/vim.css
+++ b/src/plugins/vim/keybindings/vim.css
@@ -2112,6 +2112,21 @@
   bind "<ctrl>w" { "movement" (previous-word-start, 1, 1, 0)
                    "delete-selection" () };
 
+  bind "<ctrl>d" { "save-insert-mark" ()
+                   "movement" (first-nonspace-char, 0, 1, 0)
+                   "movement" (line-end, 1, 1, 0)
+                   "begin-user-action" ()
+                   "indent-selection" (-1)
+                   "end-user-action" ()
+                   "restore-insert-mark" () };
+  bind "<ctrl>t" { "save-insert-mark" ()
+                   "movement" (first-nonspace-char, 0, 1, 0)
+                   "movement" (line-end, 1, 1, 0)
+                   "begin-user-action" ()
+                   "indent-selection" (1)
+                   "end-user-action" ()
+                   "restore-insert-mark" () };
+
   bind "<ctrl>e" { "movement" (screen-up, 0, 0, 1) };
   bind "<ctrl>y" { "movement" (screen-down, 0, 0, 1) };
 


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