Skip to content

Instantly share code, notes, and snippets.

@davidpett
Last active September 2, 2015 17:17
Show Gist options
  • Select an option

  • Save davidpett/6d4be0f2565e47db5003 to your computer and use it in GitHub Desktop.

Select an option

Save davidpett/6d4be0f2565e47db5003 to your computer and use it in GitHub Desktop.
override tab longTitle in atom editor
path = require 'path'
{TextEditor} = require 'atom'
TextEditor::getLongTitle = ->
if sessionPath = @getPath()
fileName = path.basename(sessionPath)
directory = atom.project.relativize(path.dirname(sessionPath))
directory = if directory.length > 0 then directory.split('/').pop() else path.basename(path.dirname(sessionPath))
"#{directory}/#{fileName}"
else
'untitled'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment