Skip to content
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

word motion ignores '.' and '-' #547

Open
ericfortis opened this issue Feb 3, 2014 · 25 comments
Open

word motion ignores '.' and '-' #547

ericfortis opened this issue Feb 3, 2014 · 25 comments

Comments

@ericfortis
Copy link

How to disable the behavior where word motions ignore dots and hyphens?
Consider the following:

script.js
myVariable.on(...

The word motion includes .js as well as .on which is undesirable. For example hit * over myVariable and will look for myVariable.on

@chrisnicola
Copy link
Contributor

I've been noticing this for a few days now, it's driving my nuts. Can't think of what would be causing it though.

@chrisnicola
Copy link
Contributor

This seems to be file dependent. My Coffeescript files are not having this problem. JS and Ruby files have the problem though.

Edit: Removing the 'ruby' group fixes this so it is one of the bundles in that group. Trying to narrow it down.

@BenBergman
Copy link
Contributor

I sometimes see this problem in C files

struct_ptr->member_variable

@chrisnicola
Copy link
Contributor

Removing 'tpope/vim-rails' fixes it. Not sure why though I suppose it could be a problem with vim-rails.

@chrisnicola
Copy link
Contributor

Ideally this would happen (* is the cursor):

*something.else 
something.*else

Instead of this when vim-rails is loaded:

something.else*

or this (treats '.' as an entire word rather than part of one) when it isn't

something*.else

@chrisnicola
Copy link
Contributor

Ok it isn't related to vim-rails. The problem doesn't occur on immediately starting Vim if I don't load vim-rails but it does eventually start to happen.

@chrisnicola
Copy link
Contributor

Ok this time I'm pretty sure I narrowed it down properly to gorodinskiy/vim-coloresque. Take that out and the problem seems to go away. Also it seems to fix some syntax highlighting bugs. Not sure why though.

@ericfortis
Copy link
Author

https://github.com/gorodinskiy/vim-coloresque/blob/master/after/syntax/css/vim-coloresque.vim

the problem is at lines 125-126

:set isk+=-
:set isk+=#
:set isk+=.

@ericfortis
Copy link
Author

I mean that is what is causing the trouble, but it should be fine for css files. Please check why this plugin is sourcing for js files.

@chrisnicola
Copy link
Contributor

Probably because JS files can also use color strings say when setting the style attribute. Ruby files same thing as @tpope pointed out, rails.vim does HTML parsing in %Q<> strings. Personally I don't need this functionality so I'm happy with simply not using it.

@gonzaloserrano
Copy link
Contributor

Same problem here in PHP files 🐙

@johntyree
Copy link
Collaborator

This is hugely annoying. I think coloresque should come out until it can behave, if ever.

@spf13 spf13 closed this as completed in 21ff737 Jun 30, 2014
@adambiggs
Copy link

@spf13 I don't think 21ff737 fully solves the problem, because vim-coloresque seems to clobber the fix with a BufEnter autocmd...

The only thing that's worked for me is uninstalling coloresque.

@tpope
Copy link

tpope commented Jul 3, 2014

Yes the only thing that fix will accomplish is break the current syntax highlighting if anyone reloads the vimrc.

Note that rails.vim gave up its HTML highlighting so it should no longer have an effect on its results. But Ruby files may still be affected because the plugin in question is so broken as to clobber not just the buffer local but also the global value of the option. This was explained to the author but not yet heeded. (Perhaps someone should try a pull request?)

@spf13
Copy link
Owner

spf13 commented Jul 3, 2014

doh. Thanks @tpope! & @adambiggs

he's already sitting on a pull request to fix it. https://github.com/hauleth/vim-coloresque/commit/9d8fdd25f3b161e27331c1e5e5ba04d9d169e139

We should probably just remove it...or fork it and fix it.. .any volunteers?.

@spf13 spf13 reopened this Jul 3, 2014
@tpope
Copy link

tpope commented Jul 3, 2014

Note that's a partial fix; it'll still break HTML and anything that builds on it like PHP.

smt added a commit to smt/spf13-vim that referenced this issue Aug 20, 2014
* upstream/3.0: (22 commits)
  Bugfix spf13#320. vimdiff "]c" jump to next diff doesn\'t work spf13#320. Thanks the help from @keelerm84 and @pwolfram
  Improve the readme to show an option to configure the environment variables because they are not set by default with gVim.
  improve rust and puppet support
  Removing csapprox ... and there was rejoicing in the terminals
  Adding tpope/commentary
  Adding Toml support
  Improve the readme showing an option to configure the enviroment variables because they are not set by default by gVim.
  Remove twig from default bundles.
  Move beyondwords/vim-twig into PHP bundle.
  Don't conceal JSON syntax
  Don't remap <CR> for omnicomplete it causes issues
  Closing spf13#500. xptemplate support for scala.
  fixed spf13#547. Better end of word handling.
  Better handling of neocomplete closing.
  Some improvements to clipboard support
  Adding wildfire support.. Hit return to use it.
  Add tpope/vim-repeat to default install
  Fixed spf13#617. period is now an end of word designator
  fixed spf13#474 . Smaller default font on gvim
  remove spf13-vim 3.0 note
  ...
smt added a commit to smt/spf13-vim that referenced this issue Aug 20, 2014
* spf13-merge: (23 commits)
  Merge with latest spf13
  Bugfix spf13#320. vimdiff "]c" jump to next diff doesn\'t work spf13#320. Thanks the help from @keelerm84 and @pwolfram
  Improve the readme to show an option to configure the environment variables because they are not set by default with gVim.
  improve rust and puppet support
  Removing csapprox ... and there was rejoicing in the terminals
  Adding tpope/commentary
  Adding Toml support
  Improve the readme showing an option to configure the enviroment variables because they are not set by default by gVim.
  Remove twig from default bundles.
  Move beyondwords/vim-twig into PHP bundle.
  Don't conceal JSON syntax
  Don't remap <CR> for omnicomplete it causes issues
  Closing spf13#500. xptemplate support for scala.
  fixed spf13#547. Better end of word handling.
  Better handling of neocomplete closing.
  Some improvements to clipboard support
  Adding wildfire support.. Hit return to use it.
  Add tpope/vim-repeat to default install
  Fixed spf13#617. period is now an end of word designator
  fixed spf13#474 . Smaller default font on gvim
  ...
@edi9999
Copy link
Contributor

edi9999 commented Nov 13, 2014

Experiencing the same problem in PHP, even after removing vim-coloresque and vim-rails

@edi9999
Copy link
Contributor

edi9999 commented Nov 13, 2014

Putting this in my .vimrc.local solves it

set isk-=-
set isk-=#
set isk-=.

UnBundle 'gorodinskiy/vim-coloresque'
UnBundle 'tpope/vim-rails'

, sourcing the file, and running :PluginClean

@YuMS
Copy link

YuMS commented Feb 17, 2015

Actually, some file related options are still kept in ~/.vimviews even if you have gorodinskiy/vim-coloresque removed.
You may want to clean up those views to actually solve this.

@ghost
Copy link

ghost commented Feb 19, 2015

I did Nov 13, 2014 and deleted all files in ~/.vimviews.
Alas the problem still persists in my php-files.
Help and advice are highly appreciated!

Kind regards,

Ton Akveld

@YuMS
Copy link

YuMS commented Feb 27, 2015

You can use :verbose set iskeyword to find the evil.

@ghost
Copy link

ghost commented Feb 28, 2015

Thanks YuMS.
Using your advised command, I get the following message:
iskeyword=@,48-57,_,192-255,$,-,#,.
Last set from /.vimviews/=+Documents=+WWW=+htdocs=+avri-internet.ton.netcreators.nl=+typo3conf=+realurl_conf.php=
Press ENTER or type command to continue
The file from which iskey is called, not defined.
What now?

Help and advice are highly appreciated!

Kind regards,

Ton Akveld

@YuMS
Copy link

YuMS commented Feb 28, 2015

verbose set only shows the last point an option is set. As you described, iskeyword is last set in a vimview of its previous dumping. Which means you didn't find the origin script.
I suggest that you do

  1. :1,1000bd to unload all your buffers, and close your vim
  2. delete everything in your ~/.vimview/
  3. open your .php file in vim and do verbose set iskeyword again to find the origin plugin who touched iskeyword
  4. disable it or do something you like

@ghost
Copy link

ghost commented Feb 28, 2015

That finally worked!
Thank you so very much, YuMS!!!

@YuMS
Copy link

YuMS commented Mar 6, 2015

@absynton Would mind sharing some details?

faceleg added a commit to faceleg/dotfiles that referenced this issue May 28, 2015
deiwin added a commit to deiwin/vim-dotfiles that referenced this issue Sep 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants