Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# See: https://github.com/textlint/textlint/issues/852
import json
import subprocess
import sys
from functools import cache
from os import getenv
from unicodedata import east_asian_width
r"""
set fileencodings=ucs-bom,utf-8,cp51932,euc-jp-ms,cp932,gb18030
autocmd BufReadPost * if search('\%x1b\(\$[B@]\|([BJI]\)', 'w') > 0 |
\ e ++enc=cp50221 | endif
autocmd BufReadPost * if &fileencoding ==# 'cp50221' |
\ setlocal fileencoding=iso-2022-jp | endif
autocmd BufReadPost * if &fileencoding ==# 'cp51932' |
\ setlocal fileencoding=euc-jp | endif
autocmd BufReadPost * if &fileencoding ==# 'euc-jp-ms' |
\ setlocal fileencoding=euc-jp | endif