Sunday, November 02, 2014

Some settings to enable the vim-airline

I've tried to add some plugins to make Vim a better IDE. The article has helped me alot: vim + packet manager = Vundle

Just several minutes ago, I added the vim-airline and did something to make it work in my vim (not gvim).

After some tests, the only thing I have to do was to add the following line in my .vimrc to enable 256 colors in vim:
set t_Co=256
Another useful setting was
set laststatus=2
which lets the vim-airline show the status bar even there's only one file opened.

If you want to replace the symbols with some Unicode ones, then the so-called patch fonts are needed. They can be found in https://github.com/Lokaltog/powerline-fonts.

After installing the patched fonts, you can add the following settings in the .vimrc to enable the symbols:

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

" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'

set guifont=DejaVu\ Sans\ Mono\ 10
let g:airline_powerline_fonts = 1

Here's my vim with the vim-airline:




No comments:

Post a Comment