The which-function
minor mode by default shows part of the org outline path in the mode line; you can turn it on using M-x which-function-mode
. In general, which-function
tries to show the current function in the mode line. It works in most languages.
If you want to see the entire path, you just have to add a new function to the variable which-func-functions
. The first function in this list that returns non-nil is what which-function
uses. Here is a function that uses org-get-outline-path
to get the full path, if the current major mode is org-mode
(defun org-which-function ()
(interactive)
(when (eq major-mode 'org-mode)
(mapconcat 'identity (org-get-outline-path t)
" > ")
))
(add-to-list 'which-func-functions #'org-which-function)
You will quickly run out of room in your mode line, so try putting it in the header line instead. For example, this snippet will put the current buffer name and the outline path in the header:
(setq header-line-format
'(:eval
(list
(header-buffer-name)
" "
(header-function-name))))
[EDIT] Here, the fuctions header-buffer-name
and header-function-name
are the author's private functions, and defined in this answer.
org-eldoc
found in org-contrib. Or you can usebreadcrumb-mode
, a live fork by 'joaotavora'. I learned this from this kind reply