I have a problem editing a html file on a server via vim
. The file is utf-8
encoded.
While editing with vim
(v7.3, no plugins active) I can see umlauts and editing and saving a line before the umlaut is ok. But if I edit after the umlaut it seems that the umlaut consumes two chars while only one char is visible and all edits are shifted. I can see this only after saving and reopening the file. And I can insert an umlaut but for removing I have to press x twice (the char changes meanwhile).
I have no idea where to search for the issue vim
, terminal
or ssh connection
?
remote:
> file index.html
index.html: HTML document, UTF-8 Unicode text
> echo $TERM
xterm-256color
> locale charmap
ANSI_X3.4-1968
> grep CHARMAP /etc/default/console-setup
CHARMAP="UTF-8"
local:
> locale charmap
UTF-8
vim
has various encoding settings; what do:set encoding
and:set fileencoding
say when the file is loaded? Read the vim help for details. – Murphy Apr 11 '16 at 11:24locale charmap
(both local and at the remote end) say? What OS are you using? – Radovan Garabík Apr 11 '16 at 12:10encoding
andfileencoding
in vim is bothutf-8
. Somehow vim on remote does not recognize the encoding... – Knut Apr 11 '16 at 12:28~/.vimrc
or/etc/vim/vimrc
. What dolocal
andecho $LANG
display on the remote host? – Murphy Apr 11 '16 at 12:44