diff options
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 21e2933f..bf60ad71 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -375,6 +375,8 @@ impl MappableCommand { later, "Move forward in history", commit_undo_checkpoint, "Commit changes to new checkpoint", yank, "Yank selection", + yank_to_clipboard, "Yank selections to clipboard", + yank_to_primary_clipboard, "Yank selections to primary clipboard", yank_joined, "Join and yank selections", yank_joined_to_clipboard, "Join and yank selections to clipboard", yank_main_selection_to_clipboard, "Yank main selection to clipboard", @@ -3762,6 +3764,16 @@ fn yank(cx: &mut Context) { exit_select_mode(cx); } +fn yank_to_clipboard(cx: &mut Context) { + yank_impl(cx.editor, '*'); + exit_select_mode(cx); +} + +fn yank_to_primary_clipboard(cx: &mut Context) { + yank_impl(cx.editor, '+'); + exit_select_mode(cx); +} + fn yank_impl(editor: &mut Editor, register: char) { let (view, doc) = current!(editor); let text = doc.text().slice(..); |