[gnome-builder/gnome-builder-3-36] vim: implement p and P in visual and visual line modes



commit 6813d00e9648b727a9a4586ef3996434d8ae0f37
Author: Christian Hergert <chergert redhat com>
Date:   Tue Mar 24 11:04:33 2020 -0700

    vim: implement p and P in visual and visual line modes
    
    Fixes #1172

 src/plugins/vim/keybindings/vim.css | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
---
diff --git a/src/plugins/vim/keybindings/vim.css b/src/plugins/vim/keybindings/vim.css
index c5af83482..134f6cf38 100644
--- a/src/plugins/vim/keybindings/vim.css
+++ b/src/plugins/vim/keybindings/vim.css
@@ -2225,6 +2225,21 @@
   bind "k" { "movement" (previous-line, 1, 1, 1) };
   bind "j" { "movement" (next-line, 1, 1, 1) };
 
+  bind "p" { "begin-macro" ()
+             "delete-selection" ()
+             "paste-clipboard-extended" (1, 0, 0)
+             "movement" (previous-char, 0, 1, 0)
+             "clear-count" ()
+             "end-macro" ()
+             "set-mode" ("vim-normal", permanent) };
+  bind "<shift>p" { "begin-macro" ()
+                    "delete-selection" ()
+                    "paste-clipboard-extended" (1, 0, 0)
+                    "movement" (previous-char, 0, 1, 0)
+                    "clear-count" ()
+                    "end-macro" ()
+                    "set-mode" ("vim-normal", permanent) };
+
   bind "Left" { "movement" (previous-char, 1, 1, 1) };
   bind "Right" { "movement" (next-char, 1, 1, 1) };
   bind "Up" { "movement" (previous-line, 1, 1, 1) };
@@ -2576,6 +2591,21 @@ bind "KP_Multiply" { "save-insert-mark" ()
              "clear-selection" ()
              "set-mode" ("vim-normal", permanent) };
 
+  bind "p" { "begin-macro" ()
+             "delete-selection" ()
+             "paste-clipboard-extended" (1, 0, 0)
+             "movement" (previous-char, 0, 1, 0)
+             "clear-count" ()
+             "end-macro" ()
+             "set-mode" ("vim-normal", permanent) };
+  bind "<shift>p" { "begin-macro" ()
+                    "delete-selection" ()
+                    "paste-clipboard-extended" (1, 0, 0)
+                    "movement" (previous-char, 0, 1, 0)
+                    "clear-count" ()
+                    "end-macro" ()
+                    "set-mode" ("vim-normal", permanent) };
+
   bind "Up" { "movement" (previous-line, 1, 0, 1) };
   bind "Down" { "movement" (next-line, 1, 0, 1) };
 


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