7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SublimeでもINSERTモード時jkhl移動を可能にする

Last updated at Posted at 2014-03-24

vimを使っている人はINSERTモードでもjkhlで移動出来るようにすべく以下の様なキーマップ設定をしている人が多いのではと(勝手に)思っています。
私はCtrlキーとjkhlを組み合わせています。

inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-h> <Left>
inoremap <C-l> <Right>

最近、Sublime TextをVimキーバインドで使っているのですが、上記に該当する設定なしに使っていたところストレスが半端無かったのでKey Bindingsを設定しました。

{
  "keys": ["ctrl+j"], "command": "move", "args": { "by": "lines", "forward": true },
  "context": [{"key": "setting.command_mode", "operand": false}]
},
{
  "keys": ["ctrl+k"], "command": "move", "args": { "by": "lines", "forward": false },
  "context": [{ "key": "setting.command_mode", "operand": false }]
},
{
  "keys": ["ctrl+h"], "command": "move", "args": { "by": "characters", "forward": false },
  "context": [{ "key": "setting.command_mode", "operand": false }]
},
{
  "keys": ["ctrl+l"], "command": "move", "args": { "by": "characters", "forward": true },
  "context": [{ "key": "setting.command_mode", "operand": false }]
}

これでINSERTモード時(厳密にはコマンドモード以外の時)にCtrl + jkhlでカーソル移動が可能になります。

7
7
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
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?