fault in * in perl files (.pl)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

fault in * in perl files (.pl)

Chris Willis

Hi


in .pl files vim includes colon (:) in the identifier character set. This is sort of reasonable, as perl identifiers include those of the form /\w+::\w+/ .


Unfortunately this prevents search finding the next relevant entry in (where the search is started with a * on intl1.):


$intl1 = $intobl + 1 ; # new 12 Jan 2021
s/(\d+)/$1==4?$intl1:$row/eg ; # revised 12 Jan 2021

Can this be changed to only accept double colons as part of an identifier in a * search?


regards - Chris

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/766a29b4.f9e.176f73324e5.Webtop.231%40btinternet.com.
Reply | Threaded
Open this post in threaded view
|

Re: fault in * in perl files (.pl)

Paul-7
On Tue, Jan 12, 2021 at 03:24:52PM +0000, '[hidden email]' via vim_use wrote:

>in .pl files vim includes colon (:) in the identifier character set.
>This is sort of reasonable, as perl identifiers include those of the
>form /\w+::\w+/ .
>
>Unfortunately this prevents search finding the next relevant entry in
>(where the search is started with a * on intl1.):
>
>     $intl1 = $intobl + 1 ; # new 12 Jan 2021
>     s/(\d+)/$1==4?$intl1:$row/eg ; # revised 12 Jan 2021
>Can this be changed to only accept double colons as part of an
>identifier in a * search?
No. The subject you're looking for is :help 'iskeyword', and see 'isfname' for its format. It's a list of single characters that consist a keyword, there's no "but not a double character" option, unfortunately.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210113214044.GA24530%40rainslide.net.

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: fault in * in perl files (.pl)

Chris Willis
In reply to this post by Chris Willis
------ Original Message ------
From: "'Paul' via vim_use" <[hidden email]>
To: [hidden email]
Sent: Wednesday, 13 Jan, 2021 At 21:40
Subject: Re: fault in * in perl files (.pl)

On Tue, Jan 12, 2021 at 03:24:52PM +0000, '[hidden email]' via vim_use wrote:
in .pl files vim includes colon (:) in the identifier character set. This is sort of reasonable, as perl identifiers include those of the form /\w+::\w+/ .

Unfortunately this prevents search finding the next relevant entry in (where the search is started with a * on intl1.):

$intl1 = $intobl + 1 ; # new 12 Jan 2021
s/(\d+)/$1==4?$intl1:$row/eg ; # revised 12 Jan 2021
Can this be changed to only accept double colons as part of an identifier in a * search?

No. The subject you're looking for is :help 'iskeyword', and see 'isfname' for its format. It's a list of single characters that consist a keyword, there's no "but not a double character" option, unfortunately.

Hi Paul

thanks for that. I've added an au FileType perl set iskeyword-=: to my .vimrc. I can live with adjusting the / if I need fully qualified identifiers. (Probably very rarely). The possibility of missing a real match is a real problem.

regards - Chris
--
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+[hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210113214044.GA24530%40rainslide.net.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/472724fb.a9e.176fddfa448.Webtop.226%40btinternet.com.