4

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.

Community
  • 1
  • 1
SlowBlurry
  • 171
  • 2
  • 12
  • Here is a link to a plugin that I wrote to do this: [Set Name Of Unsaved Buffer](https://github.com/mattst/sublime-set-name-of-unsaved-buffer) – mattst Apr 25 '16 at 16:53
  • Only just noticed that Enteleform edited his answer with a link to a plugin as well. Oops. – mattst Apr 25 '16 at 17:21

1 Answers1

5

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)

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
Enteleform
  • 3,753
  • 1
  • 15
  • 30
  • 1
    Thanks! `view.set_name` works!It turns out the `view.set_name('')` option was the same solution given in the link I posted in the description. I was using ctrl+shift+p and opening the package control not the console (ooops). – SlowBlurry Apr 21 '16 at 22:30
  • @SlowBlurry : I just updated my answer with a simple plugin you can use so you don't have to type `view.set_name()` every time. It's only the source code, but you can add a key-binding or quick-panel command for fast execution. – Enteleform Apr 25 '16 at 12:26