Friday, December 14, 2018

Re: search file for text in reg ?

Hi,

> :let @/=@a

Awesome, thank you Tim.

-m

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

Re: search file for text in reg ?

On 2018-12-14 09:48, M Kelly wrote:
> Is there a way to search a file for the text that is in a register ?

Is the content of the register literal text or a regular expression?

If it's a regular expression (or doesn't have any regex metachars in
it), you can use

:let @/=@a

where "@a" is the register in question. You can then use n/N to
navigate forward/backward.

If it's literal text that might contain regexp metachars, you have to
escape them:

:let @/=escape(@a, '.*\\$^')

(adjust the set of escaped characters accordingly; I just grabbed a
few I knew to be problematic)

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

search file for text in reg ?

Hi,

Is there a way to search a file for the text that is in a register ?

thx always for everything vim,
-m

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

Thursday, December 13, 2018

Re: query about vim replacement

2018-12-13 16:08 GMT+01:00, Kumar Vaddi <kumar.vsrp@gmail.com>:
> Hi,
> I want to replace syntax in files like below in gvim. The file has 90000
> lines. manually replacing is very tough.
>
> 1) -from { replaced with -from {abc.abc_core.
> 2) -from [a-z]+ replaced with -from abc.abc_core.[a-z]+
> 3) -from [A-Z]+ replaced with -from abc.abc_core.[A-Z}+
> 4) -from * replaced with -from abc.abc_core.*
>
> can you please help me in this regard.
> Thanks,
> Kumar

:%s/-from {/-from {abc.abc_core./g
:%s/-from \([A-Za-z*]\+\)/-from abc.abc_core.\1/g
--
Kit

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

Re: query about vim replacement

On Thu, Dec 13, 2018 at 4:14 PM Kumar Vaddi <kumar.vsrp@gmail.com> wrote:
>
> Hi,
> I want to replace syntax in files like below in gvim. The file has 90000 lines. manually replacing is very tough.
>
> 1) -from { replaced with -from {abc.abc_core.
> 2) -from [a-z]+ replaced with -from abc.abc_core.[a-z]+
> 3) -from [A-Z]+ replaced with -from abc.abc_core.[A-Z}+
> 4) -from * replaced with -from abc.abc_core.*
>
> can you please help me in this regard.
> Thanks,
> Kumar

This looks like a job for the :s[ubstitute] command (see ":help :s"
and ":help pattern-overview"). Note that Vim patterns are similar to,
but subtly different from, those used by Perl, grep, less, etc. For
option 4, just replace "-from " by "-from abc.abc_core." by means of
:%s/-from /\0abc\.abc_core\./g
The ending /g is only necessary if there can be more than one
replacement per line. In addition, insert ^ before -from if it must be
at the start of a line.
For the others, the same with /gc at the end instead of /g (or /c
instead of nothing) will let you answer y or n for each replacement.
Or slightly more complex patterns will let you specify more in detail
what to replace by what.

After studying the two help topics mentioned above, and what comes
around them, you should be able to (a) understand what my example
above is doing and how, and (b) how to make it more selective.

Best regards,
Tony.

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

query about vim replacement

Hi,
I want to replace syntax in files like below in gvim. The file has 90000 lines. manually replacing is very tough.

1) -from { replaced with -from {abc.abc_core.
2) -from [a-z]+ replaced with -from abc.abc_core.[a-z]+
3) -from [A-Z]+ replaced with -from abc.abc_core.[A-Z}+
4) -from * replaced with -from abc.abc_core.*

can you please help me in this regard.
Thanks,
Kumar

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

Re: Where to find recent stable Windows builds

On Thu, Dec 13, 2018 at 2:30 PM Jonathan Fudger <j.p.fudger@gmail.com> wrote:
>
> Hi everyone,
>
> I used to use the "Vim without Cream" binaries to get a recent build of Vim on Windows. Unfortunately these seem have stopped at 8.0.1616, so there are no builds of Vim 8.1.
>
> I am nervous about using the latest overnight build (from vim-win32-installer or tuxproject.de) after trying a couple which were unusable).
>
> Is there anywhere else to find a recent, stable(-ish) build of Vim 8.1?
>
> Thanks,
> Jonathan
>
> --
> --
> 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

"Vim without Cream" used to be one of the best. If you can't find
precompiled Vim executables for Windows, you can as a last resort
compile your own. It is not really hard once you get the hang of it,
and it affords you full freedom of which features to include or omit.
In addition to the (formerly Cygwin and) MinGW compiler described in
the last link below (note 4), MS Visual Studio (see note 3) has been
said to work well for compiling Vim on Windows, and there are others,
see the "Microsoft Windows" column under Note 2 below.

See:
1. https://vim.wikia.com/wiki/Getting_the_Vim_source_with_Mercurial
2. https://en.wikipedia.org/wiki/List_of_compilers#C_compilers
3. https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Community
4. http://users.skynet.be/antoine.mechelynck/vim/compile.htm

Best regards,
Tony.

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