Sunday, March 19, 2017

Re: Passing current line number to shell command

Honggyu Kim wrote:
> Hi all,
>
> I would like to ask a question regarding getting the current line number.
> I can get it as follows:
>
> :echo line(',')
>
> It works fine but my question is in command execution with '!' in the front.
>
> :!echo line('.')
>
> But "line" is not interpreted before going to shell and makes an error.
>
> Can anyone give me some guide how I can pass the current line number to shell?
>
Hello:

Try :exe "!echo ".line('.')

Regards,
Chip Campbell

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