jedi-vim autocompletion. complete by grep-style searching - jedi-vim

I'm comparing PyCharm autocomplete search and jedi-vim in Vim.
In PyCharm I'm able to see the list of methods. where the search pattern might in the beginning/middle/end.
In VIM I can only see methods, which starting at the beginning of the search pattern.
I wonder if it's my configuration or it's as expected? If not what suggestion can you propose. Thanks.
PyCharm example:
Vim example:
Ivan

It's currently not a feature of jedi-vim to search for strings in names (not that this would be hard, but it's not a Jedi feature).
If you really want this, please try out YouCompleteMe. It also uses Jedi and has support for generic substring searching.

Related

How can I use Ruby in SikuliX IDE?

According to the documentation, SikuliX IDE supports Python, Ruby and JavaScript as scripting languages, but I'm not able to find how to switch from Python, which is the default.
The section about using Ruby is empty and there is no mention of `Ruby in the FAQ.
Does anyone know how I can change the scripting language?
While writing this question, I came across the solution.
Right click on the file tab and choose Set Type on an empty file. (If the file is not empty it will be cleared.) A popup will be presented, allowing you to select the language.
This is not in the documentation, so I figure others may struggle to find this.

Sublime3, ruby programming, autocomplete - show a class' methods (like java, actually)

I am new to Sublime and to Ruby. I have been developing Java for 10+ years, and what I miss, is: autocomplete, in the meaning of:
using: Sublime3 (ok if had to switch to 2 to get this option) + Rails.
issue: I want: I type: "MyClass. [DOT]" say: I type the dot
and then: a list of methods of this class are displayed. These methods that are defined by default (as of heritage), and those that I have defined, in the class definition.
I am aware of the 'duck-typing' style, such: also these methods, that this object itself is able to use, would be a plus.
While, I would be happy with the first two (heritage and self.methods).
Yes I am aware that the Ruby-community is sort of pure coding; I like it also, and I also appreciate an editor that helps.
I have read through answers in GITHUB, and I could not figure out if that is existing or not .. it seems, the Ruby-people do not understand this Java-coding idea.
Thank you for any link or answer.
Sublime is a text editor, is not an IDE. In the Java world you are likely used to write your code with IDE (such as Netbeans, Eclipse, Intellij IDEA), I have never seen Java developers using a pure text editor.
There are some IDE for Ruby. However, the highly dynamic and loosely typed nature of Ruby makes it really hard to provide an accurate IntelliSense code completion. Both the assumption that the Ruby community pretends to be pure, or Ruby-people do not understand Java-coding idea are simply wrong. Several Ruby developers approached the language from Java, therefore they are perfectly aware of how the Java world works.
If you feel more comfortable with an IDE, try to search for a Ruby one. RubyMine is a great product, and if you come from Java world you may already be familiar with Intellij IDEA. There are also plugins for Netbeans and Eclipse, but the runtime evaluation capabilities of RubyMine are far superior and it's also the most up-to-date.
Most of text editors, such as TextMate, Sublime Text, Atom, etc understands Ruby and provide Ruby syntax highlighting and additional features, some of them even autocompletion, but IDE-level features as you would expect from the Java world.
Autocomplete is possible in Sublime - there are several packages for Python, including the excellent Anaconda plugin. Coverage for Ruby isn't quite as deep, but I did find SublimeRsense which may fit your needs. The README implies that it's for Atom, but I think that's just left over from another repo. I'm not a Rubyist, so I didn't install it, but the directions looked pretty straightforward.
That being said, depending on your personal preferences and knowledge, an IDE may work better for you. Of course, it'll take up a lot more room on your HD and in memory, and may get in your way at times, but with that comes many more features that you won't find in a text editor, even one as advanced as Sublime. Try them both out, and use what works for you. Personally, I prefer Sublime over IDEs, as I find many of their "features" annoying, but you'll have to see what best matches your style and needs.

Sublime Text 3 Doesn't Recognize %i in ruby

I'm using the latest build of Sublime Text 3. When typing %i[foo bar] Sublime does not seem to recognize this and I don't get the proper highlighting.
Has anyone else experienced this? If so, is there a way I can fix this on my end or is this something that Sublime HQ would have to fix?
The %i[foo bar] # [:foo :bar] literal notation for a symbol array was only implemented in Ruby 2.0, while the Ruby language definition that ships with ST3 is mostly focused on 1.9 and earlier. I searched around a bit, but unfortunately I couldn't find any .tmLanguage files that are updated for 2.0, let alone include this literal notation, so I can't point you to a ready-made solution. But, I do have a few suggestions.
First, head over to the unofficial Sublime Text Issues tracker and post a bug report. We're not sure how much attention is paid to this list by the developer, but it at least broadens the issue's visibility and may prompt someone to post a fix. You can also reply to this thread on the Sublime Text forum and perhaps reference your issue.
The second option, if you have good regex-fu, is to hack the Ruby.tmLanguage file and add support yourself. I was going to post directions on how to do it, but then I tried it myself and it seemed to work, so feel free to use my work:
Go to Preferences -> Browse Packages to open up the Packages folder in your system's file explorer.
Create a folder called Ruby2.
Copy the contents of this gist into a new file, and save it in your Ruby2 directory as Ruby2.tmLanguage.
Restart Sublime, switch to your problematic code, and select View -> Syntax -> Ruby2. Both lines should now be highlighted the same way. Here's a before and after screenshot using the Neon Color Scheme:
I hope this helps. I'm not a Rubyist, so if I made any blatant errors please let me know.
From my (brief) research there definitely seems to be a need for an updated version of Ruby.tmLanguage for all the new features in 2.0, so hopefully any issues you post will prompt someone to start/publish a project. I've already done something similar for Python, but my Ruby skillz just aren't there for this project :)
Good luck!

Better autocomplete in VIM

All,
I have been working with vim for some time now, and love everything about it - there is only one thing I really miss from IDEs like RubyMine, and that is advanced autocompletion.
For reference, here is my standard VIM setup: https://github.com/wrwright/.vim
I have tried ctags with omnicomplete + supertab, and the one major element I miss is the ability to bring up a context sensitive list of attributes/constants/methods. For example, as I learn RubyMotion, I'd love to have some help remembering iOS SDK constants/attributes/methods, but my VIM autocomplete stops with suggesting class names..or if it does suggest methods/attributes, it lists a ton of methods/attributes that don't even apply to the class I'm working with.
I'd like to (simple example) be able to type UIColor.bl and have it autocomplete with UIColor.blueColor (or suggest if there are multiple options that start with "bl" that are properties of UIColor.
RubyMine does this very well, and if I can get VIM to be similarly smart with autocomplete it would be heavenly (and a great boon while learning RubyMotion/iOS Development.
I have also tried SnipMate (and even a RubyMotion tailored variation at https://github.com/rcyrus/snipmate-snippets-rubymotion), but that doesn't seem to offer the features I'm looking for either.
Relatively satisfied with stock Vim's omnicomplete + vim-ruby and vim-rails having completion abilities on par with NetBeans but with all the bells&whistles of Vim and much lower resource requirements, of course.
From my .vimrc concerning completion options :
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
One thing that I have had a bit of luck with Rubymotion is YouCompleteMe and enabling tag Support. you will need a lot of ram(YCM uses ~2GB when indexing a large tag file) because the tags that rubymotion uses are about 40k tags.
The downside is that the rubymotion people don't seem to want to review pull requests and provide any feedback so I am not sure if they will add the needed things to the rake task that creates the tag files for ycm to work correctly out of the box.
To get it to work you need to set the tags files correct
set tags=./tags;,tags;
and then you need to setup ycm to complete off tags.
let g:ycm_collect_identifiers_from_tags_files = 1
you need to make the ctags file compatible with ycm as well. This pull request does that. You need to add a language field to the ctags creation and then change bridgesupport to ruby.
pull request for that
after that you need to run rake ctags in the root of your project.
If you don't want to modify the project.rb file you could probably create your own rake task that does pretty much the same thing.
Yes, Vim is an awesome... text editor.
As such, it can't be expected to match any IDE's "code awareness". Furthermore, it completely relies on the community for providing more than default support for a given language. If google or the rubymotion site didn't help you to find a serious "autocompletion" solution I doubt you'll find it here.
The process explained in the blog post below sounds ok, if not very precise on the vim configuration front.
http://rayhightower.com/blog/2013/02/12/automatic-ctags-with-rubymotion-and-vim/

mirroring Terminal with gets Ruby

There may be a good gem out there for this, but I've run out of Google.
I'm creating a command line interface with a basic gets each inputed command. I also want to have basic terminal features like hitting the up arrow and having it cycle the history. Are there gems which mimic this or is there a simple way to implement it?
Not to self-promote, but my friend and I wrote a project that is mostly functional with this goal. Check it out here: https://github.com/jamez01/arsh
It's also a packaged gem that you can install.
Some time ago I did a "smart telnet" using "Readline". I even enabled autocompletion.
It has all the cool features like up down arrow, autocompletion, ...
Take a look at it

Resources