Saturday, June 27, 2015

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

Paul,


On Saturday, 20 June 2015 15:30:47 UTC+10, Paul Isambert wrote:


So it is clear, the next line is in my .vimrc file:


> > >> 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
>
> I think Tim wanted the definition of the Execute command.


? I don't know what you mean - as far as I know using ":Execute . ." as I showed above in my .vimrc file is a built-in Vim thing?


> Anyway, you can get the content of a line from the cursor to its end
> with:
>
> getline(".")[col(".")-1:]
>
> You can pass that to whatever does you execution in you original
> command.


I still don't get what you are saying - how can I use the F8 key (that executes the command on the line in the text file - like I described above) with that getline command?

Thanks,

Phil.

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