Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
273 lines (228 sloc) 8.67 KB
# 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.
#
# 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:
# * https://atom.io/docs/latest/customizing-atom#customizing-key-bindings
# * https://atom.io/docs/latest/advanced/keymaps
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it here:
# https://github.com/bevry/cson#what-is-cson
#
# See: https://gist.github.com/BinaryMuse/621bf3e66a66876e4d78
# - (Handy Shortcuts)
#
# NOTE: CAPS LOCK should be mapped to Control
#
'atom-workspace':
# Close Pane
'ctrl-\'': 'core:close'
'ctrl-alt-\'': 'tabs:close-all-tabs'
# Ember Pods - related files
'ctrl-p': 'ember-tabs:open-file-pane'
'atom-workspace, atom-text-editor':
###############################################
# Search and handy macro-y things
##############################################
# alt-enter converts search results into selections
'ctrl-b': 'intentions:show'
# 'alt-enter': 'custom:search-to-cursors'
# 'alt-/': 'custom:search-to-cursors'
'f11': 'atom-ctags:go-to-declaration'#'goto:declaration'
'f10': 'symbols-view:toggle-file-symbols'#'goto:file-symbol'
'f9': 'goto:project-symbol'
###################################
# Pane Navigation
###################################
# ctrl+k + ctrl+direction navigates panes
# but that's too many keystrokes, therefore:
# with dvorak's chtn (Querty ijkl), instead of arrows
'alt-h': 'window:focus-pane-on-left'
'alt-t': 'window:focus-pane-below'
'alt-n': 'window:focus-pane-on-right'
'alt-c': 'window:focus-pane-above'
# pane sizing
'ctrl-n': 'pane:increase-size'
'ctrl-h': 'pane:decrease-size'
# Multiple Cursors (adding / subtracting)
'ctrl-shift-c': 'editor:add-selection-above'
'ctrl-shift-t': 'editor:add-selection-below'
#####################################################
# VIM MODE PLUS!!!
#####################################################
'atom-workspace atom-text-editor:not([mini]), atom-text-editor.vim-mode-plus':
# Deleting - because the delete key is too far away, and mac laptops don't have one
# 'ctrl-d': 'core:delete'
# 'ctrl-shift-d': 'editor:delete-to-end-of-word'
# 'alt-shift-d': 'editor:delete-line' # also d d
# Save, then exit to Normal Mode
'ctrl-s': 'custom:save-and-go-to-normal-mode'
# Enter Visual Mode
'ctrl-j': 'vim-mode-plus:activate-characterwise-visual-mode'
# Enter Normal Mode
'ctrl-u': 'vim-mode-plus:activate-normal-mode'
# Enter Insert Mode
'ctrl-i': 'vim-mode-plus:activate-insert-mode'
##############################################
################ NORMAL MODE #################
'atom-text-editor.vim-mode-plus.normal-mode':
'\'+c': 'editor:move-line-up'
'\'+t': 'editor:move-line-down'
'\' u': 'color-picker:open'
# Pane Splitting
'\' alt-t': 'pane:split-down'
'\' alt-h': 'pane:split-left'
'\' alt-n': 'pane:split-right'
'\' alt-c': 'pane:split-up'
# pane moving
'\' shift-h': 'window:move-active-item-to-pane-on-left'
'\' shift-n': 'window:move-active-item-to-pane-on-right'
'\' shift-c': 'window:move-active-item-to-pane-above'
'\' shift-t': 'window:move-active-item-to-pane-below'
##############################################
################ INSERT MODE #################
'atom-text-editor.vim-mode-plus.insert-mode':
# Copy - because for some reason, this was bound to something else
'ctrl-c': 'core:copy'
# Exit Insert Mode - Escape is too far away.
'ctrl-u': 'vim-mode-plus:activate-normal-mode'
# select next / prev occurance
'ctrl-]': 'vim-mode-plus:select-occurance'
##############################################
################ VISUAL MODE #################
'atom-text-editor.vim-mode-plus.visual-mode':
# Exit Visual Mode - Escape is too far away.
'ctrl-u': 'vim-mode-plus:activate-normal-mode'
# Enter Insert Mode
'ctrl-i': 'vim-mode-plus:activate-insert-mode'
# select the entire block with the same indentation
'i i': 'vim-mode-plus:inner-indentation'
# select the entire block within the current fold-level
'i f': 'vim-mode-plus:inner-fold'
# select next / prev occurance
# '\' u': 'vim-mode-plus:select-occurance'
# '\' i,': 'find-and-replace:find-previous-selected'
# Select outer wrapping characters
'o s': 'vim-mode-plus:a-any-pair'
'o q': 'vim-mode-plus:a-any-quote'
'o {': 'vim-mode-plus:a-curly-bracket'
'o }': 'vim-mode-plus:a-curly-bracket'
'o [': 'vim-mode-plus:a-square-bracket'
'o ]': 'vim-mode-plus:a-square-bracket'
'o <': 'vim-mode-plus:a-angle-bracket'
'o >': 'vim-mode-plus:a-angle-bracket'
'o (': 'vim-mode-plus:a-parenthesis'
'o )': 'vim-mode-plus:a-parenthesis'
# Select inside wrapping characters
'i s': 'vim-mode-plus:inner-any-pair'
'i q': 'vim-mode-plus:inner-any-quote'
'i {': 'vim-mode-plus:inner-curly-bracket'
'i }': 'vim-mode-plus:inner-curly-bracket'
'i [': 'vim-mode-plus:inner-square-bracket'
'i ]': 'vim-mode-plus:inner-square-bracket'
'i <': 'vim-mode-plus:inner-angle-bracket'
'i >': 'vim-mode-plus:inner-angle-bracket'
'i (': 'vim-mode-plus:inner-parenthesis'
'i )': 'vim-mode-plus:inner-parenthesis'
##############################################
############### NOT INSERT MODE ##############
'atom-text-editor.vim-mode-plus:not(.insert-mode)':
# Character Navigation
'c': 'core:move-up'
't': 'core:move-down'
'h': 'core:move-left'
'n': 'core:move-right'
# Character Selection
'shift-c': 'core:select-up'
'shift-h': 'core:select-left'
'shift-n': 'core:select-right'
'shift-t': 'core:select-down'
# Word Navigation
'm': 'editor:move-to-next-subword-boundary'
'b': 'editor:move-to-previous-subword-boundary'
'shift-m': 'editor:select-to-next-subword-boundary'
'shift-b': 'editor:select-to-previous-subword-boundary'
'ctrl-d': 'find-and-replace:select-next'
'shift-ctrl-d': 'find-and-replace:select-all'
# Line Navigation
'\' n': 'editor:move-to-end-of-screen-line'
'\' h': 'editor:move-to-first-character-of-line'
# Project Navigation
'ctrl-t': 'fuzzy-finder:toggle-file-finder'
# Tree View Toggle
'\' /': 'tree-view:toggle-focus'
'\' \\': 'tree-view:toggle'
# Show the current file in the tree
'\' l': 'tree-view:reveal-active-file'
# Tab Navigation
'r': 'pane:show-previous-item'
'l': 'pane:show-next-item'
# shortcut for : (so you don't have to type shift)
';': 'ex-mode:open'
# Because vim-search is actually kinda lame
'/': 'find-and-replace:show'
##############################################################################
# vim-mode-plus overrides (because I want these commands to work in every mode)
##############################################################################
'atom-text-editor.vim-mode-plus, atom-text-editor.vim-mode-plus-input':
# ctrl-c should *always* copy
'ctrl-c': 'core:copy'
'atom-text-editor.vim-mode-plus.normal-mode, atom-text-editor.vim-mode-plus.visual-mode':
# ctrl-v should *always* paste
'ctrl-v': 'core:paste'
###############################################
# To not forget the joy of NERDTree's shortcuts
###############################################
# Tree View
# ctrl+\ toggle tree view
# alt+\ toggle focus
# shift-a add folder
# a add file
# d duplicate
# ctrl+shift+c copy full path
# ctrl+shift+\ reveal active file
# F2 or m move
'.tree-view':
'd d': 'tree-view:remove'
'y': 'tree-view:copy'
'p': 'tree-view:paste'
'x': 'tree-view:cut'
'a f': 'tree-view:add-file'
'a d': 'tree-view:add-folder'
'i': 'tree-view:open-selected-entry-down'
's': 'tree-view:open-selected-entry-right'
'c': 'core:move-up'
't': 'core:move-down'
'h': 'tree-view:collapse-directory'
'n': 'tree-view:open-selected-entry'
'\' /': 'tree-view:toggle-focus'
#############################################################
# reset / clear default keybindings, cause we don't like them
'.platform-win32, .platform-linux':
'alt': 'abort!'
#############################################################
'atom-workspace atom-text-editor:not([mini])':
# 'alt-enter': 'native!'
'alt-shift-h': 'native!'
'alt-shift-n': 'native!'
'alt-shift-t': 'native!'
'alt-shift-c': 'native!'
'ctrl-shift-c': 'native!'
'ctrl-shift-h': 'native!'
'ctrl-shift-t': 'native!'
'ctrl-shift-n': 'native!'