Is There A Command For Show Invisibles?


Is there a command available to key mapping for toggling the display of invisibles in the editor. A Show/Hide Invisibles command?

Where would I go to look for such a command?


There is a setting, but no command to my knowledge. Though, since settings are live-reloaded … it wouldn’t be too hard to create a command for this, I would think.


I whipped together a package that creates the command toggle-invisibles:toggle. You can map it to whatever key you like:


Cool! And Thank You!

I set up a keybinding like this:

  'ctrl-i': 'toggle-invisibles:toggle'

And the Key Binding Resolver shows that it fired. But it didn’t show/hide invisibles. Should the scope have been ‘.workspace’ instead of ‘.editor’?


Does it work from the command palette?


No. Not for me. It’s there, and I can select it, but it doesn’t work.


It appears to show/hide the tab indent markers, but not such things as tabs, spaces or returns.


Perhaps you have some other package that is showing the invisibles in a different manner. All I’m doing is toggling the editor.showInvisibles setting.


Try adding this to your stylesheet …

.editor {
  .invisible-character {
    color: #c5c8c6;
    opacity: 0.3;


That was the problem. Thanks!


If anybody else has key-bindings issues (like I did), be sure to use the more specific selector:

    'ctrl-a': 'toggle-invisibles:toggle'


I solved this by creating a custom command and adding the appropriate keybinding…

In init.cofee add

atom.commands.add 'atom-text-editor',
  'settings:toggle-show-invisibles': (event) ->
    invisibles = atom.config.get('editor.showInvisibles')
    atom.config.set('editor.showInvisibles', !invisibles)

In keymap.cson add

'.workspace .editor:not(.mini), .workspace, .platform-darwin, .platform-win32, .platform-linux':
  'cmd-i': 'settings:toggle-show-invisibles'


What happened to this package?


See the README:

Since the functionality provided by this package is now available in Atom proper, I have unpublished it. I’m leaving it publicly available as an example of a simple package.


I still don’t see a command for toggling invisibles in the command pallet, though.



Ah. I was searching for “show invisibles”. Thanks.


I wasn’t able to find this panel. If anyone else has this problem just press:
Cmd + Shift + P if you are mac or Ctrl + Shift + P in Windows


Yes, it is called the Command Palette and it is discussed here in the Atom Flight Manual:

'cmd-i': 'toggle-invisibles:toggle'

Is not working for me; I can find Window: Toggle Invisibles via the Command Palette but I am unable to tie it into the keymap. What am I missing?