Emacs Tip: A Key to open the Current Folder in Windows

If the over-descriptive title was not enough, this is another one of my tips to use my favorite editor - Emacs. Some of you really liked my earlier post on Emacs tips on Windows, so here is one more tip to improve your productivity.

Most of the time while editing a document, we need to quickly browse the folder of that file. Add the following lines to your .emacs files and so that by just pressing function key F12 you can immediately view its corresponding folder:

;; explorer
;; ----------
;;; Windows explorer to open current file - Arun Ravindran

(defun explorer ()
  "Launch the windows explorer in the current directory and selects current file"
   (concat "/e,/select," (convert-standard-filename buffer-file-name))))

(global-set-key [f12]         'explorer)        ; F12 - Open Explorer for the current file path

A nice extra is that the opened explorer will have the current file automatically selected. Press F12 once in a while, it quickly becomes addictive ;)

Share on: Twitter, Hacker News, Reddit, Facebook, Google+

Posted on: Tue, Jun 10, 2008

Next: ▶  DASAVATHAARAM - A Futile Head Spinning Exercise

Prev: ◀  Indie Film Making against Odds

Up: ▲  Blog

Hi! Welcome to ArunRocks, an odd collection of writeups on programming, travel, gadgets and practically anything under the sun. This state of affairs could be blamed on the ecelectic interests of your host, Arun Ravindran. He loves programming in several languages especially Python.

Frequent Tags

python (36) django (18) movies (11) productivity (11) tutorial (10) gaming (8) humour (8) creativity (7) featured (7) screencast (7) python3 (6) review (6) programming (5) wordpress (5)

Don't miss any future posts!


comments powered by Disqus