Search code examples
emacsemacs24

Changing status buffer in emacs 24 to show file path


I use emacs in terminal, hence title bar is not available, How do I see full file path or at least last 2 directories of file.

enter image description here


Solution

  • I got the answer from https://emacs.stackexchange.com/questions/2338/how-can-i-display-the-parent-directory-of-the-current-file-in-the-modeline post

    Basically I added this

    (setq-default mode-line-buffer-identification
                  (let ((orig  (car mode-line-buffer-identification)))
                    `(:eval (cons (concat ,orig (abbreviate-file-name default-directory))
                                  (cdr mode-line-buffer-identification)))))