Wednesday, December 14, 2011

Re: Make underscore a non-word character in the current buffer

On 2011-12-13 22:31, Andy Wokula wrote:
> Am 12.12.2011 20:35, schrieb Tim Chase:
>> On 12/12/11 13:30, BPJ wrote:
>>> I need to make underscore a non-word character in the current
>>> buffer, preferably without having to list all characters which
>>> should be word characters after the change. How?
>>
>> Sounds like you want
>>
>> :setlocal isk-=_
>>
>> to remove "_" from the 'iskeyword' settings for the current buffer.
>>
>> :help 'isk'
>> :help :set-=
>
> May not work always, e.g. for help buffers, 'iskeyword' is set to
> :set isk?
> !-~,^*,^|,^",192-255
> where ":setl isk-=_" is not intelligent enough.
>
> You could then try
> :setl isk+=^_
>
> or even:
> :setl isk-=^_ isk+=^_
> (to make sure "^_" is at the end)
>

Thanks Tim and Andy both!

I'd have figured out :setlocal isk-=\_ myself if I only
had remembered/known the name of 'iskeyword'! I'd
expected 'keywordchars' or somesuch.

This solution is quite ok for me as I need it to work
thus only in individual rw buffers, so that the usual
behavior in help buffers is probably even desirable.

/bpj

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

No comments: