Displaying the ► symbol in the status bar of the lightbar of a Vim terminal

I am working on SUSE Linux Enterprise Desktop 11 (x86_64) and I am using Vim as my editor. I recently installed a plugin called lightline from https://github.com/itchyny/lightline.vim . The plugin uses special characters to make the status bar look like this:

enter image description here

> The bar part is actually a symbol colored as a square next to it. The problem is that the panel in my case looks like this:

enter image description here

The ► symbol is not displayed correctly even though the encoding is set to UTF-8 and all required fonts are installed on the system (power line fonts). In this case, the font installed on the terminal is Liberation Mono for Powerline.

Lightline settings in my vimrc:

set encoding=utf-8
scriptencoding utf-8

let g:lightline = {
   \ 'colorscheme': 'wombat',
   \ 'separator': {'left': "\u25B6", 'right': ''},
   \ 'subseparator': { 'left': '', 'right': ''}
   \ }

      

I also tried to copy the ► character like this

let g:lightline = {
       \ 'colorscheme': 'wombat',
       \ 'separator': {'left': "►", 'right': ''},
       \ 'subseparator': { 'left': '', 'right': ''}
       \ }

      

But it manifests itself in the same way.

Also, there is a problem with ^ characters wherever it is assumed to be a space.

Is there any solution for this?

+3


source to share


2 answers


The problem has been explained on this stackoverflow.com/questions/7223309/ thread. It says that if stl and stlnc have the same value, they will be replaced with ^^^. It works when you put * for stlnc and whitespace for stl.



0


source


Below is my my_configs.vim for lightline, it works fine on my Fedora 26 system.

let g:lightline = { 
       \ 'colorscheme': 'wombat',
       \ }

let g:lightline = { 
       \ 'colorscheme': 'wombat',
       \ 'active': {
       \   'left': [ ['mode', 'paste'],
       \             ['fugitive', 'readonly', 'filename', 'modified'] ],
       \   'right': [ [ 'lineinfo' ], ['percent'] ]
       \ },
       \ 'component': {
       \   'readonly': '%{&filetype=="help"?"":&readonly?"\ue0a2":""}',
       \   'modified': '%{&filetype=="help"?"":&modified?"\ue0a0":&modifiable?"":"-"}',
       \   'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
       \ },
       \ 'component_visible_condition': {
       \   'readonly': '(&filetype!="help"&& &readonly)',
       \   'modified': '(&filetype!="help"&&(&modified||!&modifiable))',
       \   'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
       \ },
       \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
       \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
       \ }   "" This is comment: I fotgot this line in my last post, just added

      



Sorry for my mistake, I just installed this config. If you installed the hack font from https://github.com/chrissimpkins/Hack/releases and install the powerline fonts with "sudo dnf install powerline-fonts" on Fedora 26, you probably want to add the following configurations to your / etc /fonts/local.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>Hack</family>
    <prefer>
      <family>PowerlineSymbols</family>
    </prefer>
  </alias>
</fontconfig>

      

-1


source







All Articles