Tuesday, March 10, 2015

Re: definition of a word (for e.g. dw) in Perl syntax

2015-03-10 18:16 GMT+03:00 Christian Brabandt <cblists@256bit.org>:
> Am 2015-03-10 12:51, schrieb Andrew Clarke:
>>
>> Hi folks
>>
>> Recently, the Perl syntax definition in vim (version 7.4) has
>> considered a word to be much bigger than it used to. For example, I
>> would expect
>>
>> abc::def::ghi
>>
>> to be considered 5 words, so that when I press dw while sitting on a,
>> it should only remove abc. However vim now deletes the entire string
>> when the syntax is Perl, and it's driving my nuts!
>>
>> I have no idea what is causing this. I've tried setting a few random
>> :set options but no luck, and nothing obvious showed up in the perl
>> syntax file. I can't even think what part of :help to start reading.
>>
>> HELP!
>
>
> Looks like the definition of the 'iskeyword' setting changed. Let's look
> into perls filetype plugin ($VIMRUNTIME/ftplugin/perl.vim):
>
> ,----
> | " The following line changes a global variable but is necessary to make
> | " gf and similar commands work. The change to iskeyword was incorrect.
> | " Thanks to Andrew Pimlott for pointing out the problem. If this causes a
> | " problem for you, add an after/ftplugin/perl.vim file that contains
> | " set isfname-=:
> | set isfname+=:
> | set iskeyword+=:
> `----
>
> So create a new file ~/.vim/after/ftplugin/perl.vim (create non-existing
> directories)
> and insert
>
> :set iskeyword-=:
>
> That should make it work for you again.

And alter syntax highlighting: it has a few `\k` atoms (perlFormat,
perlFormatName) and lots of `\<`/`\>` tokens. On a real world file
(one of my old projects) this does not change too much (mostly
highlighting of things like Module::open: open function with explicit
module), but I cannot say how significant changes will be for other
projects.

>
> Best,
> Christian
>
>
> --
> --
> 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.

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