mode-line.el 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ; Make erc tracking come after everything else
  2. (setq erc-track-position-in-mode-line 'after-modes)
  3. ; Don't show me the time.
  4. ; ... not sure of a nicer way to do this :)
  5. (call-interactively 'display-time-mode)
  6. ; borrowed heavily from
  7. ; http://emacs-fu.blogspot.com/2011/08/customizing-mode-line.html
  8. (setq-default mode-line-format
  9. (list
  10. "[" ;; insert vs overwrite mode, input-method in a tooltip
  11. '(:eval (propertize (if overwrite-mode "Ovr" "Ins")
  12. 'face 'font-lock-preprocessor-face
  13. 'help-echo (concat "Buffer is in "
  14. (if overwrite-mode "overwrite" "insert") " mode")))
  15. ;; was this buffer modified since the last save?
  16. '(:eval (when (buffer-modified-p)
  17. (concat "," (propertize "Mod"
  18. 'face 'font-lock-warning-face
  19. 'help-echo "Buffer has been modified"))))
  20. ;; is this buffer read-only?
  21. '(:eval (when buffer-read-only
  22. (concat "," (propertize "RO"
  23. 'face 'font-lock-type-face
  24. 'help-echo "Buffer is read-only"))))
  25. "] "
  26. ;; the buffer name; the file name as a tool tip
  27. '(:eval (propertize "%b " 'face 'font-lock-keyword-face
  28. 'help-echo (buffer-file-name)))
  29. ;; line and column
  30. "(" ;; '%02' to set to 2 chars at least; prevents flickering
  31. (propertize "%02l" 'face 'font-lock-type-face) ","
  32. ; warn if we go over 80 characters
  33. '(:eval (propertize "%02c" 'face
  34. (if (>= (current-column) 80)
  35. 'font-lock-warning-face
  36. 'font-lock-type-face)))
  37. ") "
  38. ;; the current major mode for the buffer.
  39. "["
  40. '(:eval (propertize "%m" 'face 'font-lock-string-face
  41. 'help-echo buffer-file-coding-system))
  42. "]"
  43. '(vc-mode vc-mode)
  44. " "
  45. '(global-mode-string global-mode-string)
  46. " "
  47. ;; '(:eval (when nyan-mode (list (nyan-create) " ")))
  48. ;; '(:eval (when (and erc-track-mode cwebber/show-erc-in-mode-line)
  49. ;; (list erc-modified-channels-object)))
  50. ;; i don't want to see minor-modes; but if you want, uncomment this:
  51. ;; minor-mode-alist ;; list of minor modes
  52. "%-" ;; fill with '-'
  53. ))