Skip to content

Instantly share code, notes, and snippets.

@tek-nishi
Last active March 16, 2018 05:41
Show Gist options
  • Save tek-nishi/93bfa4614f1254b0c2255bc122d0d1c0 to your computer and use it in GitHub Desktop.
Save tek-nishi/93bfa4614f1254b0c2255bc122d0d1c0 to your computer and use it in GitHub Desktop.
spacemacs buffer-encoding-abbrev with signature(BOM)
(spaceline-define-segment buffer-encoding-abbrev
"The line ending convention used in the buffer."
(let ((buf-coding (format "%s" buffer-file-coding-system)))
(list (replace-regexp-in-string "-with-signature\\|-unix\\|-dos\\|-mac" "" buf-coding)
(concat (and (string-match "with-signature" buf-coding) "ⓑ")
(and (string-match "unix" buf-coding) "ⓤ")
(and (string-match "dos" buf-coding) "ⓓ")
(and (string-match "mac" buf-coding) "ⓜ")
)))
:separator " ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment