如何设置显示当前文件编码

如何设置显示当前文件编码

默认就有,最左下角

U 代表UTF8, 点一下这个就会弹出当前文件的编码详细信息。

最左侧那个横杠的地方应该显示当前编码,但是不知道为啥横杠。 我用notepad++看,显示的是UTF8

- == utf-8-unix:

Like ‘undecided’ but prefer UTF-8 when appropriate. On decoding, if the source contains 8-bit codes and they all are valid UTF-8 sequences, detect the source as UTF-8 encoding regardless of the coding priority.

On encoding, if the source contains non-ASCII characters, encode them by UTF-8.

Type: undecided (do automatic conversion)

EOL type: LF

U == utf-8:

UTF-8 (no signature (BOM))

Type: utf-8 (UTF-8: Emacs internal multibyte form)

EOL type: Automatic selection from: [utf-8-unix utf-8-dos utf-8-mac]

看着费劲就顺手改了吧:

内容太多的话可以先只(add-to-list 'mode-line-format '(:eval (format " %s" buffer-file-coding-system)))把encoding加到最前面,其他不变

2 个赞

感谢 准备试试