Created
September 17, 2017 22:02
-
-
Save tribou/53b508b65b390183e4b23678e5b0816f to your computer and use it in GitHub Desktop.
Customize Atom tab titles to display folder and file name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add folder and filename to tab title | |
atom.workspace.observeTextEditors (editor) -> | |
if editor.getTitle() isnt "untitled" | |
sp = editor.getPath().split('/') | |
title = sp.slice(sp.length-2).join('/') | |
editor.getTitle = -> title | |
editor.getLongTitle = -> title | |
editor.emitter.emit "did-change-title", editor.getTitle() | |
atom.workspace.onDidOpen (event) -> | |
for item in event.pane.items | |
if item.emitter? | |
item.emitter.emit "did-change-title", item.getTitle() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks saved my life!