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

现在的配置老是把“."作为keyword,导致搜索的时候很不方便啊 #49

Closed
tvboxme opened this issue Sep 9, 2014 · 8 comments

Comments

@tvboxme
Copy link

tvboxme commented Sep 9, 2014

我一般是用python+js的, 现在基本每次打开都要输入一次
set isk -=.
这句话放到vimrc还不管用。我翻了下也没找到在哪设置的,
怀疑是哪个插件的内部设置。

@tvboxme
Copy link
Author

tvboxme commented Sep 9, 2014

repo主有空看看把 - -

@wklken
Copy link
Owner

wklken commented Sep 9, 2014

配置的时候没有处理这一项才对


如果是插件问题, 使用二分法排除下
注解一半插件, 重新打开查看, 确认问题是否还在 -> 缩小范围

ps: set是可以放到vimrc的, 查下文档

@spacewander
Copy link
Contributor

试试在vimrc中添加BufWinEnter set isk -=.
或者:

autocmd FileType BufWinEnter *.js set isk -=.
autocmd FileType BufWinEnter *.py set isk -=.

原理是,赶在某个插件改变你的iskeyword之后再重新设置iskeyword。
如果BufWinEnter不行,试试同类的其他events (:help BufWinEnter)

@spacewander
Copy link
Contributor

或者在.vim/bundle下使用grep/ag大法,找出哪一行vimscript修改了isk或者iskeyword,然后自己看着改改。

@tvboxme
Copy link
Author

tvboxme commented Sep 11, 2014

找到了 在 gorodinskiy/vim-coloresque 这个插件中,看作者原意应该是在 .css 的文件中添加 ., #, - 做keyword,html也添加了,暂且可以接受,但是 vimrc 的文件上也被添加了这个规则,并且凡是打开了html之后,所有其他tab或者buffer上的文件也被添加。 这里应该是一个bug吧?
谁比较懂 vimL, 讲讲问题到底怎么出的?

@spacewander
Copy link
Contributor

刚好我也用了这个插件哈!
看了下,作者错用set来设置isk,结果导致所有的window和buffer都受影响。
set改成setlocal就解决了。
这个问题去年就有人提交了pull request,但是作者弃坑了。所以建议把它fork下来,改掉错误的地方后把仓库地址改成自己fork下来的版本。

@tvboxme
Copy link
Author

tvboxme commented Sep 11, 2014

赞,就这样搞, 那我关issue了。

@tvboxme tvboxme closed this as completed Sep 11, 2014
@wklken
Copy link
Owner

wklken commented Sep 11, 2014

那个插件是前端显示颜色的,同类还有几个,也可对比换一个。我会找时间看下

发自我的 iPhone

在 2014年9月11日,下午5:07,Lingchuan Xu notifications@github.com 写道:

Closed #49.


Reply to this email directly or view it on GitHub.

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

3 participants