RubyMine 2019.1 Help

Move and Copy Refactorings


The Copy refactoring lets you create a copy of a class, file or directory in a different or the same directory.

To perform copy refactoring:

  1. Select an identifier that you want to refactor (for example, a class in the editor or a file in the Project tool window).

  2. Select Refactor | Copy (F5)

  3. In the Copy window, specify the name and location for your copy, and click OK.


The Move refactoring lets you move a file/directory to another directory or a class/module to another file.

To move a file/directory:

  1. Select a file in a project view.

  2. Select Refactor | Move... or press F6.

  3. In the Move dialog, specify a directory where the selected file will be moved:

    Move dialog

    Click OK.

To move a class/module:

  1. Place a caret at the class/module name:

  2. Select Refactor | Move... or press F6.

  3. In the invoked dialog, you can specify a new class name and a file where this class will be placed:

    Move Class dialog

    Click Refactor. If necessary, you can click Preview to preview the potential changes.

Last modified: 8 May 2019

See Also