Skip to content
Christian Brabandt edited this page May 16, 2024 · 53 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. When this variable is defined, only the extensions listed will be loaded; an empty array would effectively disable all extensions (e.g. :let g:airline_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 hundred 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.

Starting with revision 725e881a parts of vim-airline have been re-written in Vim9 Script (this is an ongoing effort and further parts will be re-written, if Vim9 Script can offer a benefit). Vim9 Script is a much more strict and compiled scripting language for Vim9 (once it is released) and brings many performance improvements, but currently (as of May 2021) is still considered highly experimental. This removes many of the known performance bottlenecks (especially in the highlighter module). You can try the improvements it brings by setting :let g:airline_experimental=1. Note you need a Vim (not Neovim!) with Version 8.2.2840 or higher.

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

A symbol in the statusline looks is overdrawn

This is typically an issue with your terminal which does not correctly draw the symbol. You can configure other symbols, please check the Documentation. You can check how it looks like in your terminal using the following command:

    for i in items(g:airline_symbols)|echo i[0] .. ':-'.. i[1] .. '-'|endfor

If any of the symbols does not look right, you can configure it in your .vimrc like this, in this case changing the colnr indicator:

  if !exists('g:airline_symbols')
    let g:airline_symbols = {}
  endif

  let g:airline_symbols.colnr = ' ℅:'

Another cause can be 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 = {}
endif
let g:airline_symbols.space = "\ua0"

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 https://github.com/vim-airline/vim-airline-themes for more.

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 one of two things is happening:

  1. You have too old of a version of vim-fugitive. vim-airline relies on a fugitive#head() function, so you should download a new version from fugitive's project page. If you are running release 0.9.0 of vim-airline, rather than a recent git commit, you shouldn't upgrade vim-fugitive past v2.3, or you'll run into the next potential problem.

  2. You have too new of a version of vim-fugitive, and are running the latest release of vim-airline rather than a git version. tpope/vim-fugitive@5d11ff7 made fugitive#head() autoloadable, which broke the latest 0.9.0 release of vim-airline. The next release of vim-airline is expected in December (see #1820), and the fix will not be backported (see #1815). Until then, you either need to downgrade vim-fugitive to v2.3, or run a recent git commit version of vim-airline.

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.

This issue has been fixed in Vim with patch v9.0.2095.

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 (Fixed since Vim 8.1.1009)

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.

How can I disable certain autocommands?

You can simply set the &eventignore option to the events that you'd like to ignore. For example to disable the FocusGained and FocusLost events (which some terminals may not be able to handle correctly) you would set in your .vimrc:

set eventignore+=FocusGained,FocusLost