トップ 差分 一覧 ソース 検索 ヘルプ RSS ログイン

AtomをEmacsキーバインドで使う

[Emacs]

AtomをWindowsで起動させるとよい感じなので、ちょいと移行を検討してみる

Qiitaにいい記事があった。

emacs-plusatomic-emacs の後継なので、これを使えばよさそう。

結局Emacsバインディングはどれがいいのか?

  最終的なパッケージとkeymap

  • パッケージ
    • いずれも apm install <package> で入れられる
Community Packages (6) C:\Users\learning\.atom\packages
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
  • キーマップ
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
# Here's an example taken from Atom's built-in keymap:
#
# 'atom-text-editor':
#   'enter': 'editor:newline'
#
# 'atom-workspace':
#   'ctrl-shift-p': 'core:move-up'
#   'ctrl-p': 'core:move-down'
#
# You can find more information about keymaps in these guides:
# * http://flight-manual.atom.io/using-atom/sections/basic-customization/#_customizing_keybindings
# * http://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/
#
# If you're having trouble with your keybindings not working, try the
# Keybinding Resolver: `Cmd+.` on macOS and `Ctrl+.` on other platforms. See the
# Debugging Guide for more information:
# * http://flight-manual.atom.io/hacking-atom/sections/debugging/#check-the-keybindings
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson

'body':
  'alt-v': 'core:page-up'
  'alt-w': 'core:copy'
  'ctrl-d': 'core:delete'
  'ctrl-g': 'core:cancel'
  'ctrl-h': 'core:backspace'
  'ctrl-m': 'core:confirm'
  'ctrl-n': 'core:move-down'
  'ctrl-p': 'core:move-up'
  'ctrl-v': 'core:page-down'
  'ctrl-w': 'core:cut'

'atom-workspace':
  'alt-x': 'command-palette:toggle'
  'ctrl-x 0': 'pane:close'
  'ctrl-x 1': 'emacs-plus:close-other-panes'
  'ctrl-x 2': 'pane:split-down-and-copy-active-item'
  'ctrl-x 3': 'pane:split-right-and-copy-active-item'
  'ctrl-x b': 'fuzzy-finder:toggle-buffer-finder'
  'ctrl-x ctrl-c': 'application:quit'
  'ctrl-x ctrl-f': 'advanced-open-file:toggle'
  'ctrl-x ctrl-j': 'tree-view:reveal-active-file'
  'ctrl-x k': 'core:close'
  'ctrl-x o': 'window:focus-next-pane'
  'ctrl-x ctrl-f': 'advanced-open-file:toggle'

'atom-workspace atom-text-editor':
  'ctrl-/': 'core:undo'
  'ctrl-_': 'core:undo'
  'ctrl-a': 'editor:move-to-beginning-of-line'
  'ctrl-b': 'core:move-left'
  'ctrl-e': 'editor:move-to-end-of-screen-line'
  'ctrl-f': 'core:move-right'
  'ctrl-g': 'editor:consolidate-selections'
  'ctrl-t': 'editor:transpose'
  'ctrl-y': 'core:paste'
  'alt-b': 'editor:move-to-beginning-of-word'
  'alt-f': 'editor:move-to-end-of-word'
  'alt-right': 'editor:move-to-end-of-word'
  'ctrl-alt-/': 'core:redo'
  'ctrl-x ctrl-l': 'editor:lower-case'
  'ctrl-x ctrl-u': 'editor:upper-case'
  'ctrl-x u': 'core:undo'

'atom-workspace atom-text-editor.emacs-plus:not([mini])':
  'alt-.': 'symbols-view:toggle-file-symbols'
  'alt-/': 'autocomplete-plus:activate'
  'alt-;': 'editor:toggle-line-comments'
  'alt-<': 'core:move-to-top'
  'alt->': 'core:move-to-bottom'
  'alt-\\': 'emacs-plus:delete-horizontal-space'
  'alt-^': 'emacs-plus:delete-indentation'
  'alt-backspace': 'emacs-plus:backward-kill-word'
  'alt-c': 'emacs-plus:capitalize-word'
  'alt-d': 'emacs-plus:kill-word'
  'alt-delete': 'emacs-plus:backward-kill-word'
  'alt-g g': 'go-to-line:toggle'
  'alt-left': 'editor:move-to-beginning-of-word'
  'alt-m': 'editor:move-to-first-character-of-line'
  'alt-q': 'autoflow:reflow-selection'
  'alt-space': 'emacs-plus:just-one-space'
  'alt-t': 'emacs-plus:transpose-words'
  'alt-w': 'emacs-plus:copy'
  'alt-{': 'editor:move-to-beginning-of-previous-paragraph'
  'alt-}': 'editor:move-to-beginning-of-next-paragraph'
  'ctrl-alt-w': 'emacs-plus:append-next-kill'
  'ctrl-i': 'editor:auto-indent'
  'ctrl-j': 'editor:newline'
  'ctrl-k': 'emacs-plus:kill-line'
  'ctrl-l': 'emacs-plus:recenter-top-bottom'
  'ctrl-m': 'editor:newline'
  'ctrl-o': 'emacs-plus:open-line'
  'ctrl-r': 'find-and-replace:show'
  'ctrl-s': 'find-and-replace:show'
  'ctrl-shift-backspace': 'emacs-plus:kill-whole-line'
  'ctrl-space': 'emacs-plus:set-mark'
  'ctrl-w': 'emacs-plus:kill-region'
  'ctrl-x ctrl-s': 'core:save'
  'ctrl-x ctrl-t': 'emacs-plus:transpose-lines'
  'ctrl-x ctrl-x': 'emacs-plus:exchange-point-and-mark'
  'ctrl-x h': 'core:select-all'

'atom-workspace atom-text-editor.emacs-plus.mark-mode:not([mini])':
  'alt-<': 'core:select-to-top'
  'alt->': 'core:select-to-bottom'
  'alt-b': 'editor:select-to-beginning-of-word'
  'alt-f': 'editor:select-to-end-of-word'
  'alt-left': 'editor:select-to-beginning-of-word'
  'alt-right': 'editor:select-to-end-of-word'
  'alt-v': 'core:select-page-up'
  'alt-{': 'editor:select-to-beginning-of-previous-paragraph'
  'alt-}': 'editor:select-to-beginning-of-next-paragraph'
  'ctrl-a': 'editor:select-to-beginning-of-line'
  'ctrl-b': 'core:select-left'
  'ctrl-e': 'editor:select-to-end-of-line'
  'ctrl-f': 'core:select-right'
  'ctrl-g': 'core:cancel'
  'ctrl-n': 'core:select-down'
  'ctrl-p': 'core:select-up'
  'ctrl-v': 'core:select-page-down'
  'down': 'core:select-down'
  'left': 'core:select-left'
  'right': 'core:select-right'
  'up': 'core:select-up'

'.find-and-replace':
  'ctrl-r': 'find-and-replace:find-previous'
  'ctrl-s': 'find-and-replace:find-next'

# autocomplete-plus
'atom-workspace atom-text-editor:not(mini).emacs-plus.autocomplete-active':
  'ctrl-g': 'autocomplete-plus:cancel'
  'ctrl-m': 'autocomplete-plus:confirm'
  'enter': 'autocomplete-plus:confirm'

# tree-view
'.tree-view':
  '^': 'tree-view:collapse-directory'
  'ctrl-m': 'tree-view:open-selected-entry'
  'n': 'core:move-down'
  'p': 'core:move-up'
  'q': 'tree-view:toggle'
  'shift-c': 'tree-view:duplicate'
  'shift-d': 'tree-view:remove'
  'shift-e': 'tree-view:recursive-expand-directory'
  'shift-r': 'tree-view:rename'

# advanced-open-file
'.advanced-open-file atom-text-editor':
  'ctrl-i': 'advanced-open-file:autocomplete'
  'ctrl-p': 'advanced-open-file:move-cursor-up'
  'ctrl-n': 'advanced-open-file:move-cursor-down'
  'ctrl-w': 'advanced-open-file:delete-path-component'
  'ctrl-/': 'advanced-open-file:undo'
  'ctrl-j': 'advanced-open-file:move-cursor-down'

'atom-text-editor':
  'ctrl-k t down': 'unset!'
  'ctrl-k t left': 'unset!'
  'ctrl-k ctrl-0': 'unset!'
  'ctrl-k ctrl-1': 'unset!'
  'ctrl-k ctrl-2': 'unset!'
  'ctrl-k ctrl-3': 'unset!'
  'ctrl-k ctrl-4': 'unset!'
  'ctrl-k ctrl-5': 'unset!'
  'ctrl-k ctrl-6': 'unset!'
  'ctrl-k ctrl-7': 'unset!'
  'ctrl-k ctrl-8': 'unset!'
  'ctrl-k ctrl-9': 'unset!'
  'ctrl-k ctrl-alt-w': 'unset!'
  'ctrl-k ctrl-b': 'unset!'
  'ctrl-k ctrl-d': 'unset!'
  'ctrl-k ctrl-down': 'unset!'
  'ctrl-k ctrl-k': 'unset!'
  'ctrl-k ctrl-l': 'unset!'
  'ctrl-k ctrl-left': 'unset!'
  'ctrl-k ctrl-n': 'unset!'
  'ctrl-k ctrl-p': 'unset!'
  'ctrl-k ctrl-right': 'unset!'
  'ctrl-k ctrl-u': 'unset!'
  'ctrl-k ctrl-up': 'unset!'
  'ctrl-k ctrl-w': 'unset!'
  'ctrl-k down': 'unset!'
  'ctrl-k h': 'unset!'
  'ctrl-k k': 'unset!'
  'ctrl-k l': 'unset!'
  'ctrl-k left': 'unset!'
  'ctrl-k right': 'unset!'
  'ctrl-k j': 'unset!'
  'ctrl-k up': 'unset!'

お名前: コメント: