VIM: Ruby methods with? and! in the end

I'm trying to use VIM termination (dictionary and current buffer), but am I having problems with? and! at the end of the method names. Can I somehow explain vim that method names (mostly words) can have it only at the end and only one method name? not a bull ??? !! shit!? or if! xyz ... (when? and! added iskeyword! xyz exists on the completion list). Any ideas how to do this?

+4
source share
1 answer

IIRC, you need to change the iskeyword parameter.

You can try set iskeyword+=?,! to and ! were considered part of the words, not separators.

In .vimrc you can add:
autocmd BufRead,BufNewFile *.rb set iskeyword+=?,!

See :help iskeyword .

Edit: I did not see that you already mentioned iskeyword as a possible workaround.

Alternative idea:
1. Create ctags for your ruby ​​code.
2. in the complete option, delete everything except the t parameter, the tags only value.

You will have suggestions coming from the tag file. The downside is that it adds a new step to use completion, and you will skip some non-tag completion.

+5
source

Source: https://habr.com/ru/post/1332112/


All Articles