Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support a ctrl+Y to insert text removed via ctrl+W or ctrl+U #633

Open
setharnold opened this issue Jul 2, 2020 · 6 comments
Open

Comments

@setharnold
Copy link

setharnold commented Jul 2, 2020

Hello, I quite often use ctrl+W and ctrl+U to kill words and lines, and then use ctrl+Y to re-insert those killed words. I'd like to have this functionality in Matterhorn.

There's two versions of this that I've seen: irssi will store one killed word or line, and re-insert just that one item. bash will store multiple words, and can keep track of an entire killed stack, for reinsertion.

I prefer the irssi version of this feature; I never use the extra features of the bash version.

Thanks

@kquick
Copy link
Collaborator

kquick commented Jul 2, 2020

These work just fine for me, @setharnold, already providing the functionality you requested. Which version of matterhorn and which terminal are you using, and what is the functionality you see when you try these keys?

@jtdaugherty
Copy link
Member

@kquick what worked for you? This is what I tried:

  • C-k (kill to EOL) followed by C-y kills and then yanks (pastes) the whole line from the cursor to end of line
  • C-w (kill word) followed by C-y does not yank (paste) a word

@jtdaugherty
Copy link
Member

@setharnold Also, I wanted to ask if you could be very specific about the keybindings you're using (or want to use). The "^W" syntax can be ambiguous due to its use to indicate some characters prefixed by Ctrl as well as to refer to other characters such as Backspace that are not printable. So if you mean "Ctrl-W" and "Ctrl-U", it would be helpful to us if you can indicate that with "Ctrl-W" or "C-W" rather than "^W".

With that said, since Matterhorn supports custom keybindings, the real question here seems to be one of functionality rather than specific keys. I'm interpreting this ticket to be about requesting that words killed with Ctrl-w are pastable with C-y.

@kquick
Copy link
Collaborator

kquick commented Jul 3, 2020

Hrm... perhaps I hadn't had my coffee yet. I must have tested C-k and C-w and C-u with the same input; the latter two don't appear to fill the yank buffer so the C-y following C-w or C-u pastes what's in the buffer, but not what the preceding yank was, so I get back the C-k removed content. I can confirm then the requested behavior doesn't work.

@setharnold setharnold changed the title Please support a ^Y to insert text removed via ^W or ^U Please support a ctrl+Y to insert text removed via ctrl+W or ctrl+U Jul 6, 2020
@setharnold
Copy link
Author

I rarely use ctrl+K so I never noticed that ctrl+Y works with it; I use ctrl+W and ctrl+Y all the time and notice that ctrl+Y doesn't paste what they removed.

Thanks

@jtdaugherty
Copy link
Member

Thanks, @setharnold!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants