On 10/17/06, Tim Chase <[EMAIL PROTECTED]> wrote:
In some text, I've got compound words separated by a single
hyphen.  For convenience of yanking, I've added the hyphen to my
iskeyword setting which works nicely for the most part.  However,
I also use a doubled-hyphen to the effect one would use an
em-dash which leads to the unwanted situation that a yank of a
"word" now includes the first word of the subordinate sentence
structure--such as this where the dashes are doubled--and effects
my ^N/^P searching (as duplicates appear for entries followed by
the double-dash).

I'm on the prowl for some way to keep the iskeyword behavior for
things like "doubled-hyphen" and "em-dash" in the above
paragraph, but exclude things like "structure--such" and
"doubled--and", limiting the "word" to things with a dash only if
that dash is not repeated.  Something like "\w-\w" but not
"\w-\+\w" (assuming that "-" isn't part of iskeyword for this
example)

How about these:
1.
set isk=... " initialize isk without '-'.
              " 'set isk-=-' won't work in all cases.
nnoremap yw :set isk+=-<cr>yw:set isk-=-<cr>

2.
Failing (1), imlpement read-write filter along the lines of ;:help hex-editing'
that convert single dashes (but not double dashes) into latin1 char'
like ÷  247 or ¬  172 or ·  183 or like (see :dig), and add this char
to 'usk' so double dashes are not affected (they remain regular minuses)

Yakov

Reply via email to