(A simple alias to display what ''vim'' thinks a file's encoding is) |
(Adding categories) |
||
Line 12: | Line 12: | ||
</pre> |
</pre> |
||
+ | [[Category:file encoding]] |
||
+ | [[Category:commandline]] |
Revision as of 06:37, 16 December 2009
Here's a simple alias to display what vim thinks a file's encoding is:
alias vimenc='vim -c '\''let $enc = &fileencoding | execute "!echo Encoding: $enc" | q'\'''
This saves having to open vim, combining opening the file, checking the file encoding, and exiting. The alias requires a file as a parameter.
E.g.
$ vimenc ISO-8859-1.xml Encoding: latin1 Press ENTER or type command to continue