Atom Editor の Tree Viewの操作についてですが
defaultのkey mapはどうも使いづらいので
home positionで操作できるようにカスタマイズしてみました。
便利にはなりましたが、vimを利用していた時と同様に、他のIDE(XCode, Eclipse, Visual Studio)を使う際に
毎度残念な気持ちになるので、カスタマイズはほどほどにするのが良い気もしています。
まずはdefault key map
keystroke patterns | commands | 概要 |
---|---|---|
shift-cmd-\ | tree-view:reveal-active-file | 現在開いているファイルをtreeviewで表示 |
ctrl-0 | tree-view:toggle-focus | treeviewとeditorのfocus切り替え |
これらが、どちらも使いにくい。
カスタマイズ例
'atom-text-editor:not([mini])': 'ctrl-f ctrl-f': 'tree-view:reveal-active-file' '.tree-view': 'ctrl-f ctrl-f': 'tree-view:toggle-focus' 'ctrl-h': 'tree-view:collapse-directory' 'ctrl-j': 'core:move-down' 'ctrl-k': 'core:move-up' 'ctrl-l': 'tree-view:expand-directory' 'ctrl-l': 'tree-view:open-selected-entry'
ポイントは、同じkey strokeを複数コマンドに割り当てているところ。
ctrl-f を2回実行すると現在開いているファイルをtreeviewで表示。
さらにctrl-f を2回実行するとeditorに戻ります。
ctrl-j / ctrl-k で tree view を上下移動し
ctrl-h で ディレクトリを閉じ、ctrl-l でディレクトリを展開します。
tree viewでファイルを選択している際に ctrl-l を押下すると、ファイルが開きます。