A Fast Open for init.el

Like me, Bozhidar Batsov is always fiddling with his init.el file. As a result, he’s devised a way to open it quickly. He wrote a bit of Elisp to load it and bound the Elisp to the simple key sequence 【Ctrl+c I】. That’s a pretty nice solution and one that Irreal readers might expect me to adopt.

I, however, have a different strategy. I have 4 or 5 files that I use all the time. I have them bookmarked so I can load them easily but I don’t need to do that very often because I just keep them loaded. I use desktop-save-mode so they stay loaded even across Emacs invocations. Then when I want to examine, say, init.el it’s just a matter of 【Ctrl+x bin or maybe just 【Ctrl+x bi depending on what ido has in its cache at the moment. That’s not as fast as Batsov’s 【Ctrl+c I】 but it’s fast enough1.

One of the commenters to Batsov’s post suggests using the bookmark facility with a label of, say, i for init.el. Then you can open init.el with 【Ctrl+x r b i】. That gives us at least 3 ways of solving the problem, which is really the point. With Emacs you can solve problems in a way that’s comfortable for you. How do you solve the problem of opening frequently accessed files?

Footnotes:

1 Basov’s solution opens init.el in another window so his solution is faster still if you have that requirement. If I needed that, I’d use 【Ctrl+x 2】 first. If I always wanted a separate window, I’d probably adopt Batsov’s solution.

This entry was posted in General and tagged . Bookmark the permalink.