Skip to content

Instantly share code, notes, and snippets.

@leotada
Last active July 21, 2023 17:17
Show Gist options
  • Save leotada/3e5885fbda5c47d486cf23388ed2c3f0 to your computer and use it in GitHub Desktop.
Save leotada/3e5885fbda5c47d486cf23388ed2c3f0 to your computer and use it in GitHub Desktop.
Atom/Pulsar Editor keybinding, for my use with atomic-emacs package (disabled default keybindings)
# Your keymap
#
# Pulsar keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Pulsar 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 Pulsar'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:
# * https://pulsar-edit.dev/docs/launch-manual/sections/using-pulsar/#customizing-keybindings
# * https://pulsar-edit.dev/docs/launch-manual/sections/behind-pulsar#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:
# * https://pulsar-edit.dev/docs/launch-manual/sections/core-hacking/#check-your-keybindings
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Pulsar Launch Manual:
# https://pulsar-edit.dev/docs/launch-manual/sections/using-pulsar/#configuring-with-cson
'atom-workspace':
'ctrl-g': 'core:cancel'
'alt-x': 'command-palette:toggle'
'ctrl-x ctrl-c': 'application:quit'
'ctrl-x k': 'core:close'
'ctrl-x ctrl-f': 'atomic-emacs:find-file'
'ctrl-x b': 'fuzzy-finder:toggle-buffer-finder'
'ctrl-x 3': 'pane:split-right'
'ctrl-x 2': 'pane:split-down'
'ctrl-x 0': 'pane:close'
'ctrl-x 1': 'atomic-emacs:close-other-panes'
'ctrl-x o': 'window:focus-next-pane'
'body.platform-darwin':
'cmd-x': 'atomic-emacs:cut'
'cmd-c': 'atomic-emacs:copy'
'body.platform-linux':
'shift-delete': 'atomic-emacs:cut'
'ctrl-insert': 'atomic-emacs:copy'
'ctrl-x': 'atomic-emacs:cut'
'ctrl-c': 'atomic-emacs:copy'
# For command palette, buffer switcher, etc. on Linux.
'body.platform-linux .select-list atom-text-editor.mini':
'ctrl-p': 'core:move-up'
'ctrl-n': 'core:move-down'
'body.platform-win32':
'shift-delete': 'atomic-emacs:cut'
'ctrl-insert': 'atomic-emacs:copy'
'ctrl-x': 'atomic-emacs:cut'
'ctrl-c': 'atomic-emacs:copy'
'atom-workspace atom-text-editor':
# Navigation
'ctrl-b': 'atomic-emacs:backward-char'
'left': 'atomic-emacs:backward-char'
'ctrl-f': 'atomic-emacs:forward-char'
'right': 'atomic-emacs:forward-char'
'alt-b': 'atomic-emacs:backward-word'
'alt-left': 'atomic-emacs:backward-word'
'alt-f': 'atomic-emacs:forward-word'
'alt-right': 'atomic-emacs:forward-word'
'ctrl-alt-b': 'atomic-emacs:backward-sexp'
'ctrl-alt-f': 'atomic-emacs:forward-sexp'
'ctrl-alt-p': 'atomic-emacs:backward-list'
'ctrl-alt-n': 'atomic-emacs:forward-list'
'alt-{': 'atomic-emacs:backward-paragraph'
'alt-}': 'atomic-emacs:forward-paragraph'
'alt-m': 'atomic-emacs:back-to-indentation'
'ctrl-a': 'editor:move-to-first-character-of-line'
'ctrl-e': 'editor:move-to-end-of-screen-line'
'alt-<': 'core:move-to-top'
'alt->': 'core:move-to-bottom'
'ctrl-d': 'core:delete'
# Killing & Yanking
'alt-backspace': 'atomic-emacs:backward-kill-word'
'alt-delete': 'atomic-emacs:backward-kill-word'
# 'alt-d': 'atomic-emacs:kill-word'
'ctrl-k': 'atomic-emacs:kill-line'
'ctrl-w': 'atomic-emacs:kill-region'
'alt-w': 'atomic-emacs:copy-region-as-kill'
'ctrl-alt-w': 'atomic-emacs:append-next-kill'
'ctrl-y': 'atomic-emacs:yank'
'alt-y': 'atomic-emacs:yank-pop'
'alt-shift-y': 'atomic-emacs:yank-shift'
# Editing
'alt-\\': 'atomic-emacs:delete-horizontal-space'
'alt-^': 'atomic-emacs:delete-indentation'
'ctrl-o': 'atomic-emacs:open-line'
'alt-space': 'atomic-emacs:just-one-space'
'ctrl-x ctrl-o': 'atomic-emacs:delete-blank-lines'
#'ctrl-t': 'atomic-emacs:transpose-chars'
'alt-t': 'atomic-emacs:transpose-words'
'ctrl-alt-t': 'atomic-emacs:transpose-sexps'
'ctrl-x ctrl-t': 'atomic-emacs:transpose-lines'
'ctrl-x ctrl-l': 'atomic-emacs:downcase-word-or-region'
'alt-l': 'atomic-emacs:downcase-word-or-region'
'ctrl-x ctrl-u': 'atomic-emacs:upcase-word-or-region'
'alt-u': 'atomic-emacs:upcase-word-or-region'
'alt-c': 'atomic-emacs:capitalize-word-or-region'
'ctrl-j': 'editor:newline'
'ctrl-m': 'editor:newline'
'ctrl-/': 'core:undo'
'ctrl-_': 'core:undo'
'ctrl-x u': 'core:undo'
'alt-/': 'atomic-emacs:dabbrev-expand'
'alt-?': 'atomic-emacs:dabbrev-previous'
'alt-q': 'autoflow:reflow-selection'
'alt-;': 'editor:toggle-line-comments'
'ctrl-alt-\\' : 'editor:auto-indent'
# Searching
'ctrl-s': 'atomic-emacs:isearch-forward'
# 'ctrl-r': 'atomic-emacs:isearch-backward'
# Marking & Selecting
'ctrl-space': 'atomic-emacs:set-mark'
'ctrl-alt-space': 'atomic-emacs:mark-sexp'
'ctrl-x h': 'atomic-emacs:mark-whole-buffer'
'ctrl-x ctrl-x': 'atomic-emacs:exchange-point-and-mark'
'alt-d': 'find-and-replace:select-next'
'alt-shift-f': 'editor:select-to-end-of-word'
'alt-shift-b': 'editor:select-to-beginning-of-word'
# UI
'ctrl-g': 'core:cancel'
'ctrl-x ctrl-s': 'core:save'
'ctrl-x ctrl-w': 'core:save-as'
'alt-.': 'symbols-view:go-to-declaration'
'atom-text-editor:not(.autocomplete-active):not(.mini)':
# Navigation
'ctrl-p': 'atomic-emacs:previous-line'
'up': 'atomic-emacs:previous-line'
'ctrl-n': 'atomic-emacs:next-line'
'down': 'atomic-emacs:next-line'
# Scrolling
'ctrl-l': 'atomic-emacs:recenter-top-bottom'
'ctrl-v': 'atomic-emacs:scroll-up'
'alt-v': 'atomic-emacs:scroll-down'
# Editing
'tab': 'editor:auto-indent'
'.platform-linux atom-workspace.atomic-emacs atom-text-editor':
'ctrl-d': 'core:delete'
'ctrl-e': 'editor:move-to-end-of-screen-line'
'.platform-linux atom-workspace atom-text-editor:not([mini]),
.platform-win32 atom-workspace atom-text-editor:not([mini])':
'ctrl-j': 'editor:newline'
'.platform-linux atom-workspace atom-text-editor:not(.autocomplete-active):not([mini]),
.platform-win32 atom-workspace atom-text-editor:not(.autocomplete-active):not([mini])':
'ctrl-/': 'core:undo'
'.platform-win32 atom-workspace.atomic-emacs atom-text-editor':
'ctrl-d': 'core:delete'
'ctrl-e': 'editor:move-to-end-of-screen-line'
'ctrl-k ctrl-k': 'editor:cut-to-end-of-line'
'atom-workspace .find-and-replace atom-text-editor':
'ctrl-s': 'find-and-replace:confirm'
'ctrl-r': 'find-and-replace:show-previous'
'.go-to-line atom-text-editor[mini] input':
'ctrl-g': 'core:cancel'
'.tree-view-dialog atom-text-editor[mini]':
'ctrl-g': 'core:cancel'
'atom-panel.left, atom-panel.right':
'ctrl-g': 'tool-panel:unfocus'
'.platform-linux atom-workspace, .platform-win32 atom-workspace':
'alt-g g': 'go-to-line:toggle'
'alt-g alt-g': 'go-to-line:toggle'
'ctrl-g': 'core:cancel'
'.platform-win32 .go-to-line atom-text-editor[mini] input':
'ctrl-g': 'core:cancel'
'.platform-darwin':
'alt-g g': 'go-to-line:toggle'
'alt-g alt-g': 'go-to-line:toggle'
'ctrl-g': 'core:cancel'
'.platform-darwin .go-to-line atom-text-editor[mini] input':
'ctrl-g': 'core:cancel'
'atom-text-editor.autocomplete-active':
'ctrl-g': 'autocomplete-plus:cancel'
'ctrl-p': 'core:move-up'
'ctrl-n': 'core:move-down'
'atom-text-editor !important, atom-text-editor[mini] !important':
'ctrl-g': 'editor:consolidate-selections'
'atom-workspace .atomic-emacs.search atom-text-editor':
'enter': 'atomic-emacs:isearch-exit'
'ctrl-m': 'atomic-emacs:isearch-exit'
'escape': 'atomic-emacs:isearch-cancel'
'ctrl-g': 'atomic-emacs:isearch-cancel'
'ctrl-s': 'atomic-emacs:isearch-repeat-forward'
'ctrl-r': 'atomic-emacs:isearch-repeat-backward'
'alt-s c': 'atomic-emacs:isearch-toggle-case-fold'
'alt-c': 'atomic-emacs:isearch-toggle-case-fold'
'alt-s r': 'atomic-emacs:isearch-toggle-regexp'
'alt-r': 'atomic-emacs:isearch-toggle-regexp'
'ctrl-w': 'atomic-emacs:isearch-yank-word-or-character'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment