CamelCaseMotion
CamelCaseMotion copied to clipboard
Support hyphenated strings
What I am finding is that while CamelCaseMotion works great for camelCaseVariables and underscore_case_variables (though I have not tried it as much on those), it most certainly does not work for editing hypen-separated-variables which often are used with HTML/CSS classes and styles and so on.
Generally only an issue when the syntax is specified such that hyphens are not word separators. E.g. I have in after/ftplugin/javascript.vim: set iskeyword+=-
Also it is somewhat better because CamelCaseMotion (the way it works with underscores) even though it does not work with a
modifier, will tend to grab the underscore, whereas without the iskeyword tweak the movement actions will never include a hyphen.
+1 for this feature
Hmm, I work with hypen-separated-variables all the time in HTML/CSS files and haven't had an issue. I also just tried it with set iskeyword+=-
and it seemed to work correctly. Try with the latest version and see if this is still an issue.
@bkad doesn't work for me.
To clarify i'm talking about:
([] represents cursor)
a-hyphenated-tok[e]n-in-code
type di,w
(I'm using the comma binding scheme for this plugin), expect:
a-hyphenated-in-code
or
a-hyphenated--in-code