• Packages
  • Themes
  • Documentation
  • Blog
  • Discussions
Sign in

sa-leader-key

Prevent dispatching commands bound to a subsequence of keybindings starting with <leader>.
lucmartens
0.1.0 209
0
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

sa-leader-key

Prevent dispatching commands bound to a subsequence of keybindings starting with <leader>.

Motivation

When a sequence of keystrokes does not exactly match a keybinding, atom will attempt to match subsequences of the original sequence. For example, given a keymap:

'atom-workspace atom-text-editor.vim-mode-plus:not(.insert-mode)':
  'space p o': 'application:add-project-folder'
  'p': 'vim-mode-plus:put-after'

Entering the space p o sequence incorrectly (e.g space p j) will attempt to find matches for space p and p. Since we have a matching keybinding for p, the vim-mode-plus:put-after command is dispatched. Partially entering the space p o sequence (e.g space p) will, after a timeout, attempt to find matches for p.

This behaviour is undesirable when you want to cancel matching a sequence of keystrokes, or want to provide discoverable keybindings.

Usage

Bind the desired leader key in your keymap.cson:

'atom-workspace atom-text-editor.vim-mode-plus:not(.insert-mode)':
  'space': 'leader-key:toggle'

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by