Am 08.11.2011 16:44, schrieb Peng Yu:
On Tue, Nov 8, 2011 at 8:24 AM, Andy Wokula<[email protected]>  wrote:
Am 07.11.2011 16:52, schrieb Peng Yu:

Hi,

"*" currently doesn't recognize the following as a single word. I
think that I need to change iskeyword. But I don't want to explicitly
specify iskeyword, rather I want to append -,:,#,/ to iskeyword and
toggle it back once I'm done. Could you anybody let me know what is
the best way to do so? Thanks!


XXX-YYY:ZZZ#AAA/BBB

Given you have a :With command [1]:

    :nn * :With isk+=/ isk+=- Do normal! *<CR>

[1] You can find one here:
http://www.vim.org/scripts/script.php?script_id=3800

Would you please let me what the above command does? And how to use it?

:With is defined in plugin/cmds.vim of the mentioned script.

Usage:
" :With {setlocal-args} Do {cmd}                   {{{1
"
"   execute {cmd} with options temporarily set to {setlocal-args}
"

It's like doing
    let sav_isk = &isk
    setlocal isk+=/ isk+=-
    normal! *
    let &l:isk = sav_isk
although it's a bit more complicated.

Maybe it's worth mentioning that "normal! *" is *not* executed within a
function (no need to worry about :h function-search-undo).

Inspired by
    :h todo|/:with
7   ":with option=value | command": temporarily set an option value and
    restore it after the command has executed.

--
Andy

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

Reply via email to