Skip to content

Support for alternative paste binding #263

@alternateved

Description

@alternateved

Hello! Thank you for that package, it works really well from my initial testing. One thing that I've noticed in regards to bindings.

Most applications (browsers, terminal emulators, file managers at least on Linux) support alternative paste binding with Shift+Insert, but in Ghostel that binding results in 2~. Would it be possible to add that binding?

Possible diff:

diff --git a/lisp/ghostel.el b/lisp/ghostel.el
index 411e374..ee295db 100644
--- a/lisp/ghostel.el
+++ b/lisp/ghostel.el
@@ -1616,8 +1616,9 @@ Most keys are sent to the terminal.  Keys in
 ;; Yank bindings layer on top of the helper's `M-y' →
 ;; `ghostel--send-event' default so the kill ring wins.
 (define-keymap :keymap ghostel-semi-char-mode-map
-  "C-y" #'ghostel-yank
-  "M-y" #'ghostel-yank-pop)
+  "C-y"        #'ghostel-yank
+  "S-<insert>" #'ghostel-yank
+  "M-y"        #'ghostel-yank-pop)
 (when (eq system-type 'darwin)
   (define-key ghostel-semi-char-mode-map (kbd "s-v") #'ghostel-yank))

Alternatively instead of binding C-y we could also just remap yank like so:

diff --git a/lisp/ghostel.el b/lisp/ghostel.el
index 411e374..9764985 100644
--- a/lisp/ghostel.el
+++ b/lisp/ghostel.el
@@ -1616,8 +1616,9 @@ Most keys are sent to the terminal.  Keys in
 ;; Yank bindings layer on top of the helper's `M-y' →
 ;; `ghostel--send-event' default so the kill ring wins.
 (define-keymap :keymap ghostel-semi-char-mode-map
-  "C-y" #'ghostel-yank
-  "M-y" #'ghostel-yank-pop)
+  "<remap> <yank>" #'ghostel-yank
+  "S-<insert>"     #'ghostel-yank
+  "M-y"            #'ghostel-yank-pop)
 (when (eq system-type 'darwin)
   (define-key ghostel-semi-char-mode-map (kbd "s-v") #'ghostel-yank))

Other places where ghostel-yank is used probably would benefit from that as well. What do you think? Or maybe this should be a part of user configuration?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions