In the mode-line appears the name of the buffer I am working with (argf.rb):
For a buffer visiting a file, is it possible to display the absolute file name (i.e., include the path)?
In the mode-line appears the name of the buffer I am working with (argf.rb):
For a buffer visiting a file, is it possible to display the absolute file name (i.e., include the path)?
First, what you see is buffer name, not file name. Try to open two files with the same names (in different directories) and see what I mean.
Second, yes, I am sure it is possible - just customize mode-line-format
.
Third, it might not be such a great idea - the mode line is already quite crowded and the long path will just not fit. I know it sounds great now, but you will hate it the next day.
Instead, put the path into the title bar:
(setq frame-title-format
'(buffer-file-name "%b - %f" ; File buffer
(dired-directory dired-directory ; Dired buffer
(revert-buffer-function "%b" ; Buffer Menu
("%b - Dir: " default-directory))))) ; Plain buffer
uniquify
, which updates the buffer name in sane ways when you're visiting multiple files with the same name. –
Finding M-: buffer-file-name RET
–
Bonnes What I do is to create a bind to show the file name in the minibuffer
(global-set-key (kbd "C-c C-f C-n") (lambda () (interactive) (message (buffer-file-name))))
Maybe there is already a feature for that that I don't know
© 2022 - 2024 — McMap. All rights reserved.