mirror of
https://github.com/amix/vimrc
synced 2025-07-12 06:05:01 +08:00
updated plugins and added eslint goodies
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! s:check_defined(variable, default)
|
||||
@ -27,6 +27,7 @@ function! airline#init#bootstrap()
|
||||
call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus'])
|
||||
call s:check_defined('g:airline_exclude_filetypes', [])
|
||||
call s:check_defined('g:airline_exclude_preview', 0)
|
||||
call s:check_defined('g:airline_gui_mode', airline#init#gui_mode())
|
||||
|
||||
call s:check_defined('g:airline_mode_map', {})
|
||||
call extend(g:airline_mode_map, {
|
||||
@ -48,6 +49,7 @@ function! airline#init#bootstrap()
|
||||
call extend(g:airline_theme_map, {
|
||||
\ 'Tomorrow.*': 'tomorrow',
|
||||
\ 'base16.*': 'base16',
|
||||
\ 'bubblegum': 'bubblegum',
|
||||
\ 'mo[l|n]okai': 'molokai',
|
||||
\ 'wombat.*': 'wombat',
|
||||
\ '.*zenburn.*': 'zenburn',
|
||||
@ -56,11 +58,12 @@ function! airline#init#bootstrap()
|
||||
|
||||
call s:check_defined('g:airline_symbols', {})
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'paste': get(g:, 'airline_paste_symbol', 'PASTE'),
|
||||
\ 'readonly': get(g:, 'airline_readonly_symbol', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a2" : 'RO'),
|
||||
\ 'paste': 'PASTE',
|
||||
\ 'readonly': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a2" : 'RO',
|
||||
\ 'whitespace': get(g:, 'airline_powerline_fonts', 0) ? "\u2739" : '!',
|
||||
\ 'linenr': get(g:, 'airline_linecolumn_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a1" : ':' ),
|
||||
\ 'branch': get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a0" : ''),
|
||||
\ 'linenr': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a1" : ':',
|
||||
\ 'branch': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a0" : '',
|
||||
\ 'notexists': "\u2204",
|
||||
\ 'modified': '+',
|
||||
\ 'space': ' ',
|
||||
\ 'crypt': get(g:, 'airline_crypt_symbol', nr2char(0x1F512)),
|
||||
@ -79,14 +82,24 @@ function! airline#init#bootstrap()
|
||||
\ 'accent': 'red',
|
||||
\ })
|
||||
call airline#parts#define_raw('file', '%f%m')
|
||||
call airline#parts#define_raw('linenr', '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#')
|
||||
call airline#parts#define_raw('path', '%F%m')
|
||||
call airline#parts#define('linenr', {
|
||||
\ 'raw': '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#',
|
||||
\ 'accent': 'bold'})
|
||||
call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
|
||||
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace','windowswap'])
|
||||
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic',
|
||||
\ 'eclim', 'whitespace','windowswap', 'ycm_error_count', 'ycm_warning_count'])
|
||||
call airline#parts#define_text('capslock', '')
|
||||
|
||||
unlet g:airline#init#bootstrapping
|
||||
endfunction
|
||||
|
||||
function! airline#init#gui_mode()
|
||||
return ((has('nvim') && exists('$NVIM_TUI_ENABLE_TRUE_COLOR'))
|
||||
\ || has('gui_running') || (has("termtruecolor") && &guicolors == 1)) ?
|
||||
\ 'gui' : 'cterm'
|
||||
endfunction
|
||||
|
||||
function! airline#init#sections()
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists('g:airline_section_a')
|
||||
@ -96,7 +109,11 @@ function! airline#init#sections()
|
||||
let g:airline_section_b = airline#section#create(['hunks', 'branch'])
|
||||
endif
|
||||
if !exists('g:airline_section_c')
|
||||
let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly'])
|
||||
if exists("+autochdir") && &autochdir == 1
|
||||
let g:airline_section_c = airline#section#create(['%<', 'path', spc, 'readonly'])
|
||||
else
|
||||
let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly'])
|
||||
endif
|
||||
endif
|
||||
if !exists('g:airline_section_gutter')
|
||||
let g:airline_section_gutter = airline#section#create(['%='])
|
||||
@ -110,8 +127,11 @@ function! airline#init#sections()
|
||||
if !exists('g:airline_section_z')
|
||||
let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', ':%3v '])
|
||||
endif
|
||||
if !exists('g:airline_section_error')
|
||||
let g:airline_section_error = airline#section#create(['ycm_error_count', 'syntastic', 'eclim'])
|
||||
endif
|
||||
if !exists('g:airline_section_warning')
|
||||
let g:airline_section_warning = airline#section#create(['syntastic', 'eclim', 'whitespace'])
|
||||
let g:airline_section_warning = airline#section#create(['ycm_warning_count', 'whitespace'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
Reference in New Issue
Block a user