2009-11-30

Uniquify buffer names

Sometimes you need to see two or more files with same name. In Emacs, buffer names confuse me a lot because they are like R.java, R.java<2>, R.java<3> and etc. You can make buffer name unique by using uniquify.;
(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward
     uniquify-separator ":")
There are several choices you can select for this uniquify-buffer-name-style (Copied from documentation).
    For example, files `/foo/bar/mumble/name' and `/baz/quux/mumble/name' would have the following buffer names in the various styles:
    • forward bar/mumble/name quux/mumble/name
    • reverse name\mumble\bar name\mumble\quux
    • post-forward name|bar/mumble name|quux/mumble
    • post-forward-angle-brackets name name
    • nil name name<2>