Navigation

  • eclim »
  • Documentation »
  • Ruby »

Ruby Search¶

Pattern Search¶

Pattern searching provides a means to widen a search beyond a single element. A pattern search can be executed using the command

:RubySearch -p <pattern> [-t <type> -s <scope> -i]

All of the results will be placed into the current window’s location list (:help location-list) so that you can easily navigate the results.

Vim command completion is supported through out the command with the exception of the pattern to search for.

:RubySearch <Tab>
:RubySearch -p MyClass* <Tab>
:RubySearch -p MyClass* -t <Tab>
:RubySearch -p MyClass* -t class <Tab>
:RubySearch -p MyClass* -t class -s <Tab>
:RubySearch -p MyClass* -t class -s project
  • -p <pattern>: The pattern to search for.

    Ex.

    MyClass

    myFunction

    my*

  • -t <type> (Default: all): The type of element to search for where possible types include

    • class
    • method
    • field
  • -x <context> (Default: declarations): The context of the search, where possible values include

    • all - All occurances.
    • declarations - Declarations matching the pattern or element.
    • references - References of the pattern or element.
  • -s <scope> (Default: all): The scope of the search where possible values include

    • all - Search the whole workspace.
    • project - Search the current project, dependent projects, and libraries.
  • -i: Ignore case when searching.

Element Search¶

Element searching allows you to place the cursor over just about any element in a source file (method call, class name, constant) and perform a search for that element. Performing an element search is the same as performing a pattern search with the exception that you do not specify the -p option since the element under the cursor will be searched for instead.

If only one result is found and that result is in the current source file, the cursor will be moved to the element found. Otherwise, on single result matches, the value of g:EclimRubySearchSingleResult will be consulted for the action to take. If there are multiple results, the location list will be opened with the list of results.

As a convenience eclim also provides the command :RubySearchContext. This command accepts no arguments and will perform the appropriate search depending on the context of the element.

  • If the cursor is on a the definition of a method, class, module, etc. then a search will be performed for all uses of that element.
  • Otherwise, it will search for the declaration of the element.

Configuration¶

Vim Variables

  • g:EclimRubySearchSingleResult (Default: ‘split’) - Determines what action to take when a only a single result is found.

    Possible values include:

    • ‘split’ - open the result in a new window via “split”.
    • ‘edit’ - open the result in the current window.
    • ‘lopen’ - open the location list to display the result.

Note

Search support depends on the eclipse dltk ruby plugin which should be installed for you when choosing ruby support in the eclim installer.

Table Of Contents

  • About / News
  • Download
  • Features
  • Screenshots
  • Source Code
  • Getting Started
  • History of Changes
  • Contribute
  • Documentation
    • Introduction
    • Eclimd
    • Settings
    • Issues / Quirks
    • Code Completion
    • Suggested Vim Mappings
    • Cheatsheet
    • FAQ
    • Common
      • Eclipse Projects
      • Eclim & Taglist
      • Utility Commands
      • Version Control System Commands
      • Local History
      • Web Lookup Commands
      • Window Maximize / Minimize
      • Archive Viewer
    • C/C++
      • C/C++ Project Configuration
      • C/C++ Code Completion
      • C/C++ Validation
      • C/C++ Search
      • Call Hierarchy
    • Css
      • Css Code Completion
      • Css Validation
    • Dltk (Dynamic Languages Toolkit)
      • Dltk Build Path
    • Dtd
      • Dtd File Validation
    • Html
      • Html Code Completion
      • Html File Validation
      • Html File Utils
    • Java
      • Ant
        • Ant Execution
        • Ant Code Completion
        • Ant File Validation
        • Ant Documentation Lookup
      • Maven
        • Maven Execution
        • Maven Dependencies
      • Log4j
        • Log4j File Validation
      • WEB-INF/web.xml
        • WEB-INF/web.xml Validation
      • Eclipse Classpath Editing
      • Java Validation
      • Java Search
      • Java / Javac Support
      • Javadoc Support
      • Automated Imports
      • Java Code Completion
      • Java Code Correction
      • Class Constructor Generation
      • Method Override / Impl
      • Delegate Methods
      • Java Bean Functionality
      • Class / Interface Hierarchy
      • Java Source Code Formatting
      • Refactoring
      • Checkstyle
      • JUnit
      • TestNG
      • Logging
      • Regex Testing
      • Java Tools Integration
    • Javascript
      • Javascript Validation
    • Php
      • PDT Build Path
      • Php Code Completion
      • Php Validation
      • Php Search
    • Python
      • Python Validation
      • Python Code Completion
      • Python Search
      • Python Regex Testing
      • Django
    • Ruby
      • Ruby Build Path
      • Ruby Code Completion
      • Ruby Validation
      • Ruby Search
    • Vim
      • Vim Find
      • Vim Doc
    • Wsdl
      • Wsdl Validation
    • Xml
      • Xml Code Completion
      • Xml Definition Lookup
      • Xml Validation
      • Xml Format
    • Xsd
      • Xsd Validation
  • Guides
    • Installing / Upgrading
    • Uninstalling
    • Troubleshooting
    • Eclim Headless Server Guide
    • Multiple Workspace Guide
    • Eclim Developers Guide
    • Running VimClojure in eclimd
  • Translations
    • Traditional Chinese
      • Eclim Vim 指令參考
  • Development Docs
    • Eclim Architecture
  • Related Projects
    • Eclipse
    • Vim
    • Emacs + Eclim
    • Vimplugin
    • Vrapper
    • viPlugin

Support / Mailing Lists

  • Users Mailing List
  • Developers Mailing List
  • Bugs / Feature Requests

Quick Search

Google Search

This Page

  • Ruby Search
    • Pattern Search
    • Element Search
    • Configuration
  • Show Source

Navigation

  • eclim »
  • Documentation »
  • Ruby »
Created with Vim - logo Sourceforge.net Logo - logo
© Copyright 2009, Eric Van Dewoestine. Last updated on Mar 06, 2010. Created using Sphinx 0.6.4.