Function: doom-modeline-segment--buffer-default-directory

doom-modeline-segment--buffer-default-directory is a natively compiled function defined in doom-modeline-segments.el.

Signature

(doom-modeline-segment--buffer-default-directory)

Documentation

Displays default-directory with the icon and state.

This is for special buffers like the scratch buffer where knowing the current project directory is important.

Source Code

;; Defined in /nix/store/1lcicrdd2r4b8rkc91nnn74ymk1jl6yd-emacs-packages-deps/share/emacs/site-lisp/elpa/doom-modeline-20260928.1632/doom-modeline-segments.el
(doom-modeline-def-segment buffer-default-directory
  "Displays `default-directory' with the icon and state.

This is for special buffers like the scratch buffer where knowing the current
project directory is important."
  (let ((face (doom-modeline-face
               (if (and buffer-file-name (buffer-modified-p))
                   'doom-modeline-buffer-modified
                 'doom-modeline-buffer-path))))
    (concat
     (doom-modeline-spc)
     (and doom-modeline-major-mode-icon
          (concat
           (doom-modeline-icon
            'octicon "nf-oct-file_directory_fill" "🖿" "" :face face)
           (doom-modeline-vspc)))
     (doom-modeline--buffer-state-icon)
     (propertize (abbreviate-file-name default-directory) 'face face))))