Sublime Forum

Awesome idea or not?


It just struck me, a new feature for ST, that I find awesome and I would like to know what other ST users think about it.

So here it comes:

The new feature allows to select a group of files and displays the content of the files in one single tab, just the way it is with one single file. All editing features would work with this group of files as with one single file. E.g. find & replace, multiple selection, go to symbol, saving, you name it.

What do you think?




How do you envision the joining of those files?



I would simply concatenate the contents in the order of their apearance in the side bar
The line numbers would be decimal: 1.1 1.2 1.3 for the first three lines of first file, 2.1 2.2 2.3 for second file and so on.
In addition, the title bar would change the title depending on the position of the cursor, showing in which file the cursor is.



Of course, the concatenated file would be somehow virtual, similar to a new unsaved file.



I guess the most important question is what exact pain point does this feature solve ? Why would you need to “concatenate” multiple files ? I can hardly concentrate on more than 2 files being open side by side in ST without needing to add 10s more to the lisy.



I tend to put all core functionality of a software project in one big file because it’s easier to work with one big file than with separate files.

On the other hand, having separate files have advantages too. No need to explain this point, since most of the people already prefere this way of working.

having the proposed feature we could unify both worlds. We could have all the advantages and no disadvantage.

“I can hardly concentrate on more than 2 files being open side by side”
Exaclty! The new feature would solve this issue.



I get your idea, but I kinda feel like we already have solutions for some of these without needing the added cognitive complexity of showing multiple files as if they are one.

  • Go to symbol: Go to symbol in project
  • Find and replace: Find in files
  • Saving: Save all

Re multiple selections across files: Iirc there was a plugin which kinda does something like this to allow editing multiple files directly from search results



Those things are known to me but they don’t give you the use and feel of one single file. The proposed feature is like an unification of everything. Let me put it the other way: If we have had this feature from the start, all other named features wouldn’t be needed.

There are noumerous actions for which there is no available solution for multiple files.
CTRL+D for selected word which stepwise selects next equal words.
Quickly pressing CTRL+F on selected word to see if the selected word is already used in the document (status bar shows the number of hits)
This new feature would save a lot of man power neded to develop surogates of this feature.

1 Like


Is there a keyboard shortcut for this? Because I tend to save very often using CTRL+S when coding. Old habit before having ST which makes saving not so urgent but still…



You can bind your own.



It looks like you are asking for

1 Like


Though I would be wary of the consistency of changes made with it because I wouldn’t trust the implementation without having checked it thoroughly myself.

There are ways to make this work from a plugin and they would probably satisfy the 90% case, however there are also some limitations and egde cases that need to be considered (like preferring to make edits to open views instead of directly into the file to avoid conflicts/races, checking whether the file contents at the intended position have changed in general, etc).

Having the clip that @jfcherng posted as a reference in the initial post would have helped with understanding the request, by the way.



Yeah, that looks good. The only difference to my idea: I want to edit whole files not only matching areas.



From an implementation point of view: If its done in the core, probably it would be better. The editiing in those merged files wouldl have the save effect as if it was in the single file. Saving would save the files directly.
BTW: I pretty don’t like extenstions. Because when I’m on the computer of a coleague at work and that installation doesn’t have my extensions, I have a problem. When I get a new laptop, I have to remember which extensions I had on my old laptop.



I had never remembered all of my used plugins. They are just there. All I need to do when I have another computer is a simple git clone. But if you are using other people’s Sublime Text, yes, that can be an issue. Though in that case, I will lose all my custom things (such as keybindings), which is an issue too no matter something is builtin or not.




Using a co-worker computer has nothing to do with Sublime Text.

You can always copy the package control file. That is the part responsible for remembering plugins.