[PHPStorm]エディタをvi(Vim)キーバインドにする

PHPStormの内蔵エディタは、IdeaVimプラグインをインストールする事でキーバインドをVim風に変更することが可能です。



IdeaVimプラグインのインストール方法

メニューより、File->Settingsを選択します。



設定画面の左側から,IDE Settings -> Pluginsを選択します。
右側に表示されたBrowse repositoriesボタンをクリックします。



一覧からIdeaVimを選択します。
項目を右クリックしてDownload and Installを選択します。


インストールしてよいですか?の確認ダイアログが表示されるので、Yesをクリックします。



設定画面でIdeaVimが追加されており、チェックが入っている事を確認します。

OKボタンを押すと、プラグインを有効にする為にPHPStormが再起動します。




再起動後、Vim Keymap settingsダイアログが表示されます。
Windowsの場合はDefaultを選択しておくことをお勧めします。






一時的にVimキーマップを無効にしたい場合は、”Ctrl+Alt+V”のショートカットキーです。
メニューのToolsからでも選択できます。


コロン”:”から始まるコマンドは、エディタの下に表示されます。





IdeaVimでサポートされている機能

IdeaVimでは全てのVimコマンドがサポートされているわけでは有りません。
何のコマンドがサポートされているかは、プラグインの説明を見ると分かります。

Vim emulation plug-in for IDEs based on the IntelliJ platform. 
IdeaVim can be used with IntelliJ IDEA, RubyMine, PyCharm, PhpStorm, WebStorm and AppCode.
Supported functionality:
    Motion keys
    Deletion/Changing
    Insert mode commands
    Marks
    Registers
    Undo/redo
    Visual mode commands
    Some Ex commands
    Some :set options
    Full Vim regexps for search and search/replace
    Macros
    Digraphs
    Command line and search history
    Vim web help



:set コマンドで使えるコマンドは以下の通りです。

'digraph'       'dg'    enable the entering of digraphs in Insert mode
'gdefault'      'gd'    the ":substitute" flag 'g' is default on
'history'       'hi'    number of command-lines that are remembered
'hlsearch'      'hls'   highlight matches with last search pattern
'ignorecase'    'ic'    ignore case in search patterns
'matchpairs'    'mps'   pairs of characters that "%" can match
'nrformats'     'nf'    number formats recognized for CTRL-A command
'scroll'        'scr'   lines to scroll with CTRL-U and CTRL-D
'scrolljump'    'sj'    minimum number of lines to scroll
'scrolloff'     'so'    minimum nr. of lines above and below cursor
'selection'     'sel'   what type of selection to use
'showmode'      'smd'   message on status line to show current mode
'sidescroll'    'ss'    minimum number of columns to scroll horizontal
'sidescrolloff' 'siso'  min. nr. of columns to left and right of cursor
'smartcase'     'scs'   no ignore case when pattern has uppercase
'undolevels'    'ul'    maximum number of changes that can be undone
'visualbell'    'vb'    use visual bell instead of beeping
'wrapscan'      'ws'    searches wrap around the end of the file



関連記事

コメントを残す

メールアドレスが公開されることはありません。