Friday, September 11, 2015

Re: i_CTRL-R to the end of current line (and related stuff)

On 2015-09-11 09:34, David Fishburn wrote:
> 1. How do I find in the help where it says I can do i_CTRL-R
> followed by CTRL-w

You're confusing i_CTRL-R & c_CTRL-R_CTRL-W

The help on the first one talks about its use in insert-mode ("i")
and the second one is about the particular sub-use in the
command-line ("c").

> 2. Does anyone have a suggestion on how I can do i_CTRL-R followed
> by something like y$ to get to the end of the line in some way. I
> was thinking I could do this using the expression register.
> i_CTRL-R= then do something like y$, but that didn't work. If I
> can do something along that line, then that opens the door to using
> whatever standard Vim keys I need.

I don't know of anything easy (out-of-the-box) that gets the
*remainder* of the line. It's pretty straight forward to get the
*entire* line using the expression register:

<c-r>=getline('.')<cr>

You can get fairly close to what you want with

:cnoremap <f3> <c-r>=getline('.')[col('.'):]<cr>

which will insert the contents of the current line from the cursor to
the end. You'd have to do some fancier twiddling to get the
entire current word through the end of the line.

-tim



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment