Uniquify and ido

A very quick post today to mention a couple of core modules I’ve included in my config that make using emacs even nicer.

I’ve been using uniquify for a while as the default emacs behaviour when loading two identically named files is a bit naff1. I found this tip here.

(requireuniquify)

(setq uniquify-buffer-name-style ‘reverse)
(setq uniquify-separator “|”)
(setq uniquify-after-kill-buffer-p t)
(setq uniquify-ignore-buffers-re “^\\*”)

I’ve just added ido to my config today based on a post I found at the emacs blog. It might take a bit of getting used to but we’ll see how that goes.

(ido-mode t)
(setq ido-enable-flex-matching t)

I’ve added those sections to a file I have called my-defaults.el that contains my really short pieces of configuration.

my-defaults.el

;; ———————————————————————- ;;

(requireido)
(requireuniquify)

;; ———————————————————————- ;;

(global-font-lock-mode 1)
(setq inhibit-splash-screen t)
(setq font-lock-maximum-decoration 3)
(fset ‘yes-or-no-p ‘y-or-n-p)
(tool-bar-mode -1)
(show-paren-mode 1)
(transient-mark-mode t)
(customize-set-variable ’scroll-bar-mode ‘right)
(setq case-fold-search t)

(line-number-mode 1)
(column-number-mode 1)

;; ———————————————————————- ;;

(setq backup-directory-alist
      (cons ‘(“.” . “~/.emacs-backups”) backup-directory-alist))

;; ———————————————————————- ;;

(ido-mode t)
(setq ido-enable-flex-matching t)

;; ———————————————————————- ;;

(setq uniquify-buffer-name-style ‘reverse)
(setq uniquify-separator “|”)
(setq uniquify-after-kill-buffer-p t)
(setq uniquify-ignore-buffers-re “^\\*”)

;; ———————————————————————- ;;

(providemy-defaults)

;; ———————————————————————- ;;

1. It appends an integer in angle brackets to the second file with a non-unique name, e.g. file.cpp<2>.

2 Responses to “Uniquify and ido”

  1. Eric Says:

    Thanks for this. Very helpful! I already use ido but uniquify is addressing something that’s always bothered me.

  2. JG Says:

    I’m glad you found it helpful Eric. Cheers for letting me know.

    JG

Leave a Reply