Search code examples
notepad++sublimetext3sublimetext

Is there a way to rename tabs in Sublime Text 3 or Notepad++?


I often find myself copying and pasting multiple different sets of code into ST or Notepad++ to work with and edit. In most cases I am just copying the code so that I can modify in one of these programs and then copy and paste back to the Content Management System, so there is no need to ever save these files and thus create a filename.

I would like to know if there is a way that I can rename the tabs in ST or Notepad++ so that I can keep track of, and hopefully remember what code snippet is which. I saw this post about renaming tabs in sublime text, but it seems to be outdated and no longer possible in ST 3.


Solution

  • Edit:

    I wrote a simple plugin that makes the process a bit easier and works around the issue mentioned below.


    You can name unsaved tabs by typing into the first line of the document, although this will become unset if you change the syntax and alter the document.
    (Seems like a bug, but it is intentional.)

    Demo1


    You can also:

    1. Launch the console with Ctrl + BackTick
    2. Run the command: view.set_name("Tab_Name_Goes_Here")

    Demo 2

    (tested in ST3)