-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dynamic iskeyword #3
base: master
Are you sure you want to change the base?
Conversation
Set iskeyword locally to buffer in filetype. This allows us to remove the over-complicated and fragile dynamic rules for adding or removing "-" from keyword depending on context. This removes the original author's desire to be able to use `w` navigation to parts of words. To reinstate that, simply install the plugin at https://github.com/bkad/CamelCaseMotion/ and use `<Leader>w` etc. instead.
haha heya Hakim! I got an idea.... instead of nuking all my iskeyword+=- hacks 😆 , how about making it an option or something? like use an
i dont really do xquery no more (I do Python/Django!) nor write Vim plugins etc etc |
Hi David, Thanks for that! I did consider a switch – but I think it makes sense to go along the grain of what Vim offers, and the workaround (e.g. using vim's own motion commands via CamelCaseVim as suggested in a comment) works fine for navigating dashes in symbol names. That said, are there use-cases that I'm missing? In any case, it's no biggie if you'd prefer not to apply the PR for back-compat reasons :-) Hope you're enjoying Python + Django by the way - I did that for a couple of years recently, found myself admiring Django more than loving it, but it's certainly very capable. All the best, From: David Lam <[email protected]mailto:[email protected]> haha heya Hakim! I got an idea.... instead of nuking all my iskeyword+=- hacks [:laughing:] , how about making it an option or something? like use an if/else that controls the behavior something like if g:xqueryvimDisableHackary i dont really do xquery no more (I do Python/Django!) nor write Vim plugins etc etc — http://www.bbc.co.uk |
yeah not really back-compat reasons, its really nostalgia so I can leave all my hackary vimscript in there 😄 yes that is probably a bad reason hahaha But maybe a more coherent reason if I was a plugin author is to be able to offer the functionality out of the box. And not have to install another plugin e.g. CamelCaseVim. Be it documented or not. For example, Vim can indent an XML file. By default, it calls this vimscript XmlIndentGet thingy: https://github.com/vim/vim/blob/master/runtime/indent/xml.vim#L79 But a far superior method is to filter it through this |
Good point about external dependencies, totally agreed. But of course these days where installing a vim plugin is as simple as typing "Plugin 'foo/bar'" in your .vimrc, it's simple to just copy 2 lines instead of 1, if the installation docs tell you to. Another option might be to fork a version of CamelCaseVim (that only matches dashes, perhaps) and bundle that. I started down that road, and then realised the module did everything I wanted already, so left it. By the way, this is the use-case that led me to refactor in the first case:
as the From: David Lam <[email protected]mailto:[email protected]> yeah not really back-compat reasons, its really nostalgia so I can leave all my hackary vimscript in there [:smile:] yes that is probably a bad reason hahaha But maybe a more coherent reason if I was a plugin author is to be able to offer the functionality out of the box. And not have to install another plugin e.g. CamelCaseVim. Be it documented or not. For example, Vim can indent an XML file. By default, it calls this vimscript XmlIndentGet thingy: https://github.com/vim/vim/blob/master/runtime/indent/xml.vim#L79 But a far superior method is to filter it through this xmllint program a la http://vim.wikia.com/wiki/Format_your_xml_document_using_xmllint — http://www.bbc.co.uk |
(Not sure if you'll approve this PR, as it reverts a chunk of behaviour, but as I found this useful, thought I'd ping just on the off-chance you did too :-) Thanks for submitting the original plugin in the first place!)
Set iskeyword locally to buffer in filetype. This allows us to remove
the over-complicated and fragile dynamic rules for adding or removing
"-" from keyword depending on context.
This removes the original author's desire to be able to use
w
navigation to parts of words. To reinstate that, simply install
the plugin at https://github.com/bkad/CamelCaseMotion/ and use
<Leader>w
etc. instead.