CamelCaseMotion icon indicating copy to clipboard operation
CamelCaseMotion copied to clipboard

Support hyphenated strings

Open unphased opened this issue 9 years ago • 3 comments

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.

unphased avatar Apr 15 '15 22:04 unphased

+1 for this feature

imomaliev avatar Dec 05 '16 06:12 imomaliev

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 avatar Dec 06 '16 21:12 bkad

@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

unphased avatar Dec 06 '16 22:12 unphased