[ldapvi] Passing encoding to vim

Ulrich Spoerlein uspoerlein at gmail.com
Fri Mar 23 18:24:39 CET 2007


David Lichteblau wrote:
> Quoting Ulrich Spoerlein (uspoerlein at gmail.com):
> > What's happening? I run ldapvi in a plain xterm (latin1 encoding), the
> > file itself is of course utf-8 encoded (fenc=utf-8) but the terminal
> > in vim is set to utf-8 too (enc=utf-8).
> 
> okay, so the modeline ldapvi puts into the files, which sets
> encoding=utf-8, affects not just the file's encoding, but also the
> terminal encoding.
> 
> `encoding' is used because I could not find any other setting that
> works.  `fileencodings', for example, does not seem to have effect in
> the modeline.

Yeah, I remember reading, that vim needs to know/guess the fileencoding
up front. So there is no sense in putting that information in a modeline
in the file itself. It does make sense, when vim _writes_ the file.
Though.

> > What's the correct way, to have ldapvi pass the file-encoding only?
> > The terminal-encoding should be untouched by it, IMHO.
> 
> What fixes the problem for me is to put this line into my .vimrc:
> 
> let &termencoding = &encoding
> 
> VIM will then correctly write the files in UTF-8 for ldapvi, but use
> Latin-1 for the terminal.

Thanks for that hint, I'll try this out next week. Using uxterm is not
so bad a workaround after all :)

Ulrich Spoerlein

PS: I can't stress, how cool ldapvi really is. It makes mass-renaming of
whole database attributes that much easier.

-- 
"The trouble with the dictionary is you have to know how the word is
spelled before you can look it up to see how it is spelled."
-- Will Cuppy



More information about the ldapvi mailing list