Skip to content

Command-line CTRL-U, CTRL-Y #17

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

Merged
merged 1 commit into from
Mar 15, 2019
Merged

Command-line CTRL-U, CTRL-Y #17

merged 1 commit into from
Mar 15, 2019

Conversation

justinmk
Copy link
Contributor

@justinmk justinmk commented Jul 20, 2014

ref #1

  • CTRL-U in cmdline-mode stores in the @- register
  • CTRL-Y in cmdline-mode yanks from the @- register

@justinmk justinmk changed the title Command-line CTRL-U and CTRL-Y Command-line CTRL-U, CTRL-W and CTRL-Y Aug 5, 2014
@justinmk
Copy link
Contributor Author

justinmk commented Aug 5, 2014

@tpope Fully implemented ctrl-w and ctrl-u. General idea is to compare getcmdline() before & after using Vim's built-in ctrl-u/ctrl-w. Also verified that this works with multibyte characters in various combinations.

plugin/rsi.vim Outdated
endfunction

cnoremap <expr> <SID>(ctrl_u) <SID>ctrl_u()
cmap <script> <C-U> <SID>(ctrl_u)<C-U>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used this approach similar to <C-T> below, because <c-\>e was causing unpleasant flicker.

@justinmk
Copy link
Contributor Author

@tpope I've been using this for a couple weeks without issue. What are your thoughts? I can add <M-BS> too if appropriate.

@belak
Copy link

belak commented Apr 20, 2016

What are the chances of this ever getting merged in? It would be really nice to use C-u

@justinmk
Copy link
Contributor Author

justinmk commented Apr 21, 2016

I can send an updated PR without the CTRL-W stuff. After using it for a long time I think CTRL-W is more trouble than it is worth. For it to be useful it needs to "append" as readline does, and that would be a lot of fiddly code. However CTRL-U is definitely useful and works without issue.

Also there's a question of what CTRL-U should do in insert-mode: should it also store in @- register?

@justinmk justinmk changed the title Command-line CTRL-U, CTRL-W and CTRL-Y Command-line CTRL-U, CTRL-Y Mar 15, 2019
@justinmk
Copy link
Contributor Author

Updated. Now only maps CTRL-U and CTRL-Y.

@tpope
Copy link
Owner

tpope commented Mar 15, 2019

I worry a bit about re-purposing @-, but I guess I'll give it a try.

@tpope tpope merged commit 8b7abe2 into tpope:master Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants