Monday, September 21, 2015

Re: I have forgotten what these fns assigned to F keys are for . .

Al, Tim,


On 2015-09-21 20:49, A. S. Budden wrote:
> Phil,
>
> F10 looks like it's set up to add the current character under the
> cursor to the '/' register, so if you have "abcdef" on the screen and
> hit F9 on the first character and then F10 on each subsequent one,
> you'll get "abcdef" in the / register (this is because you're using .=
> instead of = after "let @/".
>
> .~\\ is a list of 3 characters ( '.', '~' and '\', the latter of which
> is escaped for the string) that you're passing to the escape function
> so that it will prefix them with a backslash.
>
> As to why you have these mappings, no idea I'm afraid! If you don't
> use them ever (which I can only assume is the case since you don't
> know what they do), it might be a good time to delete them.
>
> F10 will be opening the file menu on the xfce4-term because the
> terminal window is presumably intercepting F10 before it gets to vim.


On 2015-09-21 21:31, Tim Chase wrote:
> On 2015-09-21 20:31, Philip Rhoades wrote:
>> nnoremap <F9> :let @/=escape(getline('.')[col('.')-1], '.~\\')<cr>
>> :nnoremap <F10> :let @/.=escape(getline('.')[col('.')-1], '.~\\')<cr>
>>
>> I didn't get very far doing a lot of Googling, but from
>> experimenting with them I found F9 puts the current character under
>> the cursor into the "/" register but F10 opens the file menu on my
>> xfce4-term ! What is:
>>
>> '.~\\'
>>
>> supposed to do?
>
> That's the parameter to the escape() function that you're calling.
> It looks like <f9> captures the character under the cursor; escapes
> periods, tildes, and back-slashes; then assigns it to the current
> search register. The <f10> does the same thing except it appends
> rather than assigns to the search register.
>
> I'm not sure WHY this would be helpful, but apparently you found it
> so at one time :-)


Thanks for all that - I understand it all now but it still does not
trigger any memories of what I used the fns for! . . they must be from
many years ago . . or else Alzheimer's is setting in faster than I
thought . .

Regards,

Phil.
--
Philip Rhoades

PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au

--
--
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: