151 Commits
v0.1 ... v0.3

Author SHA1 Message Date
Bailey Ling
d20bdc54e5 Merge pull request #132 from monstermunchkin/master
update tagbar extension
2013-08-12 08:20:04 -07:00
Thomas Hipp
222adbfeaa update tagbar extension
Allow the tagbar extension to be disabled.
2013-08-12 17:03:15 +02:00
Bailey Ling
7524110de9 fix possible undefined variable 2013-08-12 01:40:18 +00:00
Bailey Ling
8d4eb3c574 improve vimshell integration; support interactive modes 2013-08-12 01:15:28 +00:00
Bailey Ling
c7cc63fb62 remove support for inactive modified
statuslines don't actually get evaluated in inactive splits, so this feature never worked properly anyways.
2013-08-11 16:13:04 -04:00
Bailey Ling
14dacaab68 improve bufferline integration; revert to default in inactive splits. 2013-08-11 19:48:14 +00:00
Bailey Ling
2413babe8b remove checks for airline_active, it is always true 2013-08-11 15:24:08 +00:00
Bailey Ling
11e7e67d8d introduce g:airline_inactive_collapse. resolves #129. 2013-08-11 14:30:02 +00:00
Bailey Ling
2a10bfc32f make the mode and branch text window local 2013-08-11 13:42:47 +00:00
Bailey Ling
5d92aaecaa update documentation 2013-08-10 23:22:49 +00:00
Bailey Ling
384150ecd7 extract iminsert out of core into an extension 2013-08-10 17:02:48 -04:00
Bailey Ling
52a4a8ea7b use hack fix for now. resolves #105. 2013-08-10 16:47:17 -04:00
Bailey Ling
3dc55eda4e enable tagbar only for active windows 2013-08-10 16:43:27 +00:00
bling
e1ff1edcf0 Merge branch '127'
Resolves #127.

Conflicts:
	autoload/airline.vim
2013-08-10 12:15:14 -04:00
Bailey Ling
61a39a99ac add ability to override left/right sides independently 2013-08-10 16:05:49 +00:00
Bailey Ling
8539ac46a6 allow extensions to reload when color scheme changes. resolves #128 2013-08-10 15:50:27 +00:00
bling
cf9028df9f fixes error when colorscheme declared in gvimrc. resolves #126. 2013-08-10 11:46:12 -04:00
Bailey Ling
e67fa32fd9 extract matching background colors for file indicator 2013-08-10 13:43:12 +00:00
Bailey Ling
1d46c5874b fix warning separator colors out of sync between modes 2013-08-10 13:17:32 +00:00
Bailey Ling
2ca403053c fix whitespace indent setting changed incorrectly when toggling 2013-08-10 13:09:52 +00:00
Bailey Ling
52b4100a4f reload separator color when colorscheme changes 2013-08-09 20:50:53 -04:00
Bailey Ling
320f50c6f9 extract a line number for mixed indents 2013-08-09 20:23:03 -04:00
Bailey Ling
44db0e0c70 fix newb mistake. resolves #125. 2013-08-09 20:52:18 +00:00
Bailey Ling
aabb061470 temp disable 2013-08-09 20:43:12 +00:00
Bailey Ling
35539b2667 customizable empty branch message. closes #121. 2013-08-09 20:12:56 +00:00
Bailey Ling
2ba7ce02ec add powerline separator for warning section 2013-08-09 20:08:57 +00:00
Bailey Ling
f8b2b7be23 add support for select mode. resolves #123. 2013-08-09 08:05:08 -04:00
Bailey Ling
4485b03e51 add whitespace toggle command 2013-08-08 14:42:27 +00:00
Bailey Ling
57955b3b86 add the most common problems into the documentation (#112). 2013-08-08 00:23:43 -04:00
Bailey Ling
7eaf6281fb fix mode separator colors for ubaryd and laederon 2013-08-08 00:10:08 -04:00
Bailey Ling
edcf79c509 add bitdeli badge 2013-08-07 16:38:50 -04:00
Bailey Ling
f440ad3509 exclude readonly files from whitespace checking 2013-08-06 22:29:03 -04:00
Bailey Ling
6ced8b8ce6 add line number for trailing spaces 2013-08-06 22:02:53 -04:00
Bailey Ling
0a015e5305 use autocmds to detect whitespace, shouldn't need max anymore 2013-08-06 21:48:00 -04:00
Bailey Ling
d2c069b971 make syntastic use the warning section 2013-08-06 21:42:32 -04:00
Bailey Ling
7fb9bcf2c9 improve whitespace detection; add support for mixed indents 2013-08-07 00:48:53 +00:00
Bailey Ling
f86eafb674 reorder so that statusline funcrefs get an up to date active flag 2013-08-07 00:47:31 +00:00
Bailey Ling
528f56472c introduce new warning section, and refactor whitespace into an extension which uses it 2013-08-07 00:17:33 +00:00
Bailey Ling
4d67c802b3 Merge pull request #120 from farseer90718/master
add white space detection
2013-08-06 16:35:24 -07:00
Bailey Ling
26c7c9fca2 move default ctrlp theme to dark. autogenerate for everything else if not already defined. 2013-08-06 23:29:06 +00:00
Bailey Ling
42260bc35f can't forget about solarized 2013-08-06 21:53:14 +00:00
Bailey Ling
ae587c3dcb add ctrlp support for most themes 2013-08-06 20:52:52 +00:00
Bailey Ling
772fbc18e7 indent 2013-08-06 19:23:07 +00:00
farseer90718
164aa6f73c add white space detection 2013-08-07 00:17:57 +08:00
Bailey Ling
df72012e41 fix commandt integration 2013-08-06 15:41:37 +00:00
Bailey Ling
c1e74d72e0 Merge branch 'ext'
Conflicts:
	autoload/airline/extensions.vim
2013-08-06 15:26:32 +00:00
Bailey Ling
40614ef66b Merge pull request #118 from cg433n/master
Reload the solarized airline theme on the Colorscheme event.
2013-08-06 08:17:47 -07:00
Christopher.Green
e0f5bcc06a Reload the solarized airline theme on the Colorscheme event. 2013-08-06 07:25:21 -07:00
Bailey Ling
835f718cb6 reload colors when tomorrow theme changes 2013-08-06 08:31:45 -04:00
Bailey Ling
729f9e8354 use tagbar provided statusline func 2013-08-06 08:12:03 -04:00
Bailey Ling
e858eaa990 fix branch detection 2013-08-06 00:42:59 -04:00
Bailey Ling
990e3fc949 make branch/bufferline default statusline rather than overrides 2013-08-06 00:35:07 -04:00
Bailey Ling
8677fa875b minor optimization 2013-08-06 03:57:02 +00:00
Bailey Ling
ac211a58eb extract all plugin related functionality out of the core 2013-08-06 03:34:45 +00:00
Bailey Ling
98f3d13705 do not overwrite when left only 2013-08-06 03:33:25 +00:00
Bailey Ling
48f0e3652c extract tagbar 2013-08-06 03:16:49 +00:00
Bailey Ling
9c960875fe extract fugitive/lawrencium 2013-08-06 03:07:01 +00:00
Bailey Ling
11fd24b3ef extract syntastic 2013-08-06 02:57:06 +00:00
Bailey Ling
f15ac2146f make bufferline almost entirely self contained 2013-08-06 02:44:34 +00:00
Bailey Ling
41325bd08c extract bufferline into its own file 2013-08-06 00:29:30 +00:00
Bailey Ling
0758e2a88c fix regression, allow statusline funcrefs to execute 2013-08-05 20:31:10 +00:00
Bailey Ling
238ab44489 invoke funcrefs a different way, resolves #115. 2013-08-05 20:16:52 +00:00
Bailey Ling
4ae9484075 Merge pull request #116 from LeszekSwirski/empty-color-fix
Make themes#generate_color_map robust against undefined highlights
2013-08-05 11:03:48 -07:00
Leszek Swirski
216bcf1088 Make themes#generate_color_map robust against undefined highlights 2013-08-05 18:44:12 +01:00
Bailey Ling
61c95d4103 update readme, link to popular colorschemes 2013-08-04 20:06:24 +00:00
Bailey Ling
e84aed79a6 use directory group instead of spell to support gui colors 2013-08-04 19:51:41 +00:00
Bailey Ling
cf3473a8a3 pick highlight groups that are also compatible with the light variant 2013-08-04 19:44:57 +00:00
Bailey Ling
99179d806b tweak tomorrow colors, covers all dark themes pretty well. resolves #67 and #113. 2013-08-04 19:37:30 +00:00
Bailey Ling
a5fe4d9972 extract colors from normal if undefined (#67, #113). 2013-08-04 19:10:44 +00:00
Bailey Ling
2bedd8ef84 first pass at tomorrow themes (#67, #113) 2013-08-04 16:18:47 +00:00
Bailey Ling
d1d65dd41a add modified colors to jellybeans 2013-08-04 16:18:47 +00:00
Bailey Ling
b25dacef44 Merge pull request #114 from p-m-p/master
Add bubblegum theme
2013-08-04 06:54:36 -07:00
Phil Parsons
533a610aa0 Add bubblegum theme 2013-08-04 11:54:46 +01:00
Bailey Ling
926be0bd8a collapse section when it is empty text (#70). 2013-08-04 01:37:34 +00:00
Bailey Ling
e4d5f4cfb1 add jellybeans theme using new highlight group methods 2013-08-04 01:28:20 +00:00
Bailey Ling
9f04ef3170 fix ctrlp statusline getting overwritten via cursormove 2013-08-03 23:44:50 +00:00
Bailey Ling
10fa73996b loop differently so it works in 7.2 2013-08-03 20:56:37 +00:00
Bailey Ling
406fb2164d swap features and rationale in readme 2013-08-03 20:55:58 +00:00
Bailey Ling
e446f6a2fb fix placement of readonly, add support for startify 2013-08-03 16:06:29 +00:00
Bailey Ling
41a739d602 move syntastic implementation out of core 2013-08-03 11:23:45 -04:00
Bailey Ling
94895de8e2 rename window_override_funcrefs to statusline_funcrefs 2013-08-03 11:14:02 -04:00
Bailey Ling
257a9f2ed9 move updating external values into extensions 2013-08-03 10:59:34 -04:00
Bailey Ling
c655bdc233 move helper functions into update statusline, they're not used anywhere else 2013-08-03 10:58:25 -04:00
Bailey Ling
1d07110af3 Merge pull request #111 from bootleq/blank-section
Do not render spare spaces for empty sections.
2013-08-02 20:48:24 -07:00
bootleq
410792ed48 Remove space-padding works outside of get_section. 2013-08-03 10:09:55 +08:00
bootleq
5ebb0daf93 Add prefix/suffix options for s:get_section.
For output format other than default 1 space padding.
Need this to keep original section_c style:

    let sl.=l:status_color.' %<'.s:get_section(a:winnr, 'c').' '
2013-08-03 10:09:55 +08:00
bootleq
dcb7196097 Add padding spaces for section in s:get_section.
When section text is non-empty, pad spaces before/after it.
2013-08-03 10:09:49 +08:00
Bailey Ling
5099fbf1b9 move tagbar definition into predefined section 2013-08-03 00:51:24 +00:00
Bailey Ling
9844f14f66 change license to MIT 2013-08-02 19:43:24 +00:00
Bailey Ling
39e0df4b2d fix typo of typo fix 2013-08-02 17:59:52 +00:00
Bailey Ling
d833ae041d fix typos in readme 2013-08-02 08:21:47 -04:00
Bailey Ling
72852fa665 update readme. resolves #109. 2013-08-02 08:11:53 -04:00
Bailey Ling
577e50d788 first class integration with tagbar 2013-07-31 20:07:14 +00:00
Bailey Ling
6df46d8d22 ensure global variables are always there (#108). 2013-07-31 19:37:35 +00:00
Bailey Ling
d107c4fd5d account for plugins which use eventignore. resolves #82. 2013-07-31 17:37:00 +00:00
Bailey Ling
d56b9bbfcd modify active window algorithm, resolves #106. 2013-07-31 14:31:51 +00:00
Bailey Ling
8f52831cc0 Merge pull request #103 from PhoSor/master
add ctrlp theme for molokai
2013-07-29 05:09:54 -07:00
Andrey Sorokin
72c43838d9 add ctrlp theme for molokai 2013-07-29 17:49:06 +06:00
Bailey Ling
e4558340b0 keep left override styles intact when inactive; use powerline separator for iminsert 2013-07-28 19:25:48 -04:00
Bailey Ling
86ff404748 Merge pull request #101 from PhoSor/master
add molokai theme
2013-07-28 06:12:40 -07:00
Andrey Sorokin
96a9ef87ef add molokai theme 2013-07-28 17:12:45 +06:00
Bailey Ling
240feae0f2 Merge pull request #100 from markstory/solarized-light
Solarized light
2013-07-27 21:08:41 -07:00
Mark Story
200b54bb93 Improve coloring on branch bar & encoding segments.
Make the colors for these segments match the general look and feel of
solarized light.
2013-07-27 23:16:18 -04:00
Mark Story
dadcb3e2c3 Fix typo in blue hex code. 2013-07-27 23:05:24 -04:00
Bailey Ling
161daa7942 deprecate fugitive variable names in favour of scm-agnostic variable names 2013-07-27 18:15:00 -04:00
Bailey Ling
0c7687889e reduce complexity of themes for ctrlp, fix luna right separator color 2013-07-27 17:54:05 -04:00
Bailey Ling
60cba9cfc4 refactor ctrlp themes with generate_color_map helper function 2013-07-27 20:16:13 +00:00
Bailey Ling
f0982fa310 Merge pull request #99 from Pychimp/master
updated few values and added ctrlp theme
2013-07-27 12:44:11 -07:00
Pychimp
20372d5fb7 updated few values and added ctrlp theme 2013-07-28 00:21:58 +05:30
Bailey Ling
d1ee91eadf update the ctrlp theme when the airline theme changes 2013-07-27 14:02:43 +00:00
Bailey Ling
4683616391 Merge pull request #98 from zenbro/master
add ctrlp theme for wombat
2013-07-27 06:51:31 -07:00
zenbro
8afd815fe1 add ctrlp theme for wombat 2013-07-27 13:04:22 +04:00
Bailey Ling
68ac156256 make ctrlp themeable (#97). 2013-07-26 17:21:43 +00:00
Bailey Ling
b1975b4eb8 Merge pull request #91 from crazymaster/master
fix for out of sync statusline when buffers are unloaded.
2013-07-26 05:13:23 -07:00
Bailey Ling
6bfc2f9631 include percentage, line/column numbers for help windows 2013-07-26 12:12:39 +00:00
crazymaster
90b32f5c26 Remove unnecessary autocmds 2013-07-26 10:47:28 +09:00
Bailey Ling
77a177cc01 add more info about theming algorithm, add VAM to readme 2013-07-25 23:21:26 +00:00
Bailey Ling
c095a48aad add documentation about airline_exclude_funcrefs 2013-07-25 22:48:15 +00:00
Bailey Ling
bce1632c42 clearly separate core functionality from implementation 2013-07-25 22:29:18 +00:00
Bailey Ling
ec86f66510 move paste detection into statusline and check enabled 2013-07-25 22:09:17 +00:00
Bailey Ling
8819ab272d add commandt support. resolves #92. 2013-07-25 21:54:55 +00:00
Bailey Ling
950eb41ab6 Merge pull request #96 from zenbro/master
add wombat theme
2013-07-25 11:50:16 -07:00
zenbro
1f292621d0 add wombat theme 2013-07-25 22:23:47 +04:00
Bailey Ling
fd0628b188 add help support. resolves #95. 2013-07-25 17:49:03 +00:00
Bailey Ling
3bd1df94bc Merge branch 'master' of github.com:bling/vim-airline 2013-07-25 16:55:52 +00:00
Bailey Ling
407d8728c0 iterate available keys for each mode 2013-07-25 14:23:24 +00:00
Bailey Ling
2d63123260 Merge pull request #94 from Pychimp/master
Added Luna compatiable vim-airline theme
2013-07-25 07:00:10 -07:00
Bailey Ling
c00cd767d0 fix statusline not getting updated with some plugins (#91). 2013-07-25 13:58:48 +00:00
Pychimp
1bc2cddc74 Added Luna compatiable vim-airline theme 2013-07-25 19:11:03 +05:30
Bailey Ling
dcc0c7c84b avoid using funcrefs in the core implementation (#91). 2013-07-25 12:00:17 +00:00
Bailey Ling
34675c5d9b default iminsert to false 2013-07-25 01:48:23 +00:00
crazymaster
fbb7d1512e Fix update's condition 2013-07-25 00:53:35 +09:00
Bailey Ling
443cd8d9c8 Merge pull request #90 from klen/master
Support &iminsert
2013-07-24 06:14:39 -07:00
Kirill Klenov
efa3773bcf Merge branch 'master' of github.com:klen/vim-airline 2013-07-24 15:36:20 +04:00
Kirill Klenov
c16cafb2bb Support &iminsert. 2013-07-24 15:35:31 +04:00
Bailey Ling
ef518e5604 Merge pull request #89 from crazymaster/master
Fix vimfiler support
2013-07-24 04:26:18 -07:00
crazymaster
5951cc7ce3 Fix vimfiler support 2013-07-24 18:02:38 +09:00
Bailey Ling
dd6e952c60 update readme to demo gif 2013-07-23 23:31:15 -04:00
bling
44ac11bed3 fully document the dark theme. resolves #88. 2013-07-23 23:00:23 -04:00
Bailey Ling
8d44832c1c Merge pull request #87 from crazymaster/master
Add vimfiler support
2013-07-23 10:31:53 -07:00
crazymaster
0c88e5a7cd Add vimfiler support 2013-07-24 01:22:43 +09:00
Bailey Ling
5fd3105aae update externals after shell commands. resolves #85 and #42. 2013-07-23 14:44:05 +00:00
Bailey Ling
221864cfdc make modified/paste detection an option 2013-07-22 21:23:41 +00:00
Bailey Ling
fce0e3e8da use only a slight accent for the active buffer in the bufferline 2013-07-21 21:29:31 -04:00
Bailey Ling
ee90b7c6b3 add colorized support for selected buffers with bufferline 2013-07-20 22:31:05 -04:00
Bailey Ling
8a2890625b prepare for bufferline highlight support 2013-07-20 22:22:16 -04:00
Bailey Ling
043256f96b add reference to the FAQ in the vim doc (#81). 2013-07-20 13:24:15 +00:00
Bailey Ling
70dd963c8e Merge pull request #80 from bjauy/lawrencium
Add lawrencium support
2013-07-18 05:27:06 -07:00
maciej
645c67731c Add lawrencium support 2013-07-18 07:56:29 +02:00
Bailey Ling
6388005c46 allow g: gutter to be specified, integrate with vimshell, use get() for :w variables 2013-07-17 22:28:21 -04:00
Bailey Ling
1385667168 add old vim-powerline font symbols into the doc. resolves #76. 2013-07-17 19:09:18 +00:00
28 changed files with 1360 additions and 406 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (C) 2013 Bailey Ling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

118
README.md
View File

@@ -2,26 +2,31 @@
Lean &amp; mean statusline for vim that's light as air. Lean &amp; mean statusline for vim that's light as air.
![img](https://github.com/bling/vim-airline/wiki/screenshots/light.png) ![img](https://github.com/bling/vim-airline/wiki/screenshots/demo.gif)
# Features
* tiny core (under 200 lines), written with extensibility in mind ([open/closed principle][8]).
* integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [syntastic][5] and [lawrencium][21].
* 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.
* fully customizable; if you know a little `statusline` syntax you can tweak it to your needs.
* extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki.
* supports 7.2 as the minimum Vim version
# Rationale # Rationale
There's already [powerline][b], why yet another statusline? There's already [powerline][2], why yet another statusline?
* it's 100% vimscript; no python needed. * 100% vimscript; no python needed.
* it's small. i want the core plugin to be *less than 200 lines* as a rule (specifically adhering to the [open/closed principle][h]).
* despite the small size, it is fully featured and already integrates with: [vim-bufferline][f], [fugitive][d], [unite][i], [ctrlp][j], [minibufexpl][o], [gundo][p], [undotree][q], [nerdtree][r], [tagbar][s] and [syntastic][e].
* it looks good with regular fonts, and provides configuration points so you can use unicode or powerline symbols.
* it's fast to load, taking roughly 1ms. by comparison, powerline needs 60ms on the same machine.
* it's fully customizable; if you know a little `statusline` syntax you can tweak it to your needs.
* it's trivial to write colorschemes; for a minimal theme you need to edit 9 lines of colors. (please send pull requests if you create new themes!)
What about [old powerline][a]? What about [vim-powerline][1]?
* the old version still works well, but since it's deprecated new features won't get added * the author has been active developing powerline, which was rewritten in python and expands its capabilities to tools outside of Vim, such as bash, zsh, and tmux.
* it uses different font codes, which makes it incompatible with other powerline bindings in the same terminal (e.g. bash, zsh, tmux, etc.) * vim-powerline has been deprecated as a result, and no features will be added to it.
* vim-powerline uses different font codes, so if you want to use it with a powerline themed tmux (for example), it will not work.
# Why's it called airline? # Where did the name come from?
I wrote the initial version on an airplane, and since it's light as air it turned out to be a good name. Thanks for flying vim! I wrote the initial version on an airplane, and since it's light as air it turned out to be a good name. Thanks for flying vim!
@@ -29,12 +34,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: This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:
* [pathogen][k] * [Pathogen][11]
* `git clone https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline` * `git clone https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline`
* [neobundle][l] * [NeoBundle][12]
* `NeoBundle 'bling/vim-airline'` * `NeoBundle 'bling/vim-airline'`
* [vundle][m] * [Vundle][13]
* `Bundle 'bling/vim-airline'` * `Bundle 'bling/vim-airline'`
* [VAM][22]
* `call vam#ActivateAddons([ 'vim-airline' ])`
* manual * manual
* copy all of the files into your `~/.vim` directory * copy all of the files into your `~/.vim` directory
@@ -44,25 +51,25 @@ This plugin follows the standard runtime path structure, and as such it can be i
# Integrating with powerline fonts # Integrating with powerline fonts
For the nice looking powerline symbols to appear, you will need to install a patched font. Instructions can be found in the official powerline [documentation][t]. Prepatched fonts can be found in the [powerline-fonts][c] repository. For the nice looking powerline symbols to appear, you will need to install a patched font. Instructions can be found in the official powerline [documentation][20]. Prepatched fonts can be found in the [powerline-fonts][3] repository.
Finally, enable them in vim-airline by adding `let g:airline_powerline_fonts = 1` to your vimrc. Finally, enable them in vim-airline by adding `let g:airline_powerline_fonts = 1` to your vimrc.
# Bugs
If you encounter a bug, please do the following:
* reproduce it with this [minivimrc][g] repository to rule out any configuration conflicts.
* specify your version and patch level, as well as operating system (found with `:version`).
* a link to a gist or your vimrc where it can be reproduced.
# FAQ # FAQ
Solutions to common problems can be found in the [Wiki](https://github.com/bling/vim-airline/wiki/FAQ). Solutions to common problems can be found in the [Wiki][27].
# Screenshots # Themes/Screenshots
A full list of screenshots can be found in the [Wiki][n]. A full list of screenshots can be found in the [Wiki][14].
# 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.
* 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
@@ -70,31 +77,40 @@ Contributions and pull requests are welcome. Please take note of the following
* adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords. * 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. * keep the history clean! squash your branches before you submit a pull request. `pull --rebase` is your friend.
* this plugin got a lot more popular than i initially expected, if you make changes to the core, please test on as many versions of vim as possible. * any changes to the core should be tested against Vim 7.2.
* if you submit a theme, please create a screenshot so it can be added to the [Wiki][n]. * if you submit a theme, please create a screenshot so it can be added to the [Wiki][14].
# License # License
Distributed under the same terms as the Vim license. See `:help license`. MIT license. Copyright (c) 2013 Bailey Ling.
[a]: https://github.com/Lokaltog/vim-powerline [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/bling/vim-airline/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
[b]: https://github.com/Lokaltog/powerline
[c]: https://github.com/Lokaltog/powerline-fonts [1]: https://github.com/Lokaltog/vim-powerline
[d]: https://github.com/tpope/vim-fugitive [2]: https://github.com/Lokaltog/powerline
[e]: https://github.com/scrooloose/syntastic [3]: https://github.com/Lokaltog/powerline-fonts
[f]: https://github.com/bling/vim-bufferline [4]: https://github.com/tpope/vim-fugitive
[g]: https://github.com/bling/minivimrc [5]: https://github.com/scrooloose/syntastic
[h]: http://en.wikipedia.org/wiki/Open/closed_principle [6]: https://github.com/bling/vim-bufferline
[i]: https://github.com/Shougo/unite.vim [7]: https://github.com/bling/minivimrc
[j]: https://github.com/kien/ctrlp.vim [8]: http://en.wikipedia.org/wiki/Open/closed_principle
[k]: https://github.com/tpope/vim-pathogen [9]: https://github.com/Shougo/unite.vim
[l]: https://github.com/Shougo/neobundle.vim [10]: https://github.com/kien/ctrlp.vim
[m]: https://github.com/gmarik/vundle [11]: https://github.com/tpope/vim-pathogen
[n]: https://github.com/bling/vim-airline/wiki/Screenshots [12]: https://github.com/Shougo/neobundle.vim
[o]: https://github.com/techlivezheng/vim-plugin-minibufexpl [13]: https://github.com/gmarik/vundle
[p]: https://github.com/sjl/gundo.vim [14]: https://github.com/bling/vim-airline/wiki/Screenshots
[q]: https://github.com/mbbill/undotree [15]: https://github.com/techlivezheng/vim-plugin-minibufexpl
[r]: https://github.com/scrooloose/nerdtree [16]: https://github.com/sjl/gundo.vim
[s]: https://github.com/majutsushi/tagbar [17]: https://github.com/mbbill/undotree
[t]: https://powerline.readthedocs.org/en/latest/fontpatching.html [18]: https://github.com/scrooloose/nerdtree
[19]: https://github.com/majutsushi/tagbar
[20]: https://powerline.readthedocs.org/en/latest/fontpatching.html
[21]: https://bitbucket.org/ludovicchabant/vim-lawrencium
[22]: https://github.com/MarcWeber/vim-addon-manager
[23]: https://github.com/altercation/solarized
[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

View File

@@ -1,5 +1,8 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent " vim: ts=2 sts=2 sw=2 fdm=indent
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running') let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
let s:sections = ['a','b','c','gutter','x','y','z','warning']
let s:airline_highlight_map = { let s:airline_highlight_map = {
\ 'mode' : 'Al2', \ 'mode' : 'Al2',
@@ -9,7 +12,6 @@ let s:airline_highlight_map = {
\ 'statusline' : 'Al6', \ 'statusline' : 'Al6',
\ 'file' : 'Al7', \ 'file' : 'Al7',
\ } \ }
let s:airline_highlight_groups = keys(s:airline_highlight_map)
function! airline#exec_highlight(group, colors) function! airline#exec_highlight(group, colors)
let colors = a:colors let colors = a:colors
@@ -22,17 +24,22 @@ function! airline#exec_highlight(group, colors)
\ colors[1] != '' ? 'guibg='.colors[1] : '', \ colors[1] != '' ? 'guibg='.colors[1] : '',
\ colors[2] != '' ? 'ctermfg='.colors[2] : '', \ colors[2] != '' ? 'ctermfg='.colors[2] : '',
\ colors[3] != '' ? 'ctermbg='.colors[3] : '', \ colors[3] != '' ? 'ctermbg='.colors[3] : '',
\ colors[4] != '' ? 'gui='.colors[4] : '', \ len(colors) > 4 && colors[4] != '' ? 'gui='.colors[4] : '',
\ colors[4] != '' ? 'cterm='.colors[4] : '', \ len(colors) > 4 && colors[4] != '' ? 'cterm='.colors[4] : '',
\ colors[4] != '' ? 'term='.colors[4] : '') \ len(colors) > 4 && colors[4] != '' ? 'term='.colors[4] : '')
endfunction
function! airline#reload_highlight()
call airline#highlight(['inactive'])
call airline#highlight(['normal'])
call airline#extensions#load_theme()
endfunction endfunction
function! airline#load_theme(name) function! airline#load_theme(name)
let g:airline_theme = a:name let g:airline_theme = a:name
let inactive_colors = g:airline#themes#{g:airline_theme}#inactive "also lazy loads the theme let inactive_colors = g:airline#themes#{g:airline_theme}#inactive "also lazy loads the theme
let w:airline_lastmode = '' let w:airline_lastmode = ''
let w:airline_active = 1 call airline#reload_highlight()
call airline#highlight(['inactive'])
call airline#update_highlight() call airline#update_highlight()
endfunction endfunction
@@ -40,75 +47,30 @@ function! airline#highlight(modes)
" draw the base mode, followed by any overrides " draw the base mode, followed by any overrides
let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val') let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
for mode in mapped for mode in mapped
for key in s:airline_highlight_groups if exists('g:airline#themes#{g:airline_theme}#{mode}')
if exists('g:airline#themes#{g:airline_theme}#{mode}[key]') for key in keys(g:airline#themes#{g:airline_theme}#{mode})
let colors = g:airline#themes#{g:airline_theme}#{mode}[key] let colors = g:airline#themes#{g:airline_theme}#{mode}[key]
let suffix = a:modes[0] == 'inactive' ? '_inactive' : '' let suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
call airline#exec_highlight(s:airline_highlight_map[key].suffix, colors) call airline#exec_highlight(s:airline_highlight_map[key].suffix, colors)
endif endfor
endfor
endfor
endfunction
function! s:is_excluded_window()
for matchft in g:airline_exclude_filetypes
if matchft ==# &ft
return 1
endif endif
endfor endfor
for matchw in g:airline_exclude_filenames call airline#themes#exec_highlight_separator('Al2', 'warningmsg')
if matchstr(expand('%'), matchw) ==# matchw
return 1
endif
endfor
if g:airline_exclude_preview && &previewwindow
return 1
endif
return 0
endfunction endfunction
function! s:apply_window_overrides() " for 7.2 compatibility
call airline#extensions#clear_window_overrides() function! s:getwinvar(winnr, key, ...)
let winvals = getwinvar(a:winnr, '')
if &buftype == 'quickfix' return get(winvals, a:key, (a:0 ? a:1 : ''))
let w:airline_section_a = 'Quickfix'
let w:airline_section_b = ''
let w:airline_section_c = ''
let w:airline_section_x = ''
endif
if &previewwindow
let w:airline_section_a = 'Preview'
let w:airline_section_b = ''
let w:airline_section_c = bufname(winbufnr(winnr()))
endif
for FuncRef in g:airline_window_override_funcrefs
call FuncRef()
endfor
endfunction endfunction
function! airline#update_externals() function! s:get_section(winnr, key, ...)
let g:airline_externals_bufferline = g:airline_enable_bufferline && exists('g:bufferline_loaded') ? '%{bufferline#generate_string()}' : "%f%m" let text = s:getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
let g:airline_externals_syntastic = g:airline_enable_syntastic && exists('g:loaded_syntastic_plugin') ? '%{SyntasticStatuslineFlag()}' : '' let [prefix, suffix] = [get(a:000, 0, '%( '), get(a:000, 1, ' %)')]
let g:airline_externals_fugitive = g:airline_enable_fugitive && exists('g:loaded_fugitive') && strlen(fugitive#head()) > 0 return empty(text) ? '' : prefix.text.suffix
\ ? g:airline_fugitive_prefix.fugitive#head() : ''
endfunction endfunction
function! s:get_section(key) function! airline#get_statusline(winnr, active)
return exists('w:airline_section_{a:key}') ? w:airline_section_{a:key} : g:airline_section_{a:key}
endfunction
function! airline#update_statusline(active)
let w:airline_active = a:active
if s:is_excluded_window()
call setwinvar(winnr(), '&statusline', '')
return
endif
call airline#update_externals()
call s:apply_window_overrides()
let l:mode_color = a:active ? "%#Al2#" : "%#Al2_inactive#" let l:mode_color = a:active ? "%#Al2#" : "%#Al2_inactive#"
let l:mode_sep_color = a:active ? "%#Al3#" : "%#Al3_inactive#" let l:mode_sep_color = a:active ? "%#Al3#" : "%#Al3_inactive#"
let l:info_color = a:active ? "%#Al4#" : "%#Al4_inactive#" let l:info_color = a:active ? "%#Al4#" : "%#Al4_inactive#"
@@ -117,58 +79,104 @@ function! airline#update_statusline(active)
let l:file_flag_color = a:active ? "%#Al7#" : "%#Al7_inactive#" let l:file_flag_color = a:active ? "%#Al7#" : "%#Al7_inactive#"
let sl = '%{airline#update_highlight()}' let sl = '%{airline#update_highlight()}'
if a:active if s:getwinvar(a:winnr, 'airline_render_left', a:active || (!a:active && !g:airline_inactive_collapse))
let sl.=l:mode_color.' '.s:get_section('a').' ' let sl.=l:mode_color.s:get_section(a:winnr, 'a')
let sl.='%{g:airline_detect_paste && &paste ? g:airline_paste_symbol." " : ""}'
let sl.=l:mode_sep_color let sl.=l:mode_sep_color
let sl.=a:active ? g:airline_left_sep : g:airline_left_alt_sep let sl.=a:active ? g:airline_left_sep : g:airline_left_alt_sep
let sl.=l:info_color let sl.=l:info_color
let sl.=' '.s:get_section('b').' ' let sl.=s:get_section(a:winnr, 'b')
let sl.=l:info_sep_color let sl.=l:info_sep_color
let sl.=g:airline_left_sep let sl.=g:airline_left_sep
let sl.=l:status_color.' %<'.s:get_section('c').' ' let sl.=l:status_color.'%<'.s:get_section(a:winnr, 'c')
let sl.=exists('w:airline_section_gutter') let sl.=' '.l:file_flag_color."%(%{&ro ? g:airline_readonly_symbol : ''}%)".l:status_color
\ ? s:get_section('gutter') let sl.=s:get_section(a:winnr, 'gutter', '', '')
\ : '%#warningmsg#'.g:airline_externals_syntastic.l:file_flag_color."%{&ro ? g:airline_readonly_symbol : ''}".l:status_color let sl.=l:status_color
else else
let sl.=l:status_color.' %f%m' let sl.=l:status_color.' %f%m'
endif endif
if !exists('w:airline_left_only') if s:getwinvar(a:winnr, 'airline_render_right', 1)
let sl.='%= '.s:get_section('x').' ' let sl.='%='
let sl.=s:get_section(a:winnr, 'x')
let sl.=l:info_sep_color let sl.=l:info_sep_color
let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep
let sl.=l:info_color let sl.=l:info_color
let sl.=' '.s:get_section('y').' ' let sl.=s:get_section(a:winnr, 'y')
let sl.=l:mode_sep_color let sl.=l:mode_sep_color
let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep
let sl.=l:mode_color let sl.=l:mode_color
let sl.=' '.s:get_section('z').' ' let sl.=s:get_section(a:winnr, 'z')
if a:active
let sl.='%(%#Al2_to_warningmsg#'.g:airline_right_sep
let sl.='%#warningmsg#'.s:getwinvar(a:winnr, 'airline_section_warning', '').'%)'
endif
endif endif
call setwinvar(winnr(), '&statusline', sl) return sl
endfunction
function! airline#exec_funcrefs(list, break_early)
" for 7.2; we cannot iterate list, hence why we use range()
" for 7.3-[97, 328]; we cannot reuse the variable, hence the {}
for i in range(0, len(a:list) - 1)
let Fn{i} = a:list[i]
if a:break_early
if Fn{i}()
return 1
endif
else
call Fn{i}()
endif
endfor
return 0
endfunction
function! airline#update_statusline()
if airline#exec_funcrefs(g:airline_exclude_funcrefs, 1)
call setwinvar(winnr(), '&statusline', '')
return
endif
for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
call setwinvar(nr, 'airline_active', 0)
call setwinvar(nr, '&statusline', airline#get_statusline(nr, 0))
endfor
let w:airline_active = 1
unlet! w:airline_render_left
unlet! w:airline_render_right
for section in s:sections
unlet! w:airline_section_{section}
endfor
call airline#exec_funcrefs(g:airline_statusline_funcrefs, 0)
call setwinvar(winnr(), '&statusline', airline#get_statusline(winnr(), 1))
endfunction endfunction
let g:airline_current_mode_text = ''
function! airline#update_highlight() function! airline#update_highlight()
if w:airline_active if get(w:, 'airline_active', 1)
let l:m = mode() let l:m = mode()
if l:m ==# "i" if l:m ==# "i"
let l:mode = ['insert'] let l:mode = ['insert']
elseif l:m ==# "R" elseif l:m ==# "R"
let l:mode = ['replace'] let l:mode = ['replace']
elseif l:m ==? "v" || l:m ==# "" elseif l:m =~# '\v(v|V||s|S|)'
let l:mode = ['visual'] let l:mode = ['visual']
else else
let l:mode = ['normal'] let l:mode = ['normal']
endif endif
let g:airline_current_mode_text = get(g:airline_mode_map, l:m, l:m) let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
else else
let l:mode = ['inactive'] let l:mode = ['inactive']
let w:airline_current_mode = get(g:airline_mode_map, '__')
endif endif
if &modified | call add(l:mode, 'modified') | endif if g:airline_detect_modified && &modified | call add(l:mode, 'modified') | endif
if &paste | call add(l:mode, 'paste') | endif if g:airline_detect_paste && &paste | call add(l:mode, 'paste') | endif
let mode_string = join(l:mode) let mode_string = join(l:mode)
if !exists('w:airline_lastmode') || w:airline_lastmode != mode_string if get(w:, 'airline_lastmode', '') != mode_string
call airline#highlight(l:mode) call airline#highlight(l:mode)
let w:airline_lastmode = mode_string let w:airline_lastmode = mode_string
endif endif

View File

@@ -1,50 +1,160 @@
let s:sections = ['a','b','c','gutter','x','y','z'] " MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
function! s:override_left_only(section1, section2) let s:ext = {}
let s:ext._cursormove_funcrefs = []
function! s:ext.add_statusline_funcref(funcref) dict
call add(g:airline_statusline_funcrefs, a:funcref)
endfunction
function! s:ext.add_cursormove_funcref(funcref) dict
call add(self._cursormove_funcrefs, a:funcref)
endfunction
let s:filetype_overrides = {
\ 'netrw': [ 'netrw', '%f' ],
\ 'unite': [ 'Unite', '%{unite#get_status_string()}' ],
\ 'nerdtree': [ 'NERD', '' ],
\ 'undotree': [ 'undotree', '' ],
\ 'gundo': [ 'Gundo', '' ],
\ 'diff': [ 'diff', '' ],
\ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ],
\ 'minibufexpl': [ 'MiniBufExplorer', '' ],
\ 'startify': [ 'startify', '' ],
\ }
let s:filetype_regex_overrides = {}
function! airline#extensions#apply_left_override(section1, section2)
let w:airline_section_a = a:section1 let w:airline_section_a = a:section1
let w:airline_section_b = a:section2 let w:airline_section_b = a:section2
let w:airline_section_c = '' let w:airline_section_c = ''
let w:airline_left_only = 1 let w:airline_section_gutter = ' '
let w:airline_render_left = 1
let w:airline_render_right = 0
endfunction endfunction
function! airline#extensions#clear_window_overrides() let s:active_winnr = -1
silent! unlet w:airline_left_only function! airline#extensions#update_statusline()
for section in s:sections let s:active_winnr = winnr()
silent! unlet w:airline_section_{section}
if &buftype == 'quickfix'
let w:airline_section_a = 'Quickfix'
let w:airline_section_b = ''
let w:airline_section_c = ''
let w:airline_section_x = ''
elseif &buftype == 'help'
call airline#extensions#apply_left_override('Help', '%f')
let w:airline_section_x = ''
let w:airline_section_y = ''
let w:airline_render_right = 1
endif
if &previewwindow
let w:airline_section_a = 'Preview'
let w:airline_section_b = ''
let w:airline_section_c = bufname(winbufnr(winnr()))
endif
if has_key(s:filetype_overrides, &ft)
let args = s:filetype_overrides[&ft]
call airline#extensions#apply_left_override(args[0], args[1])
endif
for item in items(s:filetype_regex_overrides)
if match(&ft, item[0]) >= 0
call airline#extensions#apply_left_override(item[1][0], item[1][1])
endif
endfor endfor
endfunction endfunction
function! airline#extensions#apply_window_overrides() function! airline#extensions#is_excluded_window()
if &ft == 'netrw' for matchft in g:airline_exclude_filetypes
call s:override_left_only('netrw', '%f') if matchft ==# &ft
elseif &ft == 'unite' return 1
call s:override_left_only('Unite', unite#get_status_string()) endif
elseif &ft == 'nerdtree' endfor
call s:override_left_only('NERD', '')
elseif &ft == 'undotree' for matchw in g:airline_exclude_filenames
call s:override_left_only('undotree', '') if matchstr(expand('%'), matchw) ==# matchw
elseif &ft == 'gundo' return 1
call s:override_left_only('Gundo', '') endif
elseif &ft == 'diff' endfor
call s:override_left_only('diff', '')
elseif &ft == 'tagbar' if g:airline_exclude_preview && &previewwindow
call s:override_left_only('Tagbar', '') return 1
elseif &ft == 'minibufexpl' endif
call s:override_left_only('MiniBufExplorer', '')
return 0
endfunction
function! airline#extensions#load_theme()
if get(g:, 'loaded_ctrlp', 0)
call airline#extensions#ctrlp#load_theme()
endif
endfunction
function! s:sync_active_winnr()
if winnr() != s:active_winnr
if airline#exec_funcrefs(s:ext._cursormove_funcrefs, 1)
return
endif
call airline#update_statusline()
endif endif
endfunction endfunction
function! airline#extensions#load() function! airline#extensions#load()
let g:unite_force_overwrite_statusline = 0 " non-trivial number of external plugins use eventignore=all, so we need to account for that
autocmd CursorMoved * call <sid>sync_active_winnr()
if exists('g:loaded_ctrlp') && g:loaded_ctrlp " load core funcrefs
call airline#extensions#ctrlp#load_ctrlp_hi() call add(g:airline_exclude_funcrefs, function('airline#extensions#is_excluded_window'))
let g:ctrlp_status_func = { call add(g:airline_statusline_funcrefs, function('airline#extensions#update_statusline'))
\ 'main': 'airline#extensions#ctrlp#ctrlp_airline',
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status', if get(g:, 'loaded_unite', 0)
\ } let g:unite_force_overwrite_statusline = 0
endif endif
call add(g:airline_window_override_funcrefs, function('airline#extensions#apply_window_overrides')) if get(g:, 'loaded_vimfiler', 0)
let g:vimfiler_force_overwrite_statusline = 0
endif
if get(g:, 'loaded_ctrlp', 0)
call airline#extensions#ctrlp#init(s:ext)
endif
if get(g:, 'command_t_loaded', 0)
call airline#extensions#commandt#init(s:ext)
endif
if g:airline_enable_tagbar && exists(':TagbarToggle')
call airline#extensions#tagbar#init(s:ext)
endif
if exists(':VimShell')
let s:filetype_overrides['vimshell'] = ['vimshell','%{vimshell#get_status_string()}']
let s:filetype_regex_overrides['^int-'] = ['vimshell','%{substitute(&ft, "int-", "", "")}']
endif
if g:airline_enable_branch && (get(g:, 'loaded_fugitive', 0) || get(g:, 'loaded_lawrencium', 0))
call airline#extensions#branch#init(s:ext)
endif
if g:airline_enable_syntastic && get(g:, 'loaded_syntastic_plugin')
call airline#extensions#syntastic#init(s:ext)
endif
if g:airline_enable_bufferline && exists('*bufferline#get_status_string')
call airline#extensions#bufferline#init(s:ext)
endif
if g:airline_detect_whitespace
call airline#extensions#whitespace#init()
endif
if g:airline_detect_iminsert
call airline#extensions#iminsert#init()
endif
call airline#exec_funcrefs(g:airline_statusline_funcrefs, 0)
endfunction endfunction

View File

@@ -0,0 +1,15 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#branch#apply()
let w:airline_current_branch = exists('*fugitive#head') && strlen(fugitive#head()) > 0
\ ? g:airline_branch_prefix.fugitive#head()
\ : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0
\ ? g:airline_branch_prefix.lawrencium#statusline()
\ : g:airline_branch_empty_message
endfunction
function! airline#extensions#branch#init(ext)
call a:ext.add_statusline_funcref(function('airline#extensions#branch#apply'))
endfunction

View File

@@ -0,0 +1,31 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#bufferline#apply()
" revert to default in non-active splits
for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
if matchstr(getwinvar(nr, '&statusline'), '%{bufferline') != ''
call setwinvar(nr, 'airline_section_c', '%f%m')
call setwinvar(nr, '&statusline', airline#get_statusline(nr, 0))
endif
endfor
" check for other plugin overrides first
if !exists('w:airline_section_c')
let w:airline_section_c = '%{bufferline#refresh_status()}'.bufferline#get_status_string()
endif
endfunction
function! airline#extensions#bufferline#init(ext)
highlight AlBl_active gui=bold cterm=bold term=bold
highlight link AlBl_inactive Al6
let g:bufferline_inactive_highlight = 'AlBl_inactive'
let g:bufferline_active_highlight = 'AlBl_active'
let g:bufferline_active_buffer_left = ''
let g:bufferline_active_buffer_right = ''
let g:bufferline_separator = ' '
if g:airline_section_c == '%f%m'
call a:ext.add_statusline_funcref(function('airline#extensions#bufferline#apply'))
endif
endfunction

View File

@@ -0,0 +1,12 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#commandt#apply()
if bufname('%') ==# 'GoToFile'
call airline#extensions#apply_left_override('CommandT', '')
endif
endfunction
function! airline#extensions#commandt#init(ext)
call a:ext.add_statusline_funcref(function('airline#extensions#commandt#apply'))
endfunction

View File

@@ -1,20 +1,32 @@
" TODO: support loading color palette from g:airline_theme " MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#ctrlp#load_ctrlp_hi() function! airline#extensions#ctrlp#generate_color_map(dark, light, white)
hi! CtrlPdark ctermfg=189 ctermbg=55 guifg=#d7d7ff guibg=#5f00af return {
hi! CtrlPlight ctermfg=231 ctermbg=98 guifg=#ffffff guibg=#875fd7 \ 'CtrlPdark' : a:dark,
hi! CtrlPwhite ctermfg=55 ctermbg=231 term=bold guifg=#5f00af guibg=#ffffff gui=bold \ 'CtrlPlight' : a:light,
hi! CtrlParrow1 ctermfg=98 ctermbg=231 guifg=#875fd7 guibg=#ffffff \ 'CtrlPwhite' : a:white,
hi! CtrlParrow2 ctermfg=231 ctermbg=98 guifg=#ffffff guibg=#875fd7 \ 'CtrlParrow1' : [ a:light[1] , a:white[1] , a:light[3] , a:white[3] , '' ] ,
hi! CtrlParrow3 ctermfg=98 ctermbg=55 guifg=#875fd7 guibg=#5f00af \ 'CtrlParrow2' : [ a:white[1] , a:light[1] , a:white[3] , a:light[3] , '' ] ,
hi! CtrlParrow4 ctermfg=231 ctermbg=55 guifg=#ffffff guibg=#5f00af \ 'CtrlParrow3' : [ a:light[1] , a:dark[1] , a:light[3] , a:dark[3] , '' ] ,
hi! CtrlParrow5 ctermfg=98 ctermbg=231 guifg=#875fd7 guibg=#ffffff \ }
endfunction endfunction
" Recreate Ctrl-P status line with some slight modifications function! airline#extensions#ctrlp#load_theme()
if exists('g:airline#themes#{g:airline_theme}#ctrlp')
let theme = g:airline#themes#{g:airline_theme}#ctrlp
else
let theme = airline#extensions#ctrlp#generate_color_map(
\ g:airline#themes#{g:airline_theme}#insert['statusline'],
\ g:airline#themes#{g:airline_theme}#insert['info'],
\ g:airline#themes#{g:airline_theme}#insert['mode'])
endif
for key in keys(theme)
call airline#exec_highlight(key, theme[key])
endfor
endfunction
" Arguments: focus, byfname, s:regexp, prv, item, nxt, marked " Arguments: focus, byfname, s:regexp, prv, item, nxt, marked
" a:1 a:2 a:3 a:4 a:5 a:6 a:7
function! airline#extensions#ctrlp#ctrlp_airline(...) function! airline#extensions#ctrlp#ctrlp_airline(...)
let regex = a:3 ? '%#CtrlPlight# regex %*' : '' let regex = a:3 ? '%#CtrlPlight# regex %*' : ''
let prv = '%#CtrlPlight# '.a:4.' %#Ctrlparrow1#'.g:airline_left_sep let prv = '%#CtrlPlight# '.a:4.' %#Ctrlparrow1#'.g:airline_left_sep
@@ -22,17 +34,26 @@ function! airline#extensions#ctrlp#ctrlp_airline(...)
let nxt = '%#CtrlPlight# '.a:6.' %#CtrlParrow3#'.g:airline_left_sep let nxt = '%#CtrlPlight# '.a:6.' %#CtrlParrow3#'.g:airline_left_sep
let marked = '%#CtrlPdark# '.a:7.' ' let marked = '%#CtrlPdark# '.a:7.' '
let focus = '%=%<%#CtrlPdark# '.a:1.' %*' let focus = '%=%<%#CtrlPdark# '.a:1.' %*'
let byfname = '%#CtrlParrow4#'.g:airline_right_alt_sep.'%#CtrlPdark# '.a:2.' %*' let byfname = '%#CtrlParrow3#'.g:airline_right_alt_sep.'%#CtrlPdark# '.a:2.' %*'
let dir = '%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*' let dir = '%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
" Return the full statusline
return regex.prv.item.nxt.marked.focus.byfname.dir return regex.prv.item.nxt.marked.focus.byfname.dir
endfunction endfunction
" Argument: len " Argument: len
" a:1
function! airline#extensions#ctrlp#ctrlp_airline_status(...) function! airline#extensions#ctrlp#ctrlp_airline_status(...)
let len = '%#CtrlPwhite# '.a:1 let len = '%#CtrlPdark# '.a:1
let dir = '%=%<%#CtrlParrow5#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*' let dir = '%=%<%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
" Return the full statusline
return len.dir return len.dir
endfunction endfunction
function! airline#extensions#ctrlp#is_statusline_overwritten()
return match(&statusline, 'CtrlPlight') >= 0
endfunction
function! airline#extensions#ctrlp#init(ext)
let g:ctrlp_status_func = {
\ 'main': 'airline#extensions#ctrlp#ctrlp_airline',
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status',
\ }
call a:ext.add_cursormove_funcref(function('airline#extensions#ctrlp#is_statusline_overwritten'))
endfunction

View File

@@ -0,0 +1,14 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#iminsert#get_text()
if &iminsert
return toupper(get(b:, 'keymap_name', 'lang'))
endif
return ''
endfunction
function! airline#extensions#iminsert#init()
let g:airline_section_a .= ' '.g:airline_left_alt_sep.' %{airline#extensions#iminsert#get_text()}'
endfunction

View File

@@ -0,0 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#syntastic#apply()
let w:airline_section_warning = ' %#warningmsg#%{SyntasticStatuslineFlag()}'
endfunction
function! airline#extensions#syntastic#init(ext)
call a:ext.add_statusline_funcref(function('airline#extensions#syntastic#apply'))
endfunction

View File

@@ -0,0 +1,31 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#tagbar#apply()
if &ft == 'tagbar'
call airline#extensions#apply_left_override('Tagbar', '%{TagbarGenerateStatusline()}')
endif
endfunction
function! s:check_statusline()
" this is a hack!! unlike most plugins that set eventignore=all, tagbar only
" sets it to BufEnter, so the ordering is off: airline sets the statusline
" first, and then tagbar overwrites it, so this detects that and changes it
" back to the airline statusline.
if match(&statusline, '^%!Tagbar') >= 0
call airline#update_statusline()
endif
endfunction
function! airline#extensions#tagbar#init(ext)
call a:ext.add_statusline_funcref(function('airline#extensions#tagbar#apply'))
let g:airline_section_x = '%(%{get(w:,"airline_active",0) ? tagbar#currenttag("%s","") : ""} '
\ .g:airline_right_alt_sep.' %)'.g:airline_section_x
augroup airline_tagbar
autocmd!
autocmd CursorMoved * call <sid>check_statusline()
augroup END
endfunction

View File

@@ -0,0 +1,64 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
let s:initialized = 0
let s:vimrc_detect_whitespace = g:airline_detect_whitespace
function! airline#extensions#whitespace#check()
if &readonly || g:airline_detect_whitespace <= 0
return ''
endif
if !exists('b:airline_whitespace_check')
let b:airline_whitespace_check = ''
let trailing = search(' $', 'nw')
let indents = [search('^ ', 'nb'), search('^ ', 'n'), search('^\t', 'nb'), search('^\t', 'n')]
let mixed = indents[0] != 0 && indents[1] != 0 && indents[2] != 0 && indents[3] != 0
if trailing != 0 || mixed
let b:airline_whitespace_check = g:airline_whitespace_symbol." "
if g:airline_detect_whitespace == 1
if trailing != 0
let b:airline_whitespace_check .= 'trailing['.trailing.'] '
endif
if mixed
let mixnr = indents[0] == indents[1] ? indents[0] : indents[2]
let b:airline_whitespace_check .= 'mixed-indent['.mixnr.'] '
endif
endif
endif
endif
return b:airline_whitespace_check
endfunction!
function! airline#extensions#whitespace#apply()
if !exists('w:airline_section_warning')
let w:airline_section_warning = ' '
endif
let w:airline_section_warning .= '%{airline#extensions#whitespace#check()}'
endfunction
function! airline#extensions#whitespace#toggle()
if g:airline_detect_whitespace > 0
autocmd! airline_whitespace CursorHold,BufWritePost
let g:airline_detect_whitespace = 0
else
call airline#extensions#whitespace#init()
let g:airline_detect_whitespace = s:vimrc_detect_whitespace
endif
endfunction
function! airline#extensions#whitespace#init()
if !s:initialized
let s:initialized = 1
call add(g:airline_statusline_funcrefs, function('airline#extensions#whitespace#apply'))
endif
augroup airline_whitespace
autocmd!
autocmd CursorHold,BufWritePost * unlet! b:airline_whitespace_check
augroup END
endfunction

View File

@@ -1,12 +1,63 @@
" generates a hashtable which defines the colors for each highlight group " MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" generates a dictionary which defines the colors for each highlight group
function! airline#themes#generate_color_map(section1, section2, section3, file) function! airline#themes#generate_color_map(section1, section2, section3, file)
" provide matching background colors if not provided
let file = copy(a:file)
if file[1] == '' | let file[1] = a:section3[1] | endif
if file[3] == '' | let file[3] = a:section3[3] | endif
" guifg guibg ctermfg ctermbg gui/term " guifg guibg ctermfg ctermbg gui/term
return { return {
\ 'mode': [ a:section1[0] , a:section1[1] , a:section1[2] , a:section1[3] , get(a:section1, 4, 'bold') ] , \ 'mode': [ a:section1[0] , a:section1[1] , a:section1[2] , a:section1[3] , get(a:section1, 4, 'bold') ] ,
\ 'mode_separator': [ a:section1[1] , a:section2[1] , a:section1[3] , a:section2[3] , '' ] , \ 'mode_separator': [ a:section1[1] , a:section2[1] , a:section1[3] , a:section2[3] , '' ] ,
\ 'info': [ a:section2[0] , a:section2[1] , a:section2[2] , a:section2[3] , get(a:section2, 4, '' ) ] , \ 'info': [ a:section2[0] , a:section2[1] , a:section2[2] , a:section2[3] , get(a:section2, 4, '' ) ] ,
\ 'info_separator': [ a:section2[1] , a:section3[1] , a:section2[3] , a:section3[3] , '' ] , \ 'info_separator': [ a:section2[1] , a:section3[1] , a:section2[3] , a:section3[3] , '' ] ,
\ 'statusline': [ a:section3[0] , a:section3[1] , a:section3[2] , a:section3[3] , get(a:section3, 4, '' ) ] , \ 'statusline': [ a:section3[0] , a:section3[1] , a:section3[2] , a:section3[3] , get(a:section3 , 4 , '' ) ] ,
\ 'file': [ a:file[0] , a:file[1] , a:file[2] , a:file[3] , get(a:file , 4, '' ) ] , \ 'file': [ file[0] , file[1] , file[2] , file[3] , get(file , 4 , '' ) ] ,
\ } \ }
endfunction endfunction
function! s:get_syn(group, what)
let color = synIDattr(synIDtrans(hlID(a:group)), a:what)
if empty(color) || color == -1
let color = synIDattr(synIDtrans(hlID('Normal')), a:what)
endif
if empty(color) || color == -1
if has('gui_running')
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
else
let color = a:what ==# 'fg' ? 0 : 1
endif
endif
return color
endfunction
function! s:get_array(fg, bg, opts)
let fg = a:fg
let bg = a:bg
return has('gui_running')
\ ? [ fg, bg, '', '', join(a:opts, ',') ]
\ : [ '', '', fg, bg, join(a:opts, ',') ]
endfunction
function! airline#themes#get_highlight(group, ...)
let fg = s:get_syn(a:group, 'fg')
let bg = s:get_syn(a:group, 'bg')
return s:get_array(fg, bg, a:000)
endfunction
function! airline#themes#get_highlight2(fg, bg, ...)
let fg = s:get_syn(a:fg[0], a:fg[1])
let bg = s:get_syn(a:bg[0], a:bg[1])
return s:get_array(fg, bg, a:000)
endfunction
function! airline#themes#exec_highlight_separator(from, to)
let l:from = airline#themes#get_highlight(a:from)
let l:to = airline#themes#get_highlight(a:to)
let group = a:from.'_to_'.a:to
call airline#exec_highlight(group, [ l:to[1], l:from[1], l:to[3], l:from[3] ])
return group
endfunction

View File

@@ -15,7 +15,7 @@ let s:V4 = [ '#c7915b' , 173 ] " coffee
let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde
let s:RE = [ '#ff9eb8' , 211 ] " dress let s:RE = [ '#ff9eb8' , 211 ] " dress
let s:file = [ '#ff2c4b' , s:N3[1] , 196 , s:N3[3] , '' ] let s:file = [ '#ff2c4b' , '' , 196 , '' , '' ]
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
@@ -49,5 +49,4 @@ let g:airline#themes#badwolf#visual_modified = {
let g:airline#themes#badwolf#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) let g:airline#themes#badwolf#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#badwolf#inactive_modified = {
\ 'statusline' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }

View File

@@ -0,0 +1,61 @@
" 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 s:file = ['#ff0000', '', 160, '', '']
" 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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#bubblegum#normal_modified = {
\ 'statusline': [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#insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3, s:file)
let g:airline#themes#bubblegum#insert_modified = copy(g:airline#themes#bubblegum#normal_modified)
let g:airline#themes#bubblegum#insert_paste = {
\ 'mode': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
\ 'mode_separator': [s:gui_orange, s:gui_med_gray_lo, s:cterm_orange, s:cterm_med_gray_lo, ''],
\ }
" Replace mode
let g:airline#themes#bubblegum#replace = {
\ 'mode': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
\ 'mode_separator': [s:gui_red, s:N2[1], s:cterm_red, s:N2[3], ''],
\ 'statusline': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
\ }
let g:airline#themes#bubblegum#replace_modified = copy(g:airline#themes#bubblegum#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#visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3, s:file)
let g:airline#themes#bubblegum#visual_modified = copy(g:airline#themes#bubblegum#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#bubblegum#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)

View File

@@ -1,8 +1,48 @@
let s:file = [ '#ff0000' , '#1c1c1c' , 160 , 233 , '' ] " Each theme is contained in its own file and declares variables scoped to the
let s:N1 = [ '#00005f' , '#dfff00' , 17 , 190 ] " file. These variables represent the possible "modes" that airline can
let s:N2 = [ '#ffffff' , '#444444' , 255 , 238 ] " detect. The mode is the return value of mode(), which gets converted to a
let s:N3 = [ '#9cffd3' , '#202020' , 85 , 234 ] " readable string. The following is a list currently supported modes: normal,
" insert, replace, visual, and inactive.
"
" Each mode can also have overrides. These are small changes to the mode that
" don't require a completely different look. "modified" and "paste" are two
" such supported overrides. These are simply suffixed to the major mode,
" separated by an underscore. For example, "normal_modified" would be normal
" mode where the current buffer is modified.
"
" The theming algorithm is a 2-pass system where the mode will draw over all
" parts of the statusline, and then the override is applied after. This means
" it is possible to specify a subset of the theme in overrides, as it will
" simply overwrite the previous colors. If you want simultaneous overrides,
" then they will need to change different parts of the statusline so they do
" not conflict with each other.
" First let's define some arrays. The s: is just a VimL thing for scoping the
" variables to the current script. Without this, these variables would be
" declared globally.
"
" The array is in the format [ guifg, guibg, ctermfg, ctermbg, opts ].
" The opts takes in values from ":help attr-list".
let s:file = [ '#ff0000' , '' , 160 , '' , '' ]
let s:N1 = [ '#00005f' , '#dfff00' , 17 , 190 ]
let s:N2 = [ '#ffffff' , '#444444' , 255 , 238 ]
let s:N3 = [ '#9cffd3' , '#202020' , 85 , 234 ]
" vim-airline is made up of multiple sections, but for theming purposes there
" is only 3 sections: the mode, the branch indicator, and the gutter (which
" then get mirrored on the right side). generate_color_map is a helper
" function which generates a dictionary which declares the full colorscheme
" for the statusline. See the source code of "autoload/airline/themes.vim"
" for the full set of keys available for theming.
" Now let's define the global g: variable that declares the colors used for
" normal mode. The # is a separator that maps with the directory structure.
" If you get this wrong, Vim will complain loudly.
let g:airline#themes#dark#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) let g:airline#themes#dark#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
" Here we define overrides for when the buffer is modified. This will be
" applied after g:airline#themes#dark#normal, hence why only certain keys are
" declared.
let g:airline#themes#dark#normal_modified = { let g:airline#themes#dark#normal_modified = {
\ 'info_separator': [ '#444444' , '#5f005f' , 238 , 53 , '' ] , \ 'info_separator': [ '#444444' , '#5f005f' , 238 , 53 , '' ] ,
\ 'statusline': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] , \ 'statusline': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
@@ -41,7 +81,15 @@ let g:airline#themes#dark#visual_modified = {
let s:IA = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ] let s:IA = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
let g:airline#themes#dark#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) let g:airline#themes#dark#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#dark#inactive_modified = {
\ 'statusline': [ '#5f005f' , '' , '53' , '' , '' ] ,
\ }
" Here we define the color map for ctrlp. We check for the g:loaded_ctrlp
" variable so that related functionality is loaded iff the user is using
" ctrlp. Note that this is optional, and if you do not define ctrlp colors
" they will be chosen automatically from the existing palette.
if get(g:, 'loaded_ctrlp', 0)
let g:airline#themes#dark#ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
endif

View File

@@ -0,0 +1,53 @@
function! s:generate()
" 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')
" The file indicator is a special case where if the background values are
" empty the generate_color_map function will extract a matching color.
let s:file = airline#themes#get_highlight('Constant')
let s:file[1] = ''
let s:file[3] = ''
let g:airline#themes#jellybeans#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#jellybeans#normal_modified = {
\ 'statusline': [ '#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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#jellybeans#insert_modified = g:airline#themes#jellybeans#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#replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
let g:airline#themes#jellybeans#replace_modified = g:airline#themes#jellybeans#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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#jellybeans#visual_modified = g:airline#themes#jellybeans#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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
endfunction
call s:generate()
augroup airline_jellybeans
autocmd!
autocmd ColorScheme * call <sid>generate()
augroup END

View File

@@ -1,4 +1,4 @@
" vim-airline companion theme of Laederon " vim-airline companion theme of Laederon
" (https://github.com/Donearm/Laederon) " (https://github.com/Donearm/Laederon)
" Normal mode " Normal mode
@@ -8,7 +8,7 @@ let s:N3 = [ '#90a680' , '#2e2d2a' , 64, 235 ] " dilutedpaint & darkgravel
let s:N4 = [ '#777470' , 240 ] " gravel let s:N4 = [ '#777470' , 240 ] " gravel
" Insert mode " Insert mode
let s:I1 = [ '#1a1a18' , '#1693a5' , 232 , 62 ] " blackestgravel & crystallake let s:I1 = [ '#1a1a18' , '#1693a5' , 232 , 62 ] " blackestgravel & crystallake
let s:I2 = [ '#515744' , '#44403a' , 101 , 238 ] " lichen & deepgravel let s:I2 = [ '#515744' , '#44403a' , 101 , 238 ] " lichen & deepgravel
let s:I3 = [ '#1693a5' , '#2e2d2a' , 39 , 235 ] " crystallake & darkgravel let s:I3 = [ '#1693a5' , '#2e2d2a' , 39 , 235 ] " crystallake & darkgravel
@@ -24,7 +24,7 @@ let s:RE = [ '#233e09' , 22 ] " oakleaf
" Paste mode " Paste mode
let s:PA = [ '#ab3e5d' , 161 ] " raspberry let s:PA = [ '#ab3e5d' , 161 ] " raspberry
let s:file = [ '#ef393d' , s:N3[1] , 196 , s:N3[3] , '' ] let s:file = [ '#ef393d' , '' , 196 , '' , '' ]
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ] let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ]
@@ -46,8 +46,8 @@ let g:airline#themes#laederon#insert_paste = {
let g:airline#themes#laederon#replace = copy(airline#themes#laederon#insert) let g:airline#themes#laederon#replace = copy(airline#themes#laederon#insert)
let g:airline#themes#laederon#replace.mode = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ] let g:airline#themes#laederon#replace.mode = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
let g:airline#themes#laederon#replace.mode_separator = [ s:RE[0] , s:I2[1] , s:RE[1] , s:V4[1] , '' ] let g:airline#themes#laederon#replace.mode_separator = [ s:RE[0] , s:I2[1] , s:RE[1] , s:I2[3] , '' ]
let g:airline#themes#laederon#replace_modified = g:airline#themes#laederon#insert_modified let g:airline#themes#laederon#replace_modified = g:airline#themes#laederon#insert_modified
@@ -58,5 +58,4 @@ let g:airline#themes#laederon#visual_modified = {
let g:airline#themes#laederon#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) let g:airline#themes#laederon#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#laederon#inactive_modified = {
\ 'statusline' : [ s:V1[1] , '', s:V1[3] , '', '' ] }

View File

@@ -1,5 +1,4 @@
let s:file = [ '#df0000' , '' , 160 , '' ]
let s:file = [ '#df0000' , '#ffffff' , 160 , 255 ]
let s:N1 = [ '#ffffff' , '#005fff' , 255 , 27 ] let s:N1 = [ '#ffffff' , '#005fff' , 255 , 27 ]
let s:N2 = [ '#000087' , '#00dfff' , 18 , 45 ] let s:N2 = [ '#000087' , '#00dfff' , 18 , 45 ]
let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ] let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ]
@@ -42,6 +41,4 @@ let g:airline#themes#light#visual_modified = {
let s:IA = [ '#9e9e9e' , '#ffffff' , 247 , 255 , '' ] let s:IA = [ '#9e9e9e' , '#ffffff' , 247 , 255 , '' ]
let g:airline#themes#light#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) let g:airline#themes#light#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#light#inactive_modified = {
\ 'statusline': [ '#df0000' , '' , '160' , '', '' ]
\ }

View File

@@ -0,0 +1,54 @@
" vim-airline companion theme of Luna
" (https://github.com/Pychimp/vim-luna)
let s:file = [ '#ffffff' , '#002b2b' , 231 , 23 , '' ]
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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#luna#normal_modified = {
\ 'info_separator': [ '#003f3f' , '#450000' , 29 , 52 , '' ] ,
\ 'statusline': [ '#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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#luna#insert_modified = {
\ 'info_separator': [ '#003f3f' , '#005e5e' , 29 , 52 , '' ] ,
\ 'statusline': [ '#ffffff' , '#005e5e' , 255 , 52 , '' ] ,
\ }
let g:airline#themes#luna#insert_paste = {
\ 'mode': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] ,
\ 'mode_separator': [ '#789f00' , s:I2[1] , 106 , s:I2[3] , '' ] ,
\ }
let g:airline#themes#luna#replace = copy(g:airline#themes#luna#insert)
let g:airline#themes#luna#replace.mode = [ s:I2[0] , '#920000' , s:I2[2] , 88 , '' ]
let g:airline#themes#luna#replace.mode_separator = [ '#920000' , s:I2[1] , 88 , s:I2[3] , '' ]
let g:airline#themes#luna#replace_modified = g:airline#themes#luna#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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#luna#visual_modified = {
\ 'info_separator': [ '#003f3f' , '#450000' , 29 , 52 , '' ] ,
\ 'statusline': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
\ }
let s:IA = [ '#4e4e4e' , '#002b2b' , 59 , 23 , '' ]
let g:airline#themes#luna#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
if get(g:, 'loaded_ctrlp', 0)
let g:airline#themes#luna#ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] ,
\ [ '#ffffff' , '#005252' , 231 , 36 , '' ] ,
\ [ '#ffffff' , '#973d45' , 231 , 95 , '' ] )
endif

View File

@@ -0,0 +1,61 @@
let s:file = [ '#66d9ef' , '#465457' , 81 , 67 , 'bold' ]
" 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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#molokai#normal_modified = {
\ 'info_separator': [ '#232526' , '#e6db74' , 16 , 144 , '' ] ,
\ 'statusline': [ '#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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#molokai#insert_modified = {
\ 'info_separator': [ '#232526' , '#66d9ef' , 16 , 81 , '' ] ,
\ 'statusline': [ '#080808' , '#66d9ef' , 232 , 81 , '' ] ,
\ }
" Replace mode
let g:airline#themes#molokai#replace = copy(g:airline#themes#molokai#insert)
let g:airline#themes#molokai#replace.mode = [ s:I1[0] , '#ef5939' , s:I1[2] , 166 , '' ]
let g:airline#themes#molokai#replace.mode_separator = [ '#ef5939' , s:I2[1] , 166 , s:I2[3] , '' ]
let g:airline#themes#molokai#replace_modified = {
\ 'info_separator': [ '#232526' , '#ef5939' , 16 , 166 , '' ] ,
\ 'statusline': [ '#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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#molokai#visual_modified = {
\ 'info_separator': [ '#232526' , '#fd971f' , 16 , 208 , '' ] ,
\ 'statusline': [ '#080808' , '#fd971f' , 232 , 208 , '' ] ,
\ }
" Inactive
let s:IA = [ '#1b1d1e' , '#465457' , 233 , 67 , '' ]
let g:airline#themes#molokai#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
" CtrlP
if get(g:, 'loaded_ctrlp', 0)
let g:airline#themes#molokai#ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#f8f8f0' , '#465457' , 253 , 67 , '' ] ,
\ [ '#f8f8f0' , '#232526' , 253 , 16 , '' ] ,
\ [ '#080808' , '#e6db74' , 232 , 144 , 'bold' ] )
endif

View File

@@ -36,7 +36,7 @@ let s:termbg = 232
let s:termsep = 236 let s:termsep = 236
let s:guisep = '#303030' let s:guisep = '#303030'
let s:file = [ '#ff0000' , s:guibg , 160 , s:termbg , '' ] let s:file = [ '#ff0000' , '' , 160 , '' , '' ]
let s:N1 = s:swap ? [ s:guibg , '#00dfff' , s:termbg , 45 ] : [ '#00dfff' , s:guibg , 45 , s:termbg ] let s:N1 = s:swap ? [ s:guibg , '#00dfff' , s:termbg , 45 ] : [ '#00dfff' , s:guibg , 45 , s:termbg ]
let s:N2 = [ '#ff5f00' , s:guibg, 202 , s:termbg ] let s:N2 = [ '#ff5f00' , s:guibg, 202 , s:termbg ]
let s:N3 = [ '#767676' , s:guibg, 243 , s:termbg ] let s:N3 = [ '#767676' , s:guibg, 243 , s:termbg ]
@@ -98,5 +98,4 @@ let g:airline#themes#simple#visual_modified = copy(g:airline#themes#simple#norma
let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ] let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ]
let g:airline#themes#simple#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) let g:airline#themes#simple#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#simple#inactive_modified = copy(g:airline#themes#simple#normal_modified)

View File

@@ -1,163 +1,169 @@
"""""""""""""""""""""""""""""""""""""""""""""""" function! s:generate()
" Options """"""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""" " Options
let s:reduced = get(g:, 'airline_solarized_reduced', 1) """"""""""""""""""""""""""""""""""""""""""""""""
let s:background = get(g:, 'airline_solarized_bg', &background) let s:reduced = get(g:, 'airline_solarized_reduced', 1)
let s:background = get(g:, 'airline_solarized_bg', &background)
"""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""
" Colors " Colors
"""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""
" Base colors " Base colors
let s:base03 = {'t': 234, 'g': '#002b36'} let s:base03 = {'t': 234, 'g': '#002b36'}
let s:base02 = {'t': 235, 'g': '#073642'} let s:base02 = {'t': 235, 'g': '#073642'}
let s:base01 = {'t': 240, 'g': '#586e75'} let s:base01 = {'t': 240, 'g': '#586e75'}
let s:base00 = {'t': 241, 'g': '#657b83'} let s:base00 = {'t': 241, 'g': '#657b83'}
let s:base0 = {'t': 244, 'g': '#839496'} let s:base0 = {'t': 244, 'g': '#839496'}
let s:base1 = {'t': 245, 'g': '#93a1a1'} let s:base1 = {'t': 245, 'g': '#93a1a1'}
let s:base2 = {'t': 254, 'g': '#eee8d5'} let s:base2 = {'t': 254, 'g': '#eee8d5'}
let s:base3 = {'t': 230, 'g': '#fdf6e3'} let s:base3 = {'t': 230, 'g': '#fdf6e3'}
let s:yellow = {'t': 136, 'g': '#b58900'} let s:yellow = {'t': 136, 'g': '#b58900'}
let s:orange = {'t': 166, 'g': '#cb4b16'} let s:orange = {'t': 166, 'g': '#cb4b16'}
let s:red = {'t': 160, 'g': '#dc322f'} let s:red = {'t': 160, 'g': '#dc322f'}
let s:magenta = {'t': 125, 'g': '#d33682'} let s:magenta = {'t': 125, 'g': '#d33682'}
let s:violet = {'t': 61, 'g': '#6c71c4'} let s:violet = {'t': 61, 'g': '#6c71c4'}
let s:blue = {'t': 33, 'g': '#267bd2'} let s:blue = {'t': 33, 'g': '#268bd2'}
let s:cyan = {'t': 37, 'g': '#2aa198'} let s:cyan = {'t': 37, 'g': '#2aa198'}
let s:green = {'t': 64, 'g': '#859900'} let s:green = {'t': 64, 'g': '#859900'}
let s:c218 = {'t': 218, 'g': '#ffafd7'} let s:c218 = {'t': 218, 'g': '#ffafd7'}
let s:c52 = {'t': 52, 'g': '#5f0000'} let s:c52 = {'t': 52, 'g': '#5f0000'}
"""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""
" Simple mappings " Simple mappings
" NOTE: These are easily tweakable mappings. The actual mappings get " NOTE: These are easily tweakable mappings. The actual mappings get
" the specific gui and terminal colors from the base color dicts. " the specific gui and terminal colors from the base color dicts.
"""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""
" Normal mode " Normal mode
let s:N1 = [s:base2, s:blue, 'bold'] let s:N1 = [s:base2, s:blue, 'bold']
let s:N2 = [s:base2, s:base01, ''] if s:background == 'dark'
if s:background == 'dark' let s:N2 = [s:base2, s:base01, '']
let s:N3 = [s:base1, s:base02, ''] let s:N3 = [s:base1, s:base02, '']
else else
let s:N2 = [s:base2, s:base1, '']
let s:N3 = [s:base00, s:base2, ''] let s:N3 = [s:base00, s:base2, '']
endif endif
let s:NF = [s:orange, s:N3[1], ''] let s:NF = [s:orange, s:N3[1], '']
if s:reduced if s:reduced
if s:background == 'dark' if s:background == 'dark'
let s:NM = { let s:NM = {
\ 'info_separator': [s:N2[1], s:N3[1], ''], \ 'info_separator': [s:N2[1], s:N3[1], ''],
\ 'statusline': [s:magenta, s:N3[1], ''], \ 'statusline': [s:magenta, s:N3[1], ''],
\ } \ }
else else
let s:NM = { let s:NM = {
\ 'info_separator': [s:N2[1], s:N3[1], ''], \ 'info_separator': [s:N2[1], s:N3[1], ''],
\ 'statusline': [s:magenta, s:N3[1], ''], \ 'statusline': [s:magenta, s:N3[1], ''],
\ } \ }
endif endif
else else
if s:background == 'dark' if s:background == 'dark'
let s:NM = { let s:NM = {
\ 'info_separator': [s:N2[1], s:c52, ''], \ 'info_separator': [s:N2[1], s:c52, ''],
\ 'statusline': [s:c218, s:c52, ''] \ 'statusline': [s:c218, s:c52, '']
\ } \ }
else else
let s:NM = { let s:NM = {
\ 'info_separator': [s:N2[1], s:c218, ''], \ 'info_separator': [s:N2[1], s:c218, ''],
\ 'statusline': [s:red, s:c218, ''] \ 'statusline': [s:red, s:c218, '']
\ } \ }
endif endif
endif endif
" Insert mode " Insert mode
let s:I1 = [s:N1[0], s:green, 'bold'] let s:I1 = [s:N1[0], s:green, 'bold']
if s:reduced if s:reduced
let s:I2 = s:N2 let s:I2 = s:N2
else else
let s:I2 = [s:base3, s:base1, ''] let s:I2 = [s:base3, s:base1, '']
endif endif
let s:I3 = s:N3 let s:I3 = s:N3
let s:IF = s:NF let s:IF = s:NF
if s:reduced if s:reduced
let s:IM = s:NM let s:IM = s:NM
else else
let s:IM = { let s:IM = {
\ 'info_separator': [s:I2[1], s:NM.statusline[1], ''], \ 'info_separator': [s:I2[1], s:NM.statusline[1], ''],
\ 'statusline': s:NM.statusline \ 'statusline': s:NM.statusline
\ } \ }
endif endif
" Visual mode " Visual mode
let s:V1 = [s:N1[0], s:orange, 'bold'] let s:V1 = [s:N1[0], s:orange, 'bold']
if s:reduced if s:reduced
let s:V2 = s:N2 let s:V2 = s:N2
let s:V3 = s:N3 let s:V3 = s:N3
else else
let s:V2 = s:I2 let s:V2 = s:I2
let s:V3 = s:I3 let s:V3 = s:I3
endif endif
let s:VF = s:NF let s:VF = s:NF
if s:reduced if s:reduced
let s:VM = s:NM let s:VM = s:NM
else else
let s:VM = s:IM let s:VM = s:IM
endif endif
" Inactive " Inactive
if s:background == 'dark' if s:background == 'dark'
let s:IA = [s:base00, s:base02, ''] let s:IA = [s:base00, s:base02, '']
else else
let s:IA = [s:base1, s:base2, ''] let s:IA = [s:base1, s:base2, '']
endif endif
"""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""
" Actual mappings " Actual mappings
" WARNING: Don't modify this section unless necessary. " WARNING: Don't modify this section unless necessary.
"""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""
let s:NFa = [s:NF[0].g, s:NF[1].g, s:NF[0].t, s:NF[1].t, s:NF[2]] let s:NFa = [s:NF[0].g, s:NF[1].g, s:NF[0].t, s:NF[1].t, s:NF[2]]
let s:IFa = [s:IF[0].g, s:IF[1].g, s:IF[0].t, s:IF[1].t, s:IF[2]] let s:IFa = [s:IF[0].g, s:IF[1].g, s:IF[0].t, s:IF[1].t, s:IF[2]]
let s:VFa = [s:VF[0].g, s:VF[1].g, s:VF[0].t, s:VF[1].t, s:VF[2]] let s:VFa = [s:VF[0].g, s:VF[1].g, s:VF[0].t, s:VF[1].t, s:VF[2]]
let g:airline#themes#solarized#inactive = airline#themes#generate_color_map( let g:airline#themes#solarized#inactive = airline#themes#generate_color_map(
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]], \ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]], \ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]], \ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
\ s:NFa) \ s:NFa)
let g:airline#themes#solarized#inactive_modified = { let g:airline#themes#solarized#normal = airline#themes#generate_color_map(
\ 'statusline': [s:NM.statusline[0].g, '', s:NM.statusline[0].t, '', ''] } \ [s:N1[0].g, s:N1[1].g, s:N1[0].t, s:N1[1].t, s:N1[2]],
\ [s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]],
\ [s:N3[0].g, s:N3[1].g, s:N3[0].t, s:N3[1].t, s:N3[2]],
\ s:NFa)
let g:airline#themes#solarized#normal = airline#themes#generate_color_map( let g:airline#themes#solarized#normal_modified = {
\ [s:N1[0].g, s:N1[1].g, s:N1[0].t, s:N1[1].t, s:N1[2]], \ 'info_separator': [s:NM.info_separator[0].g, s:NM.info_separator[1].g,
\ [s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]], \ s:NM.info_separator[0].t, s:NM.info_separator[1].t, s:NM.info_separator[2]],
\ [s:N3[0].g, s:N3[1].g, s:N3[0].t, s:N3[1].t, s:N3[2]], \ 'statusline': [s:NM.statusline[0].g, s:NM.statusline[1].g,
\ s:NFa) \ s:NM.statusline[0].t, s:NM.statusline[1].t, s:NM.statusline[2]]}
let g:airline#themes#solarized#normal_modified = { let g:airline#themes#solarized#insert = airline#themes#generate_color_map(
\ 'info_separator': [s:NM.info_separator[0].g, s:NM.info_separator[1].g, \ [s:I1[0].g, s:I1[1].g, s:I1[0].t, s:I1[1].t, s:I1[2]],
\ s:NM.info_separator[0].t, s:NM.info_separator[1].t, s:NM.info_separator[2]], \ [s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]],
\ 'statusline': [s:NM.statusline[0].g, s:NM.statusline[1].g, \ [s:I3[0].g, s:I3[1].g, s:I3[0].t, s:I3[1].t, s:I3[2]],
\ s:NM.statusline[0].t, s:NM.statusline[1].t, s:NM.statusline[2]]} \ s:IFa)
let g:airline#themes#solarized#insert = airline#themes#generate_color_map( let g:airline#themes#solarized#insert_modified = {
\ [s:I1[0].g, s:I1[1].g, s:I1[0].t, s:I1[1].t, s:I1[2]], \ 'info_separator': [s:IM.info_separator[0].g, s:IM.info_separator[1].g,
\ [s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]], \ s:IM.info_separator[0].t, s:IM.info_separator[1].t, s:IM.info_separator[2]],
\ [s:I3[0].g, s:I3[1].g, s:I3[0].t, s:I3[1].t, s:I3[2]], \ 'statusline': [s:IM.statusline[0].g, s:IM.statusline[1].g,
\ s:IFa) \ s:IM.statusline[0].t, s:IM.statusline[1].t, s:IM.statusline[2]]}
let g:airline#themes#solarized#insert_modified = { let g:airline#themes#solarized#visual = airline#themes#generate_color_map(
\ 'info_separator': [s:IM.info_separator[0].g, s:IM.info_separator[1].g, \ [s:V1[0].g, s:V1[1].g, s:V1[0].t, s:V1[1].t, s:V1[2]],
\ s:IM.info_separator[0].t, s:IM.info_separator[1].t, s:IM.info_separator[2]], \ [s:V2[0].g, s:V2[1].g, s:V2[0].t, s:V2[1].t, s:V2[2]],
\ 'statusline': [s:IM.statusline[0].g, s:IM.statusline[1].g, \ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]],
\ s:IM.statusline[0].t, s:IM.statusline[1].t, s:IM.statusline[2]]} \ s:VFa)
let g:airline#themes#solarized#visual = airline#themes#generate_color_map( let g:airline#themes#solarized#visual_modified = {
\ [s:V1[0].g, s:V1[1].g, s:V1[0].t, s:V1[1].t, s:V1[2]], \ 'info_separator': [s:VM.info_separator[0].g, s:VM.info_separator[1].g,
\ [s:V2[0].g, s:V2[1].g, s:V2[0].t, s:V2[1].t, s:V2[2]], \ s:VM.info_separator[0].t, s:VM.info_separator[1].t, s:VM.info_separator[2]],
\ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]], \ 'statusline': [s:VM.statusline[0].g, s:VM.statusline[1].g,
\ s:VFa) \ s:VM.statusline[0].t, s:VM.statusline[1].t, s:VM.statusline[2]]}
endfunction
let g:airline#themes#solarized#visual_modified = { call s:generate()
\ 'info_separator': [s:VM.info_separator[0].g, s:VM.info_separator[1].g, augroup airline_solarized
\ s:VM.info_separator[0].t, s:VM.info_separator[1].t, s:VM.info_separator[2]], autocmd!
\ 'statusline': [s:VM.statusline[0].g, s:VM.statusline[1].g, autocmd ColorScheme * call <sid>generate() | call airline#reload_highlight()
\ s:VM.statusline[0].t, s:VM.statusline[1].t, s:VM.statusline[2]]} augroup END

View File

@@ -0,0 +1,43 @@
function! s:generate()
let s:file = airline#themes#get_highlight('Constant')
" clear out backgrounds so generate_color_map will fill them in
let s:file[1] = ''
let s:file[3] = ''
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Directory', 'fg'], 'bold')
let s:N2 = airline#themes#get_highlight('Pmenu')
let s:N3 = airline#themes#get_highlight('CursorLine')
let g:airline#themes#tomorrow#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let group = airline#themes#get_highlight('vimCommand')
let g:airline#themes#tomorrow#normal_modified = {
\ 'statusline': [ group[0], '', group[2], '', '' ]
\ }
let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['MoreMsg', 'fg'], 'bold')
let s:I2 = airline#themes#get_highlight2(['MoreMsg', 'fg'], ['Normal', 'bg'])
let s:I3 = s:N3
let g:airline#themes#tomorrow#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#tomorrow#insert_modified = g:airline#themes#tomorrow#normal_modified
let s:R1 = airline#themes#get_highlight('Error', 'bold')
let s:R2 = s:N2
let s:R3 = s:N3
let g:airline#themes#tomorrow#replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
let g:airline#themes#tomorrow#replace_modified = g:airline#themes#tomorrow#normal_modified
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Constant', 'fg'], 'bold')
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
let s:V3 = s:N3
let g:airline#themes#tomorrow#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#tomorrow#visual_modified = g:airline#themes#tomorrow#normal_modified
let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg'])
let g:airline#themes#tomorrow#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
endfunction
call s:generate()
augroup airline_tomorrow
autocmd!
autocmd ColorScheme * call <sid>generate() | call airline#reload_highlight()
augroup END

View File

@@ -11,7 +11,7 @@ let s:N4 = [ '#857f78' , 243 ] " gravel
let s:I1 = [ '#1a1a18' , '#fade3e' , 232 , 221 ] " blackestgravel & warmcorn let s:I1 = [ '#1a1a18' , '#fade3e' , 232 , 221 ] " blackestgravel & warmcorn
let s:I2 = [ '#c7b386' , '#45413b' , 252 , 238 ] " bleaksand & deepgravel let s:I2 = [ '#c7b386' , '#45413b' , 252 , 238 ] " bleaksand & deepgravel
let s:I3 = [ '#f4cf86' , '#242321' , 222 , 235 ] " lighttannedskin & darkgravel let s:I3 = [ '#f4cf86' , '#242321' , 222 , 235 ] " lighttannedskin & darkgravel
" Visual mode " Visual mode
let s:V1 = [ '#1c1b1a' , '#9a4820' , 233 , 88 ] " blackgravel & warmadobe let s:V1 = [ '#1c1b1a' , '#9a4820' , 233 , 88 ] " blackgravel & warmadobe
let s:V2 = [ '#000000' , '#88633f' , 16 , 95 ] " coal & cappuccino let s:V2 = [ '#000000' , '#88633f' , 16 , 95 ] " coal & cappuccino
@@ -21,10 +21,10 @@ let s:V4 = [ '#c14c3d' , 160 ] " tannedumbrella
" Replace mode " Replace mode
let s:RE = [ '#c7915b' , 173 ] " nut let s:RE = [ '#c7915b' , 173 ] " nut
" Paste mode " Paste mode
let s:PA = [ '#f9ef6d' , 154 ] " bleaklemon let s:PA = [ '#f9ef6d' , 154 ] " bleaklemon
let s:file = [ '#ff7400' , s:N3[1] , 196 , s:N3[3] , '' ] let s:file = [ '#ff7400' , '' , 196 , '' , '' ]
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ] let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ]
@@ -48,8 +48,8 @@ let g:airline#themes#ubaryd#insert_paste = {
let g:airline#themes#ubaryd#replace = copy(airline#themes#ubaryd#insert) let g:airline#themes#ubaryd#replace = copy(airline#themes#ubaryd#insert)
let g:airline#themes#ubaryd#replace.mode = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ] let g:airline#themes#ubaryd#replace.mode = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
let g:airline#themes#ubaryd#replace.mode_separator = [ s:RE[0] , s:I2[1] , s:RE[1] , s:V4[1] , '' ] let g:airline#themes#ubaryd#replace.mode_separator = [ s:RE[0] , s:I2[1] , s:RE[1] , s:I2[3] , '' ]
let g:airline#themes#ubaryd#replace_modified = g:airline#themes#ubaryd#insert_modified let g:airline#themes#ubaryd#replace_modified = g:airline#themes#ubaryd#insert_modified
@@ -59,6 +59,4 @@ let g:airline#themes#ubaryd#visual_modified = {
\ 'statusline' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] } \ 'statusline' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
let g:airline#themes#ubaryd#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) let g:airline#themes#ubaryd#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#ubaryd#inactive_modified = {
\ 'statusline' : [ s:V1[1] , '', s:V1[3], '', '']
\ }

View File

@@ -0,0 +1,94 @@
" vim-airline companion theme of Wombat
" looks great with wombat256 vim colorscheme
" Normal mode
" [ guifg, guibg, ctermfg, ctermbg, opts ]
let s:N1 = [ '#141413' , '#CAE682' , 232 , 192 ] " mode
let s:N2 = [ '#CAE682' , '#32322F' , 192 , 236 ] " info
let s:N3 = [ '#CAE682' , '#242424' , 192 , 234 ] " statusline
let s:N4 = [ '#86CD74' , 113 ] " mode modified
" Insert mode
let s:I1 = [ '#141413' , '#FDE76E' , 232 , 227 ]
let s:I2 = [ '#FDE76E' , '#32322F' , 227 , 236 ]
let s:I3 = [ '#FDE76E' , '#242424' , 227 , 234 ]
let s:I4 = [ '#FADE3E' , 221 ]
" Visual mode
let s:V1 = [ '#141413' , '#B5D3F3' , 232 , 153 ]
let s:V2 = [ '#B5D3F3' , '#32322F' , 153 , 236 ]
let s:V3 = [ '#B5D3F3' , '#242424' , 153 , 234 ]
let s:V4 = [ '#7CB0E6' , 111 ]
" Replace mode
let s:R1 = [ '#141413' , '#E5786D' , 232 , 173 ]
let s:R2 = [ '#E5786D' , '#32322F' , 173 , 236 ]
let s:R3 = [ '#E5786D' , '#242424' , 173 , 234 ]
let s:R4 = [ '#E55345' , 203 ]
" Paste mode
let s:PA = [ '#94E42C' , 47 ]
" Info modified
let s:IM = [ '#40403C' , 238 ]
" File permissions (RO, etc)
let s:file = [ '#E5786D' , '' , 203 , '' , '' ]
" Inactive mode
let s:IA = [ '#767676' , s:N3[1] , 243 , s:N3[3] , '' ]
let g:airline#themes#wombat#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#wombat#normal_modified = {
\ 'mode' : [ s:N1[0] , s:N4[0] , s:N1[2] , s:N4[1] , '' ] ,
\ 'mode_separator' : [ s:N4[0] , s:IM[0] , s:N4[1] , s:IM[1] , 'bold' ] ,
\ 'info' : [ s:N4[0] , s:IM[0] , s:N4[1] , s:IM[1] , '' ] ,
\ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] ,
\ 'statusline' : [ s:N4[0] , s:N3[1] , s:N4[1] , s:N3[3] , '' ] }
let g:airline#themes#wombat#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#wombat#insert_modified = {
\ 'mode' : [ s:I1[0] , s:I4[0] , s:I1[2] , s:I4[1] , '' ] ,
\ 'mode_separator' : [ s:I4[0] , s:IM[0] , s:I4[1] , s:IM[1] , 'bold' ] ,
\ 'info' : [ s:I4[0] , s:IM[0] , s:I4[1] , s:IM[1] , '' ] ,
\ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] ,
\ 'statusline' : [ s:I4[0] , s:N3[1] , s:I4[1] , s:N3[3] , '' ] }
let g:airline#themes#wombat#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#wombat#visual_modified = {
\ 'mode' : [ s:V1[0] , s:V4[0] , s:V1[2] , s:V4[1] , '' ] ,
\ 'mode_separator' : [ s:V4[0] , s:IM[0] , s:V4[1] , s:IM[1] , 'bold' ] ,
\ 'info' : [ s:V4[0] , s:IM[0] , s:V4[1] , s:IM[1] , '' ] ,
\ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] ,
\ 'statusline' : [ s:V4[0] , s:N3[1] , s:V4[1] , s:N3[3] , '' ] }
let g:airline#themes#wombat#replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
let g:airline#themes#wombat#replace_modified = {
\ 'mode' : [ s:R1[0] , s:R4[0] , s:R1[2] , s:R4[1] , '' ] ,
\ 'mode_separator' : [ s:R4[0] , s:IM[0] , s:R4[1] , s:IM[1] , 'bold' ] ,
\ 'info' : [ s:R4[0] , s:IM[0] , s:R4[1] , s:IM[1] , '' ] ,
\ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] ,
\ 'statusline' : [ s:R4[0] , s:N3[1] , s:R4[1] , s:N3[3] , '' ] }
let g:airline#themes#wombat#insert_paste = {
\ 'mode' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] ,
\ 'mode_separator' : [ s:PA[0] , s:IM[0] , s:PA[1] , s:IM[1] , 'bold' ] ,
\ 'info' : [ s:PA[0] , s:IM[0] , s:PA[1] , s:IM[1] , '' ] ,
\ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] ,
\ 'statusline' : [ s:PA[0] , s:N3[1] , s:PA[1] , s:N3[3] , '' ] }
let g:airline#themes#wombat#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
if get(g:, 'loaded_ctrlp', 0)
let g:airline#themes#wombat#ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#DADADA' , '#242424' , 253 , 234 , '' ] ,
\ [ '#DADADA' , '#40403C' , 253 , 238 , '' ] ,
\ [ '#141413' , '#DADADA' , 232 , 253 , 'bold' ] )
endif

View File

@@ -1,33 +1,32 @@
*airline.txt* Lean and mean statusline that's light as air *airline.txt* Lean and mean statusline that's light as air
_ _ _ _ ~
__ _(_)_ __ ___ __ _(_)_ __| (_)_ __ ___ ~
\ \ / / | '_ ` _ \ _____ / _` | | '__| | | '_ \ / _ \ ~
\ V /| | | | | | |_____| (_| | | | | | | | | | __/ ~
\_/ |_|_| |_| |_| \__,_|_|_| |_|_|_| |_|\___| ~
~
============================================================================== ==============================================================================
INTRODUCTION *airline* INTRODUCTION *airline*
There's already powerline <https://github.com/Lokaltog/powerline>, why yet vim-airline is a fast and lightweight alternative to powerline, written
another statusline? in 100% vimscript with no outside dependencies.
* it's 100% vimscript; no python needed. ==============================================================================
* it's small. i want the core plugin to be less than 200 lines as a rule. FEATURES *airline-features*
* it gets you 90% of the way there; in addition to all the standard goodies,
it integrates with a variety of popular plugins, including: * tiny core written with extensibility in mind.
* fugitve <https://github.com/tpope/vim-fugitive> * integrates with many popular plugins.
* syntastic <https://github.com/scrooloose/syntastic> * looks good with regular fonts, and provides configuration points so you
* vim-bufferline <https://github.com/bling/vim-bufferline>
* unite <https://github.com/Shougo/unite.vim>
* ctrlp <https://github.com/kien/ctrlp.vim>
* it looks good with regular fonts, and provides configuration points so you
can use unicode or powerline symbols. can use unicode or powerline symbols.
* it's fast to load, taking roughly 1ms. by comparison, powerline needs * optimized for speed; it loads in under a millisecond.
60ms on the same machine. * fully customizable; if you know a little |statusline| syntax you can
* it's fully customizable; if you know a little |statusline| syntax you can
tweak it to your needs. tweak it to your needs.
* it's trivial to write colorschemes; for a minimal theme you need to edit * extremely easy to write themes.
9 lines of colors. (please send pull requests if you create new themes!)
============================================================================== ==============================================================================
NAME *airline-name* NAME *airline-name*
Why is it named airline? Where did the name come from?
I wrote this on an airplane, and since it's light as air it turned out to be a I wrote this on an airplane, and since it's light as air it turned out to be a
good name :-) good name :-)
@@ -48,9 +47,10 @@ values):
let g:airline_right_sep='<' let g:airline_right_sep='<'
< <
* enable/disable fugitive integration * enable/disable fugitive/lawrencium integration
> >
let g:airline_enable_fugitive=1 let g:airline_enable_branch=1
let g:airline_branch_empty_message=''
< <
* enable/disable syntastic integration * enable/disable syntastic integration
@@ -58,6 +58,39 @@ values):
let g:airline_enable_syntastic=1 let g:airline_enable_syntastic=1
< <
* enable/disable tagbar integration
>
let g:airline_enable_tagbar=1
<
* enable modified detection
>
let g:airline_detect_modified=1
<
* enable paste detection
>
let g:airline_detect_paste=1
<
* enable iminsert detection
>
let g:airline_detect_iminsert=1
<
* enable whitespace detection
>
let g:airline_detect_whitespace=0 "disabled
let g:airline_detect_whitespace=1 "icon and message (default)
let g:airline_detect_whitespace=2 "icon only
<
* determine whether inactive windows should have the left section collapsed to
only the filename of that buffer.
>
let g:airline_inactive_collapse=1
<
* change the default theme * change the default theme
> >
let g:airline_theme='dark' let g:airline_theme='dark'
@@ -98,6 +131,9 @@ COMMANDS *airline-commands*
:AirlineTheme {theme-name} *:AirlineTheme* :AirlineTheme {theme-name} *:AirlineTheme*
Displays or changes the current theme. Displays or changes the current theme.
:AirlineToggleWhitespace *:AirlineToggleWhitespace*
Toggles whitespace detection.
============================================================================== ==============================================================================
CUSTOMIZATION *airline-customization* CUSTOMIZATION *airline-customization*
@@ -113,19 +149,29 @@ separators, as well as the powerline font glyths.
let g:airline_linecolumn_prefix = '␊ ' let g:airline_linecolumn_prefix = '␊ '
let g:airline_linecolumn_prefix = '␤ ' let g:airline_linecolumn_prefix = '␤ '
let g:airline_linecolumn_prefix = '¶ ' let g:airline_linecolumn_prefix = '¶ '
let g:airline_fugitive_prefix = '⎇ ' let g:airline_branch_prefix = '⎇ '
let g:airline_paste_symbol = 'ρ' let g:airline_paste_symbol = 'ρ'
let g:airline_paste_symbol = 'Þ' let g:airline_paste_symbol = 'Þ'
let g:airline_paste_symbol = '∥' let g:airline_paste_symbol = '∥'
let g:airline_whitespace_symbol = 'Ξ'
" powerline symbols " powerline symbols
let g:airline_left_sep = '' let g:airline_left_sep = ''
let g:airline_left_alt_sep = '' let g:airline_left_alt_sep = ''
let g:airline_right_sep = '' let g:airline_right_sep = ''
let g:airline_right_alt_sep = '' let g:airline_right_alt_sep = ''
let g:airline_fugitive_prefix = ' ' let g:airline_branch_prefix = ' '
let g:airline_readonly_symbol = '' let g:airline_readonly_symbol = ''
let g:airline_linecolumn_prefix = ' ' let g:airline_linecolumn_prefix = ' '
" old vim-powerline symbols
let g:airline_left_sep = '⮀'
let g:airline_left_alt_sep = '⮁'
let g:airline_right_sep = '⮂'
let g:airline_right_alt_sep = '⮃'
let g:airline_branch_prefix = '⭠'
let g:airline_readonly_symbol = '⭤'
let g:airline_linecolumn_prefix = '⭡'
< <
For more intricate customizations, you can replace the predefined sections For more intricate customizations, you can replace the predefined sections
@@ -133,34 +179,106 @@ with the usual statusline syntax.
> >
" here are the the default values " here are the the default values
let g:airline_section_a (the mode/paste indicator) let g:airline_section_a (the mode/paste indicator)
let g:airline_section_b (the fugitive branch indicator) let g:airline_section_b (the fugitive/lawrencium branch indicator)
let g:airline_section_c (bufferline or filename) let g:airline_section_c (bufferline or filename)
let g:airline_section_gutter (syntastic and readonly flag) let g:airline_section_gutter
let g:airline_section_x (filetype) let g:airline_section_x (tagbar, filetype)
let g:airline_section_y (fileencoding, fileformat) let g:airline_section_y (fileencoding, fileformat)
let g:airline_section_z (percentage, line number, column number) let g:airline_section_z (percentage, line number, column number)
let g:airline_section_warning (syntastic, whitespace)
" here is an example of how you could replace the fugitive indicator with " here is an example of how you could replace the branch indicator with
" the current working directory, followed by the filename. " the current working directory, followed by the filename.
let g:airline_section_b = '%{getcwd()}' let g:airline_section_b = '%{getcwd()}'
let g:airline_section_c = '%t' let g:airline_section_c = '%t'
< <
If there is a particular plugin or filetype that is not supported, you can ==============================================================================
extend it by adding a function reference to the global array. Here is an FUNCREFS *airline-funcrefs*
example that you could add to your vimrc:
vim-airline internally uses funcrefs to integrate with third party plugins,
and you can tap into this functionality to extend it for you needs.
*g:airline_statusline_funcrefs*
The g:airline_statusline_funcrefs variable is an array of funcrefs that get
invoked before the statusline gets overwritten for each window. The following
is an example of how you can extend vim-airline to support a new plugin.
> >
function! MyPlugin() function! MyPlugin()
if &filetype == 'MyPluginFileType' if &filetype == 'MyPluginFileType'
let w:airline_section_a = 'MyPlugin' let w:airline_section_a = 'MyPlugin'
let w:airline_section_b = '%f' let w:airline_section_b = '%f'
let w:airline_section_c = '%{MyPlugin#function()}' let w:airline_section_c = '%{MyPlugin#function()}'
let g:airline_variable_referenced_in_statusline = 'foo'
endif endif
endfunction endfunction
call add(g:airline_window_override_funcrefs, function('MyPlugin')) call add(g:airline_statusline_funcrefs, function('MyPlugin'))
< <
*g:airline_exclude_funcrefs*
The g:airline_exclude_funcrefs variable is an array that's returns 1 or 0 to
determine whether that particular window should be excluded from having its
statusline modified. Here is an example:
>
function! ExcludeFoo()
return &filetype == 'FooType'
endfunction
call add(g:airline_exclude_funcrefs, function('ExcludeFoo'))
<
==============================================================================
WRITING THEMES *airline-themes*
Themes are written "close to the metal" -- you will need to know some basic
VimL syntax to write a theme, but if you've written in any programming
language before it will be easy to pick up.
The |dark.vim| theme fully documents this procedure and will guide you through
the process. The |jellybeans.vim| theme is another example of how to write a
theme, but instead of manually declaring colors, it extracts the values from
highlight groups.
==============================================================================
TROUBLESHOOTING *airline-troubleshooting*
Q. There are no colors.
A. You need to set up your terminal correctly. For more details, see
<http://vim.wikia.com/wiki/256_colors_in_vim>. Alternatively, if you want
to bypass the automatic detection of terminal colors, you can force Vim
into 256 color mode with this:
>
set t_Co=256
<
Q. The statusline does not appear until I create a split.
A. This is the default setting of |laststatus|. If you want it to appear all
the time, add the following to your vimrc:
>
set laststatus=2
<
Q. Powerline symbols are not showing up.
A. First, you must install patched powerline fonts. Second, you must enable
unicode in vim.
>
set encoding=utf-8
<
Q. There is a pause when leaving insert mode.
A. Add the following to your vimrc.
>
set ttimeoutlen=50
<
Q. The colors look a little off for some themes.
A. Certain themes are derived from the active colorscheme by extracting colors
from predefined highlight groups. These airline themes will look good for
their intended matching colorschemes, but will be hit or miss when loaded
with other colorschemes.
Solutions to other common problems can be found in the Wiki:
<https://github.com/bling/vim-airline/wiki/FAQ>
============================================================================== ==============================================================================
CONTRIBUTIONS *airline-contributions* CONTRIBUTIONS *airline-contributions*
@@ -170,10 +288,7 @@ Contributions and pull requests are welcome.
============================================================================== ==============================================================================
LICENSE *airline-license* LICENSE *airline-license*
Copyright © Bailey Ling. MIT license. Copyright © 2013 Bailey Ling.
Distributed under the same terms as the vim |license|.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@@ -1,4 +1,6 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent " vim: ts=2 sts=2 sw=2 fdm=indent
if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline) if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline)
finish finish
endif endif
@@ -8,48 +10,68 @@ function! s:check_defined(variable, default)
let {a:variable} = a:default let {a:variable} = a:default
endif endif
endfunction endfunction
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables have been deprecated and renamed to g:airline_enable_branch and g:airline_branch_prefix respectively. Please update your vimrc.'
endif
if exists('g:airline_window_override_funcrefs')
echom 'The g:airline_window_override_funcrefs variable has been deprecated. Please use g:airline_statusline_funcrefs instead.'
endif
call s:check_defined('g:airline_left_sep', exists('g:airline_powerline_fonts')?"":">") call s:check_defined('g:airline_left_sep', exists('g:airline_powerline_fonts')?"":">")
call s:check_defined('g:airline_left_alt_sep', exists('g:airline_powerline_fonts')?"":">") call s:check_defined('g:airline_left_alt_sep', exists('g:airline_powerline_fonts')?"":">")
call s:check_defined('g:airline_right_sep', exists('g:airline_powerline_fonts')?"":"<") call s:check_defined('g:airline_right_sep', exists('g:airline_powerline_fonts')?"":"<")
call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_fonts')?"":"<") call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_fonts')?"":"<")
call s:check_defined('g:airline_enable_bufferline', 1) call s:check_defined('g:airline_enable_bufferline', 1)
call s:check_defined('g:airline_enable_fugitive', 1) call s:check_defined('g:airline_enable_branch', 1)
call s:check_defined('g:airline_enable_syntastic', 1) call s:check_defined('g:airline_enable_syntastic', 1)
call s:check_defined('g:airline_fugitive_prefix', exists('g:airline_powerline_fonts')?' ':'') call s:check_defined('g:airline_enable_tagbar', 1)
call s:check_defined('g:airline_detect_iminsert', 0)
call s:check_defined('g:airline_detect_modified', 1)
call s:check_defined('g:airline_detect_paste', 1)
call s:check_defined('g:airline_detect_whitespace', 1)
call s:check_defined('g:airline_whitespace_symbol', '✹')
call s:check_defined('g:airline_branch_empty_message', '')
call s:check_defined('g:airline_branch_prefix', exists('g:airline_powerline_fonts')?' ':'')
call s:check_defined('g:airline_readonly_symbol', exists('g:airline_powerline_fonts')?'':'RO') call s:check_defined('g:airline_readonly_symbol', exists('g:airline_powerline_fonts')?'':'RO')
call s:check_defined('g:airline_linecolumn_prefix', exists('g:airline_powerline_fonts')?' ':':') call s:check_defined('g:airline_linecolumn_prefix', exists('g:airline_powerline_fonts')?' ':':')
call s:check_defined('g:airline_paste_symbol', (exists('g:airline_powerline_fonts') ? ' ' : '').'PASTE') call s:check_defined('g:airline_paste_symbol', (exists('g:airline_powerline_fonts') ? ' ' : '').'PASTE')
call s:check_defined('g:airline_theme', 'dark') call s:check_defined('g:airline_theme', 'dark')
call s:check_defined('g:airline_inactive_collapse', 1)
call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus']) 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_filetypes', [])
call s:check_defined('g:airline_exclude_preview', 0) call s:check_defined('g:airline_exclude_preview', 0)
call s:check_defined('g:airline_window_override_funcrefs', []) call s:check_defined('g:airline_statusline_funcrefs', [])
call s:check_defined('g:airline_exclude_funcrefs', [])
call s:check_defined('g:airline_mode_map', { call s:check_defined('g:airline_mode_map', {
\ '__' : '------',
\ 'n' : 'NORMAL', \ 'n' : 'NORMAL',
\ 'i' : 'INSERT', \ 'i' : 'INSERT',
\ 'R' : 'RPLACE', \ 'R' : 'REPLACE',
\ 'v' : 'VISUAL', \ 'v' : 'VISUAL',
\ 'V' : 'V-LINE', \ 'V' : 'V-LINE',
\ 'c' : 'CMD ', \ 'c' : 'CMD ',
\ '' : 'V-BLCK', \ '' : 'V-BLOCK',
\ 's' : 'SELECT',
\ 'S' : 'S-LINE',
\ '' : 'S-BLOCK',
\ }) \ })
call s:check_defined('g:airline_section_a', '%{get(w:, "airline_current_mode", "")}')
call s:check_defined('g:airline_section_b', '%{get(w:, "airline_current_branch", "")}')
call s:check_defined('g:airline_section_c', '%f%m')
call s:check_defined('g:airline_section_gutter', '')
call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}")
call s:check_defined('g:airline_section_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}")
call s:check_defined('g:airline_section_z', '%3p%% '.g:airline_linecolumn_prefix.'%3l:%3c')
let s:airline_initialized = 0 let s:airline_initialized = 0
function! s:init() function! s:on_window_changed()
if !s:airline_initialized if !s:airline_initialized
call airline#extensions#load() call airline#extensions#load()
call airline#update_externals()
call airline#load_theme(g:airline_theme) call airline#load_theme(g:airline_theme)
call s:check_defined('g:airline_section_a', '%{g:airline_current_mode_text} %{&paste ? g:airline_paste_symbol." " : ""}')
call s:check_defined('g:airline_section_b', '%{g:airline_externals_fugitive}')
call s:check_defined('g:airline_section_c', g:airline_externals_bufferline)
call s:check_defined('g:airline_section_gutter', '')
call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}")
call s:check_defined('g:airline_section_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}")
call s:check_defined('g:airline_section_z', '%3p%% '.g:airline_linecolumn_prefix.'%3l:%3c')
let s:airline_initialized = 1 let s:airline_initialized = 1
endif endif
call airline#update_statusline()
endfunction endfunction
function! s:get_airline_themes(a, l, p) function! s:get_airline_themes(a, l, p)
@@ -64,10 +86,11 @@ function! s:airline_theme(...)
endif endif
endfunction endfunction
command! -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>) command! -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
command! AirlineToggleWhitespace call airline#extensions#whitespace#toggle()
augroup airline augroup airline
au! autocmd!
autocmd ColorScheme * call airline#highlight(['normal']) autocmd ColorScheme * call airline#reload_highlight()
autocmd WinLeave * call airline#update_statusline(0) autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost *
autocmd WinEnter,BufWinEnter,FileType * call <sid>init() | call airline#update_statusline(1) \ call <sid>on_window_changed()
augroup END augroup END