Skip to content

Instantly share code, notes, and snippets.

@nivir
Forked from jugyo/file_name_on_status_bar.py
Created October 8, 2020 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nivir/4656a501aeaad8c952a339275f55a08b to your computer and use it in GitHub Desktop.
Save nivir/4656a501aeaad8c952a339275f55a08b to your computer and use it in GitHub Desktop.
Sublime Text Plugin to show file name on status bar
import sublime_plugin
class FileNameOnStatusBar(sublime_plugin.EventListener):
def on_activated(self, view):
path = view.file_name()
if path:
for folder in view.window().folders():
path = path.replace(folder + '/', '', 1)
view.set_status('file_name', path)
else:
view.set_status('file_name', 'untitled')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment