Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #235321 > unrolled thread

vim not seeing many Unicode chars

Started byTom Browder <tom.browder@gmail.com>
First post2021-05-18 16:30 +0200
Last post2021-05-18 18:10 +0200
Articles 7 — 4 participants

Back to article view | Back to linux.debian.user


Contents

  vim not seeing many Unicode chars Tom Browder <tom.browder@gmail.com> - 2021-05-18 16:30 +0200
    Re: vim not seeing many Unicode chars IL Ka <kazakevichilya@gmail.com> - 2021-05-18 16:40 +0200
      Re: vim not seeing many Unicode chars Greg Wooledge <greg@wooledge.org> - 2021-05-18 16:40 +0200
    Re: vim not seeing many Unicode chars Greg Wooledge <greg@wooledge.org> - 2021-05-18 16:40 +0200
      Re: vim not seeing many Unicode chars Tom Browder <tom.browder@gmail.com> - 2021-05-20 14:20 +0200
    Re: vim not seeing many Unicode chars Tom Browder <tom.browder@gmail.com> - 2021-05-18 18:00 +0200
    Re: vim not seeing many Unicode chars Steve Dondley <s@dondley.com> - 2021-05-18 18:10 +0200

#235321 — vim not seeing many Unicode chars

FromTom Browder <tom.browder@gmail.com>
Date2021-05-18 16:30 +0200
Subjectvim not seeing many Unicode chars
Message-ID<Cg8To-4wG-5@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

I'm running Debian Buster. Inside a terminal window I can use Emacs and can
see and enter Unicode chars.

But in the same terminal, when I run vim, I have trouble editing or seeing
most Unicode chars above ASCII.

I show the LANG env var set to 'en-US.UTF-8'. When I execute 'locale' I get:

    LANG=en-US.UTF-8
    LANGUAGE=
    LC_CTYPE="C"
    # all intermediate keys: LC_X="C"
    LC_ALL=C

My $HOME/.vimrc file is empty.

Note I am a minimalist vim user and use (and rember) very few vim commands.

I appreciate any help.

Best regards,

-Tom

[toc] | [next] | [standalone]


#235322

FromIL Ka <kazakevichilya@gmail.com>
Date2021-05-18 16:40 +0200
Message-ID<Cg934-4zI-1@gated-at.bofh.it>
In reply to#235321

[Multipart message — attachments visible in raw view] — view raw

>
>     LC_CTYPE="C"
>
> this may be a problem.

Try
$ LC_CTYPE=en_US.UTF-8 vim $YOUR_FILE

make sure fileenconfig is utf-8
in vim:
: set fileencoding=utf-8

 More info about LC_ vars:
https://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html


>

[toc] | [prev] | [next] | [standalone]


#235324

FromGreg Wooledge <greg@wooledge.org>
Date2021-05-18 16:40 +0200
Message-ID<Cg934-4zI-9@gated-at.bofh.it>
In reply to#235322
On Tue, May 18, 2021 at 05:32:26PM +0300, IL Ka wrote:
> >
> >     LC_CTYPE="C"
> >
> > this may be a problem.
> 
> Try
> $ LC_CTYPE=en_US.UTF-8 vim $YOUR_FILE

That may not be enough.  The "C" being in quotes in the output of locale
for this variable means it's implicitly defined from another variable,
either LANG or LC_ALL.  In this case, it's coming from LC_ALL because
we saw LC_ALL=C without quotes.

So, overriding LC_ALL would work, but that's just fighting fire with fire,
which is not a long-term solution.

[toc] | [prev] | [next] | [standalone]


#235323

FromGreg Wooledge <greg@wooledge.org>
Date2021-05-18 16:40 +0200
Message-ID<Cg934-4zI-7@gated-at.bofh.it>
In reply to#235321
On Tue, May 18, 2021 at 09:25:30AM -0500, Tom Browder wrote:
> I show the LANG env var set to 'en-US.UTF-8'. When I execute 'locale' I get:
> 
>     LANG=en-US.UTF-8
>     LANGUAGE=
>     LC_CTYPE="C"
>     # all intermediate keys: LC_X="C"
>     LC_ALL=C

Somewhere, you have placed LC_ALL=C in your environment.  You'll need to
track that down and get rid of it.

Overriding specific variables like LC_TIME or LC_COLLATE is fine, but
you should not be setting LC_ALL on a permanent basis.  It's for short-term
emergency overrides only.

LC_ALL is overriding your LANG variable, giving you the results that you
see, and don't want.  For now, you could unset it, and that would fix the
problem in this one terminal.  But you'll need to figure out where it came
from in order to fix it permanently.

If you use bash as a login shell, one of the ways you can track down where
a variable comes from in your interactive shell is:

PS4='+ $BASH_SOURCE:$FUNCNAME:$LINENO:' bash -ilxc : 2>&1 | grep LC_ALL

This only works if it's coming from a file that's sourced by the shell,
not if it's coming from PAM, or from GNOME, or any other desktop
environment.

(And it assumes your dot file configuration is relatively sane; if for
example you failed to source .bashrc from your .profile or .bash_profile,
then you might need to repeat it with -ixc instead of -ilxc to pick up
the lines from .bashrc as well.  But if you did things correctly, this
shouldn't be needed.)

[toc] | [prev] | [next] | [standalone]


#235429

FromTom Browder <tom.browder@gmail.com>
Date2021-05-20 14:20 +0200
Message-ID<CgPOG-5lW-3@gated-at.bofh.it>
In reply to#235323

[Multipart message — attachments visible in raw view] — view raw

 On Tue, May 18, 2021 at 09:36 Greg Wooledge <greg@wooledge.org> wrote:

> On Tue, May 18, 2021 at 09:25:30AM -0500,

…

Thanks, Greg.

-Tom

[toc] | [prev] | [next] | [standalone]


#235325

FromTom Browder <tom.browder@gmail.com>
Date2021-05-18 18:00 +0200
Message-ID<Cgait-5ei-1@gated-at.bofh.it>
In reply to#235321

[Multipart message — attachments visible in raw view] — view raw

On Tue, May 18, 2021 at 09:25 Tom Browder <tom.browder@gmail.com> wrote:
...

>
I show the LANG env var set to 'en-US.UTF-8'. When I execute 'locale' I get:
>
>     LANG=en-US.UTF-8
>

Sorry, typo, should be: 'en_US.UTF-8' # underscore, not hyphen

-Tom

[toc] | [prev] | [next] | [standalone]


#235326

FromSteve Dondley <s@dondley.com>
Date2021-05-18 18:10 +0200
Message-ID<Cgas9-5x1-1@gated-at.bofh.it>
In reply to#235321

[Multipart message — attachments visible in raw view] — view raw

On 2021-05-18 10:25 AM, Tom Browder wrote:

> I'm running Debian Buster. Inside a terminal window I can use Emacs and can see and enter Unicode chars. 
> 
> But in the same terminal, when I run vim, I have trouble editing or seeing most Unicode chars above ASCII.

Type ":set fileencoding?" from inside vim. 

What do you see?

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web