1

I'm familiar with iskeyword to define word boundaries. But there's also WORD and I don't know what the setting is for that. My goal is this: to delete words in a comma-seperate list flexibly. Example:

apple, banana, carrot, orange.

If I place my cursor at carrot and type daw, I expect it to remove carrot,• (space represented by the symbol). If I type diw instead, I expect it to remove just carrot. Is this possible?

I currently have set iskeyword-=, but that makes both commands do the same thing, except one doesn't delete a space.

  • 4
    daW gets you the desired behavior (note the capital). – Tumbler41 Feb 22 '17 at 19:58
  • Why didn't you answer this question? I could've selected it as the answer. Do you want to answer it? – Geoff Lee Feb 24 '17 at 22:51
  • Because I fixed your problem without answering your question. :P But if you're satisfied I'll answer it. – Tumbler41 Feb 24 '17 at 22:52
  • I think you did answer my question. You told me how to use word boundaries properly :) – Geoff Lee Feb 24 '17 at 22:57
2

There is no need to modify iskeyword. You can just use a WORD instead. You can use a WORD (as opposed to a word) in a text object by using a capital W:

daW

See :help text-objects and :help WORD for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.