Often when I start emacs I open the same set of files. How can I make it so that I can quickly select several files from a directory and open them?
5 Answers
When you open emacs you can run dired
. This will allow you to mark several files and open them at once. Not the best method, just putting it out there.
-
1You can't do this with
dired
, (unmodified.) Howeverdired+
can, or use Trey Jackson's defun : stackoverflow.com/a/1110487/311660– ocodoCommented Jan 23, 2013 at 23:34
Yet another alternative is to just use a file glob (C-x C-f ~/foo/*.c RET
, or proj/*/*.[ch]
, etc)
-
1
Have a look at the desktop commands, you can save your desktop into a file, say at the top of your project and then use desktop-change-dir to that project and it will load the files.
Have a look at the documentation on saving sessions. http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html#Saving-Emacs-Sessions
This is a think-outside-the-box solution:
I use ENSO launcher on my windows and am more than satisfied with it.
select the files you want to open in explorer or total-commander or anywhere
simply press ENSO button and type
open with emacs
and presto :)
I know it is not an emacs solution, but it is a very helpful productivity tool.
-
2Probably want
emacsclient
instead ofemacs
so that the file will open in the Emacs you already have running. You know, the one you started after your last reboot and will be open until your next reboot? Commented May 14, 2010 at 18:02