LoginSignup
25
30

More than 5 years have passed since last update.

RubyMineよく使う機能

Last updated at Posted at 2015-11-05

Rubymineで個人的によく使う機能のまとめです。
デフォルトでも十分なRubymineですが、よく使うキーマップを変更したり、設定を自分好みに変更するとより使いやすくなると思います。

Keymap

  • Keymapの構成

image.png

No 大項目
1 Editor Actions
2 Main menu
3 Tool Windows
4 External Tools
5 Version Control Systems
6 Rake
7 Generators
8 Remote External Tools
9 Macros
10 Quick Lists
11 Plug-ins
12 Other

1.Editor Action

名前 key map 説明
Cut up to Line End CTRL + K 末尾まで切り取る
Right → , CTRL + F 右へ
Left ←, CTRL + B 左へ
Move Caret to Code Block Start Opt + Cmd + [ ブロックのスタートにジャンプ
Move Caret to Code Block End Opt + Cmd + [ ブロックのエンドにジャンプ
Move Caret to Line Start CTRL + A 行の先頭に移動
Move Caret to Line End CTRL + E 行の末尾に移動
Coose Lookup Item and Insert Dot CTRL + . 先頭の補完候補を選択して.も記入

2.Main menu

Run

名前 key map 説明
Debug CTRL + D デバッグ実行

Help

名前 key map 説明
Find Action Shift + Cmd + A 全てのアクション検索

View

名前 key map 説明
Quick Definition Opt + Space ポップアップでソース参照
Quick Documentation F1 , CTRL + J ポップアップでドキュメント参照

Navigate

名前 key map 説明
Class... Cmd + O プロジェクト内のクラス名で検索
File... Shift + Cmd + O プロジェクト内でファイル名で検索
Symbol... Opt + Cmd + O プロジェクト内で変数名、メソッド名などで検索?
Test Shift + Cmd + T テストにジャンプ
File Structure Cmd + F12 クラスのメソッド、フィールドを見れる。さらにmodelではカラムも見れる
Type Hierarchy CTRL + H タイプヒエラルキー
Back Cmd + [ 戻る
Foard Cmd + ] 進む
Last Edit Location Ctrl + Cmd Backspace 最後の編集に戻る
Declaration Cmd + B 定義へジャンプ
Implementation(s) Opt + Cmd + B 継承しているクラスへジャンプ
Toggle Bookmark F3 ブックマークのつけはずし
Show Bookmark Cmd + F3 ブックマークリスト
Related Symbol Ctrl + Cmd + ↑ view,model,controller,testへジャンプ

Code

名前 key map 説明
Reformat Code Opt + Cmd + L フォーマットをきれいにする
Fold Selection Cmd + . コードをおりたたむ
Comment with Line Comment Cmd + / #でコメントにする
Comment with Block Comment Opt + Cmd + / =begin =end でコメントにする

Window

名前 key map 説明
Select Next Tab Shift + Cmd + ] 次のタブ
Select Previous Tab Shift + Cmd + [ 前のタブ
Move Down 下分割
Move Right 右分割
Move To Opposite Group 別のウインドウに移動
Close Others 他のタブを閉じる

Edit

名前 key map 説明
Find Usage Opt + F7 使われている箇所を表示
Show Usage Opt + Cmd + F7 使われている箇所をポップアップで表示
Add Selection for Next Occurrence CTRL + G 検索時に次のヒットに進む
Copy Paths Shift + Cmd + C フルパスコピー
Copy Reference Shift + Cmd + Option + C 相対パス + Lineナンバー コピー

Refactor

名前 key map 説明
Refactor this Ctrl + T リファクタメニューを表示

Tools

名前 key map 説明
Run Rake Task Opt + R rake task実行
Run Rails Generator Opt + Cmd + G migrate実行

3.Tool Windows

名前 Shortcut 説明
Version Control Cmd + 9 gitのlocalchangesやlogを確認できる

5. Version Control Systems

名前 key map 説明
Show Local Changes - ローカルの変更を表示
Show History - ヒストリーを表示
Annotate - Git Blame

12.Other

名前 key map 説明
Search Everywhere Shift 2回 色々検索
Open source in new window 新しいwindowで開く
Terminal Terminalを開く
Database Console データベースコンソールを開く
Switch to Controller Controllerへジャンプ
Switch to Model Modelへジャンプ
Switch to View Viewへジャンプ

Editor

1. General

設定箇所 説明
Editor > Generl > Use original line's indent for wrapped parts 折り返しの時にインデントする
Editor > General > Ensure line feed at file end on Save 保存時にファイルの最終行に改行を入れる
Editor > General > Change font size with Command+Mouse Wheel マウスで拡大する
Show quick documentation on mouse move マウスオーバーでドキュメント表示

General > Appearance

名前 初期設定 説明
Show method separators チェックなし メソッド毎に線を表示

General > Code Completion

コード補完に関する設定はここ

2. Color Scheme

私はマテリアルテーマプラグイン
https://plugins.jetbrains.com/plugin/8006-material-theme-ui
を入れ、テーマを複製して微調整しています。

調整している箇所

設定内容 設定箇所 元の色
デフォルト文字色 Editor > Color Scheme > General > Default text > Foreground EEFFFF
背景色 Editor > Color Scheme > General > Default text > Background 212121
メソッドの引数 Editor > ColorSchema > Ruby > Parameter
ローカル変数 Editor > ColorSchema > Ruby > Local Variable
ローカル変数 Editor > ColorSchema > CoffeeScript > Local Variable
{}/()/[] Editor > ColorSchema > Language Defaults > (Braces/Parentheses/Brackets)
検索ヒット Editor > ColorSchema > General > Search Results > Search result
検索ヒット Editor > ColorSchema > General > Search Results > Search result(write access)
検索ヒット Editor > ColorSchema > General > Search Results > Text search result
LineNumber Editor > ColorSchema > General > Code > Line number
背景色 Editor > Color Scheme > General > Text > Default text > Background
文字色 Editor > Color Scheme > General > Text > Default text > Foreground
縦線 Editor > Color Schema > General > Guides > Editor > Hard Wrap guide
インデント縦線 Editor > Color Schema > General > Guides > Editor >  Indent guide
インデント縦線選択中 Editor > Color Schema > General > Guides > Editor >  Indent guide selected
メソッド横線 Editor > Color Schema > General > Code >  Method separator color
ドット Editor > Color Schema > Ruby >  Dot
カンマ(Ruby) Editor > Color Schema > Ruby > Comma
インスタンス変数 Editor > Color Scheme > Ruby

3. Vim Emulation

Shortcut IDE Action Handler
CTRL + A Move Caret to Line Start Vim
CTRL + E Move Caret to Line End Vim
CTRL + H Type Hierarchy Vim
CTRL + N Down Vim
CTRL + P Up Vim
CTRL + T Refactor This Vim

Plugins

自分が入れているプラグイン
- ideavim
- Railways
- Material Theme UI

設定画面以外の設定や使い方メモ

Projectペイン

image.png

  • Project
    • ファイルツリー。
  • Rails
    • Railsプロジェクト専用の表示。
  • Change Files
    • コミット未済の変更ファイル。

設定

名前 key map 説明
Autoscroll from Source off 今開いているファイルに応じてソースツリーを開いてくれる

Structureペイン

Structureはコード全体が把握しやすいので、常に右に表示するようにしています。
specファイルも構造が表示されるので大変便利。
image.png

検索範囲対象外とする

除外するフォルダで右クリック→Mark Directory As→Excluded
preferences(cmd + ,)→Project StructureにあるExcluded Folderに除外ファイルが表記されている。
×をクリックすれば除外を解除できる。

スクラッチ

メモ
Cmd + Shift + N

image.png

Github連携

内容 使い方
Githubで開く ファイルで右クリック > Open On Github

Terminal等のウィンドウを閉じる

  • Shift + ESC
  • Command + W
25
30
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
30