156 Commits
v0.3 ... v0.4

Author SHA1 Message Date
Bailey Ling
ccb00be717 check both resolved and unresolved paths (#187). 2013-08-26 15:39:27 +00:00
Bailey Ling
04e00d6933 \n only works with double quotes. 2013-08-26 15:32:18 +00:00
Bailey Ling
c42eefbd1d must use finish to prevent ctrlp from getting source. 2013-08-26 15:17:24 +00:00
Bailey Ling
9194a9f02d add temporary fix for vim-signify integration (#188). 2013-08-26 13:46:49 +00:00
Bailey Ling
295fda2f74 resolve script path (#187). 2013-08-26 13:27:09 +00:00
Bailey Ling
358d4328f4 support formattable whitespace messages. resolves #185. 2013-08-26 02:08:04 +00:00
Bailey Ling
6a3b611ba1 show difference between location/quickfix list. resolves #186. 2013-08-26 01:46:40 +00:00
bling
39c8dcd950 auto-source themes when they are changed. 2013-08-25 21:34:26 -04:00
Bailey Ling
609b4ab573 fix virtualenv_loaded check. 2013-08-25 17:54:00 +00:00
bling
3fba032439 match up gui colors with term colors for dark theme. 2013-08-25 13:11:37 -04:00
Bailey Ling
b7cf6703e5 update pipeline image. 2013-08-25 13:06:13 -04:00
Bailey Ling
2f5ba93d0e leave the loaded colorscheme alone. fixes #184. 2013-08-25 12:27:21 -04:00
Bailey Ling
3595debb97 move virtualenv to the right side, so tagbar function names don't shift it all over the place. 2013-08-25 11:51:32 -04:00
Bailey Ling
b9483d8c15 improve builder to support blended sections. 2013-08-25 11:39:42 -04:00
Bailey Ling
59d6b72962 remove redundant args. 2013-08-25 11:39:42 -04:00
Bailey Ling
a91dda01df improve documentation for writing extensions, also add helper methods. 2013-08-25 15:39:14 +00:00
Bailey Ling
9ca2aa9a8c Merge pull request #180 from joedicastro/master
add virtualenv extension
2013-08-25 08:24:53 -07:00
joe di castro
f37eeeb9af A better integration of virtualenv to avoid override other extensions 2013-08-25 17:14:12 +02:00
joe di castro
086b924992 Fix error in virtualenv at extensions.vim
Fix the global variable name for enable/disable the extension.
2013-08-25 13:38:15 +02:00
Bailey Ling
b34aa78c5a deprecate airline_detect_iminsert 2013-08-24 22:24:36 -04:00
Bailey Ling
c517f9c6f9 fix potential performance problems with completeopt+=preview 2013-08-24 21:17:16 -04:00
Bailey Ling
42cb6317c2 add base16 support for all variants. 2013-08-24 21:10:11 -04:00
Bailey Ling
f5e6205049 Merge pull request #181 from esn89/master
added base16.vim colorscheme
2013-08-24 17:37:26 -07:00
Evan Ng
00a0c52dbd added base16.vim colorscheme 2013-08-24 14:34:25 -07:00
joe di castro
f0df8825df add virtualenv extension 2013-08-24 22:49:54 +02:00
Bailey Ling
c98549913c remove hackfix and use new tagbar statusline integration.
requires 0b14e28719
2013-08-24 09:47:16 -04:00
Bailey Ling
0e6035f75c convert the highlighter into a singleton. 2013-08-24 09:40:20 -04:00
Bailey Ling
f6d8a981b6 add inactive statusline funcrefs into the pipeline. 2013-08-24 09:31:30 -04:00
Bailey Ling
04daa66b48 Revert "inactivate existing statusline without building a new one."
This reverts commit 53b856b0c5.
2013-08-24 01:08:22 -04:00
Bailey Ling
511411d55e match up bufferline colors with the gutter. 2013-08-24 01:06:04 -04:00
Bailey Ling
b62634884a fix bufferline integration 2013-08-24 04:32:44 +00:00
Bailey Ling
b7d0ccdac2 give the light theme inactive mode some more color. 2013-08-24 04:28:37 +00:00
Bailey Ling
74849d4a10 improved unite integration (#165). 2013-08-24 04:08:57 +00:00
Bailey Ling
53b856b0c5 inactivate existing statusline without building a new one. 2013-08-24 03:54:55 +00:00
Bailey Ling
3bb451f1f4 pass context into the builder. 2013-08-24 03:18:43 +00:00
Bailey Ling
2cfab73f1b fix undotree override bleeding over to the main. 2013-08-24 03:16:14 +00:00
Bailey Ling
98eecd7ae2 add error code 1 for easier override. 2013-08-24 03:02:13 +00:00
Bailey Ling
30c3613924 improve algorithm for inactive colors. resolves #178. 2013-08-24 02:52:56 +00:00
Bailey Ling
e8d0d24163 prefer function name instead of funcref. 2013-08-24 01:21:09 +00:00
Bailey Ling
95a46cc106 fix whitespace toggle command (#177). 2013-08-23 16:42:55 +00:00
Bailey Ling
ab59dfffe7 Merge pull request #176 from seletskiy/solarized-contrast-fix
solarized: fix contrast and warningmsg
2013-08-23 09:37:40 -07:00
Stanislav Seletskiy
5dd1fba954 solarized: fix contrast and warningmsg 2013-08-23 22:09:11 +07:00
Bailey Ling
dfe2273f7c add missing file highlight group. fixes #175. 2013-08-22 20:33:12 -04:00
Bailey Ling
c2632f9dbb introduce g:airline_theme_patch_func (#173). 2013-08-22 19:55:04 -04:00
Bailey Ling
e7ae77c027 add screenshot about pipeline. 2013-08-22 19:24:16 -04:00
Bailey Ling
51110b902b document the pipeline. 2013-08-22 23:20:53 +00:00
Bailey Ling
de4c7253e2 remove function call, no longer needed. 2013-08-22 21:32:11 +00:00
Bailey Ling
c16d6e69a9 pass arguments into funcrefs properly. 2013-08-22 20:22:54 +00:00
Bailey Ling
29dc7dd9b5 pass builder into statusline funcrefs. 2013-08-22 19:45:17 +00:00
Bailey Ling
261dafca9d fold exclude funcrefs into the default one. 2013-08-22 17:32:44 +00:00
Bailey Ling
e83e12447e break early implicit if return code is not 0. 2013-08-22 17:32:44 +00:00
Bailey Ling
db3a4b1df6 add screenshot for customization. 2013-08-22 10:47:19 -04:00
Bailey Ling
fa57fdb634 Merge pull request #174 from jacobwalker0814/powerline_fonts
Better toggling of powerline fonts
2013-08-22 07:39:09 -07:00
Jacob Walker
3920817442 Better toggling of powerline fonts
+ Check the value of airline_powerline_fonts not just existence
2013-08-22 09:14:17 -05:00
Bailey Ling
0dc3a7913d fix regression; account for symlinks. 2013-08-22 08:27:44 -04:00
Bailey Ling
fa3cd0fdc1 Merge pull request #172 from mattn/check_loadable
Don't use name 'vim-airline' to check loadable extensions.
2013-08-22 05:16:07 -07:00
mattn
cb112cbcb9 Don't use name 'vim-airline' to check loadable extensions. Someone may git clone as another directory. 2013-08-22 13:19:56 +09:00
Bailey Ling
18a6083b0a Merge pull request #171 from mattn/fix_bundle_paths
Fixes bundle paths. For example ftbundle add 'vim-airline/./autoload' in...
2013-08-21 21:12:41 -07:00
mattn
3c7e4b1400 Fixes bundle paths. For example ftbundle add 'vim-airline/./autoload' into RTP. 2013-08-22 13:05:59 +09:00
Bailey Ling
40d6773a22 autoload external extensions (#170). 2013-08-22 02:49:19 +00:00
Bailey Ling
41159bfbc2 improve vim-signify integration (#169). 2013-08-21 23:24:56 +00:00
Bailey Ling
8452029e98 upgrade all funcrefs to support varargs. 2013-08-21 15:14:12 +00:00
Bailey Ling
47de191a80 update doc. 2013-08-21 11:57:23 +00:00
Bailey Ling
dc9a527136 Merge pull request #168 from mattn/strict_color_conversion
Strictly color value conversion
2013-08-20 19:11:45 -07:00
mattn
a91b442366 Strictly color value conversion 2013-08-21 10:27:00 +09:00
Bailey Ling
e4a0fe1d9c move paste symbol variable into extension, update docs. 2013-08-20 23:16:39 +00:00
Bailey Ling
8bc08979d7 inverse doesn't work in all environments, do it manually. 2013-08-20 23:09:40 +00:00
Bailey Ling
0eb6ed1109 Merge pull request #166 from itchyny/paste_symbol
paste mark is now a member of extensions
2013-08-20 16:09:36 -07:00
Bailey Ling
75eeeee9a2 Merge pull request #167 from edkolev/master
allow ctrlp to use mode colors other than insert's colors
2013-08-20 16:06:49 -07:00
Evgeni Kolev
7a1d7a01b2 allow ctrlp to use mode colors other than insert's colors
add global variable g:airline#extensions#ctrlp#color_template which can
hold modes normal|insert|visual|replace as string. ctrlp will use the
given mode's colors if the active theme doesn't define any.
2013-08-20 23:30:46 +03:00
itchyny
20c5c64590 paste mark is now a member of extensions 2013-08-21 05:29:08 +09:00
Bailey Ling
0068093ea0 add screenshot for hunks. 2013-08-20 12:57:50 -04:00
Bailey Ling
a1fc8fe7ff add spacing around readonly symbol. 2013-08-20 16:13:08 +00:00
Bailey Ling
a04d7c277a support vim-signify as a hunk source. 2013-08-20 15:43:26 +00:00
Bailey Ling
35db000651 Merge pull request #163 from buztard/fixes/hunks
hunks: Display the hunks summary only if Git Gutter is enabled
2013-08-20 08:10:04 -07:00
Bailey Ling
cbb9bea9db allow warning section to be overwritten (#136). 2013-08-20 15:02:17 +00:00
Bastian Winkler
bbe077037e hunks: Display the hunks summary only if Git Gutter is enabled 2013-08-20 16:53:29 +02:00
Bailey Ling
e2a758e309 deprecate airline_readonly_symbol. move into gutter by default, so it does not conflict with bufferline logic. 2013-08-20 08:11:38 -04:00
Bailey Ling
fad2c084e7 Merge pull request #161 from itchyny/readonly_symbol
readonly mark is now a member of extensions
2013-08-20 05:03:37 -07:00
itchyny
1b6c1bf39c remove g:airline_detect_readonly 2013-08-20 20:58:29 +09:00
itchyny
57cf78ba77 readonly mark is now a member of extensions 2013-08-20 17:18:01 +09:00
Bailey Ling
fa62cbb5f6 simplify, no globals unless necessary. 2013-08-20 03:44:24 +00:00
Bailey Ling
e65aefac00 deprecate airline_detect_whitespace 2013-08-20 03:39:51 +00:00
Bailey Ling
71c8156f00 deprecate all g:airline_enabled_* variables. 2013-08-20 03:38:02 +00:00
Bailey Ling
494d15232c reduce pollution of global scope variables 2013-08-20 03:38:02 +00:00
Bailey Ling
ee19bf8825 Merge pull request #158 from BenBergman/only-non-zero-hunks
Add option to show only non-zero hunks
2013-08-19 20:37:36 -07:00
Benjamin Bergman
a5f084dc4e Use extension local variables, and expose hunk_symbols to user 2013-08-19 22:32:14 -05:00
Bailey Ling
987622fc3c Merge branch 'use_defined_theme'
Conflicts:
	plugin/airline.vim
2013-08-20 02:06:00 +00:00
Bailey Ling
f780621aa0 support x,y,z theming. resolves #159. 2013-08-20 01:56:13 +00:00
Bailey Ling
54d3605497 fix color switching again. vimrc setting should override. 2013-08-20 01:47:24 +00:00
mattn
715cf33d56 Prior checking user defined theme 2013-08-20 10:46:44 +09:00
Benjamin Bergman
4d9a0e257f Add option to show only non-zero hunks 2013-08-19 17:28:42 -05:00
Bailey Ling
dd5dbdd242 undo use of inverse; caused problems with empty sections. 2013-08-19 19:07:31 +00:00
Bailey Ling
f773325fa4 allow specific whitespace checks to be enabled/disabled. 2013-08-19 18:19:26 +00:00
Bailey Ling
ec20ea06c3 fix autoselection of theme for certain startup configs. 2013-08-19 18:17:06 +00:00
Bailey Ling
de69bba26e re-enable gitgutter integration with new upstream function. resolves #154 and #153. 2013-08-19 16:03:10 +00:00
Bailey Ling
2a02afb918 default whitespace symbol to non-unicode unless powerline fonts are enabled (#155). 2013-08-19 13:33:13 +00:00
Bailey Ling
16f2d7013d disable hunks by default, a couple bugs remaining. 2013-08-19 13:22:24 +00:00
Bailey Ling
da4d0730d3 improve gitgutter integration and algorithm 2013-08-18 21:39:27 +00:00
Bailey Ling
aa4c9977df temp disable, some errors weird cases 2013-08-18 21:08:00 +00:00
Bailey Ling
dad0d5a8d8 add gitgutter integration. 2013-08-18 21:02:33 +00:00
Bailey Ling
8f0401580b fix airline theme not getting loaded on startup (#151). 2013-08-18 19:02:14 +00:00
Bailey Ling
9d65486063 improve undotree integration; use exposed statusline functions. 2013-08-18 18:50:22 +00:00
Bailey Ling
7e563f9c74 detect branch when changing directories. resolves #138. 2013-08-18 18:34:02 +00:00
Bailey Ling
60dd8ed0a8 fix error on startup in certain configurations (#150). 2013-08-18 18:13:34 +00:00
Bailey Ling
0a88fd81d3 update branch head all the time (#42). 2013-08-18 17:22:35 +00:00
Bailey Ling
e26165caa6 support base16 variant of solarized. resolves #148. 2013-08-18 14:13:47 +00:00
Bailey Ling
38b8520a37 fix arrows being out of sync. 2013-08-18 05:34:26 +00:00
Bailey Ling
bcba04e20c account for empty vimrc with no colorscheme set. 2013-08-18 04:56:38 +00:00
Bailey Ling
88b910d959 fix getwinvar on older 7.3 builds. resolves #147. 2013-08-18 04:50:48 +00:00
Bailey Ling
03c08e819c autoload themes to match colorscheme. resolves #145. 2013-08-18 04:44:13 +00:00
Bailey Ling
b4d7531c05 fix error when using simple theme 2013-08-18 04:22:36 +00:00
Bailey Ling
a8692a7b97 autogenerate bg colors for the file indicator. resolves #131. 2013-08-18 03:25:24 +00:00
Bailey Ling
45f0d896e9 move all theme variables into a single dictionary 2013-08-18 00:59:49 +00:00
Bailey Ling
1584ee79f6 add missing space 2013-08-17 23:56:50 +00:00
Bailey Ling
f49038fba6 clean up builder a bit, use inverse 2013-08-17 23:31:51 +00:00
Bailey Ling
9c02d87f17 Merge branch 'dynamic' 2013-08-17 22:39:24 +00:00
Bailey Ling
f938159d0d fix inactive responding to modified, fix trimming 2013-08-17 22:03:50 +00:00
Bailey Ling
840f78607e optimize funcrefs for 7.4 2013-08-17 17:50:41 -04:00
Bailey Ling
e7c5bbb671 remove auto prefix. optimize getwinvar 2013-08-17 17:39:36 -04:00
Bailey Ling
b19a29675d fix list being unbounded 2013-08-17 17:10:06 -04:00
Bailey Ling
3814c21125 optimize newing up the builder 2013-08-17 16:44:53 -04:00
Bailey Ling
6bda68e35c replace all obsolete color groups in all themes 2013-08-17 19:20:40 +00:00
Bailey Ling
3fbdd28e5d add profiler. optimize separator highlighting. 2013-08-17 17:35:06 +00:00
Bailey Ling
47bfeee3ae fix separator colors for inactive splits 2013-08-17 15:12:01 +00:00
Bailey Ling
2f92346194 add highlighter class 2013-08-17 12:52:25 +00:00
Bailey Ling
ca39454ecf add example.vim extension (#134) 2013-08-16 18:04:03 +00:00
Bailey Ling
c017c9fbb3 miscellaneous minor changes 2013-08-16 14:57:48 +00:00
Bailey Ling
6e515a4627 remove redundancy from the map 2013-08-16 14:57:48 +00:00
Bailey Ling
30adb973fc move getwinvar over 2013-08-16 14:57:47 +00:00
Bailey Ling
0e936d0b9a introduce util file 2013-08-16 14:57:47 +00:00
Bailey Ling
af7dfc8677 update separator colors when mode changes 2013-08-16 14:57:47 +00:00
Bailey Ling
47c80c31da reload separator colors on demand 2013-08-16 14:57:47 +00:00
Bailey Ling
f477520ba8 move builder to its own file 2013-08-16 14:57:47 +00:00
Bailey Ling
703045a7e6 allow warning section to collapse away 2013-08-16 14:57:47 +00:00
Bailey Ling
8b92cae46c basic working dynamic statusline builder 2013-08-16 14:57:47 +00:00
Bailey Ling
81c49292d3 add shortform into doc for easy copy/pasting 2013-08-16 14:57:36 +00:00
Bailey Ling
6269632164 check existence of airline augroup before overwriting statusline 2013-08-15 16:05:12 -04:00
Bailey Ling
12fc908f43 add support for the command-line window 2013-08-15 15:54:14 -04:00
Bailey Ling
91904d942e check initialized so autoloaded plugins happen first 2013-08-15 15:02:54 -04:00
Bailey Ling
f5afe4bcac Merge pull request #141 from chrisbra/master
added airlinetoggle function
2013-08-15 11:58:28 -07:00
Christian Brabandt
8ec527465d added airlinetoggle function 2013-08-15 20:48:59 +02:00
Bailey Ling
91ca5a77ae add extensions/integration section with screenshots 2013-08-14 14:29:19 -04:00
Bailey Ling
1fa5e16558 fix right alignment for help window 2013-08-14 00:28:13 -04:00
Bailey Ling
6a0163104a unbreak csv extension. redefine gutter as the middle. 2013-08-14 03:53:29 +00:00
Bailey Ling
b7131d8b51 add section about writing extensions (#134). 2013-08-14 03:07:01 +00:00
Bailey Ling
7e63d9ddd9 rename variable so it's more obvious 2013-08-14 02:36:09 +00:00
Bailey Ling
10e8146d7b improve docs, remove deprecation warnings 2013-08-14 02:32:05 +00:00
Bailey Ling
5b840ae436 fixes error when colorscheme is used in gvimrc (#126). 2013-08-13 22:10:44 -04:00
Bailey Ling
f66cb47d29 fix up csv integration so it only applies to csv filetypes 2013-08-13 21:52:31 -04:00
Bailey Ling
509c9f68a9 rename csv variables, add extensions section for doc 2013-08-13 21:47:08 -04:00
Bailey Ling
944ed9a8b9 Merge pull request #133 from edkolev/master
Default to 16 colors for solarized theme unless g:solarized_termcolors i...
2013-08-13 18:33:21 -07:00
Bailey Ling
4fe76c0b5a Merge pull request #137 from chrisbra/master
added csv extension
2013-08-13 15:21:00 -07:00
Christian Brabandt
c5e21aa170 added csv extension 2013-08-14 00:11:51 +02:00
Bailey Ling
9dd682212f make warning a real section. references #136. 2013-08-13 20:43:04 +00:00
Evgeni Kolev
284f8efd58 Default to 16 colors for solarized theme unless g:solarized_termcolors is 256 2013-08-13 09:29:28 +03:00
41 changed files with 1564 additions and 839 deletions

View File

@@ -6,14 +6,53 @@ Lean & mean statusline for vim that's light as air.
# 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].
* tiny core 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], [vim-gitgutter][29], [vim-signify][30], [syntastic][5], [lawrencium][21] and [virtualenv][31]
* 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.
* extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki.
* supports 7.2 as the minimum Vim version
# Straightforward customization
If you don't like the defaults, you can replace all sections with standard `statusline` syntax.
![image](https://f.cloud.github.com/assets/306502/1009429/d69306da-0b38-11e3-94bf-7c6e3eef41e9.png)
# Extensible pipeline
Completely transform the statusline to your liking.
![allyourbase](https://f.cloud.github.com/assets/306502/1022714/e150034a-0da7-11e3-94a5-ca9d58a297e8.png)
# Integration with external plugins
vim-airline provides seamless integration with a variety of plugins. These extensions will be lazily loaded if and only if you have the other plugins installed (and of course you can turn them off if you don't like it).
### [ctrlp.vim][10]
![image](https://f.cloud.github.com/assets/306502/962258/7345a224-04ec-11e3-8b5a-f11724a47437.png)
### [unite.vim][9]
![image](https://f.cloud.github.com/assets/306502/962319/4d7d3a7e-04ed-11e3-9d59-ab29cb310ff8.png)
### [tagbar][19]
![image](https://f.cloud.github.com/assets/306502/962150/7e7bfae6-04ea-11e3-9e28-32af206aed80.png)
### [csv.vim][28]
![image](https://f.cloud.github.com/assets/306502/962204/cfc1210a-04eb-11e3-8a93-42e6bcd21efa.png)
### [syntastic][5]
![image](https://f.cloud.github.com/assets/306502/962864/9824c484-04f7-11e3-9928-da94f8c7da5a.png)
### whitespace
![image](https://f.cloud.github.com/assets/306502/962401/2a75385e-04ef-11e3-935c-e3b9f0e954cc.png)
### hunks ([vim-gitgutter][29] & [vim-signify][30])
![image](https://f.cloud.github.com/assets/306502/995185/73fc7054-09b9-11e3-9d45-618406c6ed98.png)
### [virtualenv][31]
![image](https://f.cloud.github.com/assets/390964/1022566/cf81f830-0d98-11e3-904f-cf4fe3ce201e.png)
# Rationale
There's already [powerline][2], why yet another statusline?
@@ -59,9 +98,9 @@ Finally, enable them in vim-airline by adding `let g:airline_powerline_fonts = 1
Solutions to common problems can be found in the [Wiki][27].
# Themes/Screenshots
# Screenshots
A full list of screenshots can be found in the [Wiki][14].
A full list of screenshots for various themes can be found in the [Wiki][14].
# Bugs
@@ -82,7 +121,7 @@ Contributions and pull requests are welcome. Please take note of the following
# License
MIT license. Copyright (c) 2013 Bailey Ling.
MIT License. Copyright (c) 2013 Bailey Ling.
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/bling/vim-airline/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
@@ -114,3 +153,8 @@ MIT license. Copyright (c) 2013 Bailey Ling.
[25]: https://github.com/tomasr/molokai
[26]: https://github.com/nanotech/jellybeans.vim
[27]: https://github.com/bling/vim-airline/wiki/FAQ
[28]: https://github.com/chrisbra/csv.vim
[29]: https://github.com/airblade/vim-gitgutter
[30]: https://github.com/mhinz/vim-signify
[31]: https://github.com/jmcantrell/vim-virtualenv
[32]: https://github.com/chriskempson/base16-vim

View File

@@ -1,160 +1,131 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', [])
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
let s:sections = ['a','b','c','gutter','x','y','z','warning']
let s:inactive_funcrefs = []
let s:airline_highlight_map = {
\ 'mode' : 'Al2',
\ 'mode_separator' : 'Al3',
\ 'info' : 'Al4',
\ 'info_separator' : 'Al5',
\ 'statusline' : 'Al6',
\ 'file' : 'Al7',
\ }
function! airline#exec_highlight(group, colors)
let colors = a:colors
if s:is_win32term
let colors = map(a:colors, 'v:val != "" && v:val > 128 ? v:val - 128 : v:val')
endif
exec printf('hi %s %s %s %s %s %s %s %s',
\ a:group,
\ colors[0] != '' ? 'guifg='.colors[0] : '',
\ colors[1] != '' ? 'guibg='.colors[1] : '',
\ colors[2] != '' ? 'ctermfg='.colors[2] : '',
\ colors[3] != '' ? 'ctermbg='.colors[3] : '',
\ len(colors) > 4 && colors[4] != '' ? 'gui='.colors[4] : '',
\ len(colors) > 4 && colors[4] != '' ? 'cterm='.colors[4] : '',
\ len(colors) > 4 && colors[4] != '' ? 'term='.colors[4] : '')
function! airline#add_statusline_func(name)
call airline#add_statusline_funcref(function(a:name))
endfunction
function! airline#reload_highlight()
call airline#highlight(['inactive'])
call airline#highlight(['normal'])
function! airline#add_statusline_funcref(function)
call add(g:airline_statusline_funcrefs, a:function)
endfunction
function! airline#remove_statusline_func(name)
let i = index(g:airline_statusline_funcrefs, function(a:name))
if i > -1
call remove(g:airline_statusline_funcrefs, i)
endif
endfunction
function! airline#add_inactive_statusline_func(name)
call add(s:inactive_funcrefs, function(a:name))
endfunction
function! airline#load_theme()
highlight! default link airline_warningmsg WarningMsg
call airline#highlighter#load_theme()
call airline#extensions#load_theme()
endfunction
function! airline#load_theme(name)
function! airline#switch_theme(name)
let g:airline_theme = a:name
let inactive_colors = g:airline#themes#{g:airline_theme}#inactive "also lazy loads the theme
let palette = g:airline#themes#{g:airline_theme}#palette "also lazy loads the theme
call airline#themes#patch(palette)
if exists('g:airline_theme_patch_func')
let Fn = function(g:airline_theme_patch_func)
call Fn(palette)
endif
let w:airline_lastmode = ''
call airline#reload_highlight()
call airline#update_highlight()
call airline#update_statusline()
call airline#load_theme()
call airline#check_mode()
endfunction
function! airline#highlight(modes)
" 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')
for mode in mapped
if exists('g:airline#themes#{g:airline_theme}#{mode}')
for key in keys(g:airline#themes#{g:airline_theme}#{mode})
let colors = g:airline#themes#{g:airline_theme}#{mode}[key]
let suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
call airline#exec_highlight(s:airline_highlight_map[key].suffix, colors)
function! airline#switch_matching_theme()
if exists('g:colors_name')
let v:errmsg = ''
silent! let palette = g:airline#themes#{g:colors_name}#palette
if empty(v:errmsg)
call airline#switch_theme(g:colors_name)
return 1
else
for map in items(g:airline_theme_map)
if match(g:colors_name, map[0]) > -1
call airline#switch_theme(map[1])
return 1
endif
endfor
endif
endfor
call airline#themes#exec_highlight_separator('Al2', 'warningmsg')
endfunction
" for 7.2 compatibility
function! s:getwinvar(winnr, key, ...)
let winvals = getwinvar(a:winnr, '')
return get(winvals, a:key, (a:0 ? a:1 : ''))
endif
return 0
endfunction
function! s:get_section(winnr, key, ...)
let text = s:getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
let [prefix, suffix] = [get(a:000, 0, '%( '), get(a:000, 1, ' %)')]
return empty(text) ? '' : prefix.text.suffix
endfunction
function! airline#get_statusline(winnr, active)
let l:mode_color = a:active ? "%#Al2#" : "%#Al2_inactive#"
let l:mode_sep_color = a:active ? "%#Al3#" : "%#Al3_inactive#"
let l:info_color = a:active ? "%#Al4#" : "%#Al4_inactive#"
let l:info_sep_color = a:active ? "%#Al5#" : "%#Al5_inactive#"
let l:status_color = a:active ? "%#Al6#" : "%#Al6_inactive#"
let l:file_flag_color = a:active ? "%#Al7#" : "%#Al7_inactive#"
let sl = '%{airline#update_highlight()}'
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:winnr, 'a')
let sl.='%{g:airline_detect_paste && &paste ? g:airline_paste_symbol." " : ""}'
let sl.=l:mode_sep_color
let sl.=a:active ? g:airline_left_sep : g:airline_left_alt_sep
let sl.=l:info_color
let sl.=s:get_section(a:winnr, 'b')
let sl.=l:info_sep_color
let sl.=g:airline_left_sep
let sl.=l:status_color.'%<'.s:get_section(a:winnr, 'c')
let sl.=' '.l:file_flag_color."%(%{&ro ? g:airline_readonly_symbol : ''}%)".l:status_color
let sl.=s:get_section(a:winnr, 'gutter', '', '')
let sl.=l:status_color
function! airline#get_statusline(builder, winnr, active)
if airline#util#getwinvar(a:winnr, 'airline_render_left', a:active || (!a:active && !g:airline_inactive_collapse))
call a:builder.add_section('airline_a', s:get_section(a:winnr, 'a'))
call a:builder.add_section('airline_b', s:get_section(a:winnr, 'b'))
call a:builder.add_section('airline_c', '%<'.s:get_section(a:winnr, 'c'))
else
let sl.=l:status_color.' %f%m'
call a:builder.add_section('airline_c', '%f%m')
endif
if s:getwinvar(a:winnr, 'airline_render_right', 1)
let sl.='%='
let sl.=s:get_section(a:winnr, 'x')
let sl.=l:info_sep_color
let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep
let sl.=l:info_color
let sl.=s:get_section(a:winnr, 'y')
let sl.=l:mode_sep_color
let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep
let sl.=l:mode_color
let sl.=s:get_section(a:winnr, 'z')
call a:builder.split(s:get_section(a:winnr, 'gutter', '', ''))
if airline#util#getwinvar(a:winnr, 'airline_render_right', 1)
call a:builder.add_section('airline_x', s:get_section(a:winnr, 'x'))
call a:builder.add_section('airline_y', s:get_section(a:winnr, 'y'))
call a:builder.add_section('airline_z', 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', '').'%)'
call a:builder.add_raw('%(')
call a:builder.add_section('airline_warningmsg', s:get_section(a:winnr, 'warning', '', ''))
call a:builder.add_raw('%)')
endif
endif
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
return a:builder.build()
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))
let context = { 'winnr': nr, 'active': 0 }
call s:invoke_funcrefs(context, s:inactive_funcrefs)
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))
let w:airline_active = 1
let context = { 'winnr': winnr(), 'active': 1 }
call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
endfunction
function! airline#update_highlight()
function! s:invoke_funcrefs(context, funcrefs)
let builder = airline#builder#new(a:context)
let err = airline#util#exec_funcrefs(a:funcrefs, builder, a:context)
if err == 0
call setwinvar(a:context.winnr, '&statusline', airline#get_statusline(builder, a:context.winnr, a:context.active))
elseif err == 1
call setwinvar(a:context.winnr, '&statusline', builder.build())
endif
endfunction
function! airline#check_mode()
if get(w:, 'airline_active', 1)
let l:m = mode()
if l:m ==# "i"
@@ -172,13 +143,18 @@ function! airline#update_highlight()
let w:airline_current_mode = get(g:airline_mode_map, '__')
endif
if g:airline_detect_modified && &modified | call add(l:mode, 'modified') | endif
if g:airline_detect_paste && &paste | call add(l:mode, 'paste') | endif
if g:airline_detect_modified && &modified
call add(l:mode, 'modified')
endif
if g:airline_detect_paste && &paste
call add(l:mode, 'paste')
endif
let mode_string = join(l:mode)
if get(w:, 'airline_lastmode', '') != mode_string
call airline#highlight(l:mode)
call airline#highlighter#highlight(l:mode)
let w:airline_lastmode = mode_string
endif
return ''
endfunction

View File

@@ -0,0 +1,45 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:prototype = {}
function! s:prototype.split(...)
let self._side = 0
let self._line .= '%#'.self._curgroup.'#'.(a:0 ? a:1 : '%=')
endfunction
function! s:prototype.add_section(group, contents)
if self._curgroup != ''
if self._curgroup == a:group
let self._line .= self._side ? g:airline_left_alt_sep : g:airline_right_alt_sep
else
call airline#highlighter#add_separator(self._curgroup, a:group, self._side)
let self._line .= '%#'.self._curgroup.'_to_'.a:group.'#'
let self._line .= self._side ? g:airline_left_sep : g:airline_right_sep
endif
endif
let self._line .= '%#'.a:group.'#'.a:contents
let self._curgroup = a:group
endfunction
function! s:prototype.add_raw(text)
let self._line .= a:text
endfunction
function! s:prototype.build()
if !self._context.active
let self._line = substitute(self._line, '%#.\{-}\ze#', '\0_inactive', 'g')
endif
return self._line
endfunction
function! airline#builder#new(context)
let builder = copy(s:prototype)
let builder._context = a:context
let builder._side = 1
let builder._curgroup = ''
let builder._line = '%{airline#check_mode()}'
return builder
endfunction

View File

@@ -0,0 +1,34 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
function! airline#debug#profile1()
profile start airline-profile-switch.log
profile func *
profile file *
split
for i in range(1, 1000)
wincmd w
redrawstatus
endfor
profile pause
noautocmd qall!
endfunction
function! airline#debug#profile2()
profile start airline-profile-cursor.log
profile func *
profile file *
edit blank
call setline(1, 'all your base are belong to us')
call setline(2, 'all your base are belong to us')
let positions = [[1,2], [2,2], [1,2], [1,1]]
for i in range(1, 1000)
for pos in positions
call cursor(pos[0], pos[1])
redrawstatus
endfor
endfor
profile pause
noautocmd qall!
endfunction

View File

@@ -1,20 +1,22 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:ext = {}
let s:ext._cursormove_funcrefs = []
function! s:ext.add_statusline_funcref(funcref) dict
call add(g:airline_statusline_funcrefs, a:funcref)
function! s:ext.add_statusline_func(name) dict
call airline#add_statusline_func(a:name)
endfunction
function! s:ext.add_cursormove_funcref(funcref) dict
call add(self._cursormove_funcrefs, a:funcref)
function! s:ext.add_statusline_funcref(function) dict
call airline#add_statusline_funcref(a:function)
endfunction
function! s:ext.add_inactive_statusline_func(name) dict
call airline#add_inactive_statusline_func(a:name)
endfunction
let s:script_path = resolve(expand('<sfile>:p:h'))
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()}' ],
@@ -24,21 +26,44 @@ let s:filetype_overrides = {
let s:filetype_regex_overrides = {}
function! s:check_defined_section(name)
if !exists('w:airline_section_{a:name}')
if g:airline_section_{a:name} == '__'
let w:airline_section_{a:name} = ''
else
let w:airline_section_{a:name} = g:airline_section_{a:name}
endif
endif
endfunction
function! airline#extensions#append_to_section(name, value)
call <sid>check_defined_section(a:name)
let w:airline_section_{a:name} .= a:value
endfunction
function! airline#extensions#prepend_to_section(name, value)
call <sid>check_defined_section(a:name)
let w:airline_section_{a:name} = a:value . w:airline_section_{a:name}
endfunction
function! airline#extensions#apply_left_override(section1, section2)
let w:airline_section_a = a:section1
let w:airline_section_b = a:section2
let w:airline_section_c = ''
let w:airline_section_gutter = ' '
let w:airline_render_left = 1
let w:airline_render_right = 0
endfunction
let s:active_winnr = -1
function! airline#extensions#update_statusline()
function! airline#extensions#update_statusline(...)
if s:is_excluded_window()
return -1
endif
let s:active_winnr = winnr()
if &buftype == 'quickfix'
let w:airline_section_a = 'Quickfix'
let w:airline_section_a = '%q'
let w:airline_section_b = ''
let w:airline_section_c = ''
let w:airline_section_x = ''
@@ -67,7 +92,7 @@ function! airline#extensions#update_statusline()
endfor
endfunction
function! airline#extensions#is_excluded_window()
function! s:is_excluded_window()
for matchft in g:airline_exclude_filetypes
if matchft ==# &ft
return 1
@@ -94,10 +119,7 @@ function! airline#extensions#load_theme()
endfunction
function! s:sync_active_winnr()
if winnr() != s:active_winnr
if airline#exec_funcrefs(s:ext._cursormove_funcrefs, 1)
return
endif
if exists('#airline') && winnr() != s:active_winnr
call airline#update_statusline()
endif
endfunction
@@ -107,11 +129,10 @@ function! airline#extensions#load()
autocmd CursorMoved * call <sid>sync_active_winnr()
" load core funcrefs
call add(g:airline_exclude_funcrefs, function('airline#extensions#is_excluded_window'))
call add(g:airline_statusline_funcrefs, function('airline#extensions#update_statusline'))
call airline#add_statusline_func('airline#extensions#update_statusline')
if get(g:, 'loaded_unite', 0)
let g:unite_force_overwrite_statusline = 0
call airline#extensions#unite#init(s:ext)
endif
if get(g:, 'loaded_vimfiler', 0)
@@ -126,35 +147,78 @@ function! airline#extensions#load()
call airline#extensions#commandt#init(s:ext)
endif
if g:airline_enable_tagbar && exists(':TagbarToggle')
if exists(':UndotreeToggle')
call airline#extensions#undotree#init(s:ext)
endif
if (get(g:, 'airline#extensions#hunks#enabled', 1) && get(g:, 'airline_enable_hunks', 1))
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter'))
call airline#extensions#hunks#init(s:ext)
endif
if (get(g:, 'airline#extensions#tagbar#enabled', 1) && get(g:, 'airline_enable_tagbar', 1))
\ && exists(':TagbarToggle')
call airline#extensions#tagbar#init(s:ext)
endif
if (get(g:, 'airline#extensions#csv#enabled', 1) && get(g:, 'airline_enable_csv', 1))
\ && (get(g:, 'loaded_csv', 0) || exists(':Table'))
call airline#extensions#csv#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))
if (get(g:, 'airline#extensions#branch#enabled', 1) && get(g:, 'airline_enable_branch', 1))
\ && (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')
if (get(g:, 'airline#extensions#bufferline#enabled', 1) && get(g:, 'airline_enable_bufferline', 1))
\ && exists('*bufferline#get_status_string')
call airline#extensions#bufferline#init(s:ext)
endif
if g:airline_detect_whitespace
call airline#extensions#whitespace#init()
if get(g:, 'virtualenv_loaded', 0) && get(g:, 'airline#extensions#virtualenv#enabled', 1)
call airline#extensions#virtualenv#init(s:ext)
endif
if g:airline_detect_iminsert
if g:airline_section_warning == '__'
if (get(g:, 'airline#extensions#whitespace#enabled', 1) && get(g:, 'airline_detect_whitespace', 1))
call airline#extensions#whitespace#init(s:ext)
endif
if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
\ && exists(':SyntasticCheck')
call airline#extensions#syntastic#init(s:ext)
endif
endif
if get(g:, 'airline#extensions#readonly#enabled', 1)
call airline#extensions#readonly#init()
endif
if (get(g:, 'airline#extensions#paste#enabled', 1) && get(g:, 'airline_detect_paste', 1))
call airline#extensions#paste#init()
endif
if get(g:, 'airline#extensions#iminsert#enabled', 0) || get(g:, 'airline_detect_iminsert', 0)
call airline#extensions#iminsert#init()
endif
call airline#exec_funcrefs(g:airline_statusline_funcrefs, 0)
" load all other extensions not part of the default distribution
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
" check to see that both the resolved and unresolved paths do not match
" up with the path of the found extension
if stridx(resolve(fnamemodify(file, ':p')), s:script_path) < 0
\ && stridx(fnamemodify(file, ':p'), s:script_path) < 0
let name = fnamemodify(file, ':t:r')
if !get(g:, 'airline#extensions#'.name.'#enabled', 1)
continue
endif
call airline#extensions#{name}#init(s:ext)
endif
endfor
endfunction

View File

@@ -1,15 +1,37 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
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
let s:empty_message = get(g:, 'airline#extensions#branch#empty_message',
\ get(g:, 'airline_branch_empty_message', ''))
let s:symbol = get(g:, 'airline#extensions#branch#symbol',
\ get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? ' ' : ''))
let s:has_fugitive = exists('*fugitive#head')
let s:has_fugitive_detect = exists('*fugitive#detect')
let s:has_lawrencium = exists('*lawrencium#statusline')
function! airline#extensions#branch#get_head()
let head = ''
if s:has_fugitive && !exists('b:mercurial_dir')
let head = fugitive#head()
if empty(head) && s:has_fugitive_detect && !exists('b:git_dir')
call fugitive#detect(getcwd())
let head = fugitive#head()
endif
endif
if empty(head)
if s:has_lawrencium
let head = lawrencium#statusline()
endif
endif
return empty(head) ? s:empty_message : s:symbol.head
endfunction
function! airline#extensions#branch#init(ext)
call a:ext.add_statusline_funcref(function('airline#extensions#branch#apply'))
let g:airline_section_b .= '%{airline#extensions#branch#get_head()}'
endfunction

View File

@@ -1,31 +1,16 @@
" 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
" vim: et ts=2 sts=2 sw=2
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'
highlight bufferline_selected gui=bold cterm=bold term=bold
highlight link bufferline_selected_inactive airline_c_inactive
let g:bufferline_inactive_highlight = 'airline_c'
let g:bufferline_active_highlight = 'bufferline_selected'
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'))
let g:airline_section_c = '%{bufferline#refresh_status()}'.bufferline#get_status_string()
endif
endfunction

View File

@@ -1,12 +1,12 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
function! airline#extensions#commandt#apply()
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'))
call a:ext.add_statusline_func('airline#extensions#commandt#apply')
endfunction

View File

@@ -0,0 +1,27 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:column_display = get(g:, 'airline#extensions#csv#column_display', 'Number')
function! airline#extensions#csv#get_column()
if exists('*CSV_WCol')
if s:column_display ==# 'Name'
return '['.CSV_WCol('Name').CSV_WCol().']'
else
return '['.CSV_WCol().']'
endif
endif
return ''
endfunction
function! airline#extensions#csv#apply(...)
if &ft ==# "csv"
call airline#extensions#prepend_to_section('gutter',
\ g:airline_left_alt_sep.' %{airline#extensions#csv#get_column()}')
endif
endfunction
function! airline#extensions#csv#init(ext)
call a:ext.add_statusline_func('airline#extensions#csv#apply')
endfunction

View File

@@ -1,5 +1,7 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:color_template = get(g:, 'airline#extensions#ctrlp#color_template', 'insert')
function! airline#extensions#ctrlp#generate_color_map(dark, light, white)
return {
@@ -13,16 +15,17 @@ function! airline#extensions#ctrlp#generate_color_map(dark, light, white)
endfunction
function! airline#extensions#ctrlp#load_theme()
if exists('g:airline#themes#{g:airline_theme}#ctrlp')
let theme = g:airline#themes#{g:airline_theme}#ctrlp
if exists('g:airline#themes#{g:airline_theme}#palette.ctrlp')
let theme = g:airline#themes#{g:airline_theme}#palette.ctrlp
else
let s:color_template = has_key(g:airline#themes#{g:airline_theme}#palette, s:color_template) ? s:color_template : 'insert'
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'])
\ g:airline#themes#{g:airline_theme}#palette[s:color_template]['airline_c'],
\ g:airline#themes#{g:airline_theme}#palette[s:color_template]['airline_b'],
\ g:airline#themes#{g:airline_theme}#palette[s:color_template]['airline_a'])
endif
for key in keys(theme)
call airline#exec_highlight(key, theme[key])
call airline#highlighter#exec(key, theme[key])
endfor
endfunction
@@ -46,8 +49,9 @@ function! airline#extensions#ctrlp#ctrlp_airline_status(...)
return len.dir
endfunction
function! airline#extensions#ctrlp#is_statusline_overwritten()
return match(&statusline, 'CtrlPlight') >= 0
function! airline#extensions#ctrlp#apply(...)
" disable statusline overwrite if ctrlp already did it
return match(&statusline, 'CtrlPlight') >= 0 ? -1 : 0
endfunction
function! airline#extensions#ctrlp#init(ext)
@@ -55,5 +59,6 @@ function! airline#extensions#ctrlp#init(ext)
\ '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'))
call a:ext.add_statusline_func('airline#extensions#ctrlp#apply')
endfunction

View File

@@ -0,0 +1,49 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
" Extension specific variables can be defined the usual fashion.
if !exists('g:airline#extensions#example#number_of_cats')
let g:airline#extensions#example#number_of_cats = 42
endif
" There are predominantly two methods for integrating a plugin into
" vim-airline. The first method here simply modifies the global section and
" appends information to it. This is useful for cases where the information
" should be displayed all the time for all filetypes.
function! airline#extensions#example#init(ext)
let g:airline_section_y .= '%{airline#extensions#example#get_cats()}'
endfunction
" The second method involves using the 'ext'ension manager that was passed in
" and appends a name of a function. This function will be invoked just prior
" to updating the statusline. This method is useful for plugin-specific
" statuslines (like NERDTree or Tagbar) or language specific plugins (like
" virtualenv) which do not need to be loaded all the time.
function! airline#extensions#example#init(ext)
call a:ext.add_statusline_func('airline#extensions#example#apply')
" There is also the following function for making changes just prior to an
" inactive statusline.
" call a:ext.add_inactive_statusline_func('airline#extensions#example#unapply')
endfunction
" This function will be invoked just prior to the statusline getting modified.
function! airline#extensions#example#apply(...)
" First we check for the filetype.
if &filetype == "nyancat"
" Let's use a helper function. It will take care of ensuring that the
" window-local override exists (and create one based on the global
" airline_section if not), and prepend to it.
call airline#extensions#prepend_to_section('x', '%{airline#extensions#example#get_cats()} ')
endif
endfunction
" Finally, this function will be invoked from the statusline.
function! airline#extensions#example#get_cats()
let cats = ''
for i in range(1, g:airline#extensions#example#number_of_cats)
let cats .= ' (,,,)=(^.^)=(,,,) '
endfor
return cats
endfunction

View File

@@ -0,0 +1,59 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:non_zero_only = get(g:, 'airline#extensions#hunks#non_zero_only', 0)
let s:hunk_symbols = get(g:, 'airline#extensions#hunks#hunk_symbols', ['+', '~', '-'])
let s:initialized = 0
function! s:init()
if !s:initialized
let s:initialized = 1
if get(g:, 'loaded_signify', 0)
function! s:get_hunks()
" this is a temporary fix (see #188)
let fname = fnamemodify(bufname('%'), ':p')
if has_key(g:sy, fname) && has_key(g:sy[fname], 'hunks')
if len(g:sy[fname].hunks) == 0
return [0, 0, 0]
endif
endif
let hunks = sy#repo#get_stats()
if hunks[0] >= 0
return hunks
endif
return []
endfunction
elseif exists('*GitGutterGetHunkSummary')
function! s:get_hunks()
if !get(g:, 'gitgutter_enabled', 0)
return ''
endif
return GitGutterGetHunkSummary()
endfunction
else
function! s:get_hunks()
return []
endfunction
endif
endif
endfunction
function! airline#extensions#hunks#get_hunks()
call <sid>init()
let hunks = s:get_hunks()
let string = ''
if !empty(hunks)
for i in [0, 1, 2]
if s:non_zero_only == 0 || hunks[i] > 0
let string .= printf('%s%s ', s:hunk_symbols[i], hunks[i])
endif
endfor
endif
return string
endfunction
function! airline#extensions#hunks#init(ext)
let g:airline_section_b .= '%{airline#extensions#hunks#get_hunks()}'
endfunction

View File

@@ -1,5 +1,5 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
function! airline#extensions#iminsert#get_text()
if &iminsert

View File

@@ -0,0 +1,14 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:symbol = get(g:, 'airline#extensions#paste#symbol',
\ get(g:, 'airline_paste_symbol', (get(g:, 'airline_powerline_fonts', 0) ? ' ' : '').'PASTE'))
function! airline#extensions#paste#get_mark()
return &paste ? ' ' . s:symbol : ''
endfunction
function! airline#extensions#paste#init()
let g:airline_section_a .= '%{airline#extensions#paste#get_mark()}'
endfunction

View File

@@ -0,0 +1,15 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:symbol = get(g:, 'airline#extensions#readonly#symbol',
\ get(g:, 'airline_readonly_symbol', get(g:, 'airline_powerline_fonts', 0) ? '' : 'RO'))
function! airline#extensions#readonly#get_mark()
return &ro ? s:symbol : ''
endfunction
function! airline#extensions#readonly#init()
let g:airline_section_gutter = ' %#airline_file#%{airline#extensions#readonly#get_mark()} '
\ .g:airline_section_gutter
endfunction

View File

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

View File

@@ -1,31 +1,26 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" vim: et ts=2 sts=2 sw=2
function! airline#extensions#tagbar#apply()
if &ft == 'tagbar'
call airline#extensions#apply_left_override('Tagbar', '%{TagbarGenerateStatusline()}')
endif
" Arguments: current, sort, fname
function! airline#extensions#tagbar#get_status(...)
let builder = airline#builder#new({ 'active': a:1 })
call builder.add_section('airline_a', ' Tagbar ')
call builder.add_section('airline_b', ' '.a:2.' ')
call builder.add_section('airline_c', ' '.a:3.' ')
return builder.build()
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()
function! airline#extensions#tagbar#inactive_apply(...)
if getwinvar(a:2.winnr, '&filetype') == 'tagbar'
return -1
endif
endfunction
function! airline#extensions#tagbar#init(ext)
call a:ext.add_statusline_funcref(function('airline#extensions#tagbar#apply'))
call a:ext.add_inactive_statusline_func('airline#extensions#tagbar#inactive_apply')
let g:tagbar_status_func = 'airline#extensions#tagbar#get_status'
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,23 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
function! airline#extensions#undotree#apply(...)
if exists('t:undotree')
if &ft == 'undotree'
if exists('*t:undotree.GetStatusLine')
call airline#extensions#apply_left_override('undo', '%{t:undotree.GetStatusLine()}')
else
call airline#extensions#apply_left_override('undotree', '%f')
endif
endif
if &ft == 'diff' && exists('*t:diffpanel.GetStatusLine')
call airline#extensions#apply_left_override('diff', '%{t:diffpanel.GetStatusLine()}')
endif
endif
endfunction
function! airline#extensions#undotree#init(ext)
call a:ext.add_statusline_func('airline#extensions#undotree#apply')
endfunction

View File

@@ -0,0 +1,19 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
function! airline#extensions#unite#apply(...)
if &ft == 'unite'
call a:1.add_section('airline_a', ' Unite ')
call a:1.add_section('airline_b', ' %{unite#get_context().buffer_name} ')
call a:1.add_section('airline_c', ' %{unite#get_status_string()} ')
call a:1.split()
call a:1.add_section('airline_y', ' %{unite#get_context().real_buffer_name} ')
return 1
endif
endfunction
function! airline#extensions#unite#init(ext)
let g:unite_force_overwrite_statusline = 0
call a:ext.add_statusline_func('airline#extensions#unite#apply')
endfunction

View File

@@ -0,0 +1,13 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
function! airline#extensions#virtualenv#init(ext)
call a:ext.add_statusline_func('airline#extensions#virtualenv#apply')
endfunction
function! airline#extensions#virtualenv#apply(...)
if &filetype == "python"
call airline#extensions#append_to_section('x', ' '.g:airline_right_alt_sep.' %{virtualenv#statusline()}')
endif
endfunction

View File

@@ -1,31 +1,54 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" vim: et ts=2 sts=2 sw=2
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
" for backwards compatibility
if exists('g:airline_detect_whitespace')
let s:show_message = g:airline_detect_whitespace == 1
else
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
endif
let s:symbol = get(g:, 'airline#extensions#whitespace#symbol',
\ get(g:, 'airline_whitespace_symbol', get(g:, 'airline_powerline_fonts', 0) ? '✹' : '!'))
let s:checks = get(g:, 'airline#extensions#whitespace#checks', ['indent', 'trailing'])
let s:trailing_format = get(g:, 'airline#extensions#whitespace#trailing_format', 'trailing[%s]')
let s:mixed_indent_format = get(g:, 'airline#extensions#whitespace#mixed_indent_format', 'mixed-indent[%s]')
let s:initialized = 0
let s:vimrc_detect_whitespace = g:airline_detect_whitespace
let s:enabled = 1
function! airline#extensions#whitespace#check()
if &readonly || g:airline_detect_whitespace <= 0
if &readonly || !s:enabled
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
let trailing = 0
if index(s:checks, 'trailing') > -1
let trailing = search(' $', 'nw')
endif
let mixed = 0
if index(s:checks, 'indent') > -1
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
endif
if trailing != 0 || mixed
let b:airline_whitespace_check = g:airline_whitespace_symbol." "
if g:airline_detect_whitespace == 1
let b:airline_whitespace_check = s:symbol." "
if s:show_message
if trailing != 0
let b:airline_whitespace_check .= 'trailing['.trailing.'] '
let b:airline_whitespace_check .= printf(s:trailing_format, trailing).' '
endif
if mixed
let mixnr = indents[0] == indents[1] ? indents[0] : indents[2]
let b:airline_whitespace_check .= 'mixed-indent['.mixnr.'] '
let b:airline_whitespace_check .= printf(s:mixed_indent_format, mixnr).' '
endif
endif
endif
@@ -33,29 +56,27 @@ function! airline#extensions#whitespace#check()
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()}'
function! airline#extensions#whitespace#apply(...)
call airline#extensions#append_to_section('warning', ' %{airline#extensions#whitespace#check()}')
endfunction
function! airline#extensions#whitespace#toggle()
if g:airline_detect_whitespace > 0
if s:enabled
autocmd! airline_whitespace CursorHold,BufWritePost
let g:airline_detect_whitespace = 0
let s:enabled = 0
else
call airline#extensions#whitespace#init()
let g:airline_detect_whitespace = s:vimrc_detect_whitespace
let s:enabled = 1
endif
endfunction
function! airline#extensions#whitespace#init()
function! airline#extensions#whitespace#init(...)
if !s:initialized
let s:initialized = 1
call add(g:airline_statusline_funcrefs, function('airline#extensions#whitespace#apply'))
call airline#add_statusline_func('airline#extensions#whitespace#apply')
endif
unlet! b:airline_whitespace_check
augroup airline_whitespace
autocmd!
autocmd CursorHold,BufWritePost * unlet! b:airline_whitespace_check

View File

@@ -0,0 +1,73 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
let s:separators = {}
function! s:gui2cui(rgb, fallback)
if a:rgb == ''
return a:fallback
endif
let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
let rgb = [rgb[0] > 127 ? 4 : 0, rgb[1] > 127 ? 2 : 0, rgb[2] > 127 ? 1 : 0]
return rgb[0]+rgb[1]+rgb[2]
endfunction
function! airline#highlighter#exec(group, colors)
let colors = a:colors
if s:is_win32term
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
endif
exec printf('hi %s %s %s %s %s %s %s %s',
\ a:group,
\ get(colors, 0, '') != '' ? 'guifg='.colors[0] : '',
\ get(colors, 1, '') != '' ? 'guibg='.colors[1] : '',
\ get(colors, 2, '') != '' ? 'ctermfg='.colors[2] : '',
\ get(colors, 3, '') != '' ? 'ctermbg='.colors[3] : '',
\ get(colors, 4, '') != '' ? 'gui='.colors[4] : '',
\ get(colors, 4, '') != '' ? 'cterm='.colors[4] : '',
\ get(colors, 4, '') != '' ? 'term='.colors[4] : '')
endfunction
function! s:exec_separator(dict, from, to, inverse, suffix)
let l:from = airline#themes#get_highlight(a:from.a:suffix)
let l:to = airline#themes#get_highlight(a:to.a:suffix)
let group = a:from.'_to_'.a:to.a:suffix
if a:inverse
let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
else
let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ]
endif
let a:dict[group] = colors
call airline#highlighter#exec(group, colors)
endfunction
function! airline#highlighter#load_theme()
call airline#highlighter#highlight(['inactive'])
call airline#highlighter#highlight(['normal'])
endfunction
function! airline#highlighter#add_separator(from, to, inverse)
let s:separators[a:from.a:to] = [a:from, a:to, a:inverse]
endfunction
function! airline#highlighter#highlight(modes)
" 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 suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
for mode in mapped
if exists('g:airline#themes#{g:airline_theme}#palette[mode]')
let dict = g:airline#themes#{g:airline_theme}#palette[mode]
for kvp in items(dict)
call airline#highlighter#exec(kvp[0].suffix, kvp[1])
endfor
" TODO: optimize this
for sep in items(s:separators)
call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
endfor
endif
endfor
endfunction

View File

@@ -1,28 +1,26 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" 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)
" 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 {
\ '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] , '' ] ,
\ '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] , '' ] ,
\ 'statusline': [ a:section3[0] , a:section3[1] , a:section3[2] , a:section3[3] , get(a:section3 , 4 , '' ) ] ,
\ 'file': [ file[0] , file[1] , file[2] , file[3] , get(file , 4 , '' ) ] ,
\ 'airline_a': [ a:section1[0] , a:section1[1] , a:section1[2] , a:section1[3] , get(a:section1 , 4 , 'bold') ] ,
\ 'airline_b': [ a:section2[0] , a:section2[1] , a:section2[2] , a:section2[3] , get(a:section2 , 4 , '' ) ] ,
\ 'airline_c': [ a:section3[0] , a:section3[1] , a:section3[2] , a:section3[3] , get(a:section3 , 4 , '' ) ] ,
\ 'airline_file': [ a:file[0] , a:file[1] , a:file[2] , a:file[3] , get(a:file , 4 , '' ) ] ,
\ 'airline_x': [ a:section3[0] , a:section3[1] , a:section3[2] , a:section3[3] , get(a:section3 , 4 , '' ) ] ,
\ 'airline_y': [ a:section2[0] , a:section2[1] , a:section2[2] , a:section2[3] , get(a:section2 , 4 , '' ) ] ,
\ 'airline_z': [ a:section1[0] , a:section1[1] , a:section1[2] , a:section1[3] , get(a:section1 , 4 , '' ) ] ,
\ }
endfunction
function! s:get_syn(group, what)
let color = synIDattr(synIDtrans(hlID(a:group)), a:what)
" need to pass in mode, known to break on 7.3.547
let mode = has('gui_running') ? 'gui' : 'cterm'
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode)
if empty(color) || color == -1
let color = synIDattr(synIDtrans(hlID('Normal')), a:what)
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode)
endif
if empty(color) || color == -1
if has('gui_running')
@@ -54,10 +52,26 @@ function! airline#themes#get_highlight2(fg, bg, ...)
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
function! airline#themes#patch(palette)
" this is a pretty heavy handed, but it works...
" basically, look for the 'airline_file' group and copy the bg
" colors from 'airline_c' into it.
for mode in keys(a:palette)
let overrides = split(mode, '_')
let mode_colors = a:palette[overrides[0]]
if exists('mode_colors.airline_file')
let file_colors = mode_colors.airline_file
let file_colors[1] = mode_colors.airline_c[1]
let file_colors[3] = mode_colors.airline_c[3]
if len(overrides) > 1
let override_colors = a:palette[overrides[0].'_'.overrides[1]]
let override_colors.airline_file = copy(file_colors)
let override_status_colors = get(override_colors, 'airline_c', mode_colors.airline_c)
let override_colors.airline_file[1] = override_status_colors[1]
let override_colors.airline_file[3] = override_status_colors[3]
endif
endif
endfor
endfunction

View File

@@ -18,35 +18,30 @@ let s:RE = [ '#ff9eb8' , 211 ] " dress
let s:file = [ '#ff2c4b' , '' , 196 , '' , '' ]
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
let g:airline#themes#badwolf#palette = {}
let g:airline#themes#badwolf#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#badwolf#normal_modified = {
\ 'mode_separator' : [ s:N1[1] , s:N4[0] , s:N1[3] , s:N4[1] , 'bold' ] ,
\ 'info' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
\ 'info_separator' : [ s:N4[0] , s:N2[1] , s:N4[1] , s:N2[3] , 'bold' ] ,
\ 'statusline' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#badwolf#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#badwolf#palette.normal_modified = {
\ 'airline_b': [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#badwolf#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#badwolf#insert_modified = {
\ 'info_separator' : [ s:I2[1] , s:N2[1] , s:I2[3] , s:N2[3] , 'bold' ] ,
\ 'statusline' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#badwolf#insert_paste = {
\ 'mode' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] ,
\ 'mode_separator' : [ s:PA[0] , s:I2[1] , s:PA[1] , s:I2[3] , '' ] }
let g:airline#themes#badwolf#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#badwolf#palette.insert_modified = {
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#badwolf#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
let g:airline#themes#badwolf#replace = copy(airline#themes#badwolf#insert)
let g:airline#themes#badwolf#replace.mode = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
let g:airline#themes#badwolf#replace.mode_separator = [ s:RE[0] , s:I2[1] , s:RE[1] , s:I2[3] , '' ]
let g:airline#themes#badwolf#replace_modified = g:airline#themes#badwolf#insert_modified
let g:airline#themes#badwolf#palette.replace = copy(airline#themes#badwolf#palette.insert)
let g:airline#themes#badwolf#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
let g:airline#themes#badwolf#palette.replace_modified = g:airline#themes#badwolf#palette.insert_modified
let g:airline#themes#badwolf#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#badwolf#visual_modified = {
\ 'info_separator' : [ s:V2[1] , s:V4[0] , s:V2[3] , s:V4[1] , 'bold' ] ,
\ 'statusline' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
let g:airline#themes#badwolf#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#badwolf#palette.visual_modified = {
\ 'airline_c': [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
let g:airline#themes#badwolf#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)

View File

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

View File

@@ -22,40 +22,40 @@ let s:cterm_pink = 182
let s:file = ['#ff0000', '', 160, '', '']
let g:airline#themes#bubblegum#palette = {}
" Normal mode
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
let g:airline#themes#bubblegum#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, ''],
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
let g:airline#themes#bubblegum#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#bubblegum#palette.normal_modified = {
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
\ }
" Insert mode
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
let g:airline#themes#bubblegum#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, ''],
let g:airline#themes#bubblegum#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3, s:file)
let g:airline#themes#bubblegum#palette.insert_modified = copy(g:airline#themes#bubblegum#palette.normal_modified)
let g:airline#themes#bubblegum#palette.insert_paste = {
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
\ }
" Replace mode
let g:airline#themes#bubblegum#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#palette.replace = {
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
\ }
let g:airline#themes#bubblegum#replace_modified = copy(g:airline#themes#bubblegum#insert_modified)
let g:airline#themes#bubblegum#palette.replace_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
" Visual mode
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
let g:airline#themes#bubblegum#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)
let g:airline#themes#bubblegum#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3, s:file)
let g:airline#themes#bubblegum#palette.visual_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
" Inactive window
let s:IA = [s:gui_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, '']
let g:airline#themes#bubblegum#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#bubblegum#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)

View File

@@ -23,11 +23,14 @@
"
" 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 ]
" The file array is a special case, where only the foreground colors are
" specified. The background colors are automatically filled.
let s:file = [ '#ff0000' , '' , 160 , '' ]
" 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
@@ -35,61 +38,63 @@ let s:N3 = [ '#9cffd3' , '#202020' , 85 , 234 ]
" 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)
" First, let's define a palette. Airline will search for this variable.
" The # is a separator that maps with the directory structure. If you get
" this wrong, Vim will complain loudly.
let g:airline#themes#dark#palette = {}
" Now let's declare some colors for normal mode and add it to the dictionary.
let g:airline#themes#dark#palette.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
" applied after g:airline#themes#dark#palette.normal, hence why only certain keys are
" declared.
let g:airline#themes#dark#normal_modified = {
\ 'info_separator': [ '#444444' , '#5f005f' , 238 , 53 , '' ] ,
\ 'statusline': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
let g:airline#themes#dark#palette.normal_modified = {
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
\ }
let s:I1 = [ '#00005f' , '#00dfff' , 17 , 45 ]
let s:I2 = [ '#ffffff' , '#005fff' , 255 , 27 ]
let s:I3 = [ '#ffffff' , '#000080' , 15 , 17 ]
let g:airline#themes#dark#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#dark#insert_modified = {
\ 'info_separator': [ '#005fff' , '#5f005f' , 27 , 53 , '' ] ,
\ 'statusline': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
let g:airline#themes#dark#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#dark#palette.insert_modified = {
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
\ }
let g:airline#themes#dark#insert_paste = {
\ 'mode': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
\ 'mode_separator': [ '#d78700' , s:I2[1] , 172 , s:I2[3] , '' ] ,
let g:airline#themes#dark#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
\ }
let g:airline#themes#dark#replace = copy(g:airline#themes#dark#insert)
let g:airline#themes#dark#replace.mode = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
let g:airline#themes#dark#replace.mode_separator = [ '#af0000' , s:I2[1] , 124 , s:I2[3] , '' ]
let g:airline#themes#dark#replace_modified = g:airline#themes#dark#insert_modified
let g:airline#themes#dark#palette.replace = copy(g:airline#themes#dark#palette.insert)
let g:airline#themes#dark#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
let g:airline#themes#dark#palette.replace_modified = g:airline#themes#dark#palette.insert_modified
let s:V1 = [ '#000000' , '#ffaf00' , 232 , 214 ]
let s:V2 = [ '#000000' , '#ff5f00' , 232 , 202 ]
let s:V3 = [ '#ffffff' , '#5f0000' , 15 , 52 ]
let g:airline#themes#dark#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#dark#visual_modified = {
\ 'info_separator': [ '#ff5f00' , '#5f005f' , 202 , 53 , '' ] ,
\ 'statusline': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
let g:airline#themes#dark#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#dark#palette.visual_modified = {
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
\ }
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 s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
let g:airline#themes#dark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3, s:file)
" 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' ])
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#dark#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])

View File

@@ -1,3 +1,5 @@
let g:airline#themes#jellybeans#palette = {}
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
@@ -9,41 +11,36 @@ function! s:generate()
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 g:airline#themes#jellybeans#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#jellybeans#palette.normal_modified = {
\ 'airline_c': [ '#ffb964', '', 215, '', '' ]
\ }
let s:I1 = airline#themes#get_highlight('DiffAdd', 'bold')
let s:I2 = s:N2
let s:I3 = s:N3
let g:airline#themes#jellybeans#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 g:airline#themes#jellybeans#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#jellybeans#palette.insert_modified = g:airline#themes#jellybeans#palette.normal_modified
let s:R1 = airline#themes#get_highlight('WildMenu', 'bold')
let s:R2 = s:N2
let s:R3 = s:N3
let g:airline#themes#jellybeans#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
let g:airline#themes#jellybeans#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
let g:airline#themes#jellybeans#palette.replace_modified = g:airline#themes#jellybeans#palette.normal_modified
" Sometimes you want to mix and match colors from different groups, you can do
" that with this method.
let s:V1 = airline#themes#get_highlight2(['TabLineSel', 'bg'], ['DiffDelete', 'bg'], 'bold')
let s:V2 = s:N2
let s:V3 = s:N3
let g:airline#themes#jellybeans#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
let g:airline#themes#jellybeans#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#jellybeans#palette.visual_modified = g:airline#themes#jellybeans#palette.normal_modified
" And of course, you can always do it manually as well.
let s:IA = [ '#444444', '#1c1c1c', 237, 234 ]
let g:airline#themes#jellybeans#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#jellybeans#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
endfunction
call s:generate()

View File

@@ -25,37 +25,33 @@ let s:RE = [ '#233e09' , 22 ] " oakleaf
let s:PA = [ '#ab3e5d' , 161 ] " raspberry
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] , '' ]
let g:airline#themes#laederon#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#laederon#normal_modified = {
\ 'mode_separator' : [ s:N1[1] , s:N4[0] , s:N1[3] , s:N4[1] , 'bold' ] ,
\ 'info' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
\ 'info_separator' : [ s:N4[0] , s:N2[1] , s:N4[1] , s:N2[3] , 'bold' ] ,
\ 'statusline' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#laederon#palette = {}
let g:airline#themes#laederon#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#laederon#palette.normal_modified = {
\ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
\ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#laederon#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#laederon#insert_modified = {
\ 'info_separator' : [ s:I2[1] , s:N2[1] , s:I2[3] , s:N2[3] , 'bold' ] ,
\ 'statusline' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
let g:airline#themes#laederon#insert_paste = {
\ 'mode' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] ,
\ 'mode_separator' : [ s:PA[0] , s:I2[1] , s:PA[1] , s:I2[3] , '' ] }
let g:airline#themes#laederon#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#laederon#palette.insert_modified = {
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
let g:airline#themes#laederon#palette.insert_paste = {
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
let g:airline#themes#laederon#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_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#palette.replace = copy(airline#themes#laederon#palette.insert)
let g:airline#themes#laederon#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
let g:airline#themes#laederon#palette.replace_modified = g:airline#themes#laederon#palette.insert_modified
let g:airline#themes#laederon#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#laederon#visual_modified = {
\ 'info_separator' : [ s:V2[1] , s:V4[0] , s:V2[3] , s:V4[1] , 'bold' ] ,
\ 'statusline' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
let g:airline#themes#laederon#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#laederon#palette.visual_modified = {
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
let g:airline#themes#laederon#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#laederon#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)

View File

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

View File

@@ -1,54 +1,51 @@
" 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#palette = {}
let s:file = [ '#ffffff' , '' , 231 , '' , '' ]
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:N1 = [ '#ffffff' , '#005252' , 231 , 36 ]
let s:N2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
let s:N3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
let g:airline#themes#luna#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#luna#palette.normal_modified = {
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
\ }
let s:I1 = [ '#ffffff' , '#789f00' , 231 , 106 ]
let s:I2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
let s:I3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
let g:airline#themes#luna#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 s:I1 = [ '#ffffff' , '#789f00' , 231 , 106 ]
let s:I2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
let s:I3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
let g:airline#themes#luna#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#luna#palette.insert_modified = {
\ 'airline_c': [ '#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#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] ,
\ }
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 g:airline#themes#luna#palette.replace = copy(g:airline#themes#luna#palette.insert)
let g:airline#themes#luna#palette.replace.airline_a = [ s:I2[0] , '#920000' , s:I2[2] , 88 , '' ]
let g:airline#themes#luna#palette.replace_modified = g:airline#themes#luna#palette.insert_modified
let s:V1 = [ '#ffff9a' , '#ff8036' , 222 , 208 ]
let s:V2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
let s:V3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
let g:airline#themes#luna#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 g:airline#themes#luna#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#luna#palette.visual_modified = {
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
\ }
let s:IA = [ '#4e4e4e' , '#002b2b' , 59 , 23 , '' ]
let g:airline#themes#luna#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#luna#palette.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 , '' ] )
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#luna#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] ,
\ [ '#ffffff' , '#005252' , 231 , 36 , '' ] ,
\ [ '#ffffff' , '#973d45' , 231 , 95 , '' ] )

View File

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

View File

@@ -28,21 +28,21 @@ let s:RE = [ '#ffffff' , '#d70000' , 231 , 160 ] " white & brightred
let s:file = copy(s:N3)
let g:airline#themes#powerlineish#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#powerlineish#palette = {}
let g:airline#themes#powerlineish#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#powerlineish#insert_replace = {
\ 'mode' : [ s:RE[0] , s:I1[1] , s:RE[1] , s:I1[3] , '' ] ,
\ 'mode_separator' : [ s:I1[1] , s:I2[1] , s:I1[3] , s:I2[3] , '' ] }
let g:airline#themes#powerlineish#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#powerlineish#visual = {
\ 'mode' : [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , '' ] ,
\ 'mode_separator' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#powerlineish#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#powerlineish#palette.insert_replace = {
\ 'airline_a': [ s:RE[0] , s:I1[1] , s:RE[1] , s:I1[3] , '' ] }
let g:airline#themes#powerlineish#replace = copy(airline#themes#powerlineish#normal)
let g:airline#themes#powerlineish#replace.mode = [ s:RE[0] , s:RE[1] , s:RE[2] , s:RE[3] , '' ]
let g:airline#themes#powerlineish#replace.mode_separator = [ s:RE[1] , s:N2[1] , s:RE[3] , s:N2[3] , '' ]
let g:airline#themes#powerlineish#palette.visual = {
\ 'airline_a': [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , '' ] }
let g:airline#themes#powerlineish#palette.replace = copy(airline#themes#powerlineish#palette.normal)
let g:airline#themes#powerlineish#palette.replace.airline_a = [ s:RE[0] , s:RE[1] , s:RE[2] , s:RE[3] , '' ]
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
let g:airline#themes#powerlineish#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
let g:airline#themes#powerlineish#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)

View File

@@ -1,101 +1,44 @@
let s:swap = 0
if exists('g:airline_powerline_fonts') && g:airline_powerline_fonts
let s:swap = 1
let s:left = 0
function! airline#themes#simple#left()
if s:left == 1
let s:left = 0
return ''
else
let s:left = 1
return ''
endif
endfunction
let g:airline_left_sep = '%{airline#themes#simple#left()}'
let s:right = 0
function! airline#themes#simple#right()
if s:right == 1
let s:right = 0
return ''
else
let s:right = 1
return ''
endif
endfunction
let g:airline_right_sep = '%{airline#themes#simple#right()}'
endif
if g:airline_left_sep == '' && g:airline_right_sep == ''
let s:swap = 1
endif
let g:airline#themes#simple#palette = {}
let s:guibg = '#080808'
let s:guibg2 = '#1c1c1c'
let s:termbg = 232
let s:termsep = 236
let s:guisep = '#303030'
let s:termbg2= 234
let s:file = [ '#ff0000' , '' , 160 , '' , '' ]
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:N3 = [ '#767676' , s:guibg, 243 , s:termbg ]
let g:airline#themes#simple#normal = {
\ 'mode': [ s:N1[0] , s:N1[1] , s:N1[2] , s:N1[3] , 'bold' ] ,
\ 'mode_separator': s:swap
\ ? [ '#00dfff' , s:N2[1] , 45 , s:N2[3] , 'bold' ]
\ : [ s:guisep , s:N2[1] , s:termsep , s:N2[3] , 'bold' ] ,
\ 'info': [ s:N2[0] , s:N2[1] , s:N2[2] , s:N2[3] , '' ] ,
\ 'info_separator': [ s:guisep , s:N3[1] , s:termsep , s:N3[3] , 'bold' ] ,
\ 'statusline': [ s:N3[0] , s:N3[1] , s:N3[2] , s:N3[3] , '' ] ,
\ 'file': s:file,
\ }
let g:airline#themes#simple#normal_modified = {
\ 'statusline': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
let s:N1 = [ s:guibg , '#00dfff' , s:termbg , 45 ]
let s:N2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
let s:N3 = [ '#767676' , s:guibg, 243 , s:termbg]
let g:airline#themes#simple#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#simple#palette.normal_modified = {
\ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
\ }
let s:I1 = s:swap ? [ s:guibg, '#5fff00' , s:termbg , 82 ] : [ '#5fff00' , s:guibg, 82 , s:termbg ]
let s:I2 = [ '#ff5f00' , s:guibg, 202 , s:termbg ]
let s:I1 = [ s:guibg, '#5fff00' , s:termbg , 82 ]
let s:I2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
let s:I3 = [ '#767676' , s:guibg, 243 , s:termbg ]
let g:airline#themes#simple#insert = {
\ 'mode': [ s:I1[0] , s:I1[1] , s:I1[2] , s:I1[3] , 'bold' ] ,
\ 'mode_separator': s:swap
\ ? [ '#5fff00' , s:I2[1] , 82 , s:I2[3] , 'bold' ]
\ : [ s:guisep , s:I2[1] , s:termsep , s:I2[3] , 'bold' ] ,
\ 'info': [ s:I2[0] , s:I2[1] , s:I2[2] , s:I2[3] , '' ] ,
\ 'info_separator': [ s:guisep , s:I3[1] , s:termsep , s:I3[3] , 'bold' ] ,
\ 'statusline': [ s:I3[0] , s:I3[1] , s:I3[2] , s:I3[3] , '' ] ,
\ }
let g:airline#themes#simple#insert_modified = copy(g:airline#themes#simple#normal_modified)
let g:airline#themes#simple#insert_paste = {
\ 'mode': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
\ 'mode_separator': [ '#d78700' , s:I2[1] , 172 , s:I2[3] , '' ] ,
let g:airline#themes#simple#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#simple#palette.insert_modified = copy(g:airline#themes#simple#palette.normal_modified)
let g:airline#themes#simple#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
\ }
let g:airline#themes#simple#replace = {
\ 'mode': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] ,
\ 'mode_separator': [ '#af0000' , s:I2[1] , 124 , s:I2[3] , '' ] ,
let g:airline#themes#simple#palette.replace = {
\ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] ,
\ }
let g:airline#themes#simple#replace_modified = copy(g:airline#themes#simple#normal_modified)
let g:airline#themes#simple#palette.replace_modified = copy(g:airline#themes#simple#palette.normal_modified)
let s:V1 = s:swap ? [ s:guibg, '#dfdf00' , s:termbg , 184 ] : [ '#dfdf00' , s:guibg, 184 , s:termbg ]
let s:V2 = [ '#ff5f00' , s:guibg, 202 , s:termbg ]
let s:V1 = [ s:guibg, '#dfdf00' , s:termbg , 184 ]
let s:V2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
let s:V3 = [ '#767676' , s:guibg, 243 , s:termbg ]
let g:airline#themes#simple#visual = {
\ 'mode': [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , 'bold' ] ,
\ 'mode_separator': s:swap
\ ? [ '#dfdf00' , s:V2[1] , 184 , s:V2[3] , 'bold' ]
\ : [ s:guisep , s:V2[1] , s:termsep , s:V2[3] , 'bold' ] ,
\ 'info': [ s:V2[0] , s:V2[1] , s:V2[2] , s:V2[3] , '' ] ,
\ 'info_separator': [ s:guisep , s:V3[1] , s:termsep , s:V3[3] , 'bold' ] ,
\ 'statusline': [ s:V3[0] , s:V3[1] , s:V3[2] , s:V3[3] , '' ] ,
\ }
let g:airline#themes#simple#visual_modified = copy(g:airline#themes#simple#normal_modified)
let g:airline#themes#simple#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#simple#palette.visual_modified = copy(g:airline#themes#simple#palette.normal_modified)
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 s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ]
let s:IA2 = [ '#4e4e4e' , s:guibg2 , 239 , s:termbg2 , '' ]
let g:airline#themes#simple#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2, s:file)

View File

@@ -1,32 +1,35 @@
let g:airline#themes#solarized#palette = {}
function! s:generate()
""""""""""""""""""""""""""""""""""""""""""""""""
" 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)
let s:ansi_colors = get(g:, 'solarized_termcolors', 16) != 256 && &t_Co >= 16 ? 1 : 0
""""""""""""""""""""""""""""""""""""""""""""""""
" Colors
""""""""""""""""""""""""""""""""""""""""""""""""
" Base colors
let s:base03 = {'t': 234, 'g': '#002b36'}
let s:base02 = {'t': 235, 'g': '#073642'}
let s:base01 = {'t': 240, 'g': '#586e75'}
let s:base00 = {'t': 241, 'g': '#657b83'}
let s:base0 = {'t': 244, 'g': '#839496'}
let s:base1 = {'t': 245, 'g': '#93a1a1'}
let s:base2 = {'t': 254, 'g': '#eee8d5'}
let s:base3 = {'t': 230, 'g': '#fdf6e3'}
let s:yellow = {'t': 136, 'g': '#b58900'}
let s:orange = {'t': 166, 'g': '#cb4b16'}
let s:red = {'t': 160, 'g': '#dc322f'}
let s:magenta = {'t': 125, 'g': '#d33682'}
let s:violet = {'t': 61, 'g': '#6c71c4'}
let s:blue = {'t': 33, 'g': '#268bd2'}
let s:cyan = {'t': 37, 'g': '#2aa198'}
let s:green = {'t': 64, 'g': '#859900'}
let s:c218 = {'t': 218, 'g': '#ffafd7'}
let s:c52 = {'t': 52, 'g': '#5f0000'}
let s:base03 = {'t': s:ansi_colors ? 8 : 234, 'g': '#002b36'}
let s:base02 = {'t': s:ansi_colors ? '0' : 235, 'g': '#073642'}
let s:base01 = {'t': s:ansi_colors ? 10 : 240, 'g': '#586e75'}
let s:base00 = {'t': s:ansi_colors ? 11 : 241, 'g': '#657b83'}
let s:base0 = {'t': s:ansi_colors ? 12 : 244, 'g': '#839496'}
let s:base1 = {'t': s:ansi_colors ? 14 : 245, 'g': '#93a1a1'}
let s:base2 = {'t': s:ansi_colors ? 7 : 254, 'g': '#eee8d5'}
let s:base3 = {'t': s:ansi_colors ? 15 : 230, 'g': '#fdf6e3'}
let s:yellow = {'t': s:ansi_colors ? 3 : 136, 'g': '#b58900'}
let s:orange = {'t': s:ansi_colors ? 9 : 166, 'g': '#cb4b16'}
let s:red = {'t': s:ansi_colors ? 1 : 160, 'g': '#dc322f'}
let s:magenta = {'t': s:ansi_colors ? 5 : 125, 'g': '#d33682'}
let s:violet = {'t': s:ansi_colors ? 13 : 61 , 'g': '#6c71c4'}
let s:blue = {'t': s:ansi_colors ? 4 : 33 , 'g': '#268bd2'}
let s:cyan = {'t': s:ansi_colors ? 6 : 37 , 'g': '#2aa198'}
let s:green = {'t': s:ansi_colors ? 2 : 64 , 'g': '#859900'}
let s:color236= {'t': s:ansi_colors ? '0' : 236, 'g': '#303030'}
let s:color251= {'t': s:ansi_colors ? 14 : 251, 'g': '#c6c6c6'}
""""""""""""""""""""""""""""""""""""""""""""""""
" Simple mappings
@@ -39,54 +42,32 @@ function! s:generate()
let s:N2 = [s:base2, s:base01, '']
let s:N3 = [s:base1, s:base02, '']
else
let s:N2 = [s:base2, s:base1, '']
let s:N2 = [s:base2, s:base00, '']
let s:N3 = [s:base00, s:base2, '']
endif
let s:NF = [s:orange, s:N3[1], '']
if s:reduced
if s:background == 'dark'
let s:NM = {
\ 'info_separator': [s:N2[1], s:N3[1], ''],
\ 'statusline': [s:magenta, s:N3[1], ''],
\ }
else
let s:NM = {
\ 'info_separator': [s:N2[1], s:N3[1], ''],
\ 'statusline': [s:magenta, s:N3[1], ''],
\ }
endif
let s:NM = [s:orange, s:N3[1], '']
let s:NW = [s:base3, s:orange, '']
if s:background == 'dark'
let s:NM = [s:orange, s:N3[1], '']
else
if s:background == 'dark'
let s:NM = {
\ 'info_separator': [s:N2[1], s:c52, ''],
\ 'statusline': [s:c218, s:c52, '']
\ }
else
let s:NM = {
\ 'info_separator': [s:N2[1], s:c218, ''],
\ 'statusline': [s:red, s:c218, '']
\ }
endif
let s:NM = [s:red, s:N3[1], '']
endif
" Insert mode
let s:I1 = [s:N1[0], s:green, 'bold']
if s:reduced
let s:I2 = s:N2
else
let s:I2 = [s:base3, s:base1, '']
if s:background == 'dark'
let s:I2 = [s:base00, s:color236, '']
else
let s:I2 = [s:base00, s:color251, '']
endif
endif
let s:I3 = s:N3
let s:IF = s:NF
if s:reduced
let s:IM = s:NM
else
let s:IM = {
\ 'info_separator': [s:I2[1], s:NM.statusline[1], ''],
\ 'statusline': s:NM.statusline
\ }
endif
let s:IM = s:NM
" Visual mode
let s:V1 = [s:N1[0], s:orange, 'bold']
@@ -119,51 +100,48 @@ function! s:generate()
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 g:airline#themes#solarized#inactive = airline#themes#generate_color_map(
let g:airline#themes#solarized#palette.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:NFa)
let g:airline#themes#solarized#normal = airline#themes#generate_color_map(
let g:airline#themes#solarized#palette.normal = airline#themes#generate_color_map(
\ [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_modified = {
\ 'info_separator': [s:NM.info_separator[0].g, s:NM.info_separator[1].g,
\ s:NM.info_separator[0].t, s:NM.info_separator[1].t, s:NM.info_separator[2]],
\ 'statusline': [s:NM.statusline[0].g, s:NM.statusline[1].g,
\ s:NM.statusline[0].t, s:NM.statusline[1].t, s:NM.statusline[2]]}
let g:airline#themes#solarized#palette.normal.airline_warningmsg = [
\ s:NW[0].g, s:NW[1].g, s:NW[0].t, s:NW[1].t, s:NW[2]]
let g:airline#themes#solarized#insert = airline#themes#generate_color_map(
let g:airline#themes#solarized#palette.normal_modified = {
\ 'airline_c': [s:NM[0].g, s:NM[1].g,
\ s:NM[0].t, s:NM[1].t, s:NM[2]]}
let g:airline#themes#solarized#palette.insert = airline#themes#generate_color_map(
\ [s:I1[0].g, s:I1[1].g, s:I1[0].t, s:I1[1].t, s:I1[2]],
\ [s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]],
\ [s:I3[0].g, s:I3[1].g, s:I3[0].t, s:I3[1].t, s:I3[2]],
\ s:IFa)
let g:airline#themes#solarized#insert_modified = {
\ 'info_separator': [s:IM.info_separator[0].g, s:IM.info_separator[1].g,
\ s:IM.info_separator[0].t, s:IM.info_separator[1].t, s:IM.info_separator[2]],
\ 'statusline': [s:IM.statusline[0].g, s:IM.statusline[1].g,
\ s:IM.statusline[0].t, s:IM.statusline[1].t, s:IM.statusline[2]]}
let g:airline#themes#solarized#palette.insert_modified = {
\ 'airline_c': [s:IM[0].g, s:IM[1].g,
\ s:IM[0].t, s:IM[1].t, s:IM[2]]}
let g:airline#themes#solarized#visual = airline#themes#generate_color_map(
let g:airline#themes#solarized#palette.visual = airline#themes#generate_color_map(
\ [s:V1[0].g, s:V1[1].g, s:V1[0].t, s:V1[1].t, s:V1[2]],
\ [s:V2[0].g, s:V2[1].g, s:V2[0].t, s:V2[1].t, s:V2[2]],
\ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]],
\ s:VFa)
let g:airline#themes#solarized#visual_modified = {
\ 'info_separator': [s:VM.info_separator[0].g, s:VM.info_separator[1].g,
\ s:VM.info_separator[0].t, s:VM.info_separator[1].t, s:VM.info_separator[2]],
\ 'statusline': [s:VM.statusline[0].g, s:VM.statusline[1].g,
\ s:VM.statusline[0].t, s:VM.statusline[1].t, s:VM.statusline[2]]}
let g:airline#themes#solarized#palette.visual_modified = {
\ 'airline_c': [s:VM[0].g, s:VM[1].g,
\ s:VM[0].t, s:VM[1].t, s:VM[2]]}
endfunction
call s:generate()
augroup airline_solarized
autocmd!
autocmd ColorScheme * call <sid>generate() | call airline#reload_highlight()
autocmd ColorScheme * call <sid>generate() | call airline#load_theme()
augroup END

View File

@@ -1,43 +1,42 @@
let g:airline#themes#tomorrow#palette = {}
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 g:airline#themes#tomorrow#palette.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 g:airline#themes#tomorrow#palette.normal_modified = {
\ 'airline_c': [ 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 g:airline#themes#tomorrow#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#tomorrow#palette.insert_modified = g:airline#themes#tomorrow#palette.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 g:airline#themes#tomorrow#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
let g:airline#themes#tomorrow#palette.replace_modified = g:airline#themes#tomorrow#palette.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 g:airline#themes#tomorrow#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#tomorrow#palette.visual_modified = g:airline#themes#tomorrow#palette.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)
let g:airline#themes#tomorrow#palette.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()
autocmd ColorScheme * call <sid>generate() | call airline#load_theme()
augroup END

View File

@@ -25,38 +25,34 @@ let s:RE = [ '#c7915b' , 173 ] " nut
let s:PA = [ '#f9ef6d' , 154 ] " bleaklemon
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], '' ]
let g:airline#themes#ubaryd#palette = {}
let g:airline#themes#ubaryd#palette.inactive = {
\ 'airline_a' : [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] }
let g:airline#themes#ubaryd#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#ubaryd#normal_modified = {
\ 'mode_separator' : [ s:N1[1] , s:N4[0] , s:N1[3] , s:N4[1] , 'bold' ] ,
\ 'info' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
\ 'info_separator' : [ s:N4[0] , s:N2[1] , s:N4[1] , s:N2[3] , 'bold' ] ,
\ 'statusline' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#ubaryd#inactive = {
\ 'mode' : [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] }
let g:airline#themes#ubaryd#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#ubaryd#palette.normal_modified = {
\ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
\ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
let g:airline#themes#ubaryd#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#ubaryd#insert_modified = {
\ 'info_separator' : [ s:I2[1] , s:N2[1] , s:I2[3] , s:N2[3] , 'bold' ] ,
\ 'statusline' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
let g:airline#themes#ubaryd#insert_paste = {
\ 'mode' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] ,
\ 'mode_separator' : [ s:PA[0] , s:I2[1] , s:PA[1] , s:I2[3] , '' ] }
let g:airline#themes#ubaryd#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#ubaryd#palette.insert_modified = {
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
let g:airline#themes#ubaryd#palette.insert_paste = {
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
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_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#palette.replace = copy(airline#themes#ubaryd#palette.insert)
let g:airline#themes#ubaryd#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
let g:airline#themes#ubaryd#palette.replace_modified = g:airline#themes#ubaryd#palette.insert_modified
let g:airline#themes#ubaryd#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#ubaryd#visual_modified = {
\ 'info_separator' : [ s:V2[1] , s:V4[0] , s:V2[3] , s:V4[1] , 'bold' ] ,
\ 'statusline' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
let g:airline#themes#ubaryd#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#ubaryd#palette.visual_modified = {
\ 'airline_c' : [ 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#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)

View File

@@ -39,56 +39,51 @@ let s:file = [ '#E5786D' , '' , 203 , '' , '' ]
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#palette = {}
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#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#wombat#palette.normal_modified = {
\ 'airline_a': [ s:N1[0] , s:N4[0] , s:N1[2] , s:N4[1] , '' ] ,
\ 'airline_b': [ s:N4[0] , s:IM[0] , s:N4[1] , s:IM[1] , '' ] ,
\ 'airline_c': [ s:N4[0] , s:N3[1] , s:N4[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#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
let g:airline#themes#wombat#palette.insert_modified = {
\ 'airline_a': [ s:I1[0] , s:I4[0] , s:I1[2] , s:I4[1] , '' ] ,
\ 'airline_b': [ s:I4[0] , s:IM[0] , s:I4[1] , s:IM[1] , '' ] ,
\ 'airline_c': [ s:I4[0] , s:N3[1] , s:I4[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#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
let g:airline#themes#wombat#palette.visual_modified = {
\ 'airline_a': [ s:V1[0] , s:V4[0] , s:V1[2] , s:V4[1] , '' ] ,
\ 'airline_b': [ s:V4[0] , s:IM[0] , s:V4[1] , s:IM[1] , '' ] ,
\ 'airline_c': [ s:V4[0] , s:N3[1] , s:V4[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#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
let g:airline#themes#wombat#palette.replace_modified = {
\ 'airline_a': [ s:R1[0] , s:R4[0] , s:R1[2] , s:R4[1] , '' ] ,
\ 'airline_b': [ s:R4[0] , s:IM[0] , s:R4[1] , s:IM[1] , '' ] ,
\ 'airline_c': [ s:R4[0] , s:N3[1] , s:R4[1] , s:N3[3] , '' ] }
let g:airline#themes#wombat#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#wombat#palette.insert_paste = {
\ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] ,
\ 'airline_b': [ s:PA[0] , s:IM[0] , s:PA[1] , s:IM[1] , '' ] ,
\ 'airline_c': [ s:PA[0] , s:N3[1] , s:PA[1] , s:N3[3] , '' ] }
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' ] )
let g:airline#themes#wombat#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#wombat#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ [ '#DADADA' , '#242424' , 253 , 234 , '' ] ,
\ [ '#DADADA' , '#40403C' , 253 , 238 , '' ] ,
\ [ '#141413' , '#DADADA' , 232 , 253 , 'bold' ] )

39
autoload/airline/util.vim Normal file
View File

@@ -0,0 +1,39 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if v:version >= 704
function! airline#util#getwinvar(winnr, key, def)
return getwinvar(a:winnr, a:key, a:def)
endfunction
else
function! airline#util#getwinvar(winnr, key, def)
let winvals = getwinvar(a:winnr, '')
return get(winvals, a:key, a:def)
endfunction
endif
if v:version >= 704
function! airline#util#exec_funcrefs(list, ...)
for Fn in a:list
let code = call(Fn, a:000)
if code != 0
return code
endif
endfor
return 0
endfunction
else
function! airline#util#exec_funcrefs(list, ...)
" for 7.2; we cannot iterate the 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]
let code = call(Fn{i}, a:000)
if code != 0
return code
endif
endfor
return 0
endfunction
endif

View File

@@ -37,94 +37,74 @@ CONFIGURATION *airline-configuration*
There are a couple configuration values available (shown with their default
values):
* the separator used on the left side
>
* the separator used on the left side >
let g:airline_left_sep='>'
<
* the separator used on the right side
>
* the separator used on the right side >
let g:airline_right_sep='<'
<
* enable/disable fugitive/lawrencium integration
>
let g:airline_enable_branch=1
let g:airline_branch_empty_message=''
<
* enable/disable syntastic integration
>
let g:airline_enable_syntastic=1
<
* enable/disable tagbar integration
>
let g:airline_enable_tagbar=1
<
* enable modified detection
>
* enable modified detection >
let g:airline_detect_modified=1
<
* enable paste detection
>
* enable paste detection >
let g:airline_detect_paste=1
<
* enable iminsert detection
>
* 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.
>
only the filename of that buffer. >
let g:airline_inactive_collapse=1
<
* change the default theme
>
let g:airline_theme='dark'
* themes are automatically selected based on the matching colorscheme. this
can be overridden by defining a value. >
let g:airline_theme=
<
* enable/disable usage of patched powerline font symbols
>
* if you want to patch the airline theme before it gets applied, you can
supply the name of a function where you can modify the palette. >
let g:airline_theme_patch_func = 'AirlineThemePatch'
function! AirlineThemePatch(palette)
if g:airline_theme == 'badwolf'
for colors in values(a:palette.inactive)
let colors[3] = 245
endfor
endif
endfunction
<
* enable/disable usage of patched powerline font symbols >
let g:airline_powerline_fonts=0
<
* define the set of text to display for each mode. >
let g:airline_mode_map = {} " see source for the defaults
* define the set of text to display for each mode.
>
let g:airline_mode_map = {} " see source for current list
" or copy paste the following into your vimrc for shortform text
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'c' : 'C',
\ 'v' : 'V',
\ 'V' : 'V',
\ '' : 'V',
\ 's' : 'S',
\ 'S' : 'S',
\ '' : 'S',
\ }
<
* define the set of filename match queries which excludes a window from having
its statusline modified
>
its statusline modified >
let g:airline_exclude_filenames = [] " see source for current list
<
* define the set of filetypes which are excluded from having its window
statusline modified
>
statusline modified >
let g:airline_exclude_filetypes = [] " see source for current list
<
* defines whether the preview window should be excluded from have its window
statusline modified (may help with plugins which use the preview window
heavily)
>
heavily) >
let g:airline_exclude_preview = 0
<
==============================================================================
COMMANDS *airline-commands*
@@ -134,12 +114,14 @@ COMMANDS *airline-commands*
:AirlineToggleWhitespace *:AirlineToggleWhitespace*
Toggles whitespace detection.
:AirlineToggle *:AirlineToggle*
Toggles between the standard `statusline`
==============================================================================
CUSTOMIZATION *airline-customization*
The following are some unicode symbols for customizing the left/right
separators, as well as the powerline font glyths.
>
" unicode symbols
let g:airline_left_sep = '»'
@@ -149,19 +131,19 @@ 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_branch_prefix = '⎇ '
let g:airline_paste_symbol = 'ρ'
let g:airline_paste_symbol = 'Þ'
let g:airline_paste_symbol = '∥'
let g:airline_whitespace_symbol = 'Ξ'
let g:airline#extensions#branch#symbol = '⎇ '
let g:airline#extensions#paste#symbol = 'ρ'
let g:airline#extensions#paste#symbol = 'Þ'
let g:airline#extensions#paste#symbol = '∥'
let g:airline#extensions#whitespace#symbol = 'Ξ'
" 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#extensions#branch#symbol = ' '
let g:airline#extensions#readonly#symbol = ''
let g:airline_linecolumn_prefix = ' '
" old vim-powerline symbols
@@ -169,21 +151,25 @@ separators, as well as the powerline font glyths.
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#extensions#branch#symbol = '⭠'
let g:airline#extensions#readonly#symbol = '⭤'
let g:airline_linecolumn_prefix = '⭡'
<
For more intricate customizations, you can replace the predefined sections
with the usual statusline syntax.
Note: Many of these settings can also be controlled with |airline-configuration|
variables, which is useful for sections which by default host more than one
extension.
>
" here are the the default values
variable names default contents
----------------------------------------------------------------------------
let g:airline_section_a (the mode/paste indicator)
let g:airline_section_b (the fugitive/lawrencium branch indicator)
let g:airline_section_c (bufferline or filename)
let g:airline_section_gutter
let g:airline_section_x (tagbar, filetype)
let g:airline_section_gutter (readonly, csv)
let g:airline_section_x (tagbar, virtualenv, filetype)
let g:airline_section_y (fileencoding, fileformat)
let g:airline_section_z (percentage, line number, column number)
let g:airline_section_warning (syntastic, whitespace)
@@ -193,6 +179,90 @@ with the usual statusline syntax.
let g:airline_section_b = '%{getcwd()}'
let g:airline_section_c = '%t'
<
==============================================================================
EXTENSIONS *airline-extensions*
Most extensions are enabled by default and lazily loaded when the
corresponding plugin (if any) is detected.
*airline-branch*
fugitive.vim <https://github.com/tpope/vim-fugitive>
lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
* enable/disable fugitive/lawrencium integration >
let g:airline#extensions#branch#enabled = 1
<
* change the text for when no branch is detected >
let g:airline#extensions#branch#empty_message = ''
<
*airline-syntastic*
syntastic <https://github.com/scrooloose/syntastic>
* enable/disable syntastic integration >
let g:airline#extensions#syntastic#enabled = 1
<
*airline-tagbar*
tagbar <https://github.com/majutsushi/>
* enable/disable tagbar integration >
let g:airline#extensions#tagbar#enabled = 1
<
*airline-csv*
csv.vim <https://github.com/chrisbra/csv.vim>
* enable/disable csv integration for displaying the current column. >
let g:airline#extensions#csv#enabled = 1
<
* change how columns are displayed. >
let g:airline#extensions#csv#column_display = 'Number' (default)
let g:airline#extensions#csv#column_display = 'Name'
<
*airline-hunks*
vim-gitgutter <https://github.com/airblade/vim-gitgutter>
vim-signify <https://github.com/mhinz/vim-signify>
* enable/disable showing a summary of changed hunks under source control.
let g:airline#extensions#hunks#enabled = 1
<
* enable/disable showing only non-zero hunks. >
let g:airline#extensions#hunks#non_zero_only = 0
<
* set hunk count symbols. >
let g:airline#extensions#hunks#hunk_symbols = ['+', '~', '-']
<
*airline-whitespace*
* enable/disable detection of whitespace errors. >
let g:airline#extensions#whitespace#enabled = 1
<
* customize the whitespace symbol. >
let g:airline#extensions#whitespace#symbol = '!'
<
* configure which whitespace checks to enable. >
let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing' ]
<
* configure whether a message should be displayed. >
let g:airline#extensions#whitespace#show_message = 1
<
* configure the formatting of the warning messages. >
let g:airline#extensions#whitespace#trailing_format = 'trailing[%s]'
let g:airline#extensions#whitespace#mixed_indent_format = 'mixed-indent[%s]'
<
*airline-ctrlp*
ctrlp <https://github.com/kien/ctrlp.vim>
* configure which mode colors should ctrlp window use (takes effect
only if the active airline theme doesn't define ctrlp colors) >
let g:airline#extensions#ctrlp#color_template = 'insert' (default)
let g:airline#extensions#ctrlp#color_template = 'normal'
let g:airline#extensions#ctrlp#color_template = 'visual'
let g:airline#extensions#ctrlp#color_template = 'replace'
<
*airline-virtualenv*
virtualenv <https://github.com/jmcantrell/vim-virtualenv>
* enable/disable virtualenv integration >
let g:airline#extensions#virtualenv#enabled = 1
==============================================================================
FUNCREFS *airline-funcrefs*
@@ -200,12 +270,10 @@ FUNCREFS *airline-funcrefs*
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()
*add_statusline_func*
The following is an example of how you can extend vim-airline to support a
new plugin. >
function! MyPlugin(...)
if &filetype == 'MyPluginFileType'
let w:airline_section_a = 'MyPlugin'
let w:airline_section_b = '%f'
@@ -213,18 +281,84 @@ is an example of how you can extend vim-airline to support a new plugin.
let g:airline_variable_referenced_in_statusline = 'foo'
endif
endfunction
call add(g:airline_statusline_funcrefs, function('MyPlugin'))
call airline#add_statusline_func('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:
*remove_statusline_func*
You can also remove a function as well, which is useful for when you want a
temporary override. >
call airline#remove_statusline_func('MyPlugin')
<
==============================================================================
PIPELINE *airline-pipeline*
Sometimes you want to do more than just use overrides. The statusline funcref
is invoked and passed a bunch of arguments. The first of these arguments is
the statusline builder. You can use this to build completely custom
statuslines to your liking. Here is an example: >
>
function! ExcludeFoo()
return &filetype == 'FooType'
function! MyPlugin(...)
" first variable is the statusline builder
let builder = a:1
" build and set the statusline
" WARNING: the API for the builder is not finalized and may change
call builder.add_section('Normal', '%f')
call builder.add_section('WarningMsg', '%{getcwd()}')
call setwinvar(winnr(), '&statusline', builder.build())
return -1
endfunction
call add(g:airline_exclude_funcrefs, function('ExcludeFoo'))
<
The second variable is the context, which is a dictionary containing various
values such as whether the statusline is active or not, and the window number.
>
context = {
'winnr': 'the window number for the statusline',
'active': 'whether the window is active or not',
}
<
*airline-pipeline-return-codes*
The pipeline accepts various return codes and can be used to determine the
next action. The following are the supported codes: >
0 the default, continue on with the next funcref
-1 do not modify the statusline
1 modify the statusline with the current contents of the builder
<
Note: Any value other than 0 will halt the pipeline and prevent the next
funcref from executing.
==============================================================================
WRITING EXTENSIONS *airline-writing-extensions*
The basic idea is that the statusline is rendered with a series of overrides.
For each section that the algorithm encounters, it will first check to see if
there is a window-local variable of the section. If it exists, the value will
be used, otherwise, the global variable of the section will be used. This
means it is possible to override only one or two sections of the statusline.
See |add_statusline_func| for an example of a simple extension.
For contributions into the plugin, here are the following guidelines:
1. For simple |&filetype| checks, they can be added directly into the
`extensions.vim` file.
2. Pretty much everything else should live as a separate file under the
`extensions/` directory.
a. Inside `extensions.vim`, add a check for some variable or command that
is always available (these must be defined in `plugin`, and _not_
`autoload` of the other plugin). If it exists, then initialize the
extension. This ensures that the extension is loaded if and only if the
user has the other plugin installed. Also, a check to
`airline#extensions#foo_plugin#enabled` should be performed to allow the
user to disable it.
b. Configuration variables for the extension should reside in the
extension, e.g. `g:airline#extensions#foo_plugin#bar_variable`.
See the source of |example.vim| for a working extension.
==============================================================================
WRITING THEMES *airline-themes*
@@ -245,31 +379,23 @@ 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:
>
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:
>
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.
>
unicode in vim. >
set encoding=utf-8
<
Q. There is a pause when leaving insert mode.
A. Add the following to your vimrc.
>
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
@@ -288,7 +414,7 @@ Contributions and pull requests are welcome.
==============================================================================
LICENSE *airline-license*
MIT license. Copyright © 2013 Bailey Ling.
MIT License. Copyright © 2013 Bailey Ling.
vim:tw=78:ts=8:ft=help:norl:

View File

@@ -1,46 +1,32 @@
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline)
finish
endif
let g:loaded_airline = 1
function! s:check_defined(variable, default)
if !exists(a:variable)
let {a:variable} = a:default
endif
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.'
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables are obsolete. Please read the documentation about the branch extension.'
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_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_alt_sep', exists('g:airline_powerline_fonts')?"":"<")
call s:check_defined('g:airline_enable_bufferline', 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_tagbar', 1)
call s:check_defined('g:airline_detect_iminsert', 0)
call s:check_defined('g:airline_left_sep', get(g:, 'airline_powerline_fonts', 0)?"":">")
call s:check_defined('g:airline_left_alt_sep', get(g:, 'airline_powerline_fonts', 0)?"":">")
call s:check_defined('g:airline_right_sep', get(g:, 'airline_powerline_fonts', 0)?"":"<")
call s:check_defined('g:airline_right_alt_sep', get(g:, 'airline_powerline_fonts', 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_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_theme', 'dark')
call s:check_defined('g:airline_linecolumn_prefix', get(g:, 'airline_powerline_fonts', 0)?' ':':')
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_filetypes', [])
call s:check_defined('g:airline_exclude_preview', 0)
call s:check_defined('g:airline_statusline_funcrefs', [])
call s:check_defined('g:airline_exclude_funcrefs', [])
call s:check_defined('g:airline_mode_map', {
\ '__' : '------',
@@ -49,48 +35,116 @@ call s:check_defined('g:airline_mode_map', {
\ 'R' : 'REPLACE',
\ 'v' : 'VISUAL',
\ 'V' : 'V-LINE',
\ 'c' : 'CMD ',
\ 'c' : 'COMMAND',
\ '' : 'V-BLOCK',
\ 's' : 'SELECT',
\ 'S' : 'S-LINE',
\ '' : 'S-BLOCK',
\ })
call s:check_defined('g:airline_theme_map', {
\ 'Tomorrow.*': 'tomorrow',
\ 'mo[l|n]okai': 'molokai',
\ 'wombat.*': 'wombat',
\ '.*solarized.*': 'solarized',
\ })
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_b', '')
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_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')
call s:check_defined('g:airline_section_warning', '__')
let s:airline_initialized = 0
function! s:on_window_changed()
let s:airline_theme_defined = 0
function! s:init()
if !s:airline_initialized
call airline#extensions#load()
call airline#load_theme(g:airline_theme)
let s:airline_initialized = 1
call airline#extensions#load()
let s:airline_theme_defined = exists('g:airline_theme')
if s:airline_theme_defined || !airline#switch_matching_theme()
let g:airline_theme = get(g:, 'airline_theme', 'dark')
call airline#switch_theme(g:airline_theme)
endif
endif
endfunction
function! s:on_window_changed()
if pumvisible()
return
endif
call <sid>init()
call airline#update_statusline()
endfunction
function! s:on_colorscheme_changed()
call <sid>init()
if !s:airline_theme_defined
if airline#switch_matching_theme()
return
endif
endif
" couldn't find a match, or theme was defined, just refresh
call airline#load_theme()
endfunction
function airline#cmdwinenter(...)
call airline#extensions#apply_left_override('Command Line', '')
endfunction
function! s:airline_toggle()
if exists("#airline")
augroup airline
au!
augroup END
augroup! airline
if exists("s:stl")
let &stl = s:stl
endif
else
let s:stl = &stl
augroup airline
autocmd!
autocmd CmdwinEnter *
\ call airline#add_statusline_func('airline#cmdwinenter')
\ | call <sid>on_window_changed()
autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter')
autocmd ColorScheme * call <sid>on_colorscheme_changed()
autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost *
\ call <sid>on_window_changed()
autocmd BufWritePost */autoload/airline/themes/*.vim
\ exec 'source '.split(globpath(&rtp, 'autoload/airline/themes/'.g:airline_theme.'.vim', 1), "\n")[0]
\ | call airline#load_theme()
augroup END
if s:airline_initialized
call <sid>on_window_changed()
endif
endif
endfunction
function! s:get_airline_themes(a, l, p)
let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:a.'*'), "\n")
return map(files, 'fnamemodify(v:val, ":t:r")')
endfunction
function! s:airline_theme(...)
if a:0
call airline#load_theme(a:1)
call airline#switch_theme(a:1)
else
echo g:airline_theme
endif
endfunction
command! -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
command! AirlineToggleWhitespace call airline#extensions#whitespace#toggle()
command! AirlineToggle call <sid>airline_toggle()
call <sid>airline_toggle()
augroup airline
autocmd!
autocmd ColorScheme * call airline#reload_highlight()
autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost *
\ call <sid>on_window_changed()
augroup END