selection-mode

When selection-mode is on, ALL cursor movement modifies the selection

jeffgran

804

6

0.4.0

MIT

GitHub

selection-mode package

When selection-mode is on, ALL cursor movement modifies the selection. View on atom.io.

Description

When you toggle selection-mode on, we set a mark where the cursor is. Then, any movement of the cursor will expand/contract the selection from that original mark.

When selection-mode is on, doing anything that changes the text buffer (typing, deleting, etc.) will also implicitly toggle selection-mode off.

Advantages

This package is better than other packages that offer similar functionality, because:

Example keybinding

# these work best in pairs. either this pair:
'atom-workspace atom-text-editor.editor':
  'ctrl-space': 'selection-mode:toggle'

'atom-workspace atom-text-editor.editor.selection-mode':
  # this one toggles off without deselecting, which works
  # well with the above, which deselects when toggling off
  'ctrl-g': 'selection-mode:off'


# ...or this pair
'atom-workspace atom-text-editor.editor':
  # this toggles but won't deselect when toggling back off
  'ctrl-space': 'selection-mode:toggle-without-deselecting'

'atom-workspace atom-text-editor.editor.selection-mode':
  # this is your dedicated toggle-off-and-deselect
  'ctrl-g': 'selection-mode:cancel'

Issues

Inspiration

This package was inspired by my dependence on emacs' transient-mark-mode