Christian Brabandt edited this page Sep 1, 2017 · 39 revisions

I have a performance problem....

Whoa! Everything got slow all of a sudden...

vim-airline strives to make it easy to use out of the box, which means that by default it will look for all compatible plugins that you have installed and enable the relevant extension.

Many optimizations have been made such that the majority of users will not see any performance degradation, but it can still happen. For example, users who routinely open very large files may want to disable the tagbar extension, as it can be very expensive to scan for the name of the current function.

The minivimrc project has some helper mappings to troubleshoot performance related issues.

If you don't want all the bells and whistles enabled by default, you can define a value for g:airline_extensions (e.g. :let g:airline_extensions = []). When this variable is defined, only the extensions listed will be loaded; an empty array will disable all extensions.

Also, you can enable caching of the various syntax highlighting groups. This will try to prevent some of the more expensive :hi calls in Vim, which seem to be expensive in the Vim core at the expense of possibly not being hunderet percent correct all the times (especially if you often change highlighting groups yourself using :hi commands). To set this up do :let g:airline_highlighting_cache = 1. A :AirlineRefresh will however clear the cache.

In addition you might want to check out the dark_minimal theme, which does not change highlighting groups once they are defined.

If you still encounter performance issues, provide some profiling information, see issue 1026

The powerline font symbols are not showing up

Adding let g:airline_powerline_fonts = 1 to your vimrc will automatically populate the g:airline_symbols dictionary with the proper font glyphs for various symbols.

Also, the older deprecated vim-powerline uses different font codes compared to the current powerline, and the switch above will automatically select codes from the new version. If you want to use the old font codes, you can :h airline and copy/paste the configuration variables in the customization section.

If you are using rxvt-unicode, try using an odd font size, 11, 13, 15 etc. in your .Xdefaults

If you are using vim in the Terminal on OSX, check that the environment variables LC_ALL and LANG are set to a sensible value (such as en_US.UTF8). If :echo &encoding does not show utf8 there is a very good chance that these settings are not correct.

If you are using vim in iTerm, you may also have to turn transparency off in the iTerm preferences, and move the contrast slider to the lowest position. In iTerm2, also make sure that you set both the regular font and the non-ASCII font to a patched powerline font.

If you are using fontconfig, make sure bitmap fonts are not disabled. That rule, if exists, is usually under /etc/fonts/conf.d/70-no-bitmaps.conf for linux users, which might be a symbolic link. If that's the case, remove that link so that bitmap fonts are available system-wide.

Also make sure Terminal uses the same font style (e.g. Meslo) as specified in your vimrc.

The Themes are missing.

Themes have moved to another repository as of this commit.

Install the themes as you would this plugin (Vundle example):

Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'

See for more.

The powerline font symbols are partially messed up

You are likely using the fontconfig method. If that is the case, you need to override the space character like so:

if !exists('g:airline_symbols')
  let g:airline_symbols = {}
let = "\ua0"

The powerline font is not perfectly lined up, or there a bit of whitespace in between symbols, or they are cut off

This is a complicated issue with no easy solution. Depending on the operating system, the font you have installed, the font you have patched, how the font was patched, terminal vs GUI, which terminal emulator itself (and how the emulator is configured), what font size, all have an effect on how the font turns on.

Try various combinations of the above and you'll eventually find something that works.

There is a pause when leaving insert mode

You need to set ttimeoutlen; 10 is a good number to start with. Many places say to edit timeoutlen, but that could conflict with other plugins.

There is a pause when entering insert mode

You are running an older version of Vim 7.3, try updating to a newer version.

You don't see any colors

All of the themes use a 256 terminal color palette. It's likely that the value of t_Co is misconfigured. please see this article on how to configure your terminal. Pull requests for 8 and 16 color terminals are welcome.

If you are using tmux, start it with the -2 option. This lets it know that the terminal supports 256 colors.

The colors look a little off for some themes.

Certain themes are derived from the active colorscheme by extracting colors from predefined highlight groups. These airline themes will look good for their intended matching colorschemes, but will be hit or miss when loaded with other colorschemes.

You do not see the current Git branch

You need fugitive to see the current git branch. If you have it and still don't see it then you are probably using version 1.2, which is very old. vim-airline relies on a fugitive#head() function. Download v2 from the project page.

vim-bufferline is printing to the statusline as well as the command bar

You can disable automatic echoing by adding let g:bufferline_echo = 0 to your vimrc.

The statusline wraps

You are probably using iTerm with double-width characters enabled. Either disable this, or set ambiwidth=double in your vimrc.

How do i get rid of the default mode indicator?

Add set noshowmode to your vimrc.

The completion popup is broken/blank when preview is enabled with vim-airline

For more details see this issue. This appears to depend on the version of Vim installed. Upgrade to the newest version available.

You see things like ^^^^^ in the statusline.

Try adding set fillchars+=stl:\ ,stlnc:\ to your vimrc. Also, make sure you're using a colorscheme that has different StatusLine and StatusLineNC highlight groups.

Colors go out of sync when I source my vimrc

vim-airline internally uses autocmds to change colors, and the order of autocmds may change from one configuration to the next. Sometimes this means that if you use things like BufEnter you may find that the colors go out of sync. vim-airline exposes a command AirlineRefresh which you can use to reload all the colors manually.

Where should I store my own custom theme?

You could simply edit dark.vim in place, since this is the default theme.

But (especially if you are using a bundler to install airline), you may prefer to keep your theme separate:

  1. Copy dark.vim into ~/.vim/autoload/airline/themes/your_theme_name.vim
  2. Open that file and search-replace: :%s/#dark#/#your_theme_name#/g
  3. (Optionally) test it with: :AirlineTheme your_theme_name
  4. To make it load on startup, add to your .vimrc:
    :let g:airline_theme='your_theme_name'

Can I get better font rendering in Windows gvim?

If you are using a gVim with the +directx interface enabled at compile time, you can use DirectX rendering. This will provide better font rendering for the powerline glyphs. You can enable this using:

set encoding=utf-8   
set rop=type:directx,gamma:1.0,contrast:0.5,level:1,geom:1,renmode:4,taamode:1

For screenshots see ticket 1031 Note: There exists a severe Rendering Bug with Windows Gvim and the Directx Renderer

How can I make Airline look like powerline?

If you want your airline looks like a new powerline install (i.e all options by default), you only have to add this option to your .vimrc

let g:airline_section_z = airline#section#create(['windowswap', '%3p%% ', 'linenr', ':%3v'])

How can I remove those angle at the end?

This happens, because the warning and error sections are empty. However, because of the way the airline sections are evaluated, those separators will always be shown. You can disable them, if you put this option into your .vimrc

let g:airline_skip_empty_sections = 1

This poses a small performance penalty, however.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.