Skip to content

t9md/atom-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toggle Build Status

Toggle keyword

gif

Commands

  • toggle:here: Toggle word under cursor.
  • toggle:there: Toggle word on current line without moving cursor.
  • toggle:visit: Toggle word on current line and move to toggled word.
  • toggle:open-config: Open user's wordGroup configuration file.

Keymap

No keymap by default.

e.g.

  • normal user
'atom-text-editor:not([mini])':
  'ctrl--': 'toggle:there'
'atom-text-editor.vim-mode-plus.normal-mode':
  '-': 'toggle:there'

Limitation

When this package search candidate word to be toggled from current line, it scan word with regular expression /\b\w+\b/.
So you can only toggle word matches \w+ or [A-Za-z0-9_]+.
This mean you cannot set special character as toggle words e.g. <, <=.

Customization

Add custom words

From command Palette, execute Toggle: Open Config.

# '*' is wildcard scope, which is always searched as last resort.
'*': [
  ['yes'   , 'no']
  ['up'    , 'down']
  ['right' , 'left']
  ['true'  , 'false']
  ['high'  , 'low']
  ['column', 'row']
  ['and'   , 'or']
  ['not'   , '']
  ['on'    , 'off']
  ['in'    , 'out']
  ['one'   , 'two'   , 'three']
  ['bar'   , 'bar']
],
'source.coffee': [
  ['is'  , 'isnt']
  ['if'  , 'unless']
]

Flash color customization

@keyframes toggle-flash {
  from { background-color: @syntax-selection-flash-color; }
  to { background-color: transparent; }
}

Similar package for other text editors.