Friday, June 19, 2015

Re: Execute a command from cursor position to the end of the line

Tim,


On 2015-06-20 10:31, Tim Chase wrote:
> On 2015-06-20 10:15, Philip Rhoades wrote:
>> nnoremap <F8> :Execute<CR>
>
> Could you provide the content of your Execute() function? It would
> help to replicate the behavior you want on an extract of the line.


The ones I currently have are:

# :Voom
# :se foldmethod=marker
# :.,$VoomSort


>> but I can't find a simple way to do the same thing from the column
>> where the cursor is to the end of the line (eg "#"s and other
>> comment characters at the beginning of the line upset the existing
>> method).
>>
>> I presume it is possible to do somehow?
>
> Assuredly, it is possible, but there may be some gotchas depending on
> where/how you're executing it currently in that function. E.g. if
> you're passing it to a shell vs. executing it as vim-script; whether
> you want to go ahead and pass comments (the shell should ignore
> them); etc.


No, simpler than that in this case . .

Thanks,

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:

Post a Comment