1
0
Fork 0
mirror of synced 2024-11-18 06:55:33 -05:00

Merge pull request #161 from andradei/master

Update Golang plugin used on README.
This commit is contained in:
Amir Salihefendic 2016-02-20 11:42:20 +00:00
commit 36019409b7
176 changed files with 4107 additions and 3275 deletions

View file

@ -102,7 +102,7 @@ Remove all clutter and focus only on the essential. Similar to iA Writer or Writ
* [vim-bundle-mako](https://github.com/sophacles/vim-bundle-mako)
* [vim-markdown](https://github.com/tpope/vim-markdown)
* [nginx.vim](https://github.com/vim-scripts/nginx.vim): Highlights configuration files for nginx
* [vim-golang](https://github.com/jnwhiteh/vim-golang)
* [vim-go](https://github.com/fatih/vim-go)
## How to include your own stuff?

View file

@ -0,0 +1,89 @@
ack.vim is distributed under the same license terms as Vim itself, which you
can find in full with `:help license` within Vim, or copied in full herein.
Copyright (c) 2007-2015 Antoine Imbert <antoine.imbert+ackvim@gmail.com>
and contributors.
Maintainers may be contacted via GitHub Issues at:
https://github.com/mileszs/ack.vim/issues
VIM LICENSE
I) There are no restrictions on distributing unmodified copies of Vim except
that they must include this license text. You can also distribute
unmodified parts of Vim, likewise unrestricted except that they must
include this license text. You are also allowed to include executables
that you made from the unmodified Vim sources, plus your own usage
examples and Vim scripts.
II) It is allowed to distribute a modified (or extended) version of Vim,
including executables and/or source code, when the following four
conditions are met:
1) This license text must be included unmodified.
2) The modified Vim must be distributed in one of the following five ways:
a) If you make changes to Vim yourself, you must clearly describe in
the distribution how to contact you. When the maintainer asks you
(in any way) for a copy of the modified Vim you distributed, you
must make your changes, including source code, available to the
maintainer without fee. The maintainer reserves the right to
include your changes in the official version of Vim. What the
maintainer will do with your changes and under what license they
will be distributed is negotiable. If there has been no negotiation
then this license, or a later version, also applies to your changes.
The current maintainer is Bram Moolenaar <Bram@vim.org>. If this
changes it will be announced in appropriate places (most likely
vim.sf.net, www.vim.org and/or comp.editors). When it is completely
impossible to contact the maintainer, the obligation to send him
your changes ceases. Once the maintainer has confirmed that he has
received your changes they will not have to be sent again.
b) If you have received a modified Vim that was distributed as
mentioned under a) you are allowed to further distribute it
unmodified, as mentioned at I). If you make additional changes the
text under a) applies to those changes.
c) Provide all the changes, including source code, with every copy of
the modified Vim you distribute. This may be done in the form of a
context diff. You can choose what license to use for new code you
add. The changes and their license must not restrict others from
making their own changes to the official version of Vim.
d) When you have a modified Vim which includes changes as mentioned
under c), you can distribute it without the source code for the
changes if the following three conditions are met:
- The license that applies to the changes permits you to distribute
the changes to the Vim maintainer without fee or restriction, and
permits the Vim maintainer to include the changes in the official
version of Vim without fee or restriction.
- You keep the changes for at least three years after last
distributing the corresponding modified Vim. When the maintainer
or someone who you distributed the modified Vim to asks you (in
any way) for the changes within this period, you must make them
available to him.
- You clearly describe in the distribution how to contact you. This
contact information must remain valid for at least three years
after last distributing the corresponding modified Vim, or as long
as possible.
e) When the GNU General Public License (GPL) applies to the changes,
you can distribute the modified Vim under the GNU GPL version 2 or
any later version.
3) A message must be added, at least in the output of the ":version"
command and in the intro screen, such that the user of the modified Vim
is able to see that it was modified. When distributing as mentioned
under 2)e) adding the message is only required for as far as this does
not conflict with the license used for the changes.
4) The contact information as required under 2)a) and 2)d) must not be
removed or changed, except that the person himself can make
corrections.
III) If you distribute a modified version of Vim, you are encouraged to use
the Vim license for your changes and make them available to the
maintainer, including the source code. The preferred way to do this is
by e-mail or by uploading the files to a server and e-mailing the URL.
If the number of changes is small (e.g., a modified Makefile) e-mailing a
context diff will do. The e-mail address to be used is
<maintainer@vim.org>
IV) It is not allowed to remove this license from the distribution of the Vim
sources, parts of it or from a modified version. You may use this
license for previous Vim releases instead of the license that they came
with, at your option.

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -0,0 +1 @@
/doc/tags

View file

@ -0,0 +1,30 @@
# rust.vim
## Description
This is a vim plugin provides [Rust][r] file detection and syntax highlighting.
It is synchronized daily to the vim support code in [rust-lang/rust][rr]'s
master branch via cronjob.
## Installation
### Using [Vundle][v]
1. Add `Plugin 'wting/rust.vim'` to `~/.vimrc`
2. `vim +PluginInstall +qall`
*Note:* Vundle will not automatically detect Rust files properly if `filetype
on` is executed before Vundle. Please check the [quickstart][vqs] for more
details.
### Using [Pathogen][p]
1. `cd ~/.vim/bundle`
2. `git clone https://github.com/wting/rust.vim.git`
[rr]: https://github.com/rust-lang/rust
[p]: https://github.com/tpope/vim-pathogen
[r]: https://en.wikipedia.org/wiki/Rust_language
[v]: https://github.com/gmarik/vundle
[vqs]: https://github.com/gmarik/vundle#quick-start

View file

@ -0,0 +1,31 @@
if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8'
finish
endif
" For those who don't want to see `::`...
if exists('g:rust_conceal_mod_path')
syn match rustNiceOperator "::" conceal cchar=
endif
syn match rustRightArrowHead contained ">" conceal cchar= 
syn match rustRightArrowTail contained "-" conceal cchar=
syn match rustNiceOperator "->" contains=rustRightArrowHead,rustRightArrowTail
syn match rustFatRightArrowHead contained ">" conceal cchar= 
syn match rustFatRightArrowTail contained "=" conceal cchar=
syn match rustNiceOperator "=>" contains=rustFatRightArrowHead,rustFatRightArrowTail
syn match rustNiceOperator /\<\@!_\(_*\>\)\@=/ conceal cchar=
" For those who don't want to see `pub`...
if exists('g:rust_conceal_pub')
syn match rustPublicSigil contained "pu" conceal cchar=
syn match rustPublicRest contained "b" conceal cchar= 
syn match rustNiceOperator "pub " contains=rustPublicSigil,rustPublicRest
endif
hi link rustNiceOperator Operator
if !exists('g:rust_conceal_mod_path')
hi! link Conceal Operator
endif

View file

@ -0,0 +1,225 @@
" Author: Kevin Ballard
" Description: Helper functions for Rust commands/mappings
" Last Modified: May 27, 2014
" Jump {{{1
function! rust#Jump(mode, function) range
let cnt = v:count1
normal! m'
if a:mode ==# 'v'
norm! gv
endif
let foldenable = &foldenable
set nofoldenable
while cnt > 0
execute "call <SID>Jump_" . a:function . "()"
let cnt = cnt - 1
endwhile
let &foldenable = foldenable
endfunction
function! s:Jump_Back()
call search('{', 'b')
keepjumps normal! w99[{
endfunction
function! s:Jump_Forward()
normal! j0
call search('{', 'b')
keepjumps normal! w99[{%
call search('{')
endfunction
" Run {{{1
function! rust#Run(bang, args)
if a:bang
let idx = index(a:args, '--')
if idx != -1
let rustc_args = idx == 0 ? [] : a:args[:idx-1]
let args = a:args[idx+1:]
else
let rustc_args = a:args
let args = []
endif
else
let rustc_args = []
let args = a:args
endif
let b:rust_last_rustc_args = rustc_args
let b:rust_last_args = args
call s:WithPath(function("s:Run"), rustc_args, args)
endfunction
function! s:Run(path, rustc_args, args)
try
let exepath = tempname()
if has('win32')
let exepath .= '.exe'
endif
let rustc_args = [a:path, '-o', exepath] + a:rustc_args
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let output = system(shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
if output != ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
endif
finally
if exists("exepath")
silent! call delete(exepath)
endif
endtry
endfunction
" Expand {{{1
function! rust#Expand(bang, args)
if a:bang && !empty(a:args)
let pretty = a:args[0]
let args = a:args[1:]
else
let pretty = "expanded"
let args = a:args
endif
call s:WithPath(function("s:Expand"), pretty, args)
endfunction
function! s:Expand(path, pretty, args)
try
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let args = [a:path, '--pretty', a:pretty] + a:args
let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)")))
if v:shell_error
echohl WarningMsg
echo output
echohl None
else
new
silent put =output
1
d
setl filetype=rust
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
endif
endtry
endfunction
function! rust#CompleteExpand(lead, line, pos)
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
" first argument and it has a !
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph="]
if !empty(a:lead)
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
endif
return list
endif
return glob(escape(a:lead, "*?[") . '*', 0, 1)
endfunction
" Emit {{{1
function! rust#Emit(type, args)
call s:WithPath(function("s:Emit"), a:type, a:args)
endfunction
function! s:Emit(path, type, args)
try
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let args = [a:path, '--emit', a:type, '-o', '-'] + a:args
let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)")))
if v:shell_error
echohl WarningMsg
echo output
echohl None
else
new
silent put =output
1
d
if a:type == "ir"
setl filetype=llvm
elseif a:type == "asm"
setl filetype=asm
endif
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
endif
endtry
endfunction
" Utility functions {{{1
function! s:WithPath(func, ...)
try
let save_write = &write
set write
let path = expand('%')
let pathisempty = empty(path)
if pathisempty || !save_write
" use a temporary file named 'unnamed.rs' inside a temporary
" directory. This produces better error messages
let tmpdir = tempname()
call mkdir(tmpdir)
let save_cwd = getcwd()
silent exe 'lcd' fnameescape(tmpdir)
let path = 'unnamed.rs'
let save_mod = &mod
set nomod
silent exe 'keepalt write! ' . fnameescape(path)
if pathisempty
silent keepalt 0file
endif
else
update
endif
call call(a:func, [path] + a:000)
finally
if exists("save_mod") | let &mod = save_mod | endif
if exists("save_write") | let &write = save_write | endif
if exists("save_cwd") | silent exe 'lcd' fnameescape(save_cwd) | endif
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
endtry
endfunction
function! rust#AppendCmdLine(text)
call setcmdpos(getcmdpos())
let cmd = getcmdline() . a:text
return cmd
endfunction
function! s:RmDir(path)
" sanity check; make sure it's not empty, /, or $HOME
if empty(a:path)
echoerr 'Attempted to delete empty path'
return 0
elseif a:path == '/' || a:path == $HOME
echoerr 'Attempted to delete protected path: ' . a:path
return 0
endif
silent exe "!rm -rf " . shellescape(a:path)
endfunction
" }}}1
" vim: set noet sw=4 ts=4:

View file

@ -0,0 +1,65 @@
" Vim compiler file
" Compiler: Cargo Compiler
" Maintainer: Damien Radtke <damienradtke@gmail.com>
" Latest Revision: 2014 Sep 24
if exists('current_compiler')
finish
endif
runtime compiler/rustc.vim
let current_compiler = "cargo"
if exists(':CompilerSet') != 2
command -nargs=* CompilerSet setlocal <args>
endif
if exists('g:cargo_makeprg_params')
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
else
CompilerSet makeprg=cargo\ $*
endif
" Allow a configurable global Cargo.toml name. This makes it easy to
" support variations like 'cargo.toml'.
let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
function! s:is_absolute(path)
return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
endfunction
let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
if s:local_manifest != ''
let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
augroup cargo
au!
au QuickfixCmdPost make call s:FixPaths()
augroup END
" FixPaths() is run after Cargo, and is used to change the file paths
" to be relative to the current directory instead of Cargo.toml.
function! s:FixPaths()
let qflist = getqflist()
let manifest = s:local_manifest
for qf in qflist
if !qf.valid
let m = matchlist(qf.text, '(file://\(.*\))$')
if !empty(m)
let manifest = m[1].'/'
" Manually strip another slash if needed; usually just an
" issue on Windows.
if manifest =~ '^/[A-Z]\+:/'
let manifest = manifest[1:]
endif
endif
continue
endif
let filename = bufname(qf.bufnr)
if s:is_absolute(filename)
continue
endif
let qf.filename = simplify(manifest.filename)
call remove(qf, 'bufnr')
endfor
call setqflist(qflist, 'r')
endfunction
endif

View file

@ -0,0 +1,33 @@
" Vim compiler file
" Compiler: Rust Compiler
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Latest Revision: 2013 Jul 12
if exists("current_compiler")
finish
endif
let current_compiler = "rustc"
let s:cpo_save = &cpo
set cpo&vim
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent == 1
CompilerSet makeprg=rustc
else
CompilerSet makeprg=rustc\ \%
endif
CompilerSet errorformat=
\%f:%l:%c:\ %t%*[^:]:\ %m,
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
\%-G%f:%l\ %s,
\%-G%*[\ ]^,
\%-G%*[\ ]^%*[~],
\%-G%*[\ ]...
let &cpo = s:cpo_save
unlet s:cpo_save

View file

@ -0,0 +1,178 @@
*rust.txt* Filetype plugin for Rust
==============================================================================
CONTENTS *rust* *ft-rust*
1. Introduction |rust-intro|
2. Settings |rust-settings|
3. Commands |rust-commands|
4. Mappings |rust-mappings|
==============================================================================
INTRODUCTION *rust-intro*
This plugin provides syntax and supporting functionality for the Rust
filetype.
==============================================================================
SETTINGS *rust-settings*
This plugin has a few variables you can define in your vimrc that change the
behavior of the plugin.
*g:rustc_path*
g:rustc_path~
Set this option to the path to rustc for use in the |:RustRun| and
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
let g:rustc_path = $HOME."/bin/rustc"
<
*g:rustc_makeprg_no_percent*
g:rustc_makeprg_no_percent~
Set this option to 1 to have 'makeprg' default to "rustc" instead of
"rustc %": >
let g:rustc_makeprg_no_percent = 1
<
*g:rust_conceal*
g:rust_conceal~
Set this option to turn on the basic |conceal| support: >
let g:rust_conceal = 1
<
*g:rust_conceal_mod_path*
g:rust_conceal_mod_path~
Set this option to turn on |conceal| for the path connecting token
"::": >
let g:rust_conceal_mod_path = 1
<
*g:rust_conceal_pub*
g:rust_conceal_pub~
Set this option to turn on |conceal| for the "pub" token: >
let g:rust_conceal_pub = 1
<
*g:rust_recommended_style*
g:rust_recommended_style~
Set this option to enable vim indentation and textwidth settings to
conform to style conventions of the rust standard library (i.e. use 4
spaces for indents and sets 'textwidth' to 99). This option is enabled
by default. To disable it: >
let g:rust_recommended_style = 0
<
*g:rust_fold*
g:rust_fold~
Set this option to turn on |folding|: >
let g:rust_fold = 1
<
Value Effect ~
0 No folding
1 Braced blocks are folded. All folds are open by
default.
2 Braced blocks are folded. 'foldlevel' is left at the
global value (all folds are closed by default).
*g:rust_bang_comment_leader*
g:rust_bang_comment_leader~
Set this option to 1 to preserve the leader on multi-line doc comments
using the /*! syntax: >
let g:rust_bang_comment_leader = 1
<
*g:ftplugin_rust_source_path*
g:ftplugin_rust_source_path~
Set this option to a path that should be prepended to 'path' for Rust
source files: >
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
<
*g:cargo_manifest_name*
g:cargo_manifest_name~
Set this option to the name of the manifest file for your projects. If
not specified it defaults to 'Cargo.toml' : >
let g:cargo_manifest_name = 'Cargo.toml'
<
==============================================================================
COMMANDS *rust-commands*
:RustRun [args] *:RustRun*
:RustRun! [rustc-args] [--] [args]
Compiles and runs the current file. If it has unsaved changes,
it will be saved first using |:update|. If the current file is
an unnamed buffer, it will be written to a temporary file
first. The compiled binary is always placed in a temporary
directory, but is run from the current directory.
The arguments given to |:RustRun| will be passed to the
compiled binary.
If ! is specified, the arguments are passed to rustc instead.
A "--" argument will separate the rustc arguments from the
arguments passed to the binary.
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustExpand [args] *:RustExpand*
:RustExpand! [TYPE] [args]
Expands the current file using --pretty and displays the
results in a new split. If the current file has unsaved
changes, it will be saved first using |:update|. If the
current file is an unnamed buffer, it will be written to a
temporary file first.
The arguments given to |:RustExpand| will be passed to rustc.
This is largely intended for specifying various --cfg
configurations.
If ! is specified, the first argument is the expansion type to
pass to rustc --pretty. Otherwise it will default to
"expanded".
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustEmitIr [args] *:RustEmitIr*
Compiles the current file to LLVM IR and displays the results
in a new split. If the current file has unsaved changes, it
will be saved first using |:update|. If the current file is an
unnamed buffer, it will be written to a temporary file first.
The arguments given to |:RustEmitIr| will be passed to rustc.
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustEmitAsm [args] *:RustEmitAsm*
Compiles the current file to assembly and displays the results
in a new split. If the current file has unsaved changes, it
will be saved first using |:update|. If the current file is an
unnamed buffer, it will be written to a temporary file first.
The arguments given to |:RustEmitAsm| will be passed to rustc.
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
==============================================================================
MAPPINGS *rust-mappings*
This plugin defines mappings for |[[| and |]]| to support hanging indents.
It also has a few other mappings:
*rust_<D-r>*
<D-r> Executes |:RustRun| with no arguments.
Note: This binding is only available in MacVim.
*rust_<D-R>*
<D-R> Populates the command line with |:RustRun|! using the
arguments given to the last invocation, but does not
execute it.
Note: This binding is only available in MacVim.
==============================================================================
vim:tw=78:sw=4:noet:ts=8:ft=help:norl:

View file

@ -0,0 +1 @@
au BufRead,BufNewFile *.rs set filetype=rust

View file

@ -0,0 +1,150 @@
" Language: Rust
" Description: Vim syntax file for Rust
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Maintainer: Kevin Ballard <kevin@sb.org>
" Last Change: Jul 07, 2014
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo&vim
" Variables {{{1
" The rust source code at present seems to typically omit a leader on /*!
" comments, so we'll use that as our default, but make it easy to switch.
" This does not affect indentation at all (I tested it with and without
" leader), merely whether a leader is inserted by default or not.
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader == 1
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
" but without it, */ gets indented one space even if there were no
" leaders. I'm fairly sure that's a Vim bug.
setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,://
else
setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
endif
setlocal commentstring=//%s
setlocal formatoptions-=t formatoptions+=croqnl
" j was only added in 7.3.541, so stop complaints about its nonexistence
silent! setlocal formatoptions+=j
" smartindent will be overridden by indentexpr if filetype indent is on, but
" otherwise it's better than nothing.
setlocal smartindent nocindent
if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
setlocal textwidth=99
endif
" This includeexpr isn't perfect, but it's a good start
setlocal includeexpr=substitute(v:fname,'::','/','g')
" NOT adding .rc as it's being phased out (0.7)
setlocal suffixesadd=.rs
if exists("g:ftplugin_rust_source_path")
let &l:path=g:ftplugin_rust_source_path . ',' . &l:path
endif
if exists("g:loaded_delimitMate")
if exists("b:delimitMate_excluded_regions")
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
endif
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
endif
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
let b:rust_set_foldmethod=1
setlocal foldmethod=syntax
if g:rust_fold == 2
setlocal foldlevel<
else
setlocal foldlevel=99
endif
endif
if has('conceal') && exists('g:rust_conceal')
let b:rust_set_conceallevel=1
setlocal conceallevel=2
endif
" Motion Commands {{{1
" Bind motion commands to support hanging indents
nnoremap <silent> <buffer> [[ :call rust#Jump('n', 'Back')<CR>
nnoremap <silent> <buffer> ]] :call rust#Jump('n', 'Forward')<CR>
xnoremap <silent> <buffer> [[ :call rust#Jump('v', 'Back')<CR>
xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
" Commands {{{1
" See |:RustRun| for docs
command! -nargs=* -complete=file -bang -bar -buffer RustRun call rust#Run(<bang>0, [<f-args>])
" See |:RustExpand| for docs
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -bar -buffer RustExpand call rust#Expand(<bang>0, [<f-args>])
" See |:RustEmitIr| for docs
command! -nargs=* -bar -buffer RustEmitIr call rust#Emit("ir", [<f-args>])
" See |:RustEmitAsm| for docs
command! -nargs=* -bar -buffer RustEmitAsm call rust#Emit("asm", [<f-args>])
" Mappings {{{1
" Bind ⌘R in MacVim to :RustRun
nnoremap <silent> <buffer> <D-r> :RustRun<CR>
" Bind ⌘⇧R in MacVim to :RustRun! pre-filled with the last args
nnoremap <buffer> <D-R> :RustRun! <C-r>=join(b:rust_last_rustc_args)<CR><C-\>erust#AppendCmdLine(' -- ' . join(b:rust_last_args))<CR>
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
let b:rust_last_rustc_args = []
let b:rust_last_args = []
endif
" Cleanup {{{1
let b:undo_ftplugin = "
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
\|if exists('b:rust_original_delimitMate_excluded_regions')
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
\|unlet b:rust_original_delimitMate_excluded_regions
\|else
\|unlet! b:delimitMate_excluded_regions
\|endif
\|if exists('b:rust_set_foldmethod')
\|setlocal foldmethod< foldlevel<
\|unlet b:rust_set_foldmethod
\|endif
\|if exists('b:rust_set_conceallevel')
\|setlocal conceallevel<
\|unlet b:rust_set_conceallevel
\|endif
\|unlet! b:rust_last_rustc_args b:rust_last_args
\|delcommand RustRun
\|delcommand RustExpand
\|delcommand RustEmitIr
\|delcommand RustEmitAsm
\|nunmap <buffer> <D-r>
\|nunmap <buffer> <D-R>
\|nunmap <buffer> [[
\|nunmap <buffer> ]]
\|xunmap <buffer> [[
\|xunmap <buffer> ]]
\|ounmap <buffer> [[
\|ounmap <buffer> ]]
\"
" }}}1
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set noet sw=4 ts=4:

View file

@ -0,0 +1,196 @@
" Vim indent file
" Language: Rust
" Author: Chris Morgan <me@chrismorgan.info>
" Last Change: 2014 Sep 13
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal cindent
setlocal cinoptions=L0,(0,Ws,J1,j1
setlocal cinkeys=0{,0},!^F,o,O,0[,0]
" Don't think cinwords will actually do anything at all... never mind
setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern
" Some preliminary settings
setlocal nolisp " Make sure lisp indenting doesn't supersede us
setlocal autoindent " indentexpr isn't much help otherwise
" Also do indentkeys, otherwise # gets shoved to column 0 :-/
setlocal indentkeys=0{,0},!^F,o,O,0[,0]
setlocal indentexpr=GetRustIndent(v:lnum)
" Only define the function once.
if exists("*GetRustIndent")
finish
endif
" Come here when loading the script the first time.
function! s:get_line_trimmed(lnum)
" Get the line and remove a trailing comment.
" Use syntax highlighting attributes when possible.
" NOTE: this is not accurate; /* */ or a line continuation could trick it
let line = getline(a:lnum)
let line_len = strlen(line)
if has('syntax_items')
" If the last character in the line is a comment, do a binary search for
" the start of the comment. synID() is slow, a linear search would take
" too long on a long line.
if synIDattr(synID(a:lnum, line_len, 1), "name") =~ 'Comment\|Todo'
let min = 1
let max = line_len
while min < max
let col = (min + max) / 2
if synIDattr(synID(a:lnum, col, 1), "name") =~ 'Comment\|Todo'
let max = col
else
let min = col + 1
endif
endwhile
let line = strpart(line, 0, min - 1)
endif
return substitute(line, "\s*$", "", "")
else
" Sorry, this is not complete, nor fully correct (e.g. string "//").
" Such is life.
return substitute(line, "\s*//.*$", "", "")
endif
endfunction
function! s:is_string_comment(lnum, col)
if has('syntax_items')
for id in synstack(a:lnum, a:col)
let synname = synIDattr(id, "name")
if synname == "rustString" || synname =~ "^rustComment"
return 1
endif
endfor
else
" without syntax, let's not even try
return 0
endif
endfunction
function GetRustIndent(lnum)
" Starting assumption: cindent (called at the end) will do it right
" normally. We just want to fix up a few cases.
let line = getline(a:lnum)
if has('syntax_items')
let synname = synIDattr(synID(a:lnum, 1, 1), "name")
if synname == "rustString"
" If the start of the line is in a string, don't change the indent
return -1
elseif synname =~ '\(Comment\|Todo\)'
\ && line !~ '^\s*/\*' " not /* opening line
if synname =~ "CommentML" " multi-line
if line !~ '^\s*\*' && getline(a:lnum - 1) =~ '^\s*/\*'
" This is (hopefully) the line after a /*, and it has no
" leader, so the correct indentation is that of the
" previous line.
return GetRustIndent(a:lnum - 1)
endif
endif
" If it's in a comment, let cindent take care of it now. This is
" for cases like "/*" where the next line should start " * ", not
" "* " as the code below would otherwise cause for module scope
" Fun fact: " /*\n*\n*/" takes two calls to get right!
return cindent(a:lnum)
endif
endif
" cindent gets second and subsequent match patterns/struct members wrong,
" as it treats the comma as indicating an unfinished statement::
"
" match a {
" b => c,
" d => e,
" f => g,
" };
" Search backwards for the previous non-empty line.
let prevlinenum = prevnonblank(a:lnum - 1)
let prevline = s:get_line_trimmed(prevlinenum)
while prevlinenum > 1 && prevline !~ '[^[:blank:]]'
let prevlinenum = prevnonblank(prevlinenum - 1)
let prevline = s:get_line_trimmed(prevlinenum)
endwhile
if prevline[len(prevline) - 1] == ","
\ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]'
\ && prevline !~ '^\s*fn\s'
\ && prevline !~ '([^()]\+,$'
" Oh ho! The previous line ended in a comma! I bet cindent will try to
" take this too far... For now, let's normally use the previous line's
" indent.
" One case where this doesn't work out is where *this* line contains
" square or curly brackets; then we normally *do* want to be indenting
" further.
"
" Another case where we don't want to is one like a function
" definition with arguments spread over multiple lines:
"
" fn foo(baz: Baz,
" baz: Baz) // <-- cindent gets this right by itself
"
" Another case is similar to the previous, except calling a function
" instead of defining it, or any conditional expression that leaves
" an open paren:
"
" foo(baz,
" baz);
"
" if baz && (foo ||
" bar) {
"
" There are probably other cases where we don't want to do this as
" well. Add them as needed.
return indent(prevlinenum)
endif
if !has("patch-7.4.355")
" cindent before 7.4.355 doesn't do the module scope well at all; e.g.::
"
" static FOO : &'static [bool] = [
" true,
" false,
" false,
" true,
" ];
"
" uh oh, next statement is indented further!
" Note that this does *not* apply the line continuation pattern properly;
" that's too hard to do correctly for my liking at present, so I'll just
" start with these two main cases (square brackets and not returning to
" column zero)
call cursor(a:lnum, 1)
if searchpair('{\|(', '', '}\|)', 'nbW',
\ 's:is_string_comment(line("."), col("."))') == 0
if searchpair('\[', '', '\]', 'nbW',
\ 's:is_string_comment(line("."), col("."))') == 0
" Global scope, should be zero
return 0
else
" At the module scope, inside square brackets only
"if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum
if line =~ "^\\s*]"
" It's the closing line, dedent it
return 0
else
return &shiftwidth
endif
endif
endif
endif
" Fall back on cindent, which does it mostly right
return cindent(a:lnum)
endfunction

View file

@ -0,0 +1,22 @@
" Vim syntastic plugin helper
" Language: Rust
" Maintainer: Andrew Gallant <jamslam@gmail.com>
if exists("g:loaded_syntastic_rust_filetype")
finish
endif
let g:loaded_syntastic_rust_filetype = 1
let s:save_cpo = &cpo
set cpo&vim
" This is to let Syntastic know about the Rust filetype.
" It enables tab completion for the 'SyntasticInfo' command.
" (This does not actually register the syntax checker.)
if exists('g:syntastic_extra_filetypes')
call add(g:syntastic_extra_filetypes, 'rust')
else
let g:syntastic_extra_filetypes = ['rust']
endif
let &cpo = s:save_cpo
unlet s:save_cpo

View file

@ -0,0 +1,262 @@
" Vim syntax file
" Language: Rust
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Last Change: January 5, 2015
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Syntax definitions {{{1
" Basic keywords {{{2
syn keyword rustConditional match if else
syn keyword rustOperator as
syn match rustAssert "\<assert\(\w\)*!" contained
syn match rustPanic "\<panic\(\w\)*!" contained
syn keyword rustKeyword break
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
syn keyword rustKeyword continue
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
syn keyword rustKeyword for in if impl let
syn keyword rustKeyword loop once pub
syn keyword rustKeyword return super
syn keyword rustKeyword unsafe virtual where while
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
" FIXME: Scoped impl's name is also fallen in this category
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
syn keyword rustStorage move mut ref static const
syn keyword rustInvalidBareKeyword crate
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty
" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.
syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained
syn keyword rustBoxPlacementExpr GC containedin=rustBoxPlacement
" Ideally we'd have syntax rules set up to match arbitrary expressions. Since
" we don't, we'll just define temporary contained rules to handle balancing
" delimiters.
syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlacement transparent
syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent
" {} are handled by rustFoldBraces
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount
syn match rustMacroRepeatCount ".\?[*+]" contained
syn match rustMacroVariable "$\w\+"
" Reserved (but not yet used) keywords {{{2
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override macro
" Built-in types {{{2
syn keyword rustType isize usize float char bool u8 u16 u32 u64 f32
syn keyword rustType f64 i8 i16 i32 i64 str Self
" Things from the prelude (src/libstd/prelude.rs) {{{2
" This section is just straight transformation of the contents of the prelude,
" to make it easy to update.
" Reexported core operators {{{3
syn keyword rustTrait Copy Send Sized Sync
syn keyword rustTrait Drop Fn FnMut FnOnce
" Reexported functions {{{3
syn keyword rustFunction drop
" Reexported types and traits {{{3
syn keyword rustTrait Box
syn keyword rustTrait CharExt
syn keyword rustTrait Clone
syn keyword rustTrait PartialEq PartialOrd Eq Ord
syn keyword rustTrait DoubleEndedIterator
syn keyword rustTrait ExactSizeIterator
syn keyword rustTrait Iterator IteratorExt Extend
syn keyword rustEnum Option
syn keyword rustEnumVariant Some None
syn keyword rustTrait PtrExt MutPtrExt
syn keyword rustEnum Result
syn keyword rustEnumVariant Ok Err
syn keyword rustTrait AsSlice
syn keyword rustTrait SliceExt SliceConcatExt
syn keyword rustTrait Str StrExt
syn keyword rustTrait String ToString
syn keyword rustTrait Vec
" FIXME: remove when path reform lands
syn keyword rustTrait Path GenericPath
" FIXME: remove when I/O reform lands
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
" Other syntax {{{2
syn keyword rustSelf self
syn keyword rustBoolean true false
" If foo::bar changes to foo.bar, change this ("::" to "\.").
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
syn match rustModPathSep "::"
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
" This is merely a convention; note also the use of [A-Z], restricting it to
" latin identifiers rather than the full Unicode uppercase. I have not used
" [:upper:] as it depends upon 'noignorecase'
"syn match rustCapsIdent display "[A-Z]\w\(\w\)*"
syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?"
" This one isn't *quite* right, as we could have binary-& with a reference
syn match rustSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1
syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
" This isn't actually correct; a closure with no arguments can be `|| { }`.
" Last, because the & in && isn't a sigil
syn match rustOperator display "&&\|||"
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
syn match rustEscapeError display contained /\\./
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/
syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/
syn match rustStringContinuation display contained /\\\n\s*/
syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive
syn region rustDerive start="derive(" end=")" contained contains=rustTrait
" Number literals
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(s\|8\|16\|32\|64\)\)\="
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
" Special case for numbers of the form "1." which are float literals, unless followed by
" an identifier, which makes them integer literals with a method call or field access,
" or by another ".", which makes them integer literals followed by the ".." token.
" (This must go first so the others take precedence.)
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
" a decimal point and more numbers; an exponent; and a type suffix.
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
" For the benefit of delimitMate
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell
syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent
syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent
" FIXME: this is a really ugly and not fully correct implementation. Most
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
" a comment, but in practice at present it leaves comments open two levels
" deep. But as long as you stay away from that particular case, I *believe*
" the highlighting is correct. Due to the way Vim's syntax engine works
" (greedy for start matches, unlike Rust's tokeniser which is searching for
" the earliest-starting match, start or end), I believe this cannot be solved.
" Oh you who would fix it, don't bother with things like duplicating the Block
" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as
" then you must deal with cases like ``/*/**/*/``. And don't try making it
" worse with ``\%(/\@<!\*\)\@<!``, either...
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
" Folding rules {{{2
" Trivial folding rules to begin with.
" FIXME: use the AST to make really good folding
syn region rustFoldBraces start="{" end="}" transparent fold
" Default highlighting {{{1
hi def link rustDecNumber rustNumber
hi def link rustHexNumber rustNumber
hi def link rustOctNumber rustNumber
hi def link rustBinNumber rustNumber
hi def link rustIdentifierPrime rustIdentifier
hi def link rustTrait rustType
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
hi def link rustMacroRepeatDelimiters Macro
hi def link rustMacroVariable Define
hi def link rustSigil StorageClass
hi def link rustEscape Special
hi def link rustEscapeUnicode rustEscape
hi def link rustEscapeError Error
hi def link rustStringContinuation Special
hi def link rustString String
hi def link rustCharacterInvalid Error
hi def link rustCharacterInvalidUnicode rustCharacterInvalid
hi def link rustCharacter Character
hi def link rustNumber Number
hi def link rustBoolean Boolean
hi def link rustEnum rustType
hi def link rustEnumVariant rustConstant
hi def link rustConstant Constant
hi def link rustSelf Constant
hi def link rustFloat Float
hi def link rustOperator Operator
hi def link rustKeyword Keyword
hi def link rustReservedKeyword Error
hi def link rustConditional Conditional
hi def link rustIdentifier Identifier
hi def link rustCapsIdent rustIdentifier
hi def link rustModPath Include
hi def link rustModPathSep Delimiter
hi def link rustFunction Function
hi def link rustFuncName Function
hi def link rustFuncCall Function
hi def link rustCommentLine Comment
hi def link rustCommentLineDoc SpecialComment
hi def link rustCommentBlock rustCommentLine
hi def link rustCommentBlockDoc rustCommentLineDoc
hi def link rustAssert PreCondit
hi def link rustPanic PreCondit
hi def link rustMacro Macro
hi def link rustType Type
hi def link rustTodo Todo
hi def link rustAttribute PreProc
hi def link rustDerive PreProc
hi def link rustStorage StorageClass
hi def link rustObsoleteStorage Error
hi def link rustLifetime Special
hi def link rustInvalidBareKeyword Error
hi def link rustExternCrate rustKeyword
hi def link rustObsoleteExternMod Error
hi def link rustBoxPlacementParens Delimiter
hi def link rustBoxPlacementExpr rustKeyword
" Other Suggestions:
" hi rustAttribute ctermfg=cyan
" hi rustDerive ctermfg=cyan
" hi rustAssert ctermfg=yellow
" hi rustPanic ctermfg=red
" hi rustMacro ctermfg=magenta
syn sync minlines=200
syn sync maxlines=500
let b:current_syntax = "rust"

View file

@ -0,0 +1,35 @@
" Vim syntastic plugin
" Language: Rust
" Maintainer: Andrew Gallant <jamslam@gmail.com>
"
" See for details on how to add an external Syntastic checker:
" https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide#external
if exists("g:loaded_syntastic_rust_rustc_checker")
finish
endif
let g:loaded_syntastic_rust_rustc_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_rust_rustc_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args': '-Zparse-only' })
let errorformat =
\ '%E%f:%l:%c: %\d%#:%\d%# %.%\{-}error:%.%\{-} %m,' .
\ '%W%f:%l:%c: %\d%#:%\d%# %.%\{-}warning:%.%\{-} %m,' .
\ '%C%f:%l %m,' .
\ '%-Z%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'rust',
\ 'name': 'rustc'})
let &cpo = s:save_cpo
unlet s:save_cpo

View file

@ -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)

View file

@ -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 = []

View file

@ -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'))

View file

@ -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*

View file

@ -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

View file

@ -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'],

View file

@ -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,

View file

@ -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'

View file

@ -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 =

View file

@ -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'

View file

@ -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({

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,23 @@
"============================================================================
"File: stylelint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: LCD 47 <lcd047 at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_scss_stylelint_checker')
finish
endif
let g:loaded_syntastic_scss_stylelint_checker = 1
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'scss',
\ 'name': 'stylelint',
\ 'redirect': 'css/stylelint'})
" vim: set sw=4 sts=4 et fdm=marker:

View file

@ -0,0 +1,52 @@
"============================================================================
"File: yamllint.vim
"Description: YAML files linting for syntastic.vim
"Maintainer: Adrien Vergé
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
if exists('g:loaded_syntastic_yaml_yamllint_checker')
finish
endif
let g:loaded_syntastic_yaml_yamllint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_yaml_yamllint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-f parsable' })
let errorformat =
\ '%f:%l:%c: [%trror] %m,' .
\ '%f:%l:%c: [%tarning] %m'
let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'env': env,
\ 'returns': [0, 1] })
for e in loclist
if e['type'] ==? 'W'
let e['subtype'] = 'Style'
endif
endfor
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'yaml',
\ 'name': 'yamllint' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

View file

@ -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

View file

@ -0,0 +1,104 @@
# Change Log
This is the Changelog for the vim-airline project.
## [Unreleased]
- Changes
- Themes have been moved into an extra repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
- Many new themes
- Airline Moved to new [repository](https://github.com/vim-airline/vim-airline)
- New features
- Integration with [taboo](https://github.com/gcmt/taboo.vim), [vim-ctrlspace](https://github.com/szw/vim-ctrlspace),
[quickfixsigns](https://github.com/tomtom/quickfixsigns_vim), [YouCompleteMe](https://github.com/Valloric/YouCompleteMe)
- Support for Neovim
- Added wordcount extension
- Adding Crypt and Byte Order Mark Indicator
## [0.7] - 2014-12-10
- New features
- accents support; allowing multiple colors/styles in the same section
- extensions: eclim
- themes: understated, monochrome, murmur, sol, lucius
- Improvements
- solarized theme; support for 8 color terminals
- tabline resizes dynamically based on number of open buffers
- miscellaneous bug fixes
## [0.6] - 2013-10-08
- New features
- accents support; allowing multiple colors/styles in the same section
- extensions: eclim
- themes: understated, monochrome, murmur, sol, lucius
- Improvements
- solarized theme; support for 8 color terminals
- tabline resizes dynamically based on number of open buffers
- miscellaneous bug fixes
## [0.5] - 2013-09-13
- New features
- smart tabline extension which displays all buffers when only one tab is visible
- automatic section truncation when the window resizes
- support for a declarative style of configuration, allowing parts to contain metadata such as minimum window width or conditional visibility
- themes: zenburn, serene
- Other
- a sizable chunk of vim-airline is now running through a unit testing suite, automated via Travis CI
## [0.4] - 2013-08-26
- New features
- integration with csv.vim and vim-virtualenv
- hunks extension for vim-gitgutter and vim-signify
- automatic theme switching with matching colorschemes
- commands: AirlineToggle
- themes: base16 (all variants)
- Improvements
- integration with undotree, tagbar, and unite
- Other
- refactored core and exposed statusline builder and pipeline
- all extension related g:airline_variables have been deprecated in favor of g:airline#extensions# variables
- extensions found in the runtimepath outside of the default distribution will be automatically loaded
## [0.3] - 2013-08-12
- New features
- first-class integration with tagbar
- white space detection for trailing spaces and mixed indentation
- introduced warning section for syntastic and white space detection
- improved ctrlp integration: colors are automatically selected based on the current airline theme
- new themes: molokai, bubblegum, jellybeans, tomorrow
- Bug fixes
- improved handling of eventignore used by other plugins
- Other
- code cleaned up for clearer separation between core functionality and extensions
- introduced color extraction from highlight groups, allowing themes to be generated off of the active colorscheme (e.g. jellybeans and tomorrow)
- License changed to MIT
## [0.2] - 2013-07-28
- New features
- iminsert detection
- integration with vimshell, vimfiler, commandt, lawrencium
- enhanced bufferline theming
- support for ctrlp theming
- support for custom window excludes
- New themes
- luna and wombat
- Bug fixes
- refresh branch name after switching with a shell command
## [0.1] - 2013-07-17
- Initial release
- integration with other plugins: netrw, unite, nerdtree, undotree, gundo, tagbar, minibufexplr, ctrlp
- support for themes: 8 included
[Unreleased]: https://github.com/vim-airline/vim-airline/compare/v0.7...HEAD
[0.7]: https://github.com/vim-airline/vim-airline/compare/v0.6...v0.7
[0.6]: https://github.com/vim-airline/vim-airline/compare/v0.5...v0.6
[0.5]: https://github.com/vim-airline/vim-airline/compare/v0.4...v0.5
[0.4]: https://github.com/vim-airline/vim-airline/compare/v0.3...v0.4
[0.3]: https://github.com/vim-airline/vim-airline/compare/v0.2...v0.3
[0.2]: https://github.com/vim-airline/vim-airline/compare/v0.1...v0.2
[0.1]: https://github.com/vim-airline/vim-airline/releases/tag/v0.1

View file

@ -0,0 +1,32 @@
# 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.
# Bugs
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:
* Reproduce it with this [minivimrc][7] repository to rule out any configuration conflicts. Even better, create a `gist` of your vimrc that is compatible with [pathogen][11].
* And to make it easier to reproduce, please supply the following:
* the `:version` of vim
* the commit of vim-airline you're using
* the OS that you're using, including terminal emulator, GUI vs non-GUI
# 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.
# Maintenance
If you would like to take a more active role in improving vim-airline, please consider [becoming a maintainer][43].
[7]: https://github.com/bling/minivimrc
[11]: https://github.com/tpope/vim-pathogen
[14]: https://github.com/vim-airline/vim-airline/wiki/Screenshots
[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer

View file

@ -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"),

View file

@ -1,8 +1,8 @@
# vim-airline [![Build Status](https://travis-ci.org/bling/vim-airline.png)](https://travis-ci.org/bling/vim-airline)
# vim-airline [![Build Status](https://travis-ci.org/vim-airline/vim-airline.png)](https://travis-ci.org/vim-airline/vim-airline)
Lean &amp; mean status/tabline for vim that's light as air.
![img](https://github.com/bling/vim-airline/wiki/screenshots/demo.gif)
![img](https://github.com/vim-airline/vim-airline/wiki/screenshots/demo.gif)
# Features
@ -15,7 +15,8 @@ Lean &amp; 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
![image](https://f.cloud.github.com/assets/306502/1009429/d69306da-0b38-11e3-94bf-7c6e3eef41e9.png)
## 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]
![airline-promptline-sc](https://f.cloud.github.com/assets/1532071/1871900/7d4b28a0-789d-11e3-90e4-16f37269981b.gif)
#### [ctrlspace][38]
![papercolor_with_ctrlspace](https://cloud.githubusercontent.com/assets/493242/12912041/7fc3c6ec-cf16-11e5-8775-8492b9c64ebf.png)
## 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
![image](https://f.cloud.github.com/assets/306502/1073278/f291dd4c-14a3-11e3-8a83-268e2753f97d.png)
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)).
![image](https://f.cloud.github.com/assets/306502/1195815/4bfa38d0-249d-11e3-823e-773cfc2ca894.png)
@ -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.
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/bling/vim-airline/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/vim-airline/vim-airline/trend.png)](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

View file

@ -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

View file

@ -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]

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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')

View file

@ -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)

View file

@ -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')

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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')

View file

@ -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

View file

@ -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()

View file

@ -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')

View file

@ -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)

View file

@ -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')

View file

@ -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'

View file

@ -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')

View file

@ -1,15 +1,16 @@
" 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:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
let s:ignore_bufadd_pat = get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree')
let s:taboo = get(g:, 'airline#extensions#taboo#enabled', 1) && get(g:, 'loaded_taboo', 0)
if s:taboo
let g:taboo_tabline = 0
endif
let s:ctrlspace = get(g:, 'CtrlSpaceLoaded', 0)
function! airline#extensions#tabline#init(ext)
if has('gui_running')
@ -27,31 +28,60 @@ function! s:toggle_off()
call airline#extensions#tabline#autoshow#off()
call airline#extensions#tabline#tabs#off()
call airline#extensions#tabline#buffers#off()
call airline#extensions#tabline#ctrlspace#off()
endfunction
function! s:toggle_on()
call airline#extensions#tabline#autoshow#on()
call airline#extensions#tabline#tabs#on()
call airline#extensions#tabline#buffers#on()
call airline#extensions#tabline#ctrlspace#on()
set tabline=%!airline#extensions#tabline#get()
endfunction
function! s:update_tabline()
let match = expand('<afile>')
if pumvisible()
return
elseif !get(g:, 'airline#extensions#tabline#enabled', 0)
return
" return, if buffer matches ignore pattern or is directory (netrw)
elseif empty(match)
\ || match(match, s:ignore_bufadd_pat) > -1
\ || isdirectory(expand("<afile>"))
return
endif
if empty(mapcheck("<Plug>AirlineTablineRefresh", 'n'))
noremap <silent> <Plug>AirlineTablineRefresh :set mod!<cr>
endif
call feedkeys("\<Plug>AirlineTablineRefresh")
call feedkeys("\<Plug>AirlineTablineRefresh")
"call feedkeys(',,', 't')
"call feedkeys(':unmap ,,')
" force re-evaluation of tabline setting
" disable explicit redraw, may cause E315
"redraw
endfunction
function! airline#extensions#tabline#load_theme(palette)
if pumvisible()
return
endif
let colors = get(a:palette, 'tabline', {})
" Theme for tabs on the left
let l:tab = get(colors, 'airline_tab', a:palette.normal.airline_b)
let l:tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
let l:tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
let l:tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
let l:tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c)
else
"Fall back to normal airline_c if modified airline_c isn't present
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
endif
let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
call airline#highlighter#exec('airline_tab', l:tab)
call airline#highlighter#exec('airline_tabsel', l:tabsel)
call airline#highlighter#exec('airline_tabtype', l:tabtype)
@ -59,6 +89,21 @@ function! airline#extensions#tabline#load_theme(palette)
call airline#highlighter#exec('airline_tabmod', l:tabmod)
call airline#highlighter#exec('airline_tabmod_unsel', l:tabmodu)
call airline#highlighter#exec('airline_tabhid', l:tabhid)
" Theme for tabs on the right
let l:tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a)
let l:tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a)
let l:tabhid_right = get(colors, 'airline_tabhid_right', a:palette.normal.airline_c)
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
let l:tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal_modified.airline_c)
else
"Fall back to normal airline_c if modified airline_c isn't present
let l:tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c)
endif
call airline#highlighter#exec('airline_tabsel_right', l:tabsel_right)
call airline#highlighter#exec('airline_tabmod_right', l:tabmod_right)
call airline#highlighter#exec('airline_tabhid_right', l:tabhid_right)
call airline#highlighter#exec('airline_tabmod_unsel_right', l:tabmodu_right)
endfunction
let s:current_tabcnt = -1
@ -68,9 +113,15 @@ function! airline#extensions#tabline#get()
let s:current_tabcnt = curtabcnt
call airline#extensions#tabline#tabs#invalidate()
call airline#extensions#tabline#buffers#invalidate()
call airline#extensions#tabline#ctrlspace#invalidate()
endif
if s:show_buffers && curtabcnt == 1 || !s:show_tabs
if !exists('#airline#BufAdd#*')
autocmd airline BufAdd * call <sid>update_tabline()
endif
if s:ctrlspace
return airline#extensions#tabline#ctrlspace#get()
elseif s:show_buffers && curtabcnt == 1 || !s:show_tabs
return airline#extensions#tabline#buffers#get()
else
return airline#extensions#tabline#tabs#get()

View file

@ -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:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
@ -22,7 +22,9 @@ function! airline#extensions#tabline#autoshow#on()
augroup airline_tabline_autoshow
autocmd!
if s:buf_min_count <= 0 && s:tab_min_count <= 1
set showtabline=2
if &lines > 3
set showtabline=2
endif
else
if s:show_buffers == 1
autocmd BufEnter * call <sid>show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()))
@ -40,7 +42,7 @@ endfunction
function! s:show_tabline(min_count, total_count)
if a:total_count >= a:min_count
if &showtabline != 2
if &showtabline != 2 && &lines > 3
set showtabline=2
endif
else

View file

@ -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
scriptencoding utf-8
@ -37,6 +37,8 @@ function! airline#extensions#tabline#buffers#on()
augroup airline_tabline_buffers
autocmd!
autocmd BufDelete * call airline#extensions#tabline#buffers#invalidate()
autocmd User BufMRUChange call airline#extensions#tabline#buflist#invalidate()
autocmd User BufMRUChange call airline#extensions#tabline#buffers#invalidate()
augroup END
endfunction
@ -45,6 +47,7 @@ function! airline#extensions#tabline#buffers#invalidate()
endfunction
function! airline#extensions#tabline#buffers#get()
call <sid>map_keys()
let cur = bufnr('%')
if cur == s:current_bufnr
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
@ -180,16 +183,18 @@ function! s:jump_to_tab(offset)
endif
endfunction
if s:buffer_idx_mode
noremap <unique> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
noremap <unique> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
noremap <unique> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
noremap <unique> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
noremap <unique> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
noremap <unique> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
noremap <unique> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
noremap <unique> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
noremap <unique> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
noremap <unique> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
noremap <unique> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
endif
function s:map_keys()
if s:buffer_idx_mode
noremap <silent> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
noremap <silent> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
noremap <silent> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
noremap <silent> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
noremap <silent> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
noremap <silent> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
noremap <silent> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
noremap <silent> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
noremap <silent> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
endif
endfunction

View file

@ -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:excludes = get(g:, 'airline#extensions#tabline#excludes', [])
@ -13,26 +13,26 @@ function! airline#extensions#tabline#buflist#list()
return s:current_buffer_list
endif
let list = (exists('g:did_bufmru') && g:did_bufmru) ? BufMRUList() : range(1, bufnr("$"))
let buffers = []
let cur = bufnr('%')
for nr in range(1, bufnr('$'))
if buflisted(nr) && bufexists(nr)
let toadd = 1
for ex in s:excludes
if match(bufname(nr), ex) >= 0
let toadd = 0
break
endif
endfor
if getbufvar(nr, 'current_syntax') == 'qf'
let toadd = 0
endif
if s:exclude_preview && getbufvar(nr, '&bufhidden') == 'wipe' && getbufvar(nr, '&buftype') == 'nofile'
let toadd = 0
endif
if toadd
call add(buffers, nr)
" If this is too slow, we can switch to a different algorithm.
" Basically branch 535 already does it, but since it relies on
" BufAdd autocommand, I'd like to avoid this if possible.
for nr in list
if buflisted(nr)
" Do not add to the bufferlist, if either
" 1) buffername matches exclude pattern
" 2) buffer is a quickfix buffer
" 3) exclude preview windows (if 'bufhidden' == wipe
" and 'buftype' == nofile
if (!empty(s:excludes) && match(bufname(nr), join(s:excludes, '\|')) > -1) ||
\ (getbufvar(nr, 'current_syntax') == 'qf') ||
\ (s:exclude_preview && getbufvar(nr, '&bufhidden') == 'wipe'
\ && getbufvar(nr, '&buftype') == 'nofile')
continue
endif
call add(buffers, nr)
endif
endfor

View file

@ -0,0 +1,97 @@
" MIT License. Copyright (c) 2016 Kevin Sapper
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
let s:current_bufnr = -1
let s:current_tabnr = -1
let s:current_tabline = ''
function! airline#extensions#tabline#ctrlspace#off()
augroup airline_tabline_ctrlspace
autocmd!
augroup END
endfunction
function! airline#extensions#tabline#ctrlspace#on()
augroup airline_tabline_ctrlspace
autocmd!
autocmd BufDelete * call airline#extensions#tabline#ctrlspace#invalidate()
augroup END
endfunction
function! airline#extensions#tabline#ctrlspace#invalidate()
let s:current_bufnr = -1
let s:current_tabnr = -1
endfunction
function! airline#extensions#tabline#ctrlspace#get()
let cur_buf = bufnr('%')
let s:tab_list = ctrlspace#api#TabList()
for tab in s:tab_list
if tab.current
let cur_tab = tab.index
endif
endfor
if cur_buf == s:current_bufnr && cur_tab == s:current_tabnr
return s:current_tabline
endif
let b = airline#extensions#tabline#new_builder()
call b.add_section_spaced('airline_tabtype', 'buffers')
let s:buffer_list = ctrlspace#api#BufferList(cur_tab)
for buffer in s:buffer_list
if cur_buf == buffer.index
if buffer.modified
let group = 'airline_tabmod'
else
let group = 'airline_tabsel'
endif
else
if buffer.modified
let group = 'airline_tabmod_unsel'
elseif buffer.visible
let group = 'airline_tab'
else
let group = 'airline_tabhid'
endif
endif
let buf_name = '%(%{airline#extensions#tabline#get_buffer_name('.buffer.index.')}%)'
call b.add_section_spaced(group, buf_name)
endfor
call b.add_section('airline_tabfill', '')
call b.split()
call b.add_section('airline_tabfill', '')
for tab in s:tab_list
if tab.current
if tab.modified
let group = 'airline_tabmod_right'
else
let group = 'airline_tabsel_right'
endif
else
if tab.modified
let group = 'airline_tabmod_unsel_right'
else
let group = 'airline_tabhid_right'
endif
endif
call b.add_section_spaced(group, tab.title.ctrlspace#api#TabBuffersNumber(tab.index))
endfor
call b.add_section_spaced('airline_tabtype', 'tabs')
let s:current_bufnr = cur_buf
let s:current_tabnr = cur_tab
let s:current_tabline = b.build()
return s:current_tabline
endfunction

View file

@ -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:fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')

View file

@ -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#extensions#tabline#formatters#unique_tail#format(bufnr, buffers)

View file

@ -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
scriptencoding utf-8

View file

@ -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:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
@ -31,6 +31,7 @@ endfunction
function! airline#extensions#tabline#tabs#get()
let curbuf = bufnr('%')
let curtab = tabpagenr()
call s:map_keys()
if curbuf == s:current_bufnr && curtab == s:current_tabnr
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified
return s:current_tabline
@ -80,3 +81,18 @@ function! airline#extensions#tabline#tabs#get()
let s:current_tabline = b.build()
return s:current_tabline
endfunction
function s:map_keys()
noremap <silent> <Plug>AirlineSelectTab1 :1tabn<CR>
noremap <silent> <Plug>AirlineSelectTab2 :2tabn<CR>
noremap <silent> <Plug>AirlineSelectTab3 :3tabn<CR>
noremap <silent> <Plug>AirlineSelectTab4 :4tabn<CR>
noremap <silent> <Plug>AirlineSelectTab5 :5tabn<CR>
noremap <silent> <Plug>AirlineSelectTab6 :6tabn<CR>
noremap <silent> <Plug>AirlineSelectTab7 :7tabn<CR>
noremap <silent> <Plug>AirlineSelectTab8 :8tabn<CR>
noremap <silent> <Plug>AirlineSelectTab9 :9tabn<CR>
noremap <silent> <Plug>AirlineSelectPrevTab gT
" tabn {count} goes to count tab does not go {count} tab pages forward!
noremap <silent> <Plug>AirlineSelectNextTab :<C-U>exe repeat(':tabn\|', v:count1)<cr>
endfunction

View file

@ -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(':TagbarToggle')

View file

@ -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(':Tmuxline')

View file

@ -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(':UndotreeToggle')

View file

@ -0,0 +1,22 @@
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !get(g:, 'loaded_unicodePlugin', 0)
finish
endif
function! airline#extensions#unicode#apply(...)
if exists(":UnicodeTable") == 2 && bufname('') ==# 'UnicodeTable'
call airline#parts#define('unicode', {
\ 'text': '[UnicodeTable]',
\ 'accent': 'bold' })
let w:airline_section_a = airline#section#create(['unicode'])
let w:airline_section_b = ''
let w:airline_section_c = ''
let w:airline_section_y = ''
endif
endfunction
function! airline#extensions#unicode#init(ext)
call a:ext.add_statusline_func('airline#extensions#unicode#apply')
endfunction

View file

@ -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_unite', 0)

View file

@ -1,10 +1,6 @@
" 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 !isdirectory($VIRTUAL_ENV)
finish
endif
let s:spc = g:airline_symbols.space
function! airline#extensions#virtualenv#init(ext)
@ -12,14 +8,22 @@ function! airline#extensions#virtualenv#init(ext)
endfunction
function! airline#extensions#virtualenv#apply(...)
if &filetype =~ "python"
if &filetype =~# "python"
if get(g:, 'virtualenv_loaded', 0)
let statusline = virtualenv#statusline()
else
let statusline = fnamemodify($VIRTUAL_ENV, ':t')
endif
call airline#extensions#append_to_section('x',
\ s:spc.g:airline_right_alt_sep.s:spc.statusline)
if !empty(statusline)
call airline#extensions#append_to_section('x',
\ s:spc.g:airline_right_alt_sep.s:spc.statusline)
endif
endif
endfunction
function! airline#extensions#virtualenv#update()
if &filetype =~# "python"
call airline#extensions#virtualenv#apply()
call airline#update_statusline()
endif
endfunction

View file

@ -1,22 +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
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
" for backwards compatibility
if exists('g:airline_detect_whitespace')
let s:show_message = g:airline_detect_whitespace == 1
else
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
endif
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)
let s:default_checks = ['indent', 'trailing']
let s:default_checks = ['indent', 'trailing', 'mixed-indent-file']
let s:trailing_format = get(g:, 'airline#extensions#whitespace#trailing_format', 'trailing[%s]')
let s:mixed_indent_format = get(g:, 'airline#extensions#whitespace#mixed_indent_format', 'mixed-indent[%s]')
let s:long_format = get(g:, 'airline#extensions#whitespace#long_format', 'long[%s]')
let s:mixed_indent_file_format = get(g:, 'airline#extensions#whitespace#mixed_indent_file_format', 'mix-indent-file[%s]')
let s:indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file'] }
let s:max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
@ -38,6 +34,16 @@ function! s:check_mixed_indent()
endif
endfunction
function! s:check_mixed_indent_file()
let indent_tabs = search('\v(^\t+)', 'nw')
let indent_spc = search('\v(^ +)', 'nw')
if indent_tabs > 0 && indent_spc > 0
return printf("%d:%d", indent_tabs, indent_spc)
else
return ''
endif
endfunction
function! airline#extensions#whitespace#check()
if &readonly || !&modifiable || !s:enabled || line('$') > s:max_lines
return ''
@ -49,20 +55,34 @@ function! airline#extensions#whitespace#check()
let trailing = 0
if index(checks, 'trailing') > -1
let trailing = search('\s$', 'nw')
try
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
let trailing = search(regexp, 'nw')
catch
echomsg 'airline#whitespace: error occured evaluating '. regexp
echomsg v:exception
return ''
endtry
endif
let mixed = 0
if index(checks, 'indent') > -1
let check = 'indent'
if index(checks, check) > -1 && index(get(s:skip_check_ft, &ft, []), check) < 0
let mixed = s:check_mixed_indent()
endif
let mixed_file = ''
let check = 'mixed-indent-file'
if index(checks, check) > -1 && index(get(s:skip_check_ft, &ft, []), check) < 0
let mixed_file = s:check_mixed_indent_file()
endif
let long = 0
if index(checks, 'long') > -1 && &tw > 0
let long = search('\%>'.&tw.'v.\+', 'nw')
endif
if trailing != 0 || mixed != 0 || long != 0
if trailing != 0 || mixed != 0 || long != 0 || !empty(mixed_file)
let b:airline_whitespace_check = s:symbol
if s:show_message
if trailing != 0
@ -74,6 +94,9 @@ function! airline#extensions#whitespace#check()
if long != 0
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:long_format, long)
endif
if !empty(mixed_file)
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_file_format, mixed_file)
endif
endif
endif
endif

View file

@ -1,33 +1,26 @@
" 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:filetypes = get(g:, 'airline#extensions#wordcount#filetypes', '\vhelp|markdown|rst|org')
let s:filetypes = get(g:, 'airline#extensions#wordcount#filetypes', '\vhelp|markdown|rst|org|text')
let s:format = get(g:, 'airline#extensions#wordcount#format', '%d words')
let s:formatter = get(g:, 'airline#extensions#wordcount#formatter', 'default')
" adapted from http://stackoverflow.com/questions/114431/fast-word-count-function-in-vim
function! s:update()
if &ft !~ s:filetypes
unlet! b:airline_wordcount
return
elseif mode() =~? 's'
" Bail on select mode
return
endif
let old_status = v:statusmsg
let position = getpos(".")
exe "silent normal! g\<c-g>"
let stat = v:statusmsg
call setpos('.', position)
let v:statusmsg = old_status
let parts = split(stat)
if len(parts) > 11
let cnt = str2nr(split(stat)[11])
let spc = g:airline_symbols.space
let b:airline_wordcount = printf(s:format, cnt) . spc . g:airline_right_alt_sep . spc
else
unlet! b:airline_wordcount
if match(&ft, s:filetypes) > -1
let l:mode = mode()
if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S'
let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format()
let b:airline_change_tick = b:changedtick
else
if get(b:, 'airline_wordcount_cache', '') is# '' ||
\ b:airline_wordcount_cache isnot# get(b:, 'airline_wordcount', '') ||
\ get(b:, 'airline_change_tick', 0) != b:changedtick
" cache data
let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format()
let b:airline_wordcount_cache = b:airline_wordcount
let b:airline_change_tick = b:changedtick
endif
endif
endif
endfunction
@ -41,4 +34,3 @@ function! airline#extensions#wordcount#init(ext)
call a:ext.add_statusline_func('airline#extensions#wordcount#apply')
autocmd BufReadPost,CursorMoved,CursorMovedI * call s:update()
endfunction

View file

@ -0,0 +1,58 @@
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
function! airline#extensions#wordcount#formatters#default#format()
let words = string(s:wordcount())
if empty(words)
return
endif
let separator = s:get_decimal_group()
if words > 999 && !empty(separator)
" Format number according to locale, e.g. German: 1.245 or English: 1,245
let a = join(reverse(split(words, '.\zs')),'')
let a = substitute(a, '...', '&'.separator, 'g')
let words = join(reverse(split(a, '.\zs')),'')
endif
return words . " words" . g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
endfunction
function! s:wordcount()
if exists("*wordcount")
let l:mode = mode()
if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S'
let l:visual_words = wordcount()['visual_words']
if l:visual_words != ''
return l:visual_words
else
return 0
endif
else
return wordcount()['words']
endif
elseif mode() =~? 's'
return
else
let old_status = v:statusmsg
let position = getpos(".")
exe "silent normal! g\<c-g>"
let stat = v:statusmsg
call setpos('.', position)
let v:statusmsg = old_status
let parts = split(stat)
if len(parts) > 11
return str2nr(parts[11])
else
return
endif
endif
endfunction
function s:get_decimal_group()
if match(v:lang, '\v\cC|en') > -1
return ','
elseif match(v:lang, '\v\cde|dk|fr|pt') > -1
return '.'
endif
return ''
endfunction

View file

@ -0,0 +1,36 @@
" MIT License. Copyright (c) 2015 Evgeny Firsov.
" vim: et ts=2 sts=2 sw=2
let s:spc = g:airline_symbols.space
let s:error_symbol = get(g:, 'airline#extensions#ycm#error_symbol', 'E:')
let s:warning_symbol = get(g:, 'airline#extensions#ycm#warning_symbol', 'W:')
function! airline#extensions#ycm#init(ext)
call airline#parts#define_function('ycm_error_count', 'airline#extensions#ycm#get_error_count')
call airline#parts#define_function('ycm_warning_count', 'airline#extensions#ycm#get_warning_count')
endfunction
function! airline#extensions#ycm#get_error_count()
if exists(':YcmDiag')
let cnt = youcompleteme#GetErrorCount()
if cnt != 0
return s:error_symbol.cnt
endif
endif
return ''
endfunction
function! airline#extensions#ycm#get_warning_count()
if exists(':YcmDiag')
let cnt = youcompleteme#GetWarningCount()
if cnt != 0
return s:warning_symbol.cnt.s:spc
endif
endif
return ''
endfunction

View file

@ -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:is_win32term = (has('win32') || has('win64')) && !has('gui_running') && (empty($CONEMUBUILD) || &term !=? 'xterm')
@ -9,25 +9,23 @@ let s:accents = {}
function! s:gui2cui(rgb, fallback)
if a:rgb == ''
return a:fallback
elseif match(a:rgb, '^\%(NONE\|[fb]g\)$') > -1
return a:rgb
endif
let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
let rgb = [rgb[0] > 127 ? 4 : 0, rgb[1] > 127 ? 2 : 0, rgb[2] > 127 ? 1 : 0]
return rgb[0]+rgb[1]+rgb[2]
let rgb = map(split(a:rgb[1:], '..\zs'), '0 + ("0x".v:val)')
return airline#msdos#round_msdos_colors(rgb)
endfunction
function! s:get_syn(group, what)
" need to pass in mode, known to break on 7.3.547
let mode = has('gui_running') || (has("termtruecolor") && &guicolors == 1) ? 'gui' : 'cterm'
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode)
if !exists("g:airline_gui_mode")
let g:airline_gui_mode = airline#init#gui_mode()
endif
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode)
if empty(color) || color == -1
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode)
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode)
endif
if empty(color) || color == -1
if has('gui_running') || (has("termtruecolor") && &guicolors == 1)
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
else
let color = a:what ==# 'fg' ? 0 : 1
endif
let color = 'NONE'
endif
return color
endfunction
@ -35,7 +33,7 @@ endfunction
function! s:get_array(fg, bg, opts)
let fg = a:fg
let bg = a:bg
return has('gui_running') || (has("termtruecolor") && &guicolors == 1)
return g:airline_gui_mode ==# 'gui'
\ ? [ fg, bg, '', '', join(a:opts, ',') ]
\ : [ '', '', fg, bg, join(a:opts, ',') ]
endfunction
@ -43,7 +41,7 @@ endfunction
function! airline#highlighter#get_highlight(group, ...)
let fg = s:get_syn(a:group, 'fg')
let bg = s:get_syn(a:group, 'bg')
let reverse = has('gui_running') || (has("termtruecolor") && &guicolors == 1)
let reverse = g:airline_gui_mode ==# 'gui'
\ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui')
\ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')
\|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
@ -57,23 +55,40 @@ function! airline#highlighter#get_highlight2(fg, bg, ...)
endfunction
function! airline#highlighter#exec(group, colors)
if pumvisible()
return
endif
let colors = a:colors
if s:is_win32term
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
endif
exec printf('hi %s %s %s %s %s %s %s %s',
\ a:group,
\ get(colors, 0, '') != '' ? 'guifg='.colors[0] : '',
\ get(colors, 1, '') != '' ? 'guibg='.colors[1] : '',
\ get(colors, 2, '') != '' ? 'ctermfg='.colors[2] : '',
\ get(colors, 3, '') != '' ? 'ctermbg='.colors[3] : '',
\ get(colors, 4, '') != '' ? 'gui='.colors[4] : '',
\ get(colors, 4, '') != '' ? 'cterm='.colors[4] : '',
\ get(colors, 4, '') != '' ? 'term='.colors[4] : '')
let cmd= printf('hi %s %s %s %s %s %s %s %s',
\ a:group, s:Get(colors, 0, 'guifg=', ''), s:Get(colors, 1, 'guibg=', ''),
\ s:Get(colors, 2, 'ctermfg=', ''), s:Get(colors, 3, 'ctermbg=', ''),
\ s:Get(colors, 4, 'gui=', ''), s:Get(colors, 4, 'cterm=', ''),
\ s:Get(colors, 4, 'term=', ''))
let old_hi = airline#highlighter#get_highlight(a:group)
if len(colors) == 4
call add(colors, '')
endif
if old_hi != colors
exe cmd
endif
endfunction
function! s:Get(dict, key, prefix, default)
if get(a:dict, a:key, a:default) isnot# a:default
return a:prefix. get(a:dict, a:key)
else
return ''
endif
endfunction
function! s:exec_separator(dict, from, to, inverse, suffix)
if pumvisible()
return
endif
let l:from = airline#themes#get_highlight(a:from.a:suffix)
let l:to = airline#themes#get_highlight(a:to.a:suffix)
let group = a:from.'_to_'.a:to.a:suffix
@ -87,6 +102,9 @@ function! s:exec_separator(dict, from, to, inverse, suffix)
endfunction
function! airline#highlighter#load_theme()
if pumvisible()
return
endif
for winnr in filter(range(1, winnr('$')), 'v:val != winnr()')
call airline#highlighter#highlight_modified_inactive(winbufnr(winnr))
endfor

View file

@ -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, {
@ -56,11 +57,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)),
@ -80,14 +82,23 @@ function! airline#init#bootstrap()
\ })
call airline#parts#define_raw('file', '%f%m')
call airline#parts#define_raw('path', '%F%m')
call airline#parts#define_raw('linenr', '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#')
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')
@ -97,7 +108,7 @@ function! airline#init#sections()
let g:airline_section_b = airline#section#create(['hunks', 'branch'])
endif
if !exists('g:airline_section_c')
if &autochdir == 1
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'])
@ -115,8 +126,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

View file

@ -0,0 +1,57 @@
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
" basic 16 msdos from MSDOS
" see output of color, should be
" 0 Black
" 1 DarkBlue
" 2 DarkGreen
" 3 DarkCyan
" 4 DarkRed
" 5 DarkMagenta
" 6 Brown
" 7 LightGray
" 8 DarkGray
" 9 Blue
" 10 Green
" 11 Cyan
" 12 Red
" 13 Magenta
" 14 Yellow
" 15 White
let s:basic16 = [
\ [ 0x00, 0x00, 0x00 ],
\ [ 0x00, 0x00, 0x80 ],
\ [ 0x00, 0x80, 0x00 ],
\ [ 0x00, 0x80, 0x80 ],
\ [ 0x80, 0x00, 0x00 ],
\ [ 0x80, 0x00, 0x80 ],
\ [ 0x80, 0x80, 0x00 ],
\ [ 0xC0, 0xC0, 0xC0 ],
\ [ 0x80, 0x80, 0x80 ],
\ [ 0x00, 0x00, 0xFF ],
\ [ 0x00, 0xFF, 0x00 ],
\ [ 0x00, 0xFF, 0xFF ],
\ [ 0xFF, 0x00, 0x00 ],
\ [ 0xFF, 0x00, 0xFF ],
\ [ 0xFF, 0xFF, 0x00 ],
\ [ 0xFF, 0xFF, 0xFF ]
\ ]
function! airline#msdos#round_msdos_colors(rgblist)
" Check for values from MSDOS 16 color terminal
let best = []
let min = 100000
let list = s:basic16
for value in list
let t = abs(value[0] - a:rgblist[0]) +
\ abs(value[1] - a:rgblist[1]) +
\ abs(value[2] - a:rgblist[2])
if min > t
let min = t
let best = value
endif
endfor
return index(s:basic16, best)
endfunction

View file

@ -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:parts = {}
@ -78,6 +78,6 @@ function! airline#parts#filetype()
endfunction
function! airline#parts#ffenc()
return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '')
return printf('%s%s%s', &fenc, &l:bomb ? '[BOM]' : '', strlen(&ff) > 0 ? '['.&ff.']' : '')
endfunction

View file

@ -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
call airline#init#bootstrap()

View file

@ -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
" generates a dictionary which defines the colors for each highlight group
@ -39,6 +39,9 @@ function! airline#themes#patch(palette)
if !has_key(a:palette[mode], 'airline_warning')
let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ]
endif
if !has_key(a:palette[mode], 'airline_error')
let a:palette[mode]['airline_error'] = [ '#000000', '#990000', 232, 160 ]
endif
endfor
let a:palette.accents = get(a:palette, 'accents', {})

View file

@ -1,52 +0,0 @@
let s:N1 = [ '#141413' , '#aeee00' , 232 , 154 ] " blackestgravel & lime
let s:N2 = [ '#f4cf86' , '#45413b' , 222 , 238 ] " dirtyblonde & deepgravel
let s:N3 = [ '#8cffba' , '#242321' , 121 , 235 ] " saltwatertaffy & darkgravel
let s:N4 = [ '#666462' , 241 ] " mediumgravel
let s:I1 = [ '#141413' , '#0a9dff' , 232 , 39 ] " blackestgravel & tardis
let s:I2 = [ '#f4cf86' , '#005fff' , 222 , 27 ] " dirtyblonde & facebook
let s:I3 = [ '#0a9dff' , '#242321' , 39 , 235 ] " tardis & darkgravel
let s:V1 = [ '#141413' , '#ffa724' , 232 , 214 ] " blackestgravel & orange
let s:V2 = [ '#000000' , '#fade3e' , 16 , 221 ] " coal & dalespale
let s:V3 = [ '#000000' , '#b88853' , 16 , 137 ] " coal & toffee
let s:V4 = [ '#c7915b' , 173 ] " coffee
let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde
let s:RE = [ '#ff9eb8' , 211 ] " dress
let s:IA = [ s:N3[1] , s:N2[1] , s:N3[3] , s:N2[3] , '' ]
let g:airline#themes#badwolf#palette = {}
let g:airline#themes#badwolf#palette.accents = {
\ 'red': [ '#ff2c4b' , '' , 196 , '' , '' ]
\ }
let g:airline#themes#badwolf#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#badwolf#palette.normal_modified = {
\ 'airline_b': [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#badwolf#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#badwolf#palette.insert_modified = {
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#badwolf#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
let g:airline#themes#badwolf#palette.replace = copy(airline#themes#badwolf#palette.insert)
let g:airline#themes#badwolf#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
let g:airline#themes#badwolf#palette.replace_modified = g:airline#themes#badwolf#palette.insert_modified
let g:airline#themes#badwolf#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#badwolf#palette.visual_modified = {
\ 'airline_c': [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#badwolf#palette.inactive_modified = {
\ 'airline_c': [ s:V1[1] , '' , s:V1[3] , '' , '' ] }

View file

@ -1,136 +0,0 @@
if get(g:, 'airline#themes#base16#constant', 0)
let g:airline#themes#base16#palette = {}
" Color palette
let s:gui_dark_gray = '#202020'
let s:cterm_dark_gray = 234
let s:gui_med_gray_hi = '#303030'
let s:cterm_med_gray_hi = 236
let s:gui_med_gray_lo = '#3a3a3a'
let s:cterm_med_gray_lo = 237
let s:gui_light_gray = '#505050'
let s:cterm_light_gray = 239
let s:gui_green = '#99cc99'
let s:cterm_green = 151
let s:gui_blue = '#6a9fb5'
let s:cterm_blue = 67
let s:gui_purple = '#aa759f'
let s:cterm_purple = 139
let s:gui_orange = '#d28445'
let s:cterm_orange = 173
let s:gui_red = '#ac4142'
let s:cterm_red = 131
let s:gui_pink = '#d7afd7'
let s:cterm_pink = 182
" Normal mode
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#base16#palette.normal_modified = {
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
\ }
" Insert mode
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
let g:airline#themes#base16#palette.insert_modified = copy(g:airline#themes#base16#palette.normal_modified)
let g:airline#themes#base16#palette.insert_paste = {
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
\ }
" Replace mode
let g:airline#themes#base16#palette.replace = {
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
\ }
let g:airline#themes#base16#palette.replace_modified = copy(g:airline#themes#base16#palette.insert_modified)
" Visual mode
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
let g:airline#themes#base16#palette.visual_modified = copy(g:airline#themes#base16#palette.insert_modified)
" Inactive window
let s:IA = [s:gui_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, '']
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#base16#palette.inactive_modified = {
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
\ }
else
function! airline#themes#base16#refresh()
let g:airline#themes#base16#palette = {}
let g:airline#themes#base16#palette.accents = {
\ 'red': airline#themes#get_highlight('Constant'),
\ }
let s:N1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffText', 'fg'], 'bold')
let s:N2 = airline#themes#get_highlight2(['Visual', 'fg'], ['Visual', 'bg'])
let s:N3 = airline#themes#get_highlight('CursorLine')
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let group = airline#themes#get_highlight('vimCommand')
let g:airline#themes#base16#palette.normal_modified = {
\ 'statusline': [ group[0], '', group[2], '', '' ]
\ }
let s:I1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffAdded', 'fg'], 'bold')
let s:I2 = airline#themes#get_highlight2(['DiffAdded', 'fg'], ['Normal', 'bg'])
let s:I3 = s:N3
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#base16#palette.insert_modified = g:airline#themes#base16#palette.normal_modified
let s:R1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['WarningMsg', 'fg'], 'bold')
let s:R2 = s:N2
let s:R3 = s:N3
let g:airline#themes#base16#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
let g:airline#themes#base16#palette.replace_modified = g:airline#themes#base16#palette.normal_modified
let s:V1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['Constant', 'fg'], 'bold')
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
let s:V3 = s:N3
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#base16#palette.visual_modified = g:airline#themes#base16#palette.normal_modified
let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg'])
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#base16#palette.inactive_modified = {
\ 'airline_c': [ group[0], '', group[2], '', '' ]
\ }
" Warnings
let s:WI = airline#themes#get_highlight2(['WarningMsg', 'bg'], ['WarningMsg', 'fg'], 'bold')
let g:airline#themes#base16#palette.normal.airline_warning = [
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
\ ]
let g:airline#themes#base16#palette.normal_modified.airline_warning =
\ g:airline#themes#base16#palette.normal.airline_warning
let g:airline#themes#base16#palette.insert.airline_warning =
\ g:airline#themes#base16#palette.normal.airline_warning
let g:airline#themes#base16#palette.insert_modified.airline_warning =
\ g:airline#themes#base16#palette.normal.airline_warning
let g:airline#themes#base16#palette.visual.airline_warning =
\ g:airline#themes#base16#palette.normal.airline_warning
let g:airline#themes#base16#palette.visual_modified.airline_warning =
\ g:airline#themes#base16#palette.normal.airline_warning
let g:airline#themes#base16#palette.replace.airline_warning =
\ g:airline#themes#base16#palette.normal.airline_warning
let g:airline#themes#base16#palette.replace_modified.airline_warning =
\ g:airline#themes#base16#palette.normal.airline_warning
endfunction
call airline#themes#base16#refresh()
endif

View file

@ -1,58 +0,0 @@
let g:airline#themes#behelit#palette = {}
" Normal mode
let s:N1 = [ '#121212', '#5f87ff', 233, 69 ]
let s:N2 = [ '#5f87ff', '#262626', 69 , 235 ]
let s:N3 = [ '#5f87ff', '#1c1c1c', 69 , 234, 'bold' ]
let g:airline#themes#behelit#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#behelit#palette.normal_modified = {
\ 'airline_c': [ '#d7005f', '#1c1c1c', 161, 234, 'bold' ],
\ }
" Insert mode
let s:I1 = [ '#121212', '#00ff87', 233, 48 ]
let s:I2 = s:N2
let s:I3 = s:N3
let g:airline#themes#behelit#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#behelit#palette.insert_modified = g:airline#themes#behelit#palette.normal_modified
let g:airline#themes#behelit#palette.insert_paste = {
\ 'airline_a': [ "#121212", "#5f5faf", 233, 61, '' ],
\ }
" Replace mode
let g:airline#themes#behelit#palette.replace = copy(g:airline#themes#behelit#palette.insert)
let g:airline#themes#behelit#palette.replace.airline_a = [ s:I1[0], '#d70057', s:I1[2], 161, '' ]
let g:airline#themes#behelit#palette.replace_modified = g:airline#themes#behelit#palette.insert_modified
" Visual mode
let s:V1 = [ '#121212', '#5fff5f', 233, 83 ]
let s:V2 = s:N2
let s:V3 = s:N3
let g:airline#themes#behelit#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#behelit#palette.visual_modified = g:airline#themes#behelit#palette.normal_modified
" Inactive window
let s:IA1 = [ '#4e4e4e', '#1c1c1c', 239, 234, '' ]
let s:IA2 = [ '#4e4e4e', '#262626', 239, 235, '' ]
let s:IA3 = [ '#4e4e4e', '#1c1c1c', 239, 234, 'bold' ]
let g:airline#themes#behelit#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
let g:airline#themes#behelit#palette.inactive_modified = {
\ 'airline_c': [ '#5f5f87', '#1c1c1c', 60, 234, 'bold' ],
\ }
" Accents
let g:airline#themes#behelit#palette.accents = {
\ 'red': [ '#d7005f', '', 161, '' ]
\ }
" Warnings
let s:WI = [ '#121212', '#d7005f', 233, 161 ]
let g:airline#themes#behelit#palette.normal.airline_warning = s:WI
let g:airline#themes#behelit#palette.normal_modified.airline_warning = s:WI
let g:airline#themes#behelit#palette.insert.airline_warning = s:WI
let g:airline#themes#behelit#palette.insert_modified.airline_warning = s:WI
let g:airline#themes#behelit#palette.insert_paste.airline_warning = s:WI
let g:airline#themes#behelit#palette.visual.airline_warning = s:WI
let g:airline#themes#behelit#palette.visual_modified.airline_warning = s:WI
let g:airline#themes#behelit#palette.replace.airline_warning = s:WI
let g:airline#themes#behelit#palette.replace_modified.airline_warning = s:WI

View file

@ -1,70 +0,0 @@
" Color palette
let s:gui_dark_gray = '#303030'
let s:cterm_dark_gray = 236
let s:gui_med_gray_hi = '#444444'
let s:cterm_med_gray_hi = 238
let s:gui_med_gray_lo = '#3a3a3a'
let s:cterm_med_gray_lo = 237
let s:gui_light_gray = '#b2b2b2'
let s:cterm_light_gray = 249
let s:gui_green = '#afd787'
let s:cterm_green = 150
let s:gui_blue = '#87afd7'
let s:cterm_blue = 110
let s:gui_purple = '#afafd7'
let s:cterm_purple = 146
let s:gui_orange = '#d7af5f'
let s:cterm_orange = 179
let s:gui_red = '#d78787'
let s:cterm_red = 174
let s:gui_pink = '#d7afd7'
let s:cterm_pink = 182
let g:airline#themes#bubblegum#palette = {}
" Normal mode
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
let g:airline#themes#bubblegum#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#bubblegum#palette.normal_modified = {
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
\ }
" Insert mode
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
let g:airline#themes#bubblegum#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
let g:airline#themes#bubblegum#palette.insert_modified = copy(g:airline#themes#bubblegum#palette.normal_modified)
let g:airline#themes#bubblegum#palette.insert_paste = {
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
\ }
" Replace mode
let g:airline#themes#bubblegum#palette.replace = {
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
\ }
let g:airline#themes#bubblegum#palette.replace_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
" Visual mode
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
let g:airline#themes#bubblegum#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
let g:airline#themes#bubblegum#palette.visual_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
" Inactive window
let s:IA = [s:gui_light_gray, s:gui_med_gray_hi, s:cterm_light_gray, s:cterm_med_gray_hi, '']
let g:airline#themes#bubblegum#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#bubblegum#palette.inactive_modified = {
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
\ }
" CtrlP
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#bubblegum#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, '' ] ,
\ [ s:gui_orange, s:gui_med_gray_lo, s:cterm_orange, s:cterm_med_gray_lo, '' ] ,
\ [ s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green, 'bold' ] )

View file

@ -1,59 +0,0 @@
" vim-airline companion theme of distinguished
" (https://github.com/Lokaltog/vim-distinguished)
" I have nothing to do with the original
" distinguished theme other than being a big fan.
" this theme was shamelessly created by modifying
" the Ubaryd airline theme.
let s:gray = [245, '#8a8a8a']
let s:golden = [143, '#afaf5f']
let s:pink = [131, '#af5f5f']
let s:blue = [ 67, '#5f87af']
let s:orange = [166, '#d75f00']
let s:outerfg = [ 16, '#000000']
let s:innerbg = [234, '#1c1c1c']
let s:middle = ['#bcbcbc', '#444444', 250, 238]
" Normal mode
let s:N1 = [s:outerfg[1], s:gray[1], s:outerfg[0], s:gray[0]]
let s:N3 = [s:gray[1], s:innerbg[1], s:gray[0], s:innerbg[0]]
" Insert mode
let s:I1 = [s:outerfg[1], s:golden[1], s:outerfg[0], s:golden[0]]
let s:I3 = [s:golden[1], s:innerbg[1], s:golden[0], s:innerbg[0]]
" Visual mode
let s:V1 = [s:outerfg[1], s:pink[1], s:outerfg[0], s:pink[0]]
let s:V3 = [s:pink[1], s:innerbg[1], s:pink[0], s:innerbg[0]]
" Replace mode
let s:R1 = [s:outerfg[1], s:blue[1], s:outerfg[0], s:blue[0]]
let s:R3 = [s:blue[1], s:innerbg[1], s:blue[0], s:innerbg[0]]
" Inactive pane
let s:IA = [s:middle[1], s:innerbg[1], s:middle[3], s:innerbg[0]]
let g:airline#themes#distinguished#palette = {}
let g:airline#themes#distinguished#palette.accents = {
\ 'red': ['#d70000', '', 160, '', '']}
let g:airline#themes#distinguished#palette.inactive = {
\ 'airline_a': s:IA,
\ 'airline_b': s:IA,
\ 'airline_c': s:IA}
let g:airline#themes#distinguished#palette.normal = airline#themes#generate_color_map(s:N1, s:middle, s:N3)
let g:airline#themes#distinguished#palette.normal_modified = {
\ 'airline_a': ['', s:orange[1], '', s:orange[0], ''],
\ 'airline_c': [s:orange[1], '', s:orange[0], '', ''],
\ 'airline_x': [s:orange[1], '', s:orange[0], '', ''],
\ 'airline_z': ['', s:orange[1], '', s:orange[0], '']}
let g:airline#themes#distinguished#palette.insert = airline#themes#generate_color_map(s:I1, s:middle, s:I3)
let g:airline#themes#distinguished#palette.insert_modified = {}
let g:airline#themes#distinguished#palette.replace = airline#themes#generate_color_map(s:R1, s:middle, s:R3)
let g:airline#themes#distinguished#palette.replace_modified = {}
let g:airline#themes#distinguished#palette.visual = airline#themes#generate_color_map(s:V1, s:middle, s:V3)
let g:airline#themes#distinguished#palette.visual_modified = {}

View file

@ -1,62 +0,0 @@
let g:airline#themes#durant#palette = {}
let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ]
let s:N2 = [ '#93a1a1' , '#586e75' , 245 , 240 ]
let s:N3 = [ '#93a1a1' , '#073642' , 240 , 233 ]
let g:airline#themes#durant#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#durant#normal_modified = {
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
\ }
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
let s:I2 = [ '#9e9e9e' , '#303030' , 247 , 236 ]
let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ]
let g:airline#themes#durant#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#durant#palette.insert_modified = {
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
\ }
let g:airline#themes#durant#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
\ }
let g:airline#themes#durant#palette.replace = copy(g:airline#themes#durant#palette.insert)
let g:airline#themes#durant#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
let g:airline#themes#durant#palette.replace_modified = g:airline#themes#durant#palette.insert_modified
let s:V1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ]
let s:V2 = [ '#ffffff' , '#44403a' , 255, 238 ]
let s:V3 = [ '#90a680' , '#2e2d2a' , 64, 235 ]
let g:airline#themes#durant#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#durant#palette.visual_modified = {
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
\ }
let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
let g:airline#themes#durant#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
let g:airline#themes#durant#palette.inactive_modified = {
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
\ }
let g:airline#themes#durant#palette.accents = {
\ 'red': [ '#ff0000' , '' , 160 , '' ]
\ }
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#durant#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])

View file

@ -1,58 +0,0 @@
" vim-airline companion theme of Hybrid
" (https://github.com/w0ng/vim-hybrid)
let g:airline#themes#hybrid#palette = {}
function! airline#themes#hybrid#refresh()
let s:N1 = airline#themes#get_highlight('DiffAdd')
let s:N2 = airline#themes#get_highlight('CursorLine')
let s:N3 = airline#themes#get_highlight('PMenu')
let g:airline#themes#hybrid#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let modified_group = airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
let g:airline#themes#hybrid#palette.normal_modified = {
\ 'airline_c': airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
\ }
let warning_group = airline#themes#get_highlight('SpellRare')
let g:airline#themes#hybrid#palette.normal.airline_warning = warning_group
let g:airline#themes#hybrid#palette.normal_modified.airline_warning = warning_group
let s:I1 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffText', 'bg'], 'bold')
let s:I2 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellLocal', 'bg'], 'bold')
let s:I3 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellCap', 'bg'], 'bold')
let g:airline#themes#hybrid#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#hybrid#palette.insert_modified = g:airline#themes#hybrid#palette.normal_modified
let g:airline#themes#hybrid#palette.insert.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
let g:airline#themes#hybrid#palette.insert_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
let s:R1 = airline#themes#get_highlight('DiffChange')
let s:R2 = s:N2
let s:R3 = s:N3
let g:airline#themes#hybrid#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
let replace_group = airline#themes#get_highlight('SpellRare')
let g:airline#themes#hybrid#palette.replace_modified = g:airline#themes#hybrid#palette.normal_modified
let g:airline#themes#hybrid#palette.replace.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
let g:airline#themes#hybrid#palette.replace_modified.airline_warning = g:airline#themes#hybrid#palette.replace_modified.airline_warning
let s:V1 = airline#themes#get_highlight2(['Text', 'fg'], ['Folded', 'bg'], 'bold')
let s:V2 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffDelete', 'bg'], 'bold')
let s:V3 = airline#themes#get_highlight2(['Text', 'fg'], ['Error', 'bg'], 'bold')
let g:airline#themes#hybrid#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#hybrid#palette.visual_modified = g:airline#themes#hybrid#palette.normal_modified
let g:airline#themes#hybrid#palette.visual.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
let g:airline#themes#hybrid#palette.visual_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
let s:IA = airline#themes#get_highlight('StatusLineNC')
let g:airline#themes#hybrid#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#hybrid#palette.inactive_modified = {
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
\ }
let g:airline#themes#hybrid#palette.accents = {
\ 'red': airline#themes#get_highlight('Constant'),
\ }
endfunction
call airline#themes#hybrid#refresh()

View file

@ -1,34 +0,0 @@
" vim-airline theme based on vim-hybrid and powerline
" (https://github.com/w0ng/vim-hybrid)
" (https://github.com/Lokaltog/powerline)
let g:airline#themes#hybridline#palette = {}
let s:N1 = [ '#282a2e' , '#c5c8c6' , 'black' , 15 ]
let s:N2 = [ '#c5c8c6' , '#373b41' , 15 , 8 ]
let s:N3 = [ '#ffffff' , '#282a2e' , 255 , 'black' ]
let g:airline#themes#hybridline#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#hybridline#palette.normal.airline_a = ['#005f00', '#b5bd68', 22, 10, '']
let s:I1 = [ '#005f5f' , '#8abeb7' , 23 , 14 ]
let s:I2 = [ '#c5c8c6' , '#0087af' , 15 , 31 ]
let s:I3 = [ '#ffffff' , '#005f87' , 255 , 24 ]
let g:airline#themes#hybridline#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#hybridline#palette.insert_paste = {
\ 'airline_a': ['#000000', '#ac4142', 16 , 1, ''] ,
\ }
let g:airline#themes#hybridline#palette.replace = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#hybridline#palette.replace.airline_a = ['#000000', '#CC6666', 16, 9]
let g:airline#themes#hybridline#palette.visual = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#hybridline#palette.visual.airline_a = ['#000000', '#de935f', 16, 3]
let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
let g:airline#themes#hybridline#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
let g:airline#themes#hybridline#palette.accents = {
\ 'red': [ '#ff0000' , '' , 160 , '' ]
\ }

View file

@ -1,52 +0,0 @@
let g:airline#themes#jellybeans#palette = {}
" The name of the function must be 'refresh'.
function! airline#themes#jellybeans#refresh()
" This theme is an example of how to use helper functions to extract highlight
" values from the corresponding colorscheme. It was written in a hurry, so it
" is very minimalistic. If you are a jellybeans user and want to make updates,
" please send pull requests.
" Here are examples where the entire highlight group is copied and an airline
" compatible color array is generated.
let s:N1 = airline#themes#get_highlight('DbgCurrent', 'bold')
let s:N2 = airline#themes#get_highlight('Folded')
let s:N3 = airline#themes#get_highlight('NonText')
let g:airline#themes#jellybeans#palette.accents = {
\ 'red': airline#themes#get_highlight('Constant'),
\ }
let g:airline#themes#jellybeans#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#jellybeans#palette.normal_modified = {
\ 'airline_c': [ '#ffb964', '', 215, '', '' ]
\ }
let s:I1 = airline#themes#get_highlight('DiffAdd', 'bold')
let s:I2 = s:N2
let s:I3 = s:N3
let g:airline#themes#jellybeans#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#jellybeans#palette.insert_modified = g:airline#themes#jellybeans#palette.normal_modified
let s:R1 = airline#themes#get_highlight('WildMenu', 'bold')
let s:R2 = s:N2
let s:R3 = s:N3
let g:airline#themes#jellybeans#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
let g:airline#themes#jellybeans#palette.replace_modified = g:airline#themes#jellybeans#palette.normal_modified
" Sometimes you want to mix and match colors from different groups, you can do
" that with this method.
let s:V1 = airline#themes#get_highlight2(['TabLineSel', 'bg'], ['DiffDelete', 'bg'], 'bold')
let s:V2 = s:N2
let s:V3 = s:N3
let g:airline#themes#jellybeans#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#jellybeans#palette.visual_modified = g:airline#themes#jellybeans#palette.normal_modified
" And of course, you can always do it manually as well.
let s:IA = [ '#444444', '#1c1c1c', 237, 234 ]
let g:airline#themes#jellybeans#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#jellybeans#palette.inactive_modified = g:airline#themes#jellybeans#palette.normal_modified
endfunction
call airline#themes#jellybeans#refresh()

View file

@ -1,70 +0,0 @@
"
" Colorscheme: Kalisi for airline. Inspired by powerline.
" Arthur Jaron
" hifreeo@gmail.com
" 24.10.2014
" Visual mode
let s:V1 = [ '#0087ff' , '#ffffff','33','231']
let s:V2 = [ '#005faf' , '#5fafff','25','75']
let s:V3 = [ '#87d7ff' , '#005faf','117','25']
" Replace mode
let s:R1 = [ '#d75fff' , '#ffffff','171','231']
let s:R2 = [ '#5f005f' , '#d75fff','53','171']
let s:R3 = [ '#ff87ff' , '#8700af','213','91']
let g:airline#themes#kalisi#palette = {}
function! airline#themes#kalisi#refresh()
let s:StatusLine = airline#themes#get_highlight('StatusLine')
let s:StatusLineNC = airline#themes#get_highlight('StatusLineNC')
" Insert mode
let s:I1 = [ '#ffffff' , '#e80000','231','160']
let s:I2 = [ '#ff0000' , '#5f0000','196','52']
let s:I3 = s:StatusLine
" Normal mode
let s:N1 = [ '#005f00' , '#afd700','22','148']
let s:N2 = [ '#afd700' , '#005f00','148','22']
let s:N3 = s:StatusLine
" Tabline Plugin
let g:airline#themes#kalisi#palette.tabline = {
\ 'airline_tab': ['#bcbcbc', '#005f00','250','22'],
\ 'airline_tabsel': ['#404042', '#A6DB29','238','148'],
\ 'airline_tabtype':['#afd700', '#204d20','148','22'],
\ 'airline_tabfill': s:StatusLine,
\ 'airline_tabhid': ['#c5c5c5', '#404042','251','238'],
\ 'airline_tabmod': ['#d7ff00', '#afd700','190','148'],
\ 'airline_tabmod_unsel': ['#d7ff00', '#005f00','190','22']
\ }
let g:airline#themes#kalisi#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#kalisi#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#kalisi#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#kalisi#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
" Inactive Mode
let s:IA = airline#themes#get_highlight('StatusLineNC')
let g:airline#themes#kalisi#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#kalisi#palette.inactive_modified = {
\ 'airline_c': ['#d7ff00', s:IA[1],'190',s:IA[3]],
\ }
endfunction
call airline#themes#kalisi#refresh()
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#kalisi#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ s:StatusLine,
\ ['#afd700', '#005f00','148','22'],
\ [ '#005f00' , '#afd700' , '22','148']
\)

View file

@ -1,59 +0,0 @@
let g:airline#themes#kolor#palette = {}
let s:N1 = [ '#e2e2e2' , '#4f3598' , 254 , 56 ]
let s:N2 = [ '#ff5fd7' , '#242322' , 206 , 234 ]
let s:N3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
let g:airline#themes#kolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#kolor#palette.normal_modified = {
\ 'airline_c': [ '#e2e2e2' , '#4f3598' , 254 , 56 , '' ] ,
\ }
let s:I1 = [ '#242322' , '#7eaefd' , 234 , 111 ]
let s:I2 = [ '#75d7d8' , '#242322' , 80 , 234 ]
let s:I3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
let g:airline#themes#kolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#kolor#palette.insert_modified = {
\ 'airline_c': [ '#242322' , '#7eaefd' , 234 , 111 , '' ] ,
\ }
let g:airline#themes#kolor#palette.replace = copy(g:airline#themes#kolor#palette.insert)
let g:airline#themes#kolor#palette.replace.airline_a = [ s:I2[0] , '#005154' , s:I2[2] , 23 , '' ]
let g:airline#themes#kolor#palette.replace_modified = {
\ 'airline_c': [ '#e2e2e2' , '#005154' , 254 , 23 , '' ] ,
\ }
let s:V1 = [ '#242322' , '#e6987a' , 234 , 180 ]
let s:V2 = [ '#dbc570' , '#242322' , 186 , 234 ]
let s:V3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
let g:airline#themes#kolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#kolor#palette.visual_modified = {
\ 'airline_c': [ '#242322' , '#e6987a' , 234 , 180 , '' ] ,
\ }
let s:IA1 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
let s:IA2 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 ]
let s:IA3 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
let g:airline#themes#kolor#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
let g:airline#themes#kolor#palette.inactive_modified = {
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
\ }
let g:airline#themes#kolor#palette.accents = {
\ 'red': [ '#d96e8a' , '' , 168 , '' ]
\ }
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#kolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#e2e2e2' , '#4a4a4a' , 254 , 238 , '' ],
\ [ '#e2e2e2' , '#242322' , 254 , 234 , '' ],
\ [ '#e2e2e2' , '#4f3598' , 254 , 56 , 'bold' ])

View file

@ -1,62 +0,0 @@
" vim-airline companion theme of Laederon
" (https://github.com/Donearm/Laederon)
" Normal mode
let s:N1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ] " blackestgravel & snow
let s:N2 = [ '#ffffff' , '#44403a' , 255, 238 ] " snow & deepgravel
let s:N3 = [ '#90a680' , '#2e2d2a' , 64, 235 ] " dilutedpaint & darkgravel
let s:N4 = [ '#777470' , 240 ] " gravel
" Insert mode
let s:I1 = [ '#1a1a18' , '#1693a5' , 232 , 62 ] " blackestgravel & crystallake
let s:I2 = [ '#515744' , '#44403a' , 101 , 238 ] " lichen & deepgravel
let s:I3 = [ '#1693a5' , '#2e2d2a' , 39 , 235 ] " crystallake & darkgravel
" Visual mode
let s:V1 = [ '#1a1a18' , '#ab3e5d' , 232 , 161 ] " blackestgravel & raspberry
let s:V2 = [ '#000000' , '#908571' , 16 , 252 ] " coal & winterterrain
let s:V3 = [ '#ab3e5d' , '#8c7f77' , 161 , 245 ] " raspberry & wetcoldterrain
let s:V4 = [ '#515744' , 101 ] " lichen
" Replace mode
let s:RE = [ '#233e09' , 22 ] " oakleaf
" Paste mode
let s:PA = [ '#ab3e5d' , 161 ] " raspberry
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ]
let g:airline#themes#laederon#palette = {}
let g:airline#themes#laederon#palette.accents = {
\ 'red': [ '#ef393d' , '' , 196 , '' , '' ]
\ }
let g:airline#themes#laederon#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#laederon#palette.normal_modified = {
\ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
\ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#laederon#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#laederon#palette.insert_modified = {
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
let g:airline#themes#laederon#palette.insert_paste = {
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
let g:airline#themes#laederon#palette.replace = copy(airline#themes#laederon#palette.insert)
let g:airline#themes#laederon#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
let g:airline#themes#laederon#palette.replace_modified = g:airline#themes#laederon#palette.insert_modified
let g:airline#themes#laederon#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#laederon#palette.visual_modified = {
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
let g:airline#themes#laederon#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#laederon#palette.inactive_modified = {
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }

View file

@ -1,45 +0,0 @@
let g:airline#themes#light#palette = {}
let s:N1 = [ '#ffffff' , '#005fff' , 255 , 27 ]
let s:N2 = [ '#000087' , '#00dfff' , 18 , 45 ]
let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ]
let g:airline#themes#light#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#light#palette.normal_modified = {
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
\ }
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
let s:I2 = [ '#005f00' , '#00df87' , 22 , 42 ]
let s:I3 = [ '#005f5f' , '#afff87' , 23 , 156 ]
let g:airline#themes#light#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#light#palette.insert_modified = {
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
\ }
let g:airline#themes#light#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
\ }
let g:airline#themes#light#palette.replace = copy(g:airline#themes#light#palette.insert)
let g:airline#themes#light#palette.replace.airline_a = [ s:I2[0] , '#ff0000' , s:I1[2] , 196 , '' ]
let g:airline#themes#light#palette.replace_modified = g:airline#themes#light#palette.insert_modified
let s:V1 = [ '#ffffff' , '#ff5f00' , 255 , 202 ]
let s:V2 = [ '#5f0000' , '#ffaf00' , 52 , 214 ]
let s:V3 = [ '#df5f00' , '#ffff87' , 166 , 228 ]
let g:airline#themes#light#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#light#palette.visual_modified = {
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
\ }
let s:IA1 = [ '#666666' , '#b2b2b2' , 242 , 249 , '' ]
let s:IA2 = [ '#8a8a8a' , '#d0d0d0' , 245 , 252 , '' ]
let s:IA3 = [ '#a8a8a8' , '#ffffff' , 248 , 255 , '' ]
let g:airline#themes#light#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
let g:airline#themes#light#palette.inactive_modified = {
\ 'airline_c': [ '#df0000' , '' , 160 , '' , '' ] ,
\ }

View file

@ -1,56 +0,0 @@
let g:airline#themes#lucius#palette = {}
function! airline#themes#lucius#refresh()
let s:N1 = airline#themes#get_highlight('StatusLine')
let s:N2 = airline#themes#get_highlight('Folded')
let s:N3 = airline#themes#get_highlight('CursorLine')
let g:airline#themes#lucius#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let modified_group = airline#themes#get_highlight('Statement')
let g:airline#themes#lucius#palette.normal_modified = {
\ 'airline_c': [modified_group[0], '', modified_group[2], '', '']
\ }
let warning_group = airline#themes#get_highlight('DiffDelete')
let g:airline#themes#lucius#palette.normal.airline_warning = warning_group
let g:airline#themes#lucius#palette.normal_modified.airline_warning = warning_group
let s:I1 = airline#themes#get_highlight('DiffAdd')
let s:I2 = s:N2
let s:I3 = s:N3
let g:airline#themes#lucius#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#lucius#palette.insert_modified = g:airline#themes#lucius#palette.normal_modified
let g:airline#themes#lucius#palette.insert.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
let g:airline#themes#lucius#palette.insert_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
let s:R1 = airline#themes#get_highlight('DiffChange')
let s:R2 = s:N2
let s:R3 = s:N3
let g:airline#themes#lucius#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
let g:airline#themes#lucius#palette.replace_modified = g:airline#themes#lucius#palette.normal_modified
let g:airline#themes#lucius#palette.replace.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
let g:airline#themes#lucius#palette.replace_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
let s:V1 = airline#themes#get_highlight('Cursor')
let s:V2 = s:N2
let s:V3 = s:N3
let g:airline#themes#lucius#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#lucius#palette.visual_modified = g:airline#themes#lucius#palette.normal_modified
let g:airline#themes#lucius#palette.visual.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
let g:airline#themes#lucius#palette.visual_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
let s:IA = airline#themes#get_highlight('StatusLineNC')
let g:airline#themes#lucius#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#lucius#palette.inactive_modified = {
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
\ }
let g:airline#themes#lucius#palette.accents = {
\ 'red': airline#themes#get_highlight('Constant'),
\ }
endfunction
call airline#themes#lucius#refresh()

View file

@ -1,92 +0,0 @@
" vim-airline companion theme of Luna
" (https://github.com/Pychimp/vim-luna)
let g:airline#themes#luna#palette = {}
let g:airline#themes#luna#palette.accents = {
\ 'red': [ '#ffffff' , '' , 231 , '' , '' ],
\ }
let s:N1 = [ '#ffffff' , '#005252' , 231 , 36 ]
let s:N2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
let s:N3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
let g:airline#themes#luna#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#luna#palette.normal_modified = {
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
\ }
let s:I1 = [ '#ffffff' , '#789f00' , 231 , 106 ]
let s:I2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
let s:I3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
let g:airline#themes#luna#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#luna#palette.insert_modified = {
\ 'airline_c': [ '#ffffff' , '#005e5e' , 255 , 52 , '' ] ,
\ }
let g:airline#themes#luna#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] ,
\ }
let g:airline#themes#luna#palette.replace = copy(g:airline#themes#luna#palette.insert)
let g:airline#themes#luna#palette.replace.airline_a = [ s:I2[0] , '#920000' , s:I2[2] , 88 , '' ]
let g:airline#themes#luna#palette.replace_modified = g:airline#themes#luna#palette.insert_modified
let s:V1 = [ '#ffff9a' , '#ff8036' , 222 , 208 ]
let s:V2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
let s:V3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
let g:airline#themes#luna#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#luna#palette.visual_modified = {
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
\ }
let s:IA = [ '#4e4e4e' , '#002b2b' , 59 , 23 , '' ]
let g:airline#themes#luna#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#luna#palette.inactive_modified = {
\ 'airline_c': [ '#e20000' , '' , 166 , '' , '' ] ,
\ }
let g:airline#themes#luna#palette.tabline = {
\ 'airline_tab': ['#2aa198', '#003f3f', 231, 29, ''],
\ 'airline_tabsel': ['#ffffff', '#2e8b57', 231, 36, ''],
\ 'airline_tabtype': ['#ffffff', '#005252', 231, 36, ''],
\ 'airline_tabfill': ['#ffffff', '#002b2b', 231, 23, ''],
\ 'airline_tabmod': ['#ffffff', '#780000', 231, 88, ''],
\ }
let s:WI = [ '#ffffff', '#5f0000', 231, 88 ]
let g:airline#themes#luna#palette.normal.airline_warning = [
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
\ ]
let g:airline#themes#luna#palette.normal_modified.airline_warning =
\ g:airline#themes#luna#palette.normal.airline_warning
let g:airline#themes#luna#palette.insert.airline_warning =
\ g:airline#themes#luna#palette.normal.airline_warning
let g:airline#themes#luna#palette.insert_modified.airline_warning =
\ g:airline#themes#luna#palette.normal.airline_warning
let g:airline#themes#luna#palette.visual.airline_warning =
\ g:airline#themes#luna#palette.normal.airline_warning
let g:airline#themes#luna#palette.visual_modified.airline_warning =
\ g:airline#themes#luna#palette.normal.airline_warning
let g:airline#themes#luna#palette.replace.airline_warning =
\ g:airline#themes#luna#palette.normal.airline_warning
let g:airline#themes#luna#palette.replace_modified.airline_warning =
\ g:airline#themes#luna#palette.normal.airline_warning
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#luna#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] ,
\ [ '#ffffff' , '#005252' , 231 , 36 , '' ] ,
\ [ '#ffffff' , '#973d45' , 231 , 95 , '' ] )

View file

@ -1,65 +0,0 @@
let g:airline#themes#molokai#palette = {}
let g:airline#themes#molokai#palette.accents = {
\ 'red': [ '#66d9ef' , '' , 81 , '' , '' ],
\ }
" Normal mode
let s:N1 = [ '#080808' , '#e6db74' , 232 , 144 ] " mode
let s:N2 = [ '#f8f8f0' , '#232526' , 253 , 16 ] " info
let s:N3 = [ '#f8f8f0' , '#465457' , 253 , 67 ] " statusline
let g:airline#themes#molokai#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#molokai#palette.normal_modified = {
\ 'airline_c': [ '#080808' , '#e6db74' , 232 , 144 , '' ] ,
\ }
" Insert mode
let s:I1 = [ '#080808' , '#66d9ef' , 232 , 81 ]
let s:I2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
let s:I3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
let g:airline#themes#molokai#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#molokai#palette.insert_modified = {
\ 'airline_c': [ '#080808' , '#66d9ef' , 232 , 81 , '' ] ,
\ }
" Replace mode
let g:airline#themes#molokai#palette.replace = copy(g:airline#themes#molokai#palette.insert)
let g:airline#themes#molokai#palette.replace.airline_a = [ s:I1[0] , '#ef5939' , s:I1[2] , 166 , '' ]
let g:airline#themes#molokai#palette.replace_modified = {
\ 'airline_c': [ '#080808' , '#ef5939' , 232 , 166 , '' ] ,
\ }
" Visual mode
let s:V1 = [ '#080808' , '#fd971f' , 232 , 208 ]
let s:V2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
let s:V3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
let g:airline#themes#molokai#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#molokai#palette.visual_modified = {
\ 'airline_c': [ '#080808' , '#fd971f' , 232 , 208 , '' ] ,
\ }
" Inactive
let s:IA = [ '#1b1d1e' , '#465457' , 233 , 67 , '' ]
let g:airline#themes#molokai#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#molokai#palette.inactive_modified = {
\ 'airline_c': [ '#f8f8f0' , '' , 253 , '' , '' ] ,
\ }
" CtrlP
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#molokai#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#f8f8f0' , '#465457' , 253 , 67 , '' ] ,
\ [ '#f8f8f0' , '#232526' , 253 , 16 , '' ] ,
\ [ '#080808' , '#e6db74' , 232 , 144 , 'bold' ] )

View file

@ -1,15 +0,0 @@
let g:airline#themes#monochrome#palette = {}
function! airline#themes#monochrome#refresh()
let s:SL = airline#themes#get_highlight('StatusLine')
let g:airline#themes#monochrome#palette.normal = airline#themes#generate_color_map(s:SL, s:SL, s:SL)
let g:airline#themes#monochrome#palette.insert = g:airline#themes#monochrome#palette.normal
let g:airline#themes#monochrome#palette.replace = g:airline#themes#monochrome#palette.normal
let g:airline#themes#monochrome#palette.visual = g:airline#themes#monochrome#palette.normal
let s:SLNC = airline#themes#get_highlight('StatusLineNC')
let g:airline#themes#monochrome#palette.inactive = airline#themes#generate_color_map(s:SLNC, s:SLNC, s:SLNC)
endfunction
call airline#themes#monochrome#refresh()

Some files were not shown because too many files have changed in this diff Show more