Skip to content

Instantly share code, notes, and snippets.

@dsandstrom
Last active May 10, 2022 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsandstrom/b31002dde9fd116b3c2ab61bf681c047 to your computer and use it in GitHub Desktop.
Save dsandstrom/b31002dde9fd116b3c2ab61bf681c047 to your computer and use it in GitHub Desktop.
atom configs
# surround for ruby string interpolation
atom.commands.add 'atom-text-editor', 'custom:surround-interpolation', ->
return unless editor = atom.workspace.getActiveTextEditor()
editor.transact ->
# TODO: get cursor scope, add quotes if not a string
for selection in editor.getSelections()
text = selection.getText()
return unless text.length
text = "\#{#{text}}"
selection.insertText(text)
'body':
'f12': 'window:toggle-dev-tools'
'cmd-shift-n': 'advanced-open-file:toggle'
'.platform-linux atom-workspace':
'ctrl-{': 'pane:show-previous-item'
'ctrl-}': 'pane:show-next-item'
'ctrl-|': 'autohide-tree-view:toggle-enabled'
'ctrl-N': 'advanced-open-file:toggle'
'.platform-linux atom-workspace atom-text-editor':
'ctrl-space': 'non-navigation:move-right'
'ctrl-alt-t': 'editor:transpose'
'alt-k': 'subword-navigation:delete-right'
'.platform-linux atom-workspace atom-pane.active > .item-views > atom-text-editor':
'ctrl-c': 'core:copy'
'ctrl-v': 'core:paste'
'.platform-linux atom-text-editor':
'ctrl-k ctrl-a': 'find-and-replace:select-all'
'ctrl-k': 'core:move-up'
'ctrl-j': 'core:move-down'
'ctrl-h': 'core:move-left'
'ctrl-l': 'core:move-right'
'ctrl-space': 'non-navigation:move-right'
'.platform-darwin atom-text-editor':
'cmd-k': 'core:move-up'
'cmd-j': 'core:move-down'
'cmd-h': 'core:move-left'
'cmd-l': 'core:move-right'
'f3': 'git-diff:move-to-next-diff'
'cmd-f3': 'git-diff:toggle-diff-list'
'cmd-k cmd-a': 'find-and-replace:select-all'
'.platform-darwin atom-text-editor.vim-mode:not(.insert-mode), .platform-darwin atom-text-editor.vim-mode-plus:not(.insert-mode)':
'ctrl-p': 'clipboard-plus:toggle'
'.platform-darwin atom-text-editor:not([mini])':
'cmd-shift-v': 'clipboard-plus:toggle'
'.platform-linux atom-text-editor:not([mini])':
'ctrl-shift-v': 'clipboard-plus:toggle'
'.platform-linux atom-text-editor.vim-mode:not(.insert-mode), .platform-linux atom-text-editor.vim-mode-plus:not(.insert-mode)':
'ctrl-p': 'clipboard-plus:toggle'
'ctrl-d': 'find-and-replace:select-next'
'ctrl-u': 'find-and-replace:select-undo'
'atom-text-editor.vim-mode:not(.insert-mode), atom-text-editor.vim-mode-plus:not(.insert-mode)':
'shift-enter': 'add-line-break:add-line-break-before'
'enter': 'add-line-break:add-line-break-after'
'[': 'editor:move-to-next-subword-boundary'
']': 'editor:move-to-previous-subword-boundary'
'v [': 'editor:select-to-next-subword-boundary'
'v ]': 'editor:select-to-previous-subword-boundary'
# 'd [': 'editor:delete-to-end-of-subword'
# 'd ]': 'editor:delete-to-beginning-of-subword'
'space w': 'core:save'
'space': 'unset!'
'r f': 'rspec-focus:add'
'r c': 'rspec-focus:clear'
'space r': 'autoflow:reflow-selection'
'g l n': 'linter-ui-default:next-in-current-file'
'g l p': 'linter-ui-default:next-in-current-file'
'g r m': 'rails-transporter:open-model'
'g r c': 'rails-transporter:open-controller'
'g r s': 'rails-transporter:open-spec'
'g r t': 'rails-transporter:open-test'
'g r f': 'rails-transporter:open-factory'
'g r h': 'rails-transporter:open-helper'
'atom-text-editor.vim-mode.visual-mode':
's #': 'custom:surround-interpolation'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment