I have a bunch of plugins installed for vim, and one of them is breaking the dw
command. I'm not sure which one it is thoug开发者_如何学运维h. Basically dw
is now deleting everything up through the next bit of whitespace it finds, instead of stopping at punctuation like it should.
I really don't want to have to figure out which one is breaking it and how to fix it. Is there a way I can specify in my .vimrc that I don't want it changed?
Edit:
Luc already answered my question, but I thought I would still clear it up for future readers, because there is a bit of disagreement over what dw
is supposed to do by default. Lets say we have the word 1234.5678. By default, on all the systems I've worked on, if the cursor is on the 1, typing dw
should leave you with .5678. When I asked the question, typing dw for me was instead deleting the whole thing (1234.5678).
dw isn't a mapping. d is a command that accepts a motion and the correct behaviour is exactly the one described by you. dw stands for delete word and does that :). By the way, if you want to know something about you mappings I suggest you to try the following commands:
:map
that gives you the list of all your mappings. And the wonderful:
:verbose map <c-s>
that gives you details about the given mapping ( in our case <c-s>
)
If the problem is not in 'iskeyword' option mentioned by @Luc Hermitte, then there are two possibilites:
Normal-mode mapping that remaps
d
ordw
. Command to check whether it is the problem:verbose nmap d
. It will report all
d*
mappings, includingd
itself anddw
. I do not think there will be many.Operator-pending mapping that remaps
w
. Check usingverbose omap w
I don't think though that any plugin author is arrogant enough to remap this, so first check @Luc Hermitte's answer.
I don't think you are looking for the right thing. Search instead which (ft?) plugin is overriding 'isk'
-- still with verbose -> :verbose set isk
:h w
:h word
精彩评论