RubyMine searching with find usages - ruby-on-rails

I have just bought a license to use Ruby Mine and am really struggling to learn how to use it. I keep having to go back to Text Mate to do simple things like searching.
I'm trying to find where i have defined a css div (called "category title"). From what I can gather, I need to use 'Find Usages' in Ruby Mine. Most times when I go to the edit/find menu, 'find usages' is greyed out. Then, if I click on the uppermost 'app' folder, and click find usages, it searches for 'app'. It doesn't recognise the search in the search bar. If i type the div name in the code and click alt/F7, it gives me a typo warning rather than a search option.
Does anyone know how to search the entire app (not just the specific file of the app) in RubyMine? I'm finding this incredibly frustrating.
Thank you

The command you need is Find in Path which will search your entire project, set of projects if they are open together, a specific director, etc. It has a bunch of options, including a regex search. For Mac, it is Command+Shift+f, for windows Ctrl+Shift+f
Checkout this site for keyboard reference.
https://www.jetbrains.com/ruby/documentation/index.html
You might also try shift+shift which is search everywhere, files, classes, symbols.

Related

Highlight text on Lyx documents

I am using Lyx for my homework (text+math) for a while now, but there are a few features I couldn't find and it is hard for me to believe they don't exist (even with some workaround).
Is there an option to highlight text on LYX?
example for how I'd like it to appear on my PDF product:
an example for PDF with highlighted text
I couldn't find it on the interface or settings.
I googled it, asked my T.As, posted a question on several Lyx related facebook communities - but couldn't find any solution.
On the other hand, no one told me "I have checked it and it's not possible" - so I keep looking.🤷‍♂️
Some add-on? Packages?
You can do this with "Soul" module. Here are the steps:
Download the module.
Put the module in the "layouts" directory inside your user directory. You can find your user directory by going to Help > About.
In LyX, do Tools > Reconfigure.
Restart LyX.
Open a document in LyX and go to Document Settings > Modules. After steps (3) and (4) you should now see "Soul Text Markup" as a module. Click "Add" and then "OK". Here is a screenshot (before clicking "Add"):
After (5), you can now select text in your document and go to Edit > Text Style > highlight.
More information is on the module wiki page. I have never heard of Facebook LyX communites. I suggest instead to join our lyx-users mailing list. There are a lot of knowledgeable and friendly LyX users helping each other out.

How to include only one folder and not others in Sublime's Find in Files?

In a rails project, I have several versions of view folders, based on locale. When doing global searches in Sublime 3, I'd like to have all of them excluded but one, the default locale folder. So that
app/views/en-US
gets searched, but any others, like
app/views/en-UK
app/views/pt-BR
don't. I know I can exclude everything under app/view with -app/views/*, but what pattern do I use to exclude everything but app/views/en-US?
After you add your project do this:
In the top menu bar go to Find -> Find Files In...
In the popup at the bottom you'll see a 'Where:' field. Click the '...' button on the right and add or exclude whichever directories you need to.

Easy way to find a view file in rails?

I develop rails applications with my designer who has minimum knowledge about rails.
She works on Windows through file-sharing from a Linux server.
She always has hard time finding view files to work on.
I usually use 'grep' to find a view file.
But she can't.
If you have a good suggestion, please share with me.
I have an idea which may be overkill.
Is there a way to automatically add comments around view files (including layouts and partials?) in html file?
Like this:
<!--Starting app/views/some_dir/some_file.html.erb-->
HTML here...
<!--Ending app/views/some_dir/some_file.html.erb-->
This way, my designer can find the file very easily.
Of course, this should be automatic and development environment only.
Thanks.
Sam
I use the Rails Footnotes gem (https://github.com/josevalim/rails-footnotes) in some of my projects which allows me to click a link in the footer of my app that opens the current view (also shows partials) in TextMate. Not sure if it could be customised to work with a Windows text editor but you could look at the URL to work out the file name.
I.e to open a file in MacVim, it creates the following link:
mvim://open?url=file:///Users/steveholt/Sites/foo/app/views/projects/log.html.haml
and for TextMate:
txmt://open?url=file:///Users/steveholt/Sites/foo/app/views/projects/log.html.haml

Which is the "One-Click Ruby Installer"?

I have a hard time reading open source file download pages like this http://rubyforge.org/frs/?group_id=167 . I click the "One-Click Ruby Installer" link on this page http://wiki.rubyonrails.org/getting-started/installation/windows and it takes me there.
I understand most of it like the versions for mac, win and source, version numbers etc. But I just don't know which is the actual one click installer. This is something I've always overlooked with pages like this and I usually just gestimate which I needed. This process is really intimidating.
Which of the many links is the "One-Click Ruby Installer"?
Can you offer any advice on reading pages like these?
I usually have trouble locating the right download to sometimes, best to just try and find the actual home page and go from there.
http://rubyinstaller.org/downloads/
This is the web page for the Ruby Installer, there's three links right at the top that are for the most recent versions of the installer.
Edit: With regards to the gems+rails you have to install them individually after you install ruby. Depending on the gem you may need to download and install the development kit which is also on the page I linked above. The install for that is simple you just need to copy the files into the folder you installed rails.
Here's the correct link:
http://rubyforge.org/frs/download.php/71078/rubyinstaller-1.9.1-p378.exe
It was the last link under "Final" in the first list. If you look at the section to the right, you can see the file type and the intended OS. The last link in a section of the list is the newest.

TextMate brackets insertion

Please note that I did ask this on Super User and received absolutely no responses, so I decided to port this to a programming community that knows a lot more about TextMate.
Working in Ruby on Rails in TextMate, when I select a chunk of text, let's say
My text
and then hit the open bracket [ key on my keyboard, TextMate wraps the selected block in opening and closing brackets, as such:
[My text]
I'd like to modify this behavior so it wraps it in an opening bracket, space, space, closing bracket, as such:
[ My text ]
(mind the spaces).
How would I go about modifying this behavior?
I don't mind modifying it only while working for Ruby on Rails (i.e. .rb, .html.erb file scope etc...) but I'd prefer it if it would take effect throughout the application.
Thank you!
Well i hope this is better than no answer. THe behaviour is controlled by a bundle. So you edit the respective bundle to get the behaviour you require.
Here is a quote "Some of the default items may not be to your exact liking, for example the coding style in snippets may differ from yours, so you may want other tab triggers, key equivalents, or similar modifications.
If you edit a default item the difference will be stored in ~/Library/Application Support/TextMate/Bundles. These are then merged with the default version so your changes will be effective even after upgrading TextMate. All new items you create also end up in this location.
Bundles or bundle items which you install by dragging them to TextMate or double clicking will be installed in ~/Library/Application Support/TextMate/Pristine Copy/Bundles. Editing these will also result in only the differences being stored in ~/Library/Application Support/TextMate/Bundles, meaning that if you later get a new version of this third party bundle, you can safely install this one on top of the old one (by dragging it to TextMate) and again your changes will be preserved.
If you want to discard local changes then currently the only option is to delete these from ~/Library/Application Support/TextMate/Bundles."
Fo more pointers go here. Hope this helps.

Resources