Sublime Forum

Easy way to open multiple files? Keyboard-based

#1

Does anyone know of a good way to do this from within sublime?

I’m looking for something to replace the method I’d use in textmate:

-open the equivalent of Goto Anything inside a project
-type a string common to the filenames I want to open to narrow down the results
-select multiple results using shift-down arrow
-press return

fb

0 Likes

#2

facepalm

:blush:

I used TM for three years and didn’t know this could be done. More than once I thought I should be able to open multiple files at one time.

big honkin’ sigh

I, too, would appreciate this functionality.

While it’s not quite the same, there is a discussion going on [1] regarding a plugin that allows saving a group of related files as a favorite and being able to open them all together.

[1] Favorite Files

0 Likes

#3

Don’t beat yourself up phillip, I’ve only just figured out I can change syntax highlighting without the menus.

Thanks for the link, I’ll check it out.

0 Likes

#4

There is also SideBarEnhancements which allow you to do a search in file names, opening the result in a plain text tab.
Right click sidebar -> find advanced -> in path containing

With that list… there is plugin Open Include which allow you to open whatever you have selected. for example, triple clickling many lines with CTRL to select many files in different positions. Or just select big portions.
And with ALT+D will open these in tabs.

0 Likes

#5

Thanks Tito. It’s not quite the same as I am used to, but perfectly workable, and both these plugins are very interesting in their own right.

0 Likes

#6

You are welcome,

I’ve added the keymap ALT+F to this function,
then for example you can open all the files including “class.” in current project by doing 3 steps.

1 - ALT+F
2 - type “class.”, press enter.
3 - ALT+D

0 Likes

#7

I was just doing something similar after poking around in your code. However, my way just opened the files matched without giving any feedback about what was about to be opened.

Your method is much better, so I’ll stop cutting and pasting now =]

Thanks very much.

0 Likes

#8

I know this topic is old, but it still comes up in Google.

In ST3 there’s an easy way to open multiple files, that I’d wager not many people know: just use ⌘P, type your file pattern, then use right and down arrows: → ↓ → ↓ … as needed.

1 Like

#9

Thank you tobia!

0 Likes

#10

I found a useful alternative:

ctrl + shift + F

space, tab

Enter your folder, tab

space

Hit replace, hit enter


This will open all files inside the folder. After saving them all (nothing has actually changed) they appear as you would expect.

If someone knows the keyboard shortcut to replace all, that would be appreciated.

1 Like

#11

This solution worked for me in Windows 10, although it’s pretty cumbersome, given it should really be a standard feature!

I needed to find all files in a directory containing this text:

href=“mmt”

I used Sublime’s Find in files, then in the result file, selected all lines containing “C:\data_jeffy.”, I copied them and pasted them all into a new document. It resulted in a list of file paths (after eliminating the fluff, such as the colon and everything following the path… One example:

C:\data_jeffy\Dropbox\Dropbox_working_working\Tweet threads_CMTV resources\other\kids-story\kids-story.html

Then I changed each line to be the following:

“C:\applications\text\sublime_text_3\Sublime Text 3\sublime_text.exe” “C:\data_jeffy\Dropbox\Dropbox_working_working\Tweet threads_CMTV resources\other\kids-story\kids-story.html”

and finally, I saved the file as temp.bat on the desktop, and executed it via the windows command prompt.

:slight_smile:

0 Likes

#12

You can achieve something similar automatically with a simple plugin that gathers all of the filenames and opens them directly:

1 Like