Toggle treeview vcs and ignored names in context menu


#1

Just posting this solution from another post since you won’t likely realize it’s in there.

To add a context menu item to the tree view (right click) that will toggle both the vcs files that git (or other vcs) are ignoring and to also toggle at the same time the “Ignored Names” which can be set in the core settings under “Ignored Names” add the following to your init.coffee file (edit>references then click on “open config folder”)

    atom.commands.add '.tree-view', 'custom:toggle-treeview-hidden', ->
      atom.commands.dispatch document.querySelector('.tree-view'), 'tree-view:toggle-ignored-names'
      atom.commands.dispatch document.querySelector('.tree-view'), 'tree-view:toggle-vcs-ignored-files'

    atom.contextMenu.add {
      '.tree-view': [{label: 'Toggle All Ignored', command: 'custom:toggle-treeview-hidden'}]
       }

Then either restart Atom or from the palette Window:Reload and you should see the menu item “Toggle All Ignored” when right clicking in the tree view.

add this to your keymap.cson for keyboard toggling.
(change key sequence if it conflicts with your installed packages)

'.tree-view':
  'ctrl-alt-i': 'custom:toggle-treeview-hidden'

Then if you add,.* to the list of core ‘Ignored Names’ you can hide all those dot config files too and yet unhide them when you need them.

Enjoy…finally I am


How to ignore .DS-Store in project