LoginSignup
112
107

More than 5 years have passed since last update.

【Atom Editor】マウス操作不要!キーボードだけで矩形選択をする方法

Last updated at Posted at 2015-03-20

はじめに

Atom Editorで矩形選択したいって思ったら
sublime-style-column-selectionが有名だと思います。(たぶん)

でもこれって、altキーを押しながらマウス操作しないといけないんですよね。
矩形選択するためにマウス操作するのやだなーって思っていたんですが、解決策を見つけましたので共有します(*´∀`)

必要なPackages

multi-cursorっていうpackageが複数行選択を可能にしてくれます

image

キーバインドの初期設定は

alt + shift + cmd + up = Create cursor above
alt + shift + cmd + down = Create cursor under
alt + shift + cmd + left = The next cursor will skip 1 line above
alt + shift + cmd + right = The next cursor will skip 1 line under

とのこと

vim-modeと併用したキーバインドのオレオレカスタマイズ

keymap.cson
'atom-text-editor.vim-mode:not(.insert-mode)':
  'alt-cmd-j': 'multi-cursor:expandDown'
  'alt-cmd-k': 'multi-cursor:expandUp'
  'alt-cmd-l': 'core:select-right'
  'alt-cmd-h': 'core:select-left'
  'alt-cmd-u': 'multi-cursor:skipUp'
  'alt-cmd-d': 'multi-cursor:skipDown'

この設定をすると、vim-modeのコマンドモードの時に
alt-cmd-jで下に
alt-cmd-kで上に
動かせます。その後 alt-cmd-l で 選択範囲を右に広げることができます

image

最後に

キーバインドを変えるかどうかは好みだと思いますが、
矩形選択(的?)なことがマウスを使わずに出来るのは個人的にとってもうれしかったので共有してみました。

もっといいPackageやカスタマイズ方法があれば教えて下さいね(๑´ڡ`๑)

112
107
2

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