I wanna add some hooks to web-mode and
js2-mode, but it doesn't go well.
Here is what I am doing. I wanna to add header line for
js2-mode cuz they are derived from
fundamental-mode. And I have to manually add these modes.
(which-function-mode) ;; when editing js file, this feature is very useful ;; (setq-default header-line-format ;; '((which-func-mode ("" which-func-format " ")))) (defun set-header-line () (setq header-line-format '((which-func-mode ("" which-func-format " "))))) (add-hook 'prog-mode-hook 'set-header-line) (add-hook 'text-mode-hook 'set-header-line) (add-hook 'js2-mode-hook 'set-header-line) (add-hook 'web-mode-hook 'set-header-line)
The reason why the header-line disappear is due to the ranger. It shows up when I open the file with dired or treemacs, but not for ranger.
Here is the
header-line-format value opened with dired and ranger.
I tried adding hooks to
ranger-mode-load-hook and set
ranger-modify-header to nil. Not working.
Does anyone have some ideas what's going on here?