Update packages
This commit is contained in:
parent
a0d57ea14e
commit
6ac337eccd
|
@ -129,15 +129,6 @@ optional background search execution with [vim-dispatch], and auto-previewing.
|
|||
|
||||
Please see [the Github releases page][releases].
|
||||
|
||||
### 1.0.9 (unreleased)
|
||||
|
||||
* Fix location list and layout of quickfix when using Dispatch (#154)
|
||||
* Fix the quick help overlay clobbering the list mappings
|
||||
* Fix `:AckFile` when using Dispatch
|
||||
* Restore original `'makeprg'` and `'errorformat'` when using Dispatch
|
||||
* Arrow keys also work for auto-preview (#158)
|
||||
* Internal refactoring and clean-up
|
||||
|
||||
## Credits
|
||||
|
||||
This plugin is derived from Antoine Imbert's blog post [Ack and Vim
|
||||
|
|
|
@ -67,6 +67,9 @@ In the quickfix window, you can use:
|
|||
gv to open in vertical split silently
|
||||
q to close the quickfix window
|
||||
|
||||
### Related Plugin ###
|
||||
[vim-ag-anything](https://github.com/Chun-Yang/vim-ag-anything) adds an 'ga' action to search any text object.
|
||||
|
||||
### Acknowledgements ###
|
||||
|
||||
This Vim plugin is derived (and by derived, I mean copied, almost entirely)
|
||||
|
|
|
@ -33,7 +33,7 @@ function! s:get_color(group, attr)
|
|||
endfunction
|
||||
|
||||
function! s:set_color(group, attr, color)
|
||||
let gui = has('gui_running')
|
||||
let gui = a:color =~ '^#'
|
||||
execute printf("hi %s %s%s=%s", a:group, gui ? 'gui' : 'cterm', a:attr, a:color)
|
||||
endfunction
|
||||
|
||||
|
@ -106,7 +106,7 @@ function! s:resize_pads()
|
|||
endfunction
|
||||
|
||||
function! s:tranquilize()
|
||||
let bg = s:get_color('Normal', 'bg')
|
||||
let bg = s:get_color('Normal', 'bg#')
|
||||
for grp in ['NonText', 'FoldColumn', 'ColorColumn', 'VertSplit',
|
||||
\ 'StatusLine', 'StatusLineNC', 'SignColumn']
|
||||
" -1 on Vim / '' on GVim
|
||||
|
|
|
@ -173,10 +173,17 @@ endfunction " }}}2
|
|||
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:_log_timestamp() abort " {{{2
|
||||
function! s:_log_timestamp_smart() abort " {{{2
|
||||
return printf('syntastic: %f: ', reltimefloat(reltime(g:_SYNTASTIC_START)))
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:_log_timestamp_dumb() abort " {{{2
|
||||
return 'syntastic: ' . split(reltimestr(reltime(g:_SYNTASTIC_START)))[0] . ': '
|
||||
endfunction " }}}2
|
||||
|
||||
let s:_log_timestamp = function(has('float') && exists('*reltimefloat') ? 's:_log_timestamp_smart' : 's:_log_timestamp_dumb')
|
||||
lockvar s:_log_timestamp
|
||||
|
||||
function! s:_format_variable(name) abort " {{{2
|
||||
let vals = []
|
||||
if exists('g:syntastic_' . a:name)
|
||||
|
|
|
@ -284,6 +284,42 @@ function! syntastic#preprocess#rparse(errors) abort " {{{2
|
|||
return out
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#preprocess#scss_lint(errors) abort " {{{2
|
||||
let errs = join(a:errors, '')
|
||||
if errs ==# ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let json = s:_decode_JSON(errs)
|
||||
|
||||
let out = []
|
||||
if type(json) == type({})
|
||||
for fname in keys(json)
|
||||
if type(json[fname]) == type([])
|
||||
for e in json[fname]
|
||||
try
|
||||
cal add(out, fname . ':' .
|
||||
\ e['severity'][0] . ':' .
|
||||
\ e['line'] . ':' .
|
||||
\ e['column'] . ':' .
|
||||
\ e['length'] . ':' .
|
||||
\ ( has_key(e, 'linter') ? e['linter'] . ': ' : '' ) .
|
||||
\ e['reason'])
|
||||
catch /\m^Vim\%((\a\+)\)\=:E716/
|
||||
call syntastic#log#warn('checker scss/scss_lint: unrecognized error item ' . string(e))
|
||||
let out = []
|
||||
endtry
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker scss/scss_lint: unrecognized error format')
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker scss/scss_lint: unrecognized error format')
|
||||
endif
|
||||
return out
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#preprocess#stylelint(errors) abort " {{{2
|
||||
let out = []
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ endfunction " }}}2
|
|||
function! syntastic#util#tmpdir() abort " {{{2
|
||||
let tempdir = ''
|
||||
|
||||
if (has('unix') || has('mac')) && executable('mktemp')
|
||||
if (has('unix') || has('mac')) && executable('mktemp') && !has('win32unix')
|
||||
" TODO: option "-t" to mktemp(1) is not portable
|
||||
let tmp = $TMPDIR !=# '' ? $TMPDIR : $TMP !=# '' ? $TMP : '/tmp'
|
||||
let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . getpid() . '-XXXXXXXX'), "\n")
|
||||
|
@ -90,18 +90,7 @@ function! syntastic#util#rmrf(what) abort " {{{2
|
|||
endif
|
||||
|
||||
if getftype(a:what) ==# 'dir'
|
||||
if !exists('s:rmrf')
|
||||
let s:rmrf =
|
||||
\ has('unix') || has('mac') ? 'rm -rf' :
|
||||
\ has('win32') || has('win64') ? 'rmdir /S /Q' :
|
||||
\ has('win16') || has('win95') || has('dos16') || has('dos32') ? 'deltree /Y' : ''
|
||||
endif
|
||||
|
||||
if s:rmrf !=# ''
|
||||
silent! call syntastic#util#system(s:rmrf . ' ' . syntastic#util#shescape(a:what))
|
||||
else
|
||||
call s:_rmrf(a:what)
|
||||
endif
|
||||
call s:_delete(a:what, 'rf')
|
||||
else
|
||||
silent! call delete(a:what)
|
||||
endif
|
||||
|
@ -274,8 +263,9 @@ function! syntastic#util#unique(list) abort " {{{2
|
|||
let seen = {}
|
||||
let uniques = []
|
||||
for e in a:list
|
||||
if !has_key(seen, e)
|
||||
let seen[e] = 1
|
||||
let k = string(e)
|
||||
if !has_key(seen, k)
|
||||
let seen[k] = 1
|
||||
call add(uniques, e)
|
||||
endif
|
||||
endfor
|
||||
|
@ -478,6 +468,27 @@ function! s:_translateElement(key, term) abort " {{{2
|
|||
return ret
|
||||
endfunction " }}}2
|
||||
|
||||
" @vimlint(EVL103, 1, a:flags)
|
||||
function! s:_delete_dumb(what, flags) abort " {{{2
|
||||
if !exists('s:rmrf')
|
||||
let s:rmrf =
|
||||
\ has('unix') || has('mac') ? 'rm -rf' :
|
||||
\ has('win32') || has('win64') ? 'rmdir /S /Q' :
|
||||
\ has('win16') || has('win95') || has('dos16') || has('dos32') ? 'deltree /Y' : ''
|
||||
endif
|
||||
|
||||
if s:rmrf !=# ''
|
||||
silent! call syntastic#util#system(s:rmrf . ' ' . syntastic#util#shescape(a:what))
|
||||
else
|
||||
call s:_rmrf(a:what)
|
||||
endif
|
||||
endfunction " }}}2
|
||||
" @vimlint(EVL103, 0, a:flags)
|
||||
|
||||
" delete(dir, 'rf') was added in Vim 7.4.1107, but it didn't become usable until 7.4.1128
|
||||
let s:_delete = function(v:version > 704 || (v:version == 704 && has('patch1128')) ? 'delete' : 's:_delete_dumb')
|
||||
lockvar s:_delete
|
||||
|
||||
function! s:_rmrf(what) abort " {{{2
|
||||
if !exists('s:rmdir')
|
||||
let s:rmdir = syntastic#util#shescape(get(g:, 'netrw_localrmdir', 'rmdir'))
|
||||
|
|
|
@ -36,6 +36,7 @@ CONTENTS *syntastic-contents*
|
|||
5.2.Choosing the executable................|syntastic-config-exec|
|
||||
5.3.Configuring specific checkers..........|syntastic-config-makeprg|
|
||||
5.4.Sorting errors.........................|syntastic-config-sort|
|
||||
5.5.Debugging..............................|syntastic-config-debug|
|
||||
6.Notes........................................|syntastic-notes|
|
||||
6.1.Handling of composite filetypes........|syntastic-composite|
|
||||
6.2.Editing files over network.............|syntastic-netrw|
|
||||
|
@ -158,6 +159,11 @@ Something like this could be more useful: >
|
|||
When syntax errors are detected a flag will be shown. The content of the flag
|
||||
is derived from the |syntastic_stl_format| option.
|
||||
|
||||
Please note that these settings might conflict with other Vim plugins that
|
||||
change the way statusline works. Refer to these plugins' documentation for
|
||||
possible solutions. See also |syntastic-powerline| below if you're using the
|
||||
"powerline" Vim plugin (https://github.com/powerline/powerline).
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2.2. Error signs *syntastic-error-signs*
|
||||
|
||||
|
@ -541,10 +547,10 @@ overriding filters, cf. |filter-overrides|).
|
|||
|
||||
"level" - takes one of two values, "warnings" or "errors"
|
||||
"type" - can be either "syntax" or "style"
|
||||
"regex" - is matched against the messages' text as a case-insensitive
|
||||
|regular-expression|
|
||||
"file" - is matched against the filenames the messages refer to, as a
|
||||
case-sensitive |regular-expression|.
|
||||
"regex" - each item in list is matched against the messages' text as a
|
||||
case-insensitive |regular-expression|
|
||||
"file" - each item in list is matched against the filenames the messages
|
||||
refer to, as a case-sensitive |regular-expression|.
|
||||
|
||||
If a key is prefixed by an exclamation mark "!", the corresponding filter is
|
||||
negated (i.e. the above example silences all messages that are NOT errors).
|
||||
|
@ -814,6 +820,25 @@ defined.
|
|||
For aggregated lists (see |syntastic-aggregating-errors|) these variables are
|
||||
ignored if |'syntastic_sort_aggregated_errors'| is set (which is the default).
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.5 Debugging *syntastic-config-debug*
|
||||
|
||||
Syntastic can log a trace of its working to Vim's |message-history|. To verify
|
||||
the command line constructed by syntastic to run a checker, set the variable
|
||||
|'syntastic_debug'| to a non-zero value, run the checker, then run |:mes| to
|
||||
display the messages, and look for "makeprg" in the output.
|
||||
|
||||
From a user's perspective, the useful values for |'syntastic_debug'| are 1, 3,
|
||||
and 33:
|
||||
|
||||
1 - logs syntastic's workflow
|
||||
3 - logs workflow, checker's output, and |location-list| manipulations
|
||||
33 - logs workflow and checker-specific details (such as version checks).
|
||||
|
||||
Debug logs can be saved to a file; see |'syntastic_debug_file'| for details.
|
||||
|
||||
Setting |'syntastic_debug'| to 0 turns off logging.
|
||||
|
||||
==============================================================================
|
||||
6. Notes *syntastic-notes*
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ if has('reltime')
|
|||
lockvar! g:_SYNTASTIC_START
|
||||
endif
|
||||
|
||||
let g:_SYNTASTIC_VERSION = '3.7.0-69'
|
||||
let g:_SYNTASTIC_VERSION = '3.7.0-86'
|
||||
lockvar g:_SYNTASTIC_VERSION
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
|
|
@ -40,7 +40,7 @@ let s:_DEFAULT_CHECKERS = {
|
|||
\ 'go': ['go'],
|
||||
\ 'haml': ['haml'],
|
||||
\ 'handlebars': ['handlebars'],
|
||||
\ 'haskell': ['ghc_mod', 'hdevtools', 'hlint'],
|
||||
\ 'haskell': ['hdevtools', 'hlint'],
|
||||
\ 'haxe': ['haxe'],
|
||||
\ 'hss': ['hss'],
|
||||
\ 'html': ['tidy'],
|
||||
|
|
|
@ -22,14 +22,14 @@ function! SyntaxCheckers_asciidoc_asciidoc_GetLocList() dict
|
|||
let makeprg = self.makeprgBuild({ 'args_after': syntastic#c#NullOutput() })
|
||||
|
||||
let errorformat =
|
||||
\ '%Easciidoc: %tRROR: %f: line %l: %m,' .
|
||||
\ '%Easciidoc: %tRROR: %f: %m,' .
|
||||
\ '%Easciidoc: FAILED: %f: line %l: %m,' .
|
||||
\ '%Easciidoc: FAILED: %f: %m,' .
|
||||
\ '%Wasciidoc: %tARNING: %f: line %l: %m,' .
|
||||
\ '%Wasciidoc: %tARNING: %f: %m,' .
|
||||
\ '%Wasciidoc: DEPRECATED: %f: line %l: %m,' .
|
||||
\ '%Wasciidoc: DEPRECATED: %f: %m'
|
||||
\ '%E%\w%\+: %tRROR: %f: line %l: %m,' .
|
||||
\ '%E%\w%\+: %tRROR: %f: %m,' .
|
||||
\ '%E%\w%\+: FAILED: %f: line %l: %m,' .
|
||||
\ '%E%\w%\+: FAILED: %f: %m,' .
|
||||
\ '%W%\w%\+: %tARNING: %f: line %l: %m,' .
|
||||
\ '%W%\w%\+: %tARNING: %f: %m,' .
|
||||
\ '%W%\w%\+: DEPRECATED: %f: line %l: %m,' .
|
||||
\ '%W%\w%\+: DEPRECATED: %f: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
|
|
|
@ -19,8 +19,12 @@ let g:loaded_syntastic_css_stylelint_checker = 1
|
|||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:args_after = {
|
||||
\ 'css': '-f json',
|
||||
\ 'scss': '-f json -s scss' }
|
||||
|
||||
function! SyntaxCheckers_css_stylelint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '-f json' })
|
||||
let makeprg = self.makeprgBuild({ 'args_after': get(s:args_after, self.getFiletype(), '') })
|
||||
|
||||
let errorformat = '%t:%f:%l:%c:%m'
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ function! SyntaxCheckers_javascript_flow_GetLocList() dict
|
|||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': self.getExecEscaped() . ' status',
|
||||
\ 'exe': self.getExecEscaped() . ' check',
|
||||
\ 'args_after': '--show-all-errors --json' })
|
||||
|
||||
let errorformat =
|
||||
|
|
|
@ -29,7 +29,8 @@ function! SyntaxCheckers_javascript_jscs_IsAvailable() dict
|
|||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jscs_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '--no-colors --reporter json' })
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '--no-colors --max-errors -1 --reporter json' })
|
||||
|
||||
let errorformat = '%f:%l:%c:%m'
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ function! SyntaxCheckers_markdown_mdl_GetLocList() dict
|
|||
let makeprg = self.makeprgBuild({ 'args': '--warnings' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l: %m,'.
|
||||
\ '%E%f:%\s%\=%l: %m,'.
|
||||
\ '%W%f: Kramdown Warning: %m found on line %l'
|
||||
|
||||
return SyntasticMake({
|
||||
|
|
|
@ -29,10 +29,8 @@ function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList() dict
|
|||
\ 'tail': syntastic#util#DevNull() })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l: (%tNFO/1) %m,'.
|
||||
\ '%f:%l: (%tARNING/2) %m,'.
|
||||
\ '%f:%l: (%tRROR/3) %m,'.
|
||||
\ '%f:%l: (%tEVERE/4) %m,'.
|
||||
\ '%f:%l: (%t%\w%\+/%\d%\+) %m,'.
|
||||
\ '%f:: (%t%\w%\+/%\d%\+) %m,'.
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
|
@ -40,11 +38,11 @@ function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList() dict
|
|||
\ 'errorformat': errorformat })
|
||||
|
||||
for e in loclist
|
||||
if e['type'] ==? 'S'
|
||||
let e['type'] = 'E'
|
||||
elseif e['type'] ==? 'I'
|
||||
if e['type'] ==? 'I'
|
||||
let e['type'] = 'W'
|
||||
let e['subtype'] = 'Style'
|
||||
else
|
||||
let e['type'] = 'E'
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
|
|
@ -21,21 +21,28 @@ function! SyntaxCheckers_scss_scss_lint_IsAvailable() dict
|
|||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 12])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 29])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_scss_scss_lint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '-f JSON' })
|
||||
|
||||
let errorformat = '%f:%l [%t] %m'
|
||||
let errorformat = '%f:%t:%l:%c:%n:%m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'scss_lint',
|
||||
\ 'postprocess': ['guards'],
|
||||
\ 'returns': [0, 1, 2, 65, 66] })
|
||||
|
||||
let cutoff = strlen('Syntax Error: ')
|
||||
for e in loclist
|
||||
if e['nr'] > 1
|
||||
let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['col'] + e['nr']) . 'c'
|
||||
endif
|
||||
let e['nr'] = 0
|
||||
|
||||
if e['text'][: cutoff-1] ==# 'Syntax Error: '
|
||||
let e['text'] = e['text'][cutoff :]
|
||||
else
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
language: ruby
|
||||
before_install:
|
||||
- curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/simple.vim" -o autoload/airline/themes/simple.vim
|
||||
- curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/molokai.vim" -o autoload/airline/themes/molokai.vim
|
||||
- mkdir colors && curl -f -L 'https://raw.githubusercontent.com/tomasr/molokai/master/colors/molokai.vim' -o colors/molokai.vim
|
||||
rvm:
|
||||
- 1.9.3
|
||||
script: rake ci
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 2013-2015 Bailey Ling
|
||||
Copyright (C) 2013-2016 Bailey Ling
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# vim-airline [](https://travis-ci.org/bling/vim-airline)
|
||||
# vim-airline [](https://travis-ci.org/vim-airline/vim-airline)
|
||||
|
||||
Lean & mean status/tabline for vim that's light as air.
|
||||
|
||||

|
||||

|
||||
|
||||
# Features
|
||||
|
||||
|
@ -15,7 +15,8 @@ Lean & mean status/tabline for vim that's light as air.
|
|||
[ctrlspace][38] and more.
|
||||
* Looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols.
|
||||
* Optimized for speed; it loads in under a millisecond.
|
||||
* Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki.
|
||||
* Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others.
|
||||
Note these are now external to this plugin. See [below][46] for detail.
|
||||
* Supports 7.2 as the minimum Vim version.
|
||||
* The master branch tries to be as stable as possible, and new features are merged in only after they have gone through a [full regression test][33].
|
||||
* Unit testing suite.
|
||||
|
@ -26,6 +27,20 @@ If you don't like the defaults, you can replace all sections with standard `stat
|
|||
|
||||

|
||||
|
||||
## Themes
|
||||
|
||||
Themes have moved to
|
||||
another repository as of [this commit][45].
|
||||
|
||||
Install the themes as you would this plugin (Vundle example):
|
||||
|
||||
```vim
|
||||
Plugin 'vim-airline/vim-airline'
|
||||
Plugin 'vim-airline/vim-airline-themes'
|
||||
```
|
||||
|
||||
See https://github.com/vim-airline/vim-airline-themes for more.
|
||||
|
||||
## Automatic truncation
|
||||
|
||||
Sections and parts within sections can be configured to automatically hide when the window size shrinks.
|
||||
|
@ -78,6 +93,9 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
|
|||
#### [promptline][36]
|
||||

|
||||
|
||||
#### [ctrlspace][38]
|
||||

|
||||
|
||||
## Extras
|
||||
|
||||
vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also:
|
||||
|
@ -93,7 +111,7 @@ Every section is composed of parts, and you can reorder and reconfigure them at
|
|||
|
||||

|
||||
|
||||
Sections can contain accents, which allows for very granular control of visuals (see configuration [here](https://github.com/bling/vim-airline/issues/299#issuecomment-25772886)).
|
||||
Sections can contain accents, which allows for very granular control of visuals (see configuration [here](https://github.com/vim-airline/vim-airline/issues/299#issuecomment-25772886)).
|
||||
|
||||

|
||||
|
||||
|
@ -122,12 +140,14 @@ I wrote the initial version on an airplane, and since it's light as air it turne
|
|||
This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:
|
||||
|
||||
* [Pathogen][11]
|
||||
* `git clone https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline`
|
||||
* `git clone https://github.com/vim-airline/vim-airline ~/.vim/bundle/vim-airline`
|
||||
* Remember to run `:Helptags` to generate help tags
|
||||
* [NeoBundle][12]
|
||||
* `NeoBundle 'bling/vim-airline'`
|
||||
* `NeoBundle 'vim-airline/vim-airline'`
|
||||
* [Vundle][13]
|
||||
* `Plugin 'bling/vim-airline'`
|
||||
* `Plugin 'vim-airline/vim-airline'`
|
||||
* [Plug][40]
|
||||
* `Plug 'vim-airline/vim-airline'`
|
||||
* [VAM][22]
|
||||
* `call vam#ActivateAddons([ 'vim-airline' ])`
|
||||
* manual
|
||||
|
@ -166,33 +186,17 @@ If you don't want all the bells and whistles enabled by default, you can define
|
|||
|
||||
A full list of screenshots for various themes can be found in the [Wiki][14].
|
||||
|
||||
# Bugs
|
||||
# Maintainers
|
||||
|
||||
Tracking down bugs can take a very long time due to different configurations, versions, and operating systems. To ensure a timely response, please help me out by doing the following:
|
||||
The project is currently being maintained by [Bailey Ling][41], [Christian Brabandt][42], and [Mike Hartington][44].
|
||||
|
||||
* Reproduce it with this [minivimrc][7] repository to rule out any configuration conflicts.
|
||||
* A link to your vimrc or a gist which shows how you configured the plugin(s).
|
||||
* And so I can reproduce; your `:version` of vim, and the commit of vim-airline you're using.
|
||||
|
||||
# Contributions
|
||||
|
||||
Contributions and pull requests are welcome. Please take note of the following guidelines:
|
||||
|
||||
* Adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords.
|
||||
* Keep the history clean! squash your branches before you submit a pull request. `pull --rebase` is your friend.
|
||||
* Any changes to the core should be tested against Vim 7.2.
|
||||
|
||||
## Themes
|
||||
|
||||
* If you submit a theme, please create a screenshot so it can be added to the [Wiki][14].
|
||||
* In the majority of cases, modifications to colors of existing themes will likely be rejected. Themes are a subjective thing, so while you may prefer that a particular color be darker, another user will prefer it to be lighter, or something entirely different. The more popular the theme, the more unlikely the change will be accepted. However, it's pretty simple to create your own theme; copy the theme to `~/.vim/autoload/airline/themes` under a new name with your modifications, and it can be used.
|
||||
If you are interested in becoming a maintainer (we always welcome more maintainers), please [go here][43].
|
||||
|
||||
# License
|
||||
|
||||
MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
|
||||
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||
|
||||
[1]: https://github.com/Lokaltog/vim-powerline
|
||||
[2]: https://github.com/Lokaltog/powerline
|
||||
|
@ -207,7 +211,7 @@ MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
|||
[11]: https://github.com/tpope/vim-pathogen
|
||||
[12]: https://github.com/Shougo/neobundle.vim
|
||||
[13]: https://github.com/gmarik/vundle
|
||||
[14]: https://github.com/bling/vim-airline/wiki/Screenshots
|
||||
[14]: https://github.com/vim-airline/vim-airline/wiki/Screenshots
|
||||
[15]: https://github.com/techlivezheng/vim-plugin-minibufexpl
|
||||
[16]: https://github.com/sjl/gundo.vim
|
||||
[17]: https://github.com/mbbill/undotree
|
||||
|
@ -220,16 +224,23 @@ MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
|||
[24]: https://github.com/chriskempson/tomorrow-theme
|
||||
[25]: https://github.com/tomasr/molokai
|
||||
[26]: https://github.com/nanotech/jellybeans.vim
|
||||
[27]: https://github.com/bling/vim-airline/wiki/FAQ
|
||||
[27]: https://github.com/vim-airline/vim-airline/wiki/FAQ
|
||||
[28]: https://github.com/chrisbra/csv.vim
|
||||
[29]: https://github.com/airblade/vim-gitgutter
|
||||
[30]: https://github.com/mhinz/vim-signify
|
||||
[31]: https://github.com/jmcantrell/vim-virtualenv
|
||||
[32]: https://github.com/chriskempson/base16-vim
|
||||
[33]: https://github.com/bling/vim-airline/wiki/Test-Plan
|
||||
[33]: https://github.com/vim-airline/vim-airline/wiki/Test-Plan
|
||||
[34]: http://eclim.org
|
||||
[35]: https://github.com/edkolev/tmuxline.vim
|
||||
[36]: https://github.com/edkolev/promptline.vim
|
||||
[37]: https://github.com/gcmt/taboo.vim
|
||||
[38]: https://github.com/szw/vim-ctrlspace
|
||||
[39]: https://github.com/tomtom/quickfixsigns_vim
|
||||
[40]: https://github.com/junegunn/vim-plug
|
||||
[41]: https://github.com/bling
|
||||
[42]: https://github.com/chrisbra
|
||||
[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer
|
||||
[44]: https://github.com/mhartington
|
||||
[45]: https://github.com/vim-airline/vim-airline/commit/d7fd8ca649e441b3865551a325b10504cdf0711b
|
||||
[46]: https://github.com/vim-airline/vim-airline#themes
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', [])
|
||||
|
||||
let s:sections = ['a','b','c','gutter','x','y','z','warning']
|
||||
let s:sections = ['a','b','c','gutter','x','y','z', 'error', 'warning']
|
||||
let s:inactive_funcrefs = []
|
||||
|
||||
function! airline#add_statusline_func(name)
|
||||
|
@ -71,6 +71,7 @@ endfunction
|
|||
|
||||
function! airline#switch_matching_theme()
|
||||
if exists('g:colors_name')
|
||||
let existing = g:airline_theme
|
||||
try
|
||||
let palette = g:airline#themes#{g:colors_name}#palette
|
||||
call airline#switch_theme(g:colors_name)
|
||||
|
@ -78,7 +79,12 @@ function! airline#switch_matching_theme()
|
|||
catch
|
||||
for map in items(g:airline_theme_map)
|
||||
if match(g:colors_name, map[0]) > -1
|
||||
call airline#switch_theme(map[1])
|
||||
try
|
||||
let palette = g:airline#themes#{map[1]}#palette
|
||||
call airline#switch_theme(map[1])
|
||||
catch
|
||||
call airline#switch_theme(existing)
|
||||
endtry
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
|
|
@ -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
|
||||
|
||||
let s:prototype = {}
|
||||
|
@ -77,7 +77,7 @@ function! s:should_change_group(group1, group2)
|
|||
endif
|
||||
let color1 = airline#highlighter#get_highlight(a:group1)
|
||||
let color2 = airline#highlighter#get_highlight(a:group2)
|
||||
if has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
if g:airline_gui_mode ==# 'gui'
|
||||
return color1[1] != color2[1] || color1[0] != color2[0]
|
||||
else
|
||||
return color1[3] != color2[3] || color1[2] != color2[2]
|
||||
|
|
|
@ -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! airline#debug#profile1()
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#deprecation#check()
|
||||
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
|
||||
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables are obsolete. Please read the documentation about the branch extension.'
|
||||
endif
|
||||
|
||||
let tests = [
|
||||
\ [ 'g:airline_paste_symbol', 'g:airline_symbols.paste' ],
|
||||
\ [ 'g:airline_readonly_symbol', 'g:airline_symbols.readonly' ],
|
||||
\ [ 'g:airline_linecolumn_prefix', 'g:airline_symbols.linenr' ],
|
||||
\ [ 'g:airline_branch_prefix', 'g:airline_symbols.branch' ],
|
||||
\ [ 'g:airline_branch_empty_message', 'g:airline#extensions#branch#empty_message' ],
|
||||
\ [ 'g:airline_detect_whitespace', 'g:airline#extensions#whitespace#enabled|show_message' ],
|
||||
\ [ 'g:airline_enable_hunks', 'g:airline#extensions#hunks#enabled' ],
|
||||
\ [ 'g:airline_enable_tagbar', 'g:airline#extensions#tagbar#enabled' ],
|
||||
\ [ 'g:airline_enable_csv', 'g:airline#extensions#csv#enabled' ],
|
||||
\ [ 'g:airline_enable_branch', 'g:airline#extensions#branch#enabled' ],
|
||||
\ [ 'g:airline_enable_bufferline', 'g:airline#extensions#bufferline#enabled' ],
|
||||
\ [ 'g:airline_enable_syntastic', 'g:airline#extensions#syntastic#enabled' ],
|
||||
\ [ 'g:airline_enable_eclim', 'g:airline#extensions#eclim#enabled' ],
|
||||
\ ]
|
||||
for test in tests
|
||||
if exists(test[0])
|
||||
let max = winwidth(0) - 16
|
||||
let msg = printf('The variable %s is deprecated and may not work in the future. It has been replaced with %s. Please read the documentation.', test[0], test[1])
|
||||
echom msg[:max].'...'
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
|
@ -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
|
||||
|
||||
let s:ext = {}
|
||||
|
@ -138,6 +138,10 @@ function! airline#extensions#load()
|
|||
call airline#extensions#netrw#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#ycm#enabled', 0)
|
||||
call airline#extensions#ycm#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_vimfiler', 0)
|
||||
let g:vimfiler_force_overwrite_statusline = 0
|
||||
endif
|
||||
|
@ -146,7 +150,7 @@ function! airline#extensions#load()
|
|||
call airline#extensions#ctrlp#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'ctrlspace_loaded', 0)
|
||||
if get(g:, 'CtrlSpaceLoaded', 0)
|
||||
call airline#extensions#ctrlspace#init(s:ext)
|
||||
endif
|
||||
|
||||
|
@ -158,17 +162,17 @@ function! airline#extensions#load()
|
|||
call airline#extensions#undotree#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#hunks#enabled', 1) && get(g:, 'airline_enable_hunks', 1))
|
||||
if get(g:, 'airline#extensions#hunks#enabled', 1)
|
||||
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter') || exists('g:loaded_changes') || exists('g:loaded_quickfixsigns'))
|
||||
call airline#extensions#hunks#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#tagbar#enabled', 1) && get(g:, 'airline_enable_tagbar', 1))
|
||||
if get(g:, 'airline#extensions#tagbar#enabled', 1)
|
||||
\ && exists(':TagbarToggle')
|
||||
call airline#extensions#tagbar#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#csv#enabled', 1) && get(g:, 'airline_enable_csv', 1))
|
||||
if get(g:, 'airline#extensions#csv#enabled', 1)
|
||||
\ && (get(g:, 'loaded_csv', 0) || exists(':Table'))
|
||||
call airline#extensions#csv#init(s:ext)
|
||||
endif
|
||||
|
@ -178,18 +182,18 @@ function! airline#extensions#load()
|
|||
let s:filetype_regex_overrides['^int-'] = ['vimshell','%{substitute(&ft, "int-", "", "")}']
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#branch#enabled', 1) && get(g:, 'airline_enable_branch', 1))
|
||||
if get(g:, 'airline#extensions#branch#enabled', 1)
|
||||
\ && (exists('*fugitive#head') || exists('*lawrencium#statusline') ||
|
||||
\ (get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')))
|
||||
call airline#extensions#branch#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#bufferline#enabled', 1) && get(g:, 'airline_enable_bufferline', 1))
|
||||
if get(g:, 'airline#extensions#bufferline#enabled', 1)
|
||||
\ && exists('*bufferline#get_status_string')
|
||||
call airline#extensions#bufferline#init(s:ext)
|
||||
endif
|
||||
|
||||
if isdirectory($VIRTUAL_ENV) && get(g:, 'airline#extensions#virtualenv#enabled', 1)
|
||||
if (get(g:, 'airline#extensions#virtualenv#enabled', 1) && (exists(':VirtualEnvList') || isdirectory($VIRTUAL_ENV)))
|
||||
call airline#extensions#virtualenv#init(s:ext)
|
||||
endif
|
||||
|
||||
|
@ -197,12 +201,12 @@ function! airline#extensions#load()
|
|||
call airline#extensions#eclim#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
|
||||
if get(g:, 'airline#extensions#syntastic#enabled', 1)
|
||||
\ && exists(':SyntasticCheck')
|
||||
call airline#extensions#syntastic#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#whitespace#enabled', 1) && get(g:, 'airline_detect_whitespace', 1))
|
||||
if get(g:, 'airline#extensions#whitespace#enabled', 1)
|
||||
call airline#extensions#whitespace#init(s:ext)
|
||||
endif
|
||||
|
||||
|
@ -226,6 +230,10 @@ function! airline#extensions#load()
|
|||
call airline#extensions#nrrwrgn#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#unicode#enabled', 1) && exists(':UnicodeTable') == 2
|
||||
call airline#extensions#unicode#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#capslock#enabled', 1) && exists('*CapsLockStatusline'))
|
||||
call airline#extensions#capslock#init(s:ext)
|
||||
endif
|
||||
|
|
|
@ -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
|
||||
|
||||
let s:has_fugitive = exists('*fugitive#head')
|
||||
|
@ -9,6 +9,10 @@ if !s:has_fugitive && !s:has_lawrencium && !s:has_vcscommand
|
|||
finish
|
||||
endif
|
||||
|
||||
let s:git_dirs = {}
|
||||
let s:untracked_git = {}
|
||||
let s:untracked_hg = {}
|
||||
|
||||
let s:head_format = get(g:, 'airline#extensions#branch#format', 0)
|
||||
if s:head_format == 1
|
||||
function! s:format_name(name)
|
||||
|
@ -28,71 +32,125 @@ else
|
|||
endfunction
|
||||
endif
|
||||
|
||||
let s:git_dirs = {}
|
||||
function! s:get_git_branch(path)
|
||||
if has_key(s:git_dirs, a:path)
|
||||
return s:git_dirs[a:path]
|
||||
if !s:has_fugitive
|
||||
return ''
|
||||
endif
|
||||
|
||||
let dir = fugitive#extract_git_dir(a:path)
|
||||
if empty(dir)
|
||||
let name = ''
|
||||
else
|
||||
try
|
||||
let line = join(readfile(dir . '/HEAD'))
|
||||
if strpart(line, 0, 16) == 'ref: refs/heads/'
|
||||
let name = strpart(line, 16)
|
||||
else
|
||||
" raw commit hash
|
||||
let name = strpart(line, 0, 7)
|
||||
endif
|
||||
catch
|
||||
let name = fugitive#head(7)
|
||||
if empty(name)
|
||||
if has_key(s:git_dirs, a:path)
|
||||
return s:git_dirs[a:path]
|
||||
endif
|
||||
|
||||
let dir = fugitive#extract_git_dir(a:path)
|
||||
if empty(dir)
|
||||
let name = ''
|
||||
endtry
|
||||
else
|
||||
try
|
||||
let line = join(readfile(dir . '/HEAD'))
|
||||
if strpart(line, 0, 16) == 'ref: refs/heads/'
|
||||
let name = strpart(line, 16)
|
||||
else
|
||||
" raw commit hash
|
||||
let name = strpart(line, 0, 7)
|
||||
endif
|
||||
catch
|
||||
let name = ''
|
||||
endtry
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:git_dirs[a:path] = name
|
||||
return name
|
||||
endfunction
|
||||
|
||||
function! s:get_git_untracked(file)
|
||||
let untracked = ''
|
||||
if empty(a:file)
|
||||
return untracked
|
||||
endif
|
||||
if has_key(s:untracked_git, a:file)
|
||||
let untracked = s:untracked_git[a:file]
|
||||
else
|
||||
let output = system('git status --porcelain -- '. a:file)
|
||||
if output[0:1] is# '??' && output[3:-2] is? a:file
|
||||
let untracked = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists)
|
||||
endif
|
||||
let s:untracked_git[a:file] = untracked
|
||||
endif
|
||||
return untracked
|
||||
endfunction
|
||||
|
||||
function! s:get_hg_untracked(file)
|
||||
if s:has_lawrencium
|
||||
" delete cache when unlet b:airline head?
|
||||
let untracked = ''
|
||||
if empty(a:file)
|
||||
return untracked
|
||||
endif
|
||||
if has_key(s:untracked_hg, a:file)
|
||||
let untracked = s:untracked_hg[a:file]
|
||||
else
|
||||
let untracked = (system('hg status -u -- '. a:file)[0] is# '?' ?
|
||||
\ get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists) : '')
|
||||
let s:untracked_hg[a:file] = untracked
|
||||
endif
|
||||
return untracked
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_hg_branch()
|
||||
if s:has_lawrencium
|
||||
return lawrencium#statusline()
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#head()
|
||||
if exists('b:airline_head') && !empty(b:airline_head)
|
||||
return b:airline_head
|
||||
endif
|
||||
|
||||
let b:airline_head = ''
|
||||
let l:heads = {}
|
||||
let l:vcs_priority = get(g:, "airline#extensions#branch#vcs_priority", ["git", "mercurial"])
|
||||
let found_fugitive_head = 0
|
||||
|
||||
if s:has_fugitive && !exists('b:mercurial_dir')
|
||||
let b:airline_head = fugitive#head(7)
|
||||
let l:git_head = s:get_git_branch(expand("%:p:h"))
|
||||
let l:hg_head = s:get_hg_branch()
|
||||
|
||||
if !empty(l:git_head)
|
||||
let found_fugitive_head = 1
|
||||
|
||||
if empty(b:airline_head) && !exists('b:git_dir')
|
||||
let b:airline_head = s:get_git_branch(expand("%:p:h"))
|
||||
endif
|
||||
let l:heads.git = (!empty(l:hg_head) ? "git:" : '') . s:format_name(l:git_head)
|
||||
let l:git_untracked = s:get_git_untracked(expand("%:p"))
|
||||
let l:heads.git .= l:git_untracked
|
||||
endif
|
||||
|
||||
if empty(b:airline_head)
|
||||
if s:has_lawrencium
|
||||
let b:airline_head = lawrencium#statusline()
|
||||
endif
|
||||
if !empty(l:hg_head)
|
||||
let l:heads.mercurial = (!empty(l:git_head) ? "hg:" : '') . s:format_name(l:hg_head)
|
||||
let l:hg_untracked = s:get_hg_untracked(expand("%:p"))
|
||||
let l:heads.mercurial.= l:hg_untracked
|
||||
endif
|
||||
|
||||
if empty(b:airline_head)
|
||||
if empty(l:heads)
|
||||
if s:has_vcscommand
|
||||
call VCSCommandEnableBufferSetup()
|
||||
if exists('b:VCSCommandBufferInfo')
|
||||
let b:airline_head = get(b:VCSCommandBufferInfo, 0, '')
|
||||
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, ''))
|
||||
endif
|
||||
endif
|
||||
else
|
||||
for vcs in l:vcs_priority
|
||||
if has_key(l:heads, vcs)
|
||||
if !empty(b:airline_head)
|
||||
let b:airline_head = b:airline_head . " | "
|
||||
endif
|
||||
let b:airline_head = b:airline_head . l:heads[vcs]
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||
let b:airline_head = ''
|
||||
endif
|
||||
|
||||
let b:airline_head = s:format_name(b:airline_head)
|
||||
|
||||
if exists("g:airline#extensions#branch#displayed_head_limit")
|
||||
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit
|
||||
if len(b:airline_head) > w:displayed_head_limit - 1
|
||||
|
@ -100,13 +158,15 @@ function! airline#extensions#branch#head()
|
|||
endif
|
||||
endif
|
||||
|
||||
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||
let b:airline_head = ''
|
||||
endif
|
||||
return b:airline_head
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#get_head()
|
||||
let head = airline#extensions#branch#head()
|
||||
let empty_message = get(g:, 'airline#extensions#branch#empty_message',
|
||||
\ get(g:, 'airline_branch_empty_message', ''))
|
||||
let empty_message = get(g:, 'airline#extensions#branch#empty_message', '')
|
||||
let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
|
||||
return empty(head)
|
||||
\ ? empty_message
|
||||
|
@ -136,9 +196,20 @@ function! s:check_in_path()
|
|||
return b:airline_file_in_root
|
||||
endfunction
|
||||
|
||||
function! s:reset_untracked_cache()
|
||||
if exists("s:untracked_git")
|
||||
let s:untracked_git={}
|
||||
endif
|
||||
if exists("s:untracked_hg")
|
||||
let s:untracked_hg={}
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
call airline#parts#define_function('branch', 'airline#extensions#branch#get_head')
|
||||
|
||||
autocmd BufReadPost * unlet! b:airline_file_in_root
|
||||
autocmd CursorHold,ShellCmdPost,CmdwinLeave * unlet! b:airline_head
|
||||
autocmd User AirlineBeforeRefresh unlet! b:airline_head
|
||||
autocmd BufWritePost,ShellCmdPost * call s:reset_untracked_cache()
|
||||
endfunction
|
||||
|
|
|
@ -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
|
||||
|
||||
if !exists('*bufferline#get_status_string')
|
||||
|
|
|
@ -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
|
||||
|
||||
if !get(g:, 'command_t_loaded', 0)
|
||||
|
|
|
@ -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
|
||||
|
||||
if !get(g:, 'loaded_csv', 0) && !exists(':Table')
|
||||
|
|
|
@ -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
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
|
|
|
@ -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
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
@ -6,13 +6,12 @@ let s:padding = s:spc . s:spc . s:spc
|
|||
|
||||
function! airline#extensions#ctrlspace#statusline(...)
|
||||
let b = airline#builder#new({ 'active': 1 })
|
||||
call b.add_section('airline_a', s:padding . g:ctrlspace_symbols.cs . s:padding)
|
||||
call b.add_section('airline_b', s:padding . ctrlspace#statusline_mode_segment(s:padding))
|
||||
call b.add_section('airline_b', '⌗' . s:padding . ctrlspace#api#StatuslineModeSegment(s:padding))
|
||||
call b.split()
|
||||
call b.add_section('airline_x', s:spc . ctrlspace#statusline_tab_segment() . s:spc)
|
||||
call b.add_section('airline_x', s:spc . ctrlspace#api#StatuslineTabSegment() . s:spc)
|
||||
return b.build()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlspace#init(ext)
|
||||
let g:ctrlspace_statusline_function = 'airline#extensions#ctrlspace#statusline()'
|
||||
let g:CtrlSpaceStatuslineFunction = "airline#extensions#ctrlspace#statusline()"
|
||||
endfunction
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:section_use_groups = get(g:, 'airline#extensions#default#section_use_groupitems', 1)
|
||||
let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', {
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ 'warning': 80,
|
||||
\ 'error': 80,
|
||||
\ })
|
||||
let s:layout = get(g:, 'airline#extensions#default#layout', [
|
||||
\ [ 'a', 'b', 'c' ],
|
||||
\ [ 'x', 'y', 'z', 'warning' ]
|
||||
\ [ 'x', 'y', 'z', 'warning', 'error' ]
|
||||
\ ])
|
||||
|
||||
function! s:get_section(winnr, key, ...)
|
||||
|
@ -26,30 +29,41 @@ endfunction
|
|||
|
||||
function! s:build_sections(builder, context, keys)
|
||||
for key in a:keys
|
||||
if key == 'warning' && !a:context.active
|
||||
if (key == 'warning' || key == 'error') && !a:context.active
|
||||
continue
|
||||
endif
|
||||
call s:add_section(a:builder, a:context, key)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
if v:version >= 704 || (v:version >= 703 && has('patch81'))
|
||||
" There still is a highlighting bug when using groups %(%) in the statusline,
|
||||
" deactivate it, until this is properly fixed:
|
||||
" https://groups.google.com/d/msg/vim_dev/sb1jmVirXPU/mPhvDnZ-CwAJ
|
||||
if s:section_use_groups && (v:version >= 704 || (v:version >= 703 && has('patch81')))
|
||||
function s:add_section(builder, context, key)
|
||||
" i have no idea why the warning section needs special treatment, but it's
|
||||
" needed to prevent separators from showing up
|
||||
if a:key == 'warning'
|
||||
if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
|
||||
return
|
||||
endif
|
||||
if (a:key == 'warning' || a:key == 'error')
|
||||
call a:builder.add_raw('%(')
|
||||
endif
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
if a:key == 'warning'
|
||||
if (a:key == 'warning' || a:key == 'error')
|
||||
call a:builder.add_raw('%)')
|
||||
endif
|
||||
endfunction
|
||||
else
|
||||
" older version don't like the use of %(%)
|
||||
function s:add_section(builder, context, key)
|
||||
if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
|
||||
return
|
||||
endif
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%#airline_warning#'.s:get_section(a:context.winnr, a:key))
|
||||
elseif a:key == 'error'
|
||||
call a:builder.add_raw('%#airline_error#'.s:get_section(a:context.winnr, a:key))
|
||||
else
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
endif
|
||||
|
|
|
@ -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
|
||||
|
||||
if !exists(':ProjectCreate')
|
||||
|
|
|
@ -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
|
||||
|
||||
" we don't actually want this loaded :P
|
||||
|
|
|
@ -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
|
||||
|
||||
if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0) && !get(g:, 'loaded_changes', 0) && !get(g:, 'loaded_quickfixsigns', 0)
|
||||
|
@ -44,22 +44,21 @@ function! s:get_hunks_empty()
|
|||
return ''
|
||||
endfunction
|
||||
|
||||
let s:source_func = ''
|
||||
function! s:get_hunks()
|
||||
if empty(s:source_func)
|
||||
if get(g:, 'loaded_signify', 0)
|
||||
let s:source_func = 's:get_hunks_signify'
|
||||
if !exists('b:source_func')
|
||||
if get(g:, 'loaded_signify') && sy#buffer_is_active()
|
||||
let b:source_func = 's:get_hunks_signify'
|
||||
elseif exists('*GitGutterGetHunkSummary')
|
||||
let s:source_func = 's:get_hunks_gitgutter'
|
||||
let b:source_func = 's:get_hunks_gitgutter'
|
||||
elseif exists('*changes#GetStats')
|
||||
let s:source_func = 's:get_hunks_changes'
|
||||
let b:source_func = 's:get_hunks_changes'
|
||||
elseif exists('*quickfixsigns#vcsdiff#GetHunkSummary')
|
||||
let s:source_func = 'quickfixsigns#vcsdiff#GetHunkSummary'
|
||||
let b:source_func = 'quickfixsigns#vcsdiff#GetHunkSummary'
|
||||
else
|
||||
let s:source_func = 's:get_hunks_empty'
|
||||
let b:source_func = 's:get_hunks_empty'
|
||||
endif
|
||||
endif
|
||||
return {s:source_func}()
|
||||
return {b:source_func}()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#get_hunks()
|
||||
|
|
|
@ -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
|
||||
|
||||
if !exists(':NetrwSettings')
|
||||
|
|
|
@ -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
|
||||
|
||||
if !get(g:, 'loaded_nrrw_rgn', 0)
|
||||
|
@ -39,7 +39,8 @@ function! airline#extensions#nrrwrgn#apply(...)
|
|||
endif
|
||||
endif
|
||||
let range=(dict.multi ? '' : printf("[%d-%d]", dict.start[1], dict.end[1]))
|
||||
call a:1.add_section('airline_c', printf("%s %s %s", name, range, dict.enabled ? "\u2713" : '!'))
|
||||
call a:1.add_section('airline_c', printf("%s %s %s", name, range,
|
||||
\ dict.enabled ? (&encoding ==? 'utf-8' ? "\u2713" : '') : '!'))
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_x', get(g:, 'airline_section_x').spc)
|
||||
call a:1.add_section('airline_y', spc.get(g:, 'airline_section_y').spc)
|
||||
|
|
|
@ -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
|
||||
|
||||
if !exists(':PromptlineSnapshot')
|
||||
|
|
|
@ -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
|
||||
|
||||
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix'
|
||||
|
|
|
@ -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
|
||||
|
||||
if !exists(':SyntasticCheck')
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" |