mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-01-26 21:07:26 +08:00
Compare commits
662 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7835562a3 | ||
|
|
3cd278ad08 | ||
|
|
69587e1aa0 | ||
|
|
87e2e578b5 | ||
|
|
2cf0ac1230 | ||
|
|
94611d1091 | ||
|
|
da21b97529 | ||
|
|
82d1cab392 | ||
|
|
b094374f37 | ||
|
|
1be1ed8810 | ||
|
|
768a475add | ||
|
|
1490f59e75 | ||
|
|
5181d49a63 | ||
|
|
a1cb468339 | ||
|
|
04f4b0f778 | ||
|
|
453f4b759f | ||
|
|
020ee382dc | ||
|
|
889492e01c | ||
|
|
97e204f3b6 | ||
|
|
c35fd1a068 | ||
|
|
349ca86c71 | ||
|
|
fb76dfbca1 | ||
|
|
9e25f52c6f | ||
|
|
cce3e41398 | ||
|
|
e42c0b0f33 | ||
|
|
8fb92586ee | ||
|
|
698db37591 | ||
|
|
b1c00b6cc9 | ||
|
|
5923ced2b0 | ||
|
|
fb255b570d | ||
|
|
b6d65b41a0 | ||
|
|
8ae46e989d | ||
|
|
8afd72d886 | ||
|
|
1d6ec383e4 | ||
|
|
d07799421a | ||
|
|
604f744727 | ||
|
|
0e6a0b9389 | ||
|
|
fb77c3ac27 | ||
|
|
2ebe79a0d0 | ||
|
|
c10a072b9e | ||
|
|
17eff4f4b0 | ||
|
|
b8278dc446 | ||
|
|
6c1fb7e275 | ||
|
|
7ace10651f | ||
|
|
dcfe24bc6d | ||
|
|
0a75e493a6 | ||
|
|
348663f7f8 | ||
|
|
44769aab3a | ||
|
|
db6bf458fb | ||
|
|
8845f56686 | ||
|
|
06723fc82c | ||
|
|
d85d697b5f | ||
|
|
17f5eaaa6a | ||
|
|
048b24a916 | ||
|
|
2c613a1746 | ||
|
|
e53a77b1e6 | ||
|
|
004c4259a3 | ||
|
|
f6fc6419be | ||
|
|
83880b9a1f | ||
|
|
ae2f3dc6e2 | ||
|
|
79cdd75a0c | ||
|
|
ca6ab34e3c | ||
|
|
c1fbea46bc | ||
|
|
0138313656 | ||
|
|
0931311916 | ||
|
|
daafeed223 | ||
|
|
39810a33dd | ||
|
|
2fbdbc8893 | ||
|
|
4791dcac02 | ||
|
|
6a9eb4d915 | ||
|
|
4733a92e20 | ||
|
|
06f2cb5a89 | ||
|
|
a0c7e1538b | ||
|
|
b48e2390cb | ||
|
|
18a19532ea | ||
|
|
e0841b10a7 | ||
|
|
1c498d1af3 | ||
|
|
6a14987276 | ||
|
|
14d14cf951 | ||
|
|
a8d40a1bc3 | ||
|
|
8c30610c5f | ||
|
|
2637e3ee58 | ||
|
|
a253b68812 | ||
|
|
e1ffd1cc30 | ||
|
|
5c799511c9 | ||
|
|
e59c3ecd6e | ||
|
|
bb4be0095d | ||
|
|
543438e482 | ||
|
|
8f42044cc9 | ||
|
|
b7a2159128 | ||
|
|
4b4c70308a | ||
|
|
2659eafa3a | ||
|
|
cc23d65af7 | ||
|
|
a58b3cba55 | ||
|
|
2efa4c0815 | ||
|
|
3db2b66587 | ||
|
|
022c769494 | ||
|
|
4bfb57f40d | ||
|
|
92c2ac1c14 | ||
|
|
c761566dcf | ||
|
|
cdc6d98a09 | ||
|
|
3942ce6790 | ||
|
|
317e5fa47a | ||
|
|
78566c37ae | ||
|
|
9afda181dd | ||
|
|
373b83ee58 | ||
|
|
efa8edf3ae | ||
|
|
b29e01fa22 | ||
|
|
22b43c909a | ||
|
|
a5a88ce662 | ||
|
|
14759c1b57 | ||
|
|
a0110e13bd | ||
|
|
9837c1e7c8 | ||
|
|
540c148d31 | ||
|
|
312f847e73 | ||
|
|
9d90e2cbfe | ||
|
|
7acfcc9aed | ||
|
|
67de5f2257 | ||
|
|
0b5ef59cf5 | ||
|
|
491b3335cd | ||
|
|
1e46a46bb3 | ||
|
|
673ca1ace2 | ||
|
|
3d3c382822 | ||
|
|
f22fbfd41d | ||
|
|
bb2d6d8436 | ||
|
|
be2ea5d7be | ||
|
|
e6ca2ac58d | ||
|
|
f45ecdac15 | ||
|
|
f1869cc47c | ||
|
|
252978e4ac | ||
|
|
8d93bc7fd4 | ||
|
|
5dc0cc5418 | ||
|
|
5e1cc0a28b | ||
|
|
837f53cf79 | ||
|
|
57767cc320 | ||
|
|
7ea4b510af | ||
|
|
1b8e4b965a | ||
|
|
77c58de628 | ||
|
|
96a94d8c3a | ||
|
|
3635b78448 | ||
|
|
661c5fb0c5 | ||
|
|
50e47ced42 | ||
|
|
51095bad95 | ||
|
|
ca44fd467c | ||
|
|
f0492b5aea | ||
|
|
8aad42644c | ||
|
|
36bc297e60 | ||
|
|
b6e29a8cfb | ||
|
|
c78767a564 | ||
|
|
b08784907a | ||
|
|
ec18e6639d | ||
|
|
e2a120869b | ||
|
|
618851188a | ||
|
|
59752b2659 | ||
|
|
5b55dd94f4 | ||
|
|
83000d9a30 | ||
|
|
791de5a34d | ||
|
|
63e309130a | ||
|
|
7394642293 | ||
|
|
987306dcaf | ||
|
|
6f9d92df7c | ||
|
|
8693a525b9 | ||
|
|
3add7b265a | ||
|
|
065b141033 | ||
|
|
ac58bc9954 | ||
|
|
ca925efdbf | ||
|
|
1ca6ffb6d0 | ||
|
|
6efde428c6 | ||
|
|
f9b5611ac8 | ||
|
|
f820a7eb95 | ||
|
|
1e35ad5d77 | ||
|
|
98c2dbd04e | ||
|
|
b6accd91c8 | ||
|
|
3c1295bb71 | ||
|
|
925147baef | ||
|
|
7bc939bee9 | ||
|
|
ce58af7191 | ||
|
|
446397e006 | ||
|
|
462ee313e7 | ||
|
|
b55b526c65 | ||
|
|
3acea37fdc | ||
|
|
6d7996ff1b | ||
|
|
13ee9f456a | ||
|
|
1fd9886219 | ||
|
|
527e6661e6 | ||
|
|
6387268f13 | ||
|
|
dd587883eb | ||
|
|
401ce611c6 | ||
|
|
317fcfd295 | ||
|
|
9650024142 | ||
|
|
4a2208821e | ||
|
|
a323b5ba3d | ||
|
|
6b4f03efbc | ||
|
|
96afdbc877 | ||
|
|
4c22406e28 | ||
|
|
15666d71e3 | ||
|
|
4878fab120 | ||
|
|
eb04e25d34 | ||
|
|
b4c8d43e85 | ||
|
|
038c000f91 | ||
|
|
411ae84890 | ||
|
|
d003b2450a | ||
|
|
09817e0984 | ||
|
|
f8645fb654 | ||
|
|
be6e4d6dd6 | ||
|
|
727192ad6a | ||
|
|
256dec6800 | ||
|
|
246c217562 | ||
|
|
3e0b5474b1 | ||
|
|
328016ce85 | ||
|
|
82a4ebb56c | ||
|
|
64b9ae176d | ||
|
|
616daceb73 | ||
|
|
37ddb6e7da | ||
|
|
78c3cd9bba | ||
|
|
c85ce909df | ||
|
|
7c4bf0aba6 | ||
|
|
23b452d1ae | ||
|
|
84c242a27d | ||
|
|
0bc3a21116 | ||
|
|
258817ff38 | ||
|
|
53e765a49d | ||
|
|
51c788a37b | ||
|
|
b16870fbf9 | ||
|
|
6feec73d14 | ||
|
|
825a048b10 | ||
|
|
908f031f42 | ||
|
|
4dab93470f | ||
|
|
8421f03178 | ||
|
|
50c9ea89a5 | ||
|
|
ae472d6716 | ||
|
|
3eef719c4d | ||
|
|
d6475684b7 | ||
|
|
a5e5d8ab4f | ||
|
|
3f3ae446e1 | ||
|
|
bfd160a08b | ||
|
|
6e5865473c | ||
|
|
310331cfc4 | ||
|
|
7c65176499 | ||
|
|
ad19d1a10f | ||
|
|
30df99a681 | ||
|
|
47fd63586c | ||
|
|
f17927053e | ||
|
|
83a7e30790 | ||
|
|
f0e00620c0 | ||
|
|
ed180fda62 | ||
|
|
00e4b68ee6 | ||
|
|
0349f85ab0 | ||
|
|
2114e70251 | ||
|
|
ac08bbcf26 | ||
|
|
e10ef2fb25 | ||
|
|
9a1dff320d | ||
|
|
faa15c136c | ||
|
|
936e2b6a66 | ||
|
|
bd7220cb5b | ||
|
|
ea828c5a6a | ||
|
|
3ab1bb7eb0 | ||
|
|
c5a404bd62 | ||
|
|
f2ae2bd7d0 | ||
|
|
45cab177ef | ||
|
|
44bf6fd1c5 | ||
|
|
4f904ab0d4 | ||
|
|
bfcece76c9 | ||
|
|
c5347b2f03 | ||
|
|
99a4b38732 | ||
|
|
7b56fbdd29 | ||
|
|
534d8e844b | ||
|
|
db0ea7a970 | ||
|
|
5ff2b4b2f5 | ||
|
|
3267c74a55 | ||
|
|
7bd40715d4 | ||
|
|
a222518b76 | ||
|
|
7372806f1d | ||
|
|
9e8fe7a98e | ||
|
|
a90a39b4aa | ||
|
|
81430cbdf6 | ||
|
|
7560204212 | ||
|
|
931367d9fb | ||
|
|
fafb9ea76e | ||
|
|
e49eac95a3 | ||
|
|
abee990d30 | ||
|
|
66d0a47f37 | ||
|
|
7b0d80050a | ||
|
|
a37f0b9ae0 | ||
|
|
d111e4edb3 | ||
|
|
c374af183a | ||
|
|
13297cee03 | ||
|
|
25059d43b1 | ||
|
|
5a2daf6dfb | ||
|
|
496ba60984 | ||
|
|
42a4590948 | ||
|
|
3c66f13b9a | ||
|
|
3bde2fabd1 | ||
|
|
ab92a95969 | ||
|
|
9291968b94 | ||
|
|
9cb7366128 | ||
|
|
5a3e8852bd | ||
|
|
f196ea1f36 | ||
|
|
799e5e028f | ||
|
|
4a76132cbe | ||
|
|
d99112d6c6 | ||
|
|
7857cc2345 | ||
|
|
9aea79bb99 | ||
|
|
942c6ae382 | ||
|
|
63f811e15c | ||
|
|
5e25794d4b | ||
|
|
6aac1b469d | ||
|
|
a6e304e07c | ||
|
|
ffbbaa769a | ||
|
|
2dc416aa8f | ||
|
|
dbd6c4a71a | ||
|
|
0f091db08f | ||
|
|
b45ab384ee | ||
|
|
82efa95d94 | ||
|
|
3e044418a3 | ||
|
|
fae68dbcb7 | ||
|
|
baed8ac063 | ||
|
|
ac798b0106 | ||
|
|
75ee42b118 | ||
|
|
b7c88b40aa | ||
|
|
4ca48ba6e2 | ||
|
|
6141a59278 | ||
|
|
c638affe4f | ||
|
|
5f1c24528c | ||
|
|
41a148f1e6 | ||
|
|
1c41ce53d9 | ||
|
|
7a1801e9c4 | ||
|
|
48f762e312 | ||
|
|
576d1de716 | ||
|
|
4345a6b29a | ||
|
|
1a6c84b00a | ||
|
|
225098475a | ||
|
|
19861d0514 | ||
|
|
50fd649110 | ||
|
|
6c79004aaa | ||
|
|
0714c35547 | ||
|
|
f6133e4fa1 | ||
|
|
43c1636e36 | ||
|
|
8d7c2ad830 | ||
|
|
233e3c60ce | ||
|
|
df2f33d6a5 | ||
|
|
739a275d5d | ||
|
|
414f43812a | ||
|
|
7c10cfa73e | ||
|
|
285b4da3e5 | ||
|
|
ad1b23e8c3 | ||
|
|
9039793343 | ||
|
|
ba899b2dde | ||
|
|
87951ba090 | ||
|
|
fdc847c8da | ||
|
|
ce32405105 | ||
|
|
0966b693d9 | ||
|
|
ed7111b1ff | ||
|
|
08a57d0227 | ||
|
|
ce15809db3 | ||
|
|
7baedbacc0 | ||
|
|
63272a08ae | ||
|
|
253974506a | ||
|
|
f2f164bda1 | ||
|
|
02441be0e1 | ||
|
|
2e8f99d39b | ||
|
|
3c9f8bb979 | ||
|
|
31f36740c8 | ||
|
|
aef500c426 | ||
|
|
47acdcb92c | ||
|
|
99b7cdf334 | ||
|
|
de1d1e365e | ||
|
|
11950b0298 | ||
|
|
c4c4be836e | ||
|
|
dd2be8ac8d | ||
|
|
592cc412cf | ||
|
|
778c0f59ca | ||
|
|
382c000958 | ||
|
|
5976cf3a48 | ||
|
|
00cd0be601 | ||
|
|
047e40a3e1 | ||
|
|
9e53c2c155 | ||
|
|
491091706f | ||
|
|
af330f6a47 | ||
|
|
a75f91baba | ||
|
|
fda5be77cd | ||
|
|
6de7c3e0fe | ||
|
|
dd967eee4d | ||
|
|
ccccb87671 | ||
|
|
f26c7d4143 | ||
|
|
008eb8cd3b | ||
|
|
fc6c9120e4 | ||
|
|
a8c96b6020 | ||
|
|
d0c6ca4577 | ||
|
|
47ecfff9b8 | ||
|
|
2735282992 | ||
|
|
0f23d9373c | ||
|
|
6c66ad5dfc | ||
|
|
6fc15ff321 | ||
|
|
4eec9cfa91 | ||
|
|
7365ccf3fe | ||
|
|
5582daf79c | ||
|
|
e16c36eea1 | ||
|
|
e0f6bee10e | ||
|
|
b460822c84 | ||
|
|
a81d1cd9c7 | ||
|
|
2f3b33daae | ||
|
|
60edd20300 | ||
|
|
d7c66aa377 | ||
|
|
9d3c6506da | ||
|
|
7dd8c4705c | ||
|
|
3c2fa1d16d | ||
|
|
d123e3583a | ||
|
|
c8ef456a25 | ||
|
|
4d706c5f4a | ||
|
|
e507f481a2 | ||
|
|
d9df49e38f | ||
|
|
9fdb064f11 | ||
|
|
b97f687fb1 | ||
|
|
46099b43da | ||
|
|
c869665b16 | ||
|
|
89a9b9399f | ||
|
|
93a95b3fdc | ||
|
|
6cf12f7268 | ||
|
|
1b0c260980 | ||
|
|
dc570de0c8 | ||
|
|
095295b839 | ||
|
|
e2a88dd67f | ||
|
|
5dcd1e942c | ||
|
|
66d4c8c893 | ||
|
|
123daf2861 | ||
|
|
99329b0c96 | ||
|
|
248c9b0e29 | ||
|
|
b07362947e | ||
|
|
e5fb2456d4 | ||
|
|
019d158a02 | ||
|
|
245fe31f80 | ||
|
|
3c1498017f | ||
|
|
ccd419bb0f | ||
|
|
ad96110eef | ||
|
|
a6cee001e8 | ||
|
|
cf643aa7fa | ||
|
|
cdc951be36 | ||
|
|
b5e8ea275e | ||
|
|
bb30c09371 | ||
|
|
474116461f | ||
|
|
41192a2a65 | ||
|
|
8e3c91e486 | ||
|
|
5aacb96135 | ||
|
|
8dcc370d94 | ||
|
|
aa41683342 | ||
|
|
bfe35ed76c | ||
|
|
b39308c49b | ||
|
|
e01b2a99c0 | ||
|
|
77a0d933d7 | ||
|
|
3cc1dcb697 | ||
|
|
b22190400d | ||
|
|
dfb17198da | ||
|
|
2fa6697071 | ||
|
|
a3df71463e | ||
|
|
e787b570e9 | ||
|
|
39cb28b7e3 | ||
|
|
12ea154de8 | ||
|
|
7d78fbf2cc | ||
|
|
20b2ee3ac3 | ||
|
|
0860d2f525 | ||
|
|
0b70880471 | ||
|
|
948a4178a8 | ||
|
|
2d465afb95 | ||
|
|
9d5a1744a1 | ||
|
|
fdbf2c05a5 | ||
|
|
a5fc024f3a | ||
|
|
e93263538f | ||
|
|
d833718dd9 | ||
|
|
6442f01912 | ||
|
|
0a6b833e7c | ||
|
|
02aa620a92 | ||
|
|
858ef19a6f | ||
|
|
7e7766ee45 | ||
|
|
e31d5f333c | ||
|
|
256a9681cb | ||
|
|
6f3a4daba4 | ||
|
|
0b6263844f | ||
|
|
c197532b7a | ||
|
|
59e4ab49ce | ||
|
|
11fe597152 | ||
|
|
b60004d504 | ||
|
|
39ba0b2d6a | ||
|
|
8606f3ebc1 | ||
|
|
a88996b170 | ||
|
|
ebb0040ca8 | ||
|
|
979c81c59f | ||
|
|
93b9fa7c75 | ||
|
|
61de5d3949 | ||
|
|
8886ea0a23 | ||
|
|
1dcdfc502e | ||
|
|
95f83e8c5a | ||
|
|
e117af9dd0 | ||
|
|
3f67df6440 | ||
|
|
80afce1eb1 | ||
|
|
d2c70194b0 | ||
|
|
aabb85ddc2 | ||
|
|
2702015544 | ||
|
|
3a5a40730a | ||
|
|
bed11010ba | ||
|
|
55f524de77 | ||
|
|
4c6aa4401b | ||
|
|
b4cff305b1 | ||
|
|
5e5414dac6 | ||
|
|
71a4b2f595 | ||
|
|
9c416f28d4 | ||
|
|
697e08a83c | ||
|
|
d26ca50a97 | ||
|
|
dbd9121c05 | ||
|
|
e1062c5f84 | ||
|
|
87c999358c | ||
|
|
8cfb43fe32 | ||
|
|
d74b3bfdbf | ||
|
|
ad3556d243 | ||
|
|
db58294871 | ||
|
|
bfb091c3ca | ||
|
|
22f1701a2e | ||
|
|
f11e133c1a | ||
|
|
2e46190034 | ||
|
|
0ac25ecc30 | ||
|
|
65efb89145 | ||
|
|
7a2f6525c3 | ||
|
|
b636c28ae2 | ||
|
|
2391ed0579 | ||
|
|
8b71285c6b | ||
|
|
46db9b9bdf | ||
|
|
3c49b9cf3d | ||
|
|
29972ef857 | ||
|
|
c5a0374b4c | ||
|
|
a1eca0a06a | ||
|
|
e16d728e36 | ||
|
|
8b2d58af59 | ||
|
|
83bbd09b0e | ||
|
|
5754bcabce | ||
|
|
01d742794f | ||
|
|
003522a42d | ||
|
|
e1be8ff22f | ||
|
|
fc6cf26ac6 | ||
|
|
210a974980 | ||
|
|
2cfe26f72f | ||
|
|
0a3524c6a3 | ||
|
|
e967d09bf3 | ||
|
|
f57b65d3b8 | ||
|
|
11f03baf37 | ||
|
|
9356265d3e | ||
|
|
ada6523d59 | ||
|
|
ecd66184f6 | ||
|
|
8c32da38c7 | ||
|
|
4596c9ce22 | ||
|
|
eb3a70bbf2 | ||
|
|
a9b2fd2c41 | ||
|
|
56eaf3733f | ||
|
|
53364af1e3 | ||
|
|
2066410156 | ||
|
|
00e5e1c20e | ||
|
|
9b7191d052 | ||
|
|
561422c11c | ||
|
|
e167e67819 | ||
|
|
c144543d03 | ||
|
|
15322a26ed | ||
|
|
2051dfb9a1 | ||
|
|
cf798d8783 | ||
|
|
d0579e012c | ||
|
|
bf3f8ba946 | ||
|
|
6261149451 | ||
|
|
a4deb82ac4 | ||
|
|
4f76b3a971 | ||
|
|
cedd91d23a | ||
|
|
1e353beaa3 | ||
|
|
fbdf39c403 | ||
|
|
ffcdd3b1a3 | ||
|
|
345a60fb23 | ||
|
|
ecccf51401 | ||
|
|
2f7cf4cffd | ||
|
|
6689aca82b | ||
|
|
301fcdc64a | ||
|
|
9966b3d9f3 | ||
|
|
60cc5a5ca1 | ||
|
|
f6900aeb0a | ||
|
|
4b33adee42 | ||
|
|
41414a3a84 | ||
|
|
7171a169f3 | ||
|
|
c994d08a6d | ||
|
|
16028e69dc | ||
|
|
08f87f2103 | ||
|
|
d5c035bd5c | ||
|
|
d6599d0b3b | ||
|
|
92de8ad160 | ||
|
|
723e721b32 | ||
|
|
0ad6deb832 | ||
|
|
c858116f87 | ||
|
|
62fa3c37e4 | ||
|
|
69f40d62ee | ||
|
|
c908d03cc0 | ||
|
|
501e341589 | ||
|
|
5c0ef8ffbf | ||
|
|
f48031cde8 | ||
|
|
660109a61a | ||
|
|
1b91c71fc9 | ||
|
|
3b2b224a3b | ||
|
|
ded2c2ff7e | ||
|
|
fd68997398 | ||
|
|
7e1206469c | ||
|
|
f11f871e39 | ||
|
|
fb711ba9a9 | ||
|
|
389650645b | ||
|
|
96e92232f6 | ||
|
|
68331a5e4f | ||
|
|
a249c87f61 | ||
|
|
7bcb9b5fff | ||
|
|
a13c692529 | ||
|
|
500ecf7cd0 | ||
|
|
d268744077 | ||
|
|
e852fb388f | ||
|
|
b4cd0ae99d | ||
|
|
f5885bf9c2 | ||
|
|
54ec1f39ca | ||
|
|
0548aeefcb | ||
|
|
cb774fcfd0 | ||
|
|
c6d996d5ca | ||
|
|
19910a26cb | ||
|
|
2d049949f0 | ||
|
|
93eb0389b9 | ||
|
|
fa517238c7 | ||
|
|
1f6b936dd8 | ||
|
|
17aa2eaf87 | ||
|
|
43dfdc6de4 | ||
|
|
95f00f2341 | ||
|
|
fcbf0a4c9c | ||
|
|
29cb8991a6 | ||
|
|
6925d567eb | ||
|
|
a927bf9475 | ||
|
|
e13a4c8b1a | ||
|
|
bdd758dd38 | ||
|
|
e10b690cdf | ||
|
|
8beb275534 | ||
|
|
386ba6b087 | ||
|
|
6c5672d686 | ||
|
|
bf8fa9af03 | ||
|
|
eadeee316c | ||
|
|
14656f766b | ||
|
|
4b9cda77dd | ||
|
|
39c3ba360e | ||
|
|
ea4e0280fb | ||
|
|
6fc8c00ef1 | ||
|
|
f9718e6b65 | ||
|
|
24a2035e42 | ||
|
|
2708951715 | ||
|
|
3d3d93e135 | ||
|
|
ff975d3d7d | ||
|
|
2c7e31801f | ||
|
|
85c1f5ad03 | ||
|
|
83a1d7e47c | ||
|
|
d5d87d2cdc | ||
|
|
5c1c985502 | ||
|
|
895743c13d | ||
|
|
2be030b7e8 | ||
|
|
6dd4cd5423 | ||
|
|
fe24924ad3 | ||
|
|
e919663781 | ||
|
|
bc03ab5cbf | ||
|
|
1980c51971 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
doc/tags
|
||||
*.lock
|
||||
.vim-flavor
|
||||
|
||||
4
.travis.yml
Normal file
4
.travis.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
language: ruby
|
||||
rvm:
|
||||
- 1.9.3
|
||||
script: rake ci
|
||||
32
CONTRIBUTING.md
Normal file
32
CONTRIBUTING.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Contributions
|
||||
|
||||
Contributions and pull requests are welcome. Please take note of the following guidelines:
|
||||
|
||||
* Adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords.
|
||||
* Keep the history clean! Squash your branches before you submit a pull request. `pull --rebase` is your friend.
|
||||
* Any changes to the core should be tested against Vim 7.2.
|
||||
|
||||
# Bugs
|
||||
|
||||
Tracking down bugs can take a very long time due to different configurations, versions, and operating systems. To ensure a timely response, please help me out by doing the following:
|
||||
|
||||
* Reproduce it with this [minivimrc][7] repository to rule out any configuration conflicts. Even better, create a `gist` of your vimrc that is compatible with [pathogen][11].
|
||||
* And to make it easier to reproduce, please supply the following:
|
||||
* the `:version` of vim
|
||||
* the commit of vim-airline you're using
|
||||
* the OS that you're using, including terminal emulator, GUI vs non-GUI
|
||||
|
||||
# Themes
|
||||
|
||||
* If you submit a theme, please create a screenshot so it can be added to the [Wiki][14].
|
||||
* In the majority of cases, modifications to colors of existing themes will likely be rejected. Themes are a subjective thing, so while you may prefer that a particular color be darker, another user will prefer it to be lighter, or something entirely different. The more popular the theme, the more unlikely the change will be accepted. However, it's pretty simple to create your own theme; copy the theme to `~/.vim/autoload/airline/themes` under a new name with your modifications, and it can be used.
|
||||
|
||||
# Maintenance
|
||||
|
||||
If you would like to take a more active role in improving vim-airline, please consider [becoming a maintainer][43].
|
||||
|
||||
|
||||
[7]: https://github.com/bling/minivimrc
|
||||
[11]: https://github.com/tpope/vim-pathogen
|
||||
[14]: https://github.com/vim-airline/vim-airline/wiki/Screenshots
|
||||
[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer
|
||||
2
Gemfile
Normal file
2
Gemfile
Normal file
@@ -0,0 +1,2 @@
|
||||
source 'https://rubygems.org'
|
||||
gem 'vim-flavor', '~> 1.1'
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 2013 Bailey Ling
|
||||
Copyright (C) 2013-2016 Bailey Ling
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the "Software"),
|
||||
|
||||
174
README.md
174
README.md
@@ -1,58 +1,108 @@
|
||||
# vim-airline
|
||||
# vim-airline [](https://travis-ci.org/vim-airline/vim-airline)
|
||||
|
||||
Lean & mean statusline for vim that's light as air.
|
||||
Lean & mean status/tabline for vim that's light as air.
|
||||
|
||||

|
||||

|
||||
|
||||
# Features
|
||||
|
||||
* 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.
|
||||
* 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
|
||||
* 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], [quickfixsigns][39], [syntastic][5], [eclim][34],
|
||||
[lawrencium][21], [virtualenv][31], [tmuxline][35], [taboo.vim][37],
|
||||
[ctrlspace][38] and more.
|
||||
* Looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols.
|
||||
* Optimized for speed; it loads in under a millisecond.
|
||||
* Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki.
|
||||
* Supports 7.2 as the minimum Vim version.
|
||||
* The master branch tries to be as stable as possible, and new features are merged in only after they have gone through a [full regression test][33].
|
||||
* Unit testing suite.
|
||||
|
||||
# Straightforward customization
|
||||
## Straightforward customization
|
||||
|
||||
If you don't like the defaults, you can replace all sections with standard `statusline` syntax.
|
||||
If you don't like the defaults, you can replace all sections with standard `statusline` syntax. Give your statusline that you've built over the years a face lift.
|
||||
|
||||

|
||||
|
||||
# Extensible pipeline
|
||||
## Automatic truncation
|
||||
|
||||
Completely transform the statusline to your liking.
|
||||
Sections and parts within sections can be configured to automatically hide when the window size shrinks.
|
||||
|
||||

|
||||

|
||||
|
||||
# Integration with external plugins
|
||||
## Smarter tab line
|
||||
|
||||
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).
|
||||
Automatically displays all buffers when there's only one tab open.
|
||||
|
||||
### [ctrlp.vim][10]
|
||||

|
||||
|
||||
This is disabled by default; add the following to your vimrc to enable the extension:
|
||||
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
|
||||
Separators can be configured independently for the tabline, so here is how you can define "straight" tabs:
|
||||
|
||||
let g:airline#extensions#tabline#left_sep = ' '
|
||||
let g:airline#extensions#tabline#left_alt_sep = '|'
|
||||
|
||||
## Seamless integration
|
||||
|
||||
vim-airline integrates with a variety of plugins out of the box. These extensions will be lazily loaded if and only if you have the other plugins installed (and of course you can turn them off).
|
||||
|
||||
#### [ctrlp.vim][10]
|
||||

|
||||
|
||||
### [unite.vim][9]
|
||||
#### [unite.vim][9]
|
||||

|
||||
|
||||
### [tagbar][19]
|
||||
#### [tagbar][19]
|
||||

|
||||
|
||||
### [csv.vim][28]
|
||||
#### [csv.vim][28]
|
||||

|
||||
|
||||
### [syntastic][5]
|
||||
#### [syntastic][5]
|
||||

|
||||
|
||||
### whitespace
|
||||

|
||||
|
||||
### hunks ([vim-gitgutter][29] & [vim-signify][30])
|
||||
#### hunks ([vim-gitgutter][29] & [vim-signify][30])
|
||||

|
||||
|
||||
### [virtualenv][31]
|
||||
#### [virtualenv][31]
|
||||

|
||||
|
||||
#### [tmuxline][35]
|
||||

|
||||
|
||||
#### [promptline][36]
|
||||

|
||||
|
||||
## Extras
|
||||
|
||||
vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also:
|
||||
|
||||
#### whitespace
|
||||

|
||||
|
||||
## Configurable and extensible
|
||||
|
||||
#### Fine-tuned configuration
|
||||
|
||||
Every section is composed of parts, and you can reorder and reconfigure them at will.
|
||||
|
||||

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

|
||||
|
||||
#### Extensible pipeline
|
||||
|
||||
Completely transform the statusline to your liking. Build out the statusline as you see fit by extracting colors from the current colorscheme's highlight groups.
|
||||
|
||||

|
||||
|
||||
# Rationale
|
||||
|
||||
There's already [powerline][2], why yet another statusline?
|
||||
@@ -61,9 +111,7 @@ There's already [powerline][2], why yet another statusline?
|
||||
|
||||
What about [vim-powerline][1]?
|
||||
|
||||
* the author has been active developing powerline, which was rewritten in python and expands its capabilities to tools outside of Vim, such as bash, zsh, and tmux.
|
||||
* vim-powerline has been deprecated as a result, and no features will be added to it.
|
||||
* vim-powerline uses different font codes, so if you want to use it with a powerline themed tmux (for example), it will not work.
|
||||
* vim-powerline has been deprecated in favor of the newer, unifying powerline, which is under active development; the new version is written in python at the core and exposes various bindings such that it can style statuslines not only in vim, but also tmux, bash, zsh, and others.
|
||||
|
||||
# Where did the name come from?
|
||||
|
||||
@@ -74,11 +122,14 @@ I wrote the initial version on an airplane, and since it's light as air it turne
|
||||
This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:
|
||||
|
||||
* [Pathogen][11]
|
||||
* `git clone https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline`
|
||||
* `git clone https://github.com/vim-airline/vim-airline ~/.vim/bundle/vim-airline`
|
||||
* Remember to run `:Helptags` to generate help tags
|
||||
* [NeoBundle][12]
|
||||
* `NeoBundle 'bling/vim-airline'`
|
||||
* `NeoBundle 'vim-airline/vim-airline'`
|
||||
* [Vundle][13]
|
||||
* `Bundle 'bling/vim-airline'`
|
||||
* `Plugin 'vim-airline/vim-airline'`
|
||||
* [Plug][40]
|
||||
* `Plug 'vim-airline/vim-airline'`
|
||||
* [VAM][22]
|
||||
* `call vam#ActivateAddons([ 'vim-airline' ])`
|
||||
* manual
|
||||
@@ -88,43 +139,46 @@ This plugin follows the standard runtime path structure, and as such it can be i
|
||||
|
||||
`:help airline`
|
||||
|
||||
The default setting of 'laststatus' is for the statusline to not appear until a split is created. If you want it to appear all the time, add the following to your vimrc:
|
||||
`set laststatus=2`
|
||||
|
||||
# Integrating with powerline fonts
|
||||
|
||||
For the nice looking powerline symbols to appear, you will need to install a patched font. Instructions can be found in the official powerline [documentation][20]. Prepatched fonts can be found in the [powerline-fonts][3] repository.
|
||||
|
||||
Finally, enable them in vim-airline by adding `let g:airline_powerline_fonts = 1` to your vimrc.
|
||||
Finally, you can add the convenience variable `let g:airline_powerline_fonts = 1` to your vimrc which will automatically populate the `g:airline_symbols` dictionary with the powerline symbols.
|
||||
|
||||
# FAQ
|
||||
|
||||
Solutions to common problems can be found in the [Wiki][27].
|
||||
|
||||
# Performance
|
||||
|
||||
Whoa! Everything got slow all of a sudden...
|
||||
|
||||
vim-airline strives to make it easy to use out of the box, which means that by default it will look for all compatible plugins that you have installed and enable the relevant extension.
|
||||
|
||||
Many optimizations have been made such that the majority of users will not see any performance degradation, but it can still happen. For example, users who routinely open very large files may want to disable the `tagbar` extension, as it can be very expensive to scan for the name of the current function.
|
||||
|
||||
The [minivimrc][7] project has some helper mappings to troubleshoot performance related issues.
|
||||
|
||||
If you don't want all the bells and whistles enabled by default, you can define a value for `g:airline_extensions`. When this variable is defined, only the extensions listed will be loaded; an empty array would effectively disable all extensions.
|
||||
|
||||
# Screenshots
|
||||
|
||||
A full list of screenshots for various themes can be found in the [Wiki][14].
|
||||
|
||||
# Bugs
|
||||
# Maintainers
|
||||
|
||||
Tracking down bugs can take a very long time due to different configurations, versions, and operating systems. To ensure a timely response, please help me out by doing the following:
|
||||
The project is currently being maintained by [Bailey Ling][41], [Christian Brabandt][42], and [Mike Hartington][44].
|
||||
|
||||
* reproduce it with this [minivimrc][7] repository to rule out any configuration conflicts.
|
||||
* a link to your vimrc or a gist which shows how you configured the plugin(s).
|
||||
* and so I can reproduce; your `:version` of vim, and the commit of vim-airline you're using.
|
||||
|
||||
# Contributions
|
||||
|
||||
Contributions and pull requests are welcome. Please take note of the following guidelines:
|
||||
|
||||
* adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords.
|
||||
* keep the history clean! squash your branches before you submit a pull request. `pull --rebase` is your friend.
|
||||
* any changes to the core should be tested against Vim 7.2.
|
||||
* if you submit a theme, please create a screenshot so it can be added to the [Wiki][14].
|
||||
If you are interested in becoming a maintainer (we always welcome more maintainers), please [go here][43].
|
||||
|
||||
# License
|
||||
|
||||
MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
|
||||
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||
|
||||
[1]: https://github.com/Lokaltog/vim-powerline
|
||||
[2]: https://github.com/Lokaltog/powerline
|
||||
@@ -135,26 +189,38 @@ MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
[7]: https://github.com/bling/minivimrc
|
||||
[8]: http://en.wikipedia.org/wiki/Open/closed_principle
|
||||
[9]: https://github.com/Shougo/unite.vim
|
||||
[10]: https://github.com/kien/ctrlp.vim
|
||||
[10]: https://github.com/ctrlpvim/ctrlp.vim
|
||||
[11]: https://github.com/tpope/vim-pathogen
|
||||
[12]: https://github.com/Shougo/neobundle.vim
|
||||
[13]: https://github.com/gmarik/vundle
|
||||
[14]: https://github.com/bling/vim-airline/wiki/Screenshots
|
||||
[14]: https://github.com/vim-airline/vim-airline/wiki/Screenshots
|
||||
[15]: https://github.com/techlivezheng/vim-plugin-minibufexpl
|
||||
[16]: https://github.com/sjl/gundo.vim
|
||||
[17]: https://github.com/mbbill/undotree
|
||||
[18]: https://github.com/scrooloose/nerdtree
|
||||
[19]: https://github.com/majutsushi/tagbar
|
||||
[20]: https://powerline.readthedocs.org/en/latest/fontpatching.html
|
||||
[20]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts
|
||||
[21]: https://bitbucket.org/ludovicchabant/vim-lawrencium
|
||||
[22]: https://github.com/MarcWeber/vim-addon-manager
|
||||
[23]: https://github.com/altercation/solarized
|
||||
[24]: https://github.com/chriskempson/tomorrow-theme
|
||||
[25]: https://github.com/tomasr/molokai
|
||||
[26]: https://github.com/nanotech/jellybeans.vim
|
||||
[27]: https://github.com/bling/vim-airline/wiki/FAQ
|
||||
[27]: https://github.com/vim-airline/vim-airline/wiki/FAQ
|
||||
[28]: https://github.com/chrisbra/csv.vim
|
||||
[29]: https://github.com/airblade/vim-gitgutter
|
||||
[30]: https://github.com/mhinz/vim-signify
|
||||
[31]: https://github.com/jmcantrell/vim-virtualenv
|
||||
[32]: https://github.com/chriskempson/base16-vim
|
||||
[33]: https://github.com/vim-airline/vim-airline/wiki/Test-Plan
|
||||
[34]: http://eclim.org
|
||||
[35]: https://github.com/edkolev/tmuxline.vim
|
||||
[36]: https://github.com/edkolev/promptline.vim
|
||||
[37]: https://github.com/gcmt/taboo.vim
|
||||
[38]: https://github.com/szw/vim-ctrlspace
|
||||
[39]: https://github.com/tomtom/quickfixsigns_vim
|
||||
[40]: https://github.com/junegunn/vim-plug
|
||||
[41]: https://github.com/bling
|
||||
[42]: https://github.com/chrisbra
|
||||
[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer
|
||||
[44]: https://github.com/mhartington
|
||||
|
||||
14
Rakefile
Normal file
14
Rakefile
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env rake
|
||||
|
||||
task :default => [:test]
|
||||
|
||||
task :ci => [:dump, :test]
|
||||
|
||||
task :dump do
|
||||
sh 'vim --version'
|
||||
end
|
||||
|
||||
task :test do
|
||||
sh 'bundle exec vim-flavor test'
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', [])
|
||||
@@ -11,6 +11,12 @@ function! airline#add_statusline_func(name)
|
||||
endfunction
|
||||
|
||||
function! airline#add_statusline_funcref(function)
|
||||
if index(g:airline_statusline_funcrefs, a:function) >= 0
|
||||
echohl WarningMsg
|
||||
echo 'The airline statusline funcref '.string(a:function).' has already been added.'
|
||||
echohl NONE
|
||||
return
|
||||
endif
|
||||
call add(g:airline_statusline_funcrefs, a:function)
|
||||
endfunction
|
||||
|
||||
@@ -26,14 +32,11 @@ function! airline#add_inactive_statusline_func(name)
|
||||
endfunction
|
||||
|
||||
function! airline#load_theme()
|
||||
highlight! default link airline_warningmsg WarningMsg
|
||||
call airline#highlighter#load_theme()
|
||||
call airline#extensions#load_theme()
|
||||
endfunction
|
||||
if exists('*airline#themes#{g:airline_theme}#refresh')
|
||||
call airline#themes#{g:airline_theme}#refresh()
|
||||
endif
|
||||
|
||||
function! airline#switch_theme(name)
|
||||
let g:airline_theme = a:name
|
||||
let palette = g:airline#themes#{g:airline_theme}#palette "also lazy loads the theme
|
||||
let palette = g:airline#themes#{g:airline_theme}#palette
|
||||
call airline#themes#patch(palette)
|
||||
|
||||
if exists('g:airline_theme_patch_func')
|
||||
@@ -41,66 +44,59 @@ function! airline#switch_theme(name)
|
||||
call Fn(palette)
|
||||
endif
|
||||
|
||||
let w:airline_lastmode = ''
|
||||
call airline#highlighter#load_theme()
|
||||
call airline#extensions#load_theme()
|
||||
call airline#update_statusline()
|
||||
endfunction
|
||||
|
||||
function! airline#switch_theme(name)
|
||||
try
|
||||
let palette = g:airline#themes#{a:name}#palette "also lazy loads the theme
|
||||
let g:airline_theme = a:name
|
||||
catch
|
||||
echohl WarningMsg | echo 'The specified theme cannot be found.' | echohl NONE
|
||||
if exists('g:airline_theme')
|
||||
return
|
||||
else
|
||||
let g:airline_theme = 'dark'
|
||||
endif
|
||||
endtry
|
||||
|
||||
let w:airline_lastmode = ''
|
||||
call airline#load_theme()
|
||||
call airline#check_mode()
|
||||
|
||||
" this is required to prevent clobbering the startup info message, i don't know why...
|
||||
call airline#check_mode(winnr())
|
||||
endfunction
|
||||
|
||||
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)
|
||||
try
|
||||
let palette = g:airline#themes#{g:colors_name}#palette
|
||||
call airline#switch_theme(g:colors_name)
|
||||
return 1
|
||||
else
|
||||
catch
|
||||
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
|
||||
endtry
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:get_section(winnr, 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(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
|
||||
call a:builder.add_section('airline_c', '%f%m')
|
||||
endif
|
||||
|
||||
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
|
||||
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 a:builder.build()
|
||||
endfunction
|
||||
|
||||
function! airline#update_statusline()
|
||||
if airline#util#getwinvar(winnr(), 'airline_disabled', 0)
|
||||
return
|
||||
endif
|
||||
for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
if airline#util#getwinvar(nr, 'airline_disabled', 0)
|
||||
continue
|
||||
endif
|
||||
call setwinvar(nr, 'airline_active', 0)
|
||||
let context = { 'winnr': nr, 'active': 0 }
|
||||
let context = { 'winnr': nr, 'active': 0, 'bufnr': winbufnr(nr) }
|
||||
call s:invoke_funcrefs(context, s:inactive_funcrefs)
|
||||
endfor
|
||||
|
||||
@@ -111,21 +107,36 @@ function! airline#update_statusline()
|
||||
endfor
|
||||
|
||||
let w:airline_active = 1
|
||||
let context = { 'winnr': winnr(), 'active': 1 }
|
||||
let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) }
|
||||
call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
|
||||
endfunction
|
||||
|
||||
let s:contexts = {}
|
||||
let s:core_funcrefs = [
|
||||
\ function('airline#extensions#apply'),
|
||||
\ function('airline#extensions#default#apply') ]
|
||||
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())
|
||||
let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context)
|
||||
if err == 1
|
||||
let a:context.line = builder.build()
|
||||
let s:contexts[a:context.winnr] = a:context
|
||||
call setwinvar(a:context.winnr, '&statusline', '%!airline#statusline('.a:context.winnr.')')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#check_mode()
|
||||
function! airline#statusline(winnr)
|
||||
if has_key(s:contexts, a:winnr)
|
||||
return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
|
||||
endif
|
||||
|
||||
" in rare circumstances this happens...see #276
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#check_mode(winnr)
|
||||
let context = s:contexts[a:winnr]
|
||||
|
||||
if get(w:, 'airline_active', 1)
|
||||
let l:m = mode()
|
||||
if l:m ==# "i"
|
||||
@@ -134,6 +145,8 @@ function! airline#check_mode()
|
||||
let l:mode = ['replace']
|
||||
elseif l:m =~# '\v(v|V||s|S|)'
|
||||
let l:mode = ['visual']
|
||||
elseif l:m ==# "t"
|
||||
let l:mode = ['terminal']
|
||||
else
|
||||
let l:mode = ['normal']
|
||||
endif
|
||||
@@ -146,15 +159,26 @@ function! airline#check_mode()
|
||||
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_crypt && exists("+key") && !empty(&key)
|
||||
call add(l:mode, 'crypt')
|
||||
endif
|
||||
|
||||
if &readonly || ! &modifiable
|
||||
call add(l:mode, 'readonly')
|
||||
endif
|
||||
|
||||
let mode_string = join(l:mode)
|
||||
if get(w:, 'airline_lastmode', '') != mode_string
|
||||
call airline#highlighter#highlight_modified_inactive(context.bufnr)
|
||||
call airline#highlighter#highlight(l:mode)
|
||||
let w:airline_lastmode = mode_string
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,45 +1,134 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 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 : '%=')
|
||||
call add(self._sections, ['|', a:0 ? a:1 : '%='])
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_section_spaced(group, contents)
|
||||
call self.add_section(a:group, (g:airline_symbols.space).a:contents.(g:airline_symbols.space))
|
||||
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
|
||||
call add(self._sections, [a:group, a:contents])
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_raw(text)
|
||||
let self._line .= a:text
|
||||
call add(self._sections, ['', a:text])
|
||||
endfunction
|
||||
|
||||
function! s:get_prev_group(sections, i)
|
||||
let x = a:i - 1
|
||||
while x >= 0
|
||||
let group = a:sections[x][0]
|
||||
if group != '' && group != '|'
|
||||
return group
|
||||
endif
|
||||
let x = x - 1
|
||||
endwhile
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:prototype.build()
|
||||
let side = 1
|
||||
let line = ''
|
||||
let i = 0
|
||||
let length = len(self._sections)
|
||||
let split = 0
|
||||
|
||||
while i < length
|
||||
let section = self._sections[i]
|
||||
let group = section[0]
|
||||
let contents = section[1]
|
||||
let prev_group = s:get_prev_group(self._sections, i)
|
||||
|
||||
if group == ''
|
||||
let line .= contents
|
||||
elseif group == '|'
|
||||
let side = 0
|
||||
let line .= contents
|
||||
let split = 1
|
||||
else
|
||||
if prev_group == ''
|
||||
let line .= '%#'.group.'#'
|
||||
elseif split
|
||||
let line .= s:get_transitioned_seperator(self, prev_group, group, side)
|
||||
let split = 0
|
||||
else
|
||||
let line .= s:get_seperator(self, prev_group, group, side)
|
||||
endif
|
||||
let line .= s:get_accented_line(self, group, contents)
|
||||
endif
|
||||
|
||||
let i = i + 1
|
||||
endwhile
|
||||
|
||||
if !self._context.active
|
||||
let self._line = substitute(self._line, '%#.\{-}\ze#', '\0_inactive', 'g')
|
||||
let line = substitute(line, '%#.\{-}\ze#', '\0_inactive', 'g')
|
||||
endif
|
||||
return self._line
|
||||
return line
|
||||
endfunction
|
||||
|
||||
function! s:should_change_group(group1, group2)
|
||||
if a:group1 == a:group2
|
||||
return 0
|
||||
endif
|
||||
let color1 = airline#highlighter#get_highlight(a:group1)
|
||||
let color2 = airline#highlighter#get_highlight(a:group2)
|
||||
if has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
return color1[1] != color2[1] || color1[0] != color2[0]
|
||||
else
|
||||
return color1[3] != color2[3] || color1[2] != color2[2]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_transitioned_seperator(self, prev_group, group, side)
|
||||
let line = ''
|
||||
call airline#highlighter#add_separator(a:prev_group, a:group, a:side)
|
||||
let line .= '%#'.a:prev_group.'_to_'.a:group.'#'
|
||||
let line .= a:side ? a:self._context.left_sep : a:self._context.right_sep
|
||||
let line .= '%#'.a:group.'#'
|
||||
return line
|
||||
endfunction
|
||||
|
||||
function! s:get_seperator(self, prev_group, group, side)
|
||||
if s:should_change_group(a:prev_group, a:group)
|
||||
return s:get_transitioned_seperator(a:self, a:prev_group, a:group, a:side)
|
||||
else
|
||||
return a:side ? a:self._context.left_alt_sep : a:self._context.right_alt_sep
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_accented_line(self, group, contents)
|
||||
if a:self._context.active
|
||||
let contents = []
|
||||
let content_parts = split(a:contents, '__accent')
|
||||
for cpart in content_parts
|
||||
let accent = matchstr(cpart, '_\zs[^#]*\ze')
|
||||
call add(contents, cpart)
|
||||
endfor
|
||||
let line = join(contents, a:group)
|
||||
let line = substitute(line, '__restore__', a:group, 'g')
|
||||
else
|
||||
let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g')
|
||||
let line = substitute(line, '%#__restore__#', '', 'g')
|
||||
endif
|
||||
return 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()}'
|
||||
let builder._sections = []
|
||||
|
||||
call extend(builder._context, {
|
||||
\ 'left_sep': g:airline_left_sep,
|
||||
\ 'left_alt_sep': g:airline_left_alt_sep,
|
||||
\ 'right_sep': g:airline_right_sep,
|
||||
\ 'right_alt_sep': g:airline_right_alt_sep,
|
||||
\ }, 'keep')
|
||||
return builder
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#debug#profile1()
|
||||
@@ -32,3 +32,19 @@ function! airline#debug#profile2()
|
||||
noautocmd qall!
|
||||
endfunction
|
||||
|
||||
function! airline#debug#profile3()
|
||||
profile start airline-profile-mode.log
|
||||
profile func *
|
||||
profile file *
|
||||
|
||||
for i in range(1000)
|
||||
startinsert
|
||||
redrawstatus
|
||||
stopinsert
|
||||
redrawstatus
|
||||
endfor
|
||||
|
||||
profile pause
|
||||
noautocmd qall!
|
||||
endfunction
|
||||
|
||||
|
||||
36
autoload/airline/deprecation.vim
Normal file
36
autoload/airline/deprecation.vim
Normal file
@@ -0,0 +1,36 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#deprecation#check()
|
||||
if !exists('g:loaded_airline_themes')
|
||||
echom 'airline themes have been migrated to github.com/vim-airline/vim-airline-themes and will be removed from the core in the near future.'
|
||||
endif
|
||||
|
||||
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
|
||||
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables are obsolete. Please read the documentation about the branch extension.'
|
||||
endif
|
||||
|
||||
let tests = [
|
||||
\ [ 'g:airline_paste_symbol', 'g:airline_symbols.paste' ],
|
||||
\ [ 'g:airline_readonly_symbol', 'g:airline_symbols.readonly' ],
|
||||
\ [ 'g:airline_linecolumn_prefix', 'g:airline_symbols.linenr' ],
|
||||
\ [ 'g:airline_branch_prefix', 'g:airline_symbols.branch' ],
|
||||
\ [ 'g:airline_branch_empty_message', 'g:airline#extensions#branch#empty_message' ],
|
||||
\ [ 'g:airline_detect_whitespace', 'g:airline#extensions#whitespace#enabled|show_message' ],
|
||||
\ [ 'g:airline_enable_hunks', 'g:airline#extensions#hunks#enabled' ],
|
||||
\ [ 'g:airline_enable_tagbar', 'g:airline#extensions#tagbar#enabled' ],
|
||||
\ [ 'g:airline_enable_csv', 'g:airline#extensions#csv#enabled' ],
|
||||
\ [ 'g:airline_enable_branch', 'g:airline#extensions#branch#enabled' ],
|
||||
\ [ 'g:airline_enable_bufferline', 'g:airline#extensions#bufferline#enabled' ],
|
||||
\ [ 'g:airline_enable_syntastic', 'g:airline#extensions#syntastic#enabled' ],
|
||||
\ [ 'g:airline_enable_eclim', 'g:airline#extensions#eclim#enabled' ],
|
||||
\ ]
|
||||
for test in tests
|
||||
if exists(test[0])
|
||||
let max = winwidth(0) - 16
|
||||
let msg = printf('The variable %s is deprecated and may not work in the future. It has been replaced with %s. Please read the documentation.', test[0], test[1])
|
||||
echom msg[:max].'...'
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:ext = {}
|
||||
let s:ext._theme_funcrefs = []
|
||||
|
||||
function! s:ext.add_statusline_func(name) dict
|
||||
call airline#add_statusline_func(a:name)
|
||||
endfunction
|
||||
@@ -11,28 +13,26 @@ endfunction
|
||||
function! s:ext.add_inactive_statusline_func(name) dict
|
||||
call airline#add_inactive_statusline_func(a:name)
|
||||
endfunction
|
||||
function! s:ext.add_theme_func(name) dict
|
||||
call add(self._theme_funcrefs, function(a:name))
|
||||
endfunction
|
||||
|
||||
let s:script_path = resolve(expand('<sfile>:p:h'))
|
||||
let s:script_path = tolower(resolve(expand('<sfile>:p:h')))
|
||||
|
||||
let s:filetype_overrides = {
|
||||
\ 'netrw': [ 'netrw', '%f' ],
|
||||
\ 'nerdtree': [ 'NERD', '' ],
|
||||
\ 'gundo': [ 'Gundo', '' ],
|
||||
\ 'diff': [ 'diff', '' ],
|
||||
\ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ],
|
||||
\ 'minibufexpl': [ 'MiniBufExplorer', '' ],
|
||||
\ 'startify': [ 'startify', '' ],
|
||||
\ 'vim-plug': [ 'Plugins', '' ],
|
||||
\ }
|
||||
|
||||
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
|
||||
let w:airline_section_{a:name} = g:airline_section_{a:name}
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -49,25 +49,20 @@ 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_c = airline#section#create(['readonly'])
|
||||
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#apply(...)
|
||||
let s:active_winnr = winnr()
|
||||
|
||||
if s:is_excluded_window()
|
||||
return -1
|
||||
endif
|
||||
|
||||
let s:active_winnr = winnr()
|
||||
|
||||
if &buftype == 'quickfix'
|
||||
let w:airline_section_a = '%q'
|
||||
let w:airline_section_b = ''
|
||||
let w:airline_section_c = ''
|
||||
let w:airline_section_x = ''
|
||||
elseif &buftype == 'help'
|
||||
if &buftype == 'help'
|
||||
call airline#extensions#apply_left_override('Help', '%f')
|
||||
let w:airline_section_x = ''
|
||||
let w:airline_section_y = ''
|
||||
@@ -113,9 +108,7 @@ function! s:is_excluded_window()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#load_theme()
|
||||
if get(g:, 'loaded_ctrlp', 0)
|
||||
call airline#extensions#ctrlp#load_theme()
|
||||
endif
|
||||
call airline#util#exec_funcrefs(s:ext._theme_funcrefs, g:airline#themes#{g:airline_theme}#palette)
|
||||
endfunction
|
||||
|
||||
function! s:sync_active_winnr()
|
||||
@@ -128,13 +121,23 @@ function! airline#extensions#load()
|
||||
" non-trivial number of external plugins use eventignore=all, so we need to account for that
|
||||
autocmd CursorMoved * call <sid>sync_active_winnr()
|
||||
|
||||
" load core funcrefs
|
||||
call airline#add_statusline_func('airline#extensions#update_statusline')
|
||||
if exists('g:airline_extensions')
|
||||
for ext in g:airline_extensions
|
||||
call airline#extensions#{ext}#init(s:ext)
|
||||
endfor
|
||||
return
|
||||
endif
|
||||
|
||||
call airline#extensions#quickfix#init(s:ext)
|
||||
|
||||
if get(g:, 'loaded_unite', 0)
|
||||
call airline#extensions#unite#init(s:ext)
|
||||
endif
|
||||
|
||||
if exists(':NetrwSettings')
|
||||
call airline#extensions#netrw#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_vimfiler', 0)
|
||||
let g:vimfiler_force_overwrite_statusline = 0
|
||||
endif
|
||||
@@ -143,6 +146,10 @@ function! airline#extensions#load()
|
||||
call airline#extensions#ctrlp#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'ctrlspace_loaded', 0)
|
||||
call airline#extensions#ctrlspace#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'command_t_loaded', 0)
|
||||
call airline#extensions#commandt#init(s:ext)
|
||||
endif
|
||||
@@ -152,7 +159,7 @@ function! airline#extensions#load()
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#hunks#enabled', 1) && get(g:, 'airline_enable_hunks', 1))
|
||||
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter'))
|
||||
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter') || exists('g:loaded_changes') || exists('g:loaded_quickfixsigns'))
|
||||
call airline#extensions#hunks#init(s:ext)
|
||||
endif
|
||||
|
||||
@@ -172,7 +179,8 @@ function! airline#extensions#load()
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#branch#enabled', 1) && get(g:, 'airline_enable_branch', 1))
|
||||
\ && (get(g:, 'loaded_fugitive', 0) || get(g:, 'loaded_lawrencium', 0))
|
||||
\ && (exists('*fugitive#head') || exists('*lawrencium#statusline') ||
|
||||
\ (get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')))
|
||||
call airline#extensions#branch#init(s:ext)
|
||||
endif
|
||||
|
||||
@@ -181,44 +189,69 @@ function! airline#extensions#load()
|
||||
call airline#extensions#bufferline#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'virtualenv_loaded', 0) && get(g:, 'airline#extensions#virtualenv#enabled', 1)
|
||||
if (get(g:, 'airline#extensions#virtualenv#enabled', 1) && (exists(':VirtualEnvList') || isdirectory($VIRTUAL_ENV)))
|
||||
call airline#extensions#virtualenv#init(s:ext)
|
||||
endif
|
||||
|
||||
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
|
||||
if (get(g:, 'airline#extensions#eclim#enabled', 1) && exists(':ProjectCreate'))
|
||||
call airline#extensions#eclim#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#readonly#enabled', 1)
|
||||
call airline#extensions#readonly#init()
|
||||
if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
|
||||
\ && exists(':SyntasticCheck')
|
||||
call airline#extensions#syntastic#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#paste#enabled', 1) && get(g:, 'airline_detect_paste', 1))
|
||||
call airline#extensions#paste#init()
|
||||
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#iminsert#enabled', 0) || get(g:, 'airline_detect_iminsert', 0)
|
||||
call airline#extensions#iminsert#init()
|
||||
if get(g:, 'airline#extensions#wordcount#enabled', 1)
|
||||
call airline#extensions#wordcount#init(s:ext)
|
||||
endif
|
||||
|
||||
" 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
|
||||
if get(g:, 'airline#extensions#tabline#enabled', 0)
|
||||
call airline#extensions#tabline#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tmuxline#enabled', 1) && exists(':Tmuxline')
|
||||
call airline#extensions#tmuxline#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#promptline#enabled', 1) && exists(':PromptlineSnapshot') && len(get(g:, 'airline#extensions#promptline#snapshot_file', ''))
|
||||
call airline#extensions#promptline#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#nrrwrgn#enabled', 1) && exists(':NR') == 2
|
||||
call airline#extensions#nrrwrgn#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#capslock#enabled', 1) && exists('*CapsLockStatusline'))
|
||||
call airline#extensions#capslock#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#windowswap#enabled', 1) && get(g:, 'loaded_windowswap', 0))
|
||||
call airline#extensions#windowswap#init(s:ext)
|
||||
endif
|
||||
|
||||
if !get(g:, 'airline#extensions#disable_rtp_load', 0)
|
||||
" load all other extensions, which are not part of the default distribution.
|
||||
" (autoload/airline/extensions/*.vim outside of our s:script_path).
|
||||
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
|
||||
" we have to check both resolved and unresolved paths, since it's possible
|
||||
" that they might not get resolved properly (see #187)
|
||||
if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0
|
||||
\ && stridx(tolower(fnamemodify(file, ':p')), s:script_path) < 0
|
||||
let name = fnamemodify(file, ':t:r')
|
||||
if !get(g:, 'airline#extensions#'.name.'#enabled', 1)
|
||||
continue
|
||||
endif
|
||||
try
|
||||
call airline#extensions#{name}#init(s:ext)
|
||||
catch
|
||||
endtry
|
||||
endif
|
||||
call airline#extensions#{name}#init(s:ext)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,37 +1,144 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
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')
|
||||
let s:has_vcscommand = get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')
|
||||
|
||||
function! airline#extensions#branch#get_head()
|
||||
let head = ''
|
||||
if !s:has_fugitive && !s:has_lawrencium && !s:has_vcscommand
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:head_format = get(g:, 'airline#extensions#branch#format', 0)
|
||||
if s:head_format == 1
|
||||
function! s:format_name(name)
|
||||
return fnamemodify(a:name, ':t')
|
||||
endfunction
|
||||
elseif s:head_format == 2
|
||||
function! s:format_name(name)
|
||||
return pathshorten(a:name)
|
||||
endfunction
|
||||
elseif type(s:head_format) == type('')
|
||||
function! s:format_name(name)
|
||||
return call(s:head_format, [a:name])
|
||||
endfunction
|
||||
else
|
||||
function! s:format_name(name)
|
||||
return a:name
|
||||
endfunction
|
||||
endif
|
||||
|
||||
let s:git_dirs = {}
|
||||
function! s:get_git_branch(path)
|
||||
if has_key(s:git_dirs, a:path)
|
||||
return s:git_dirs[a:path]
|
||||
endif
|
||||
|
||||
let dir = fugitive#extract_git_dir(a:path)
|
||||
if empty(dir)
|
||||
let name = ''
|
||||
else
|
||||
try
|
||||
let line = join(readfile(dir . '/HEAD'))
|
||||
if strpart(line, 0, 16) == 'ref: refs/heads/'
|
||||
let name = strpart(line, 16)
|
||||
else
|
||||
" raw commit hash
|
||||
let name = strpart(line, 0, 7)
|
||||
endif
|
||||
catch
|
||||
let name = ''
|
||||
endtry
|
||||
endif
|
||||
|
||||
let s:git_dirs[a:path] = name
|
||||
return name
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#head()
|
||||
if exists('b:airline_head') && !empty(b:airline_head)
|
||||
return b:airline_head
|
||||
endif
|
||||
|
||||
let b:airline_head = ''
|
||||
let found_fugitive_head = 0
|
||||
|
||||
if s:has_fugitive && !exists('b:mercurial_dir')
|
||||
let head = fugitive#head()
|
||||
let b:airline_head = fugitive#head(7)
|
||||
let found_fugitive_head = 1
|
||||
|
||||
if empty(head) && s:has_fugitive_detect && !exists('b:git_dir')
|
||||
call fugitive#detect(getcwd())
|
||||
let head = fugitive#head()
|
||||
if empty(b:airline_head) && !exists('b:git_dir')
|
||||
let b:airline_head = s:get_git_branch(expand("%:p:h"))
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(head)
|
||||
if empty(b:airline_head)
|
||||
if s:has_lawrencium
|
||||
let head = lawrencium#statusline()
|
||||
let b:airline_head = lawrencium#statusline()
|
||||
endif
|
||||
endif
|
||||
|
||||
return empty(head) ? s:empty_message : s:symbol.head
|
||||
if empty(b:airline_head)
|
||||
if s:has_vcscommand
|
||||
call VCSCommandEnableBufferSetup()
|
||||
if exists('b:VCSCommandBufferInfo')
|
||||
let b:airline_head = get(b:VCSCommandBufferInfo, 0, '')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||
let b:airline_head = ''
|
||||
endif
|
||||
|
||||
let b:airline_head = s:format_name(b:airline_head)
|
||||
|
||||
if exists("g:airline#extensions#branch#displayed_head_limit")
|
||||
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit
|
||||
if len(b:airline_head) > w:displayed_head_limit - 1
|
||||
let b:airline_head = b:airline_head[0:w:displayed_head_limit - 1].'…'
|
||||
endif
|
||||
endif
|
||||
|
||||
return b:airline_head
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#get_head()
|
||||
let head = airline#extensions#branch#head()
|
||||
let empty_message = get(g:, 'airline#extensions#branch#empty_message',
|
||||
\ get(g:, 'airline_branch_empty_message', ''))
|
||||
let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
|
||||
return empty(head)
|
||||
\ ? empty_message
|
||||
\ : printf('%s%s', empty(symbol) ? '' : symbol.(g:airline_symbols.space), head)
|
||||
endfunction
|
||||
|
||||
function! s:check_in_path()
|
||||
if !exists('b:airline_branch_path')
|
||||
let root = get(b:, 'git_dir', get(b:, 'mercurial_dir', ''))
|
||||
let bufferpath = resolve(fnamemodify(expand('%'), ':p'))
|
||||
|
||||
if !filereadable(root) "not a file
|
||||
" if .git is a directory, it's the old submodule format
|
||||
if match(root, '\.git$') >= 0
|
||||
let root = expand(fnamemodify(root, ':h'))
|
||||
else
|
||||
" else it's the newer format, and we need to guesstimate
|
||||
let pattern = '\.git\(\\\|\/\)modules\(\\\|\/\)'
|
||||
if match(root, pattern) >= 0
|
||||
let root = substitute(root, pattern, '', '')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
let b:airline_file_in_root = stridx(bufferpath, root) > -1
|
||||
endif
|
||||
return b:airline_file_in_root
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
let g:airline_section_b .= '%{airline#extensions#branch#get_head()}'
|
||||
endfunction
|
||||
call airline#parts#define_function('branch', 'airline#extensions#branch#get_head')
|
||||
|
||||
autocmd BufReadPost * unlet! b:airline_file_in_root
|
||||
autocmd CursorHold,ShellCmdPost,CmdwinLeave * unlet! b:airline_head
|
||||
endfunction
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#bufferline#init(ext)
|
||||
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 !exists('*bufferline#get_status_string')
|
||||
finish
|
||||
endif
|
||||
|
||||
if g:airline_section_c == '%f%m'
|
||||
let g:airline_section_c = '%{bufferline#refresh_status()}'.bufferline#get_status_string()
|
||||
let s:overwrite = get(g:, 'airline#extensions#bufferline#overwrite_variables', 1)
|
||||
|
||||
function! airline#extensions#bufferline#init(ext)
|
||||
if s:overwrite
|
||||
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 = g:airline_symbols.space
|
||||
endif
|
||||
|
||||
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
|
||||
endfunction
|
||||
|
||||
|
||||
14
autoload/airline/extensions/capslock.vim
Normal file
14
autoload/airline/extensions/capslock.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" MIT License. Copyright (c) 2014 Mathias Andersson.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
if !exists('*CapsLockStatusline')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#capslock#status()
|
||||
return tolower(CapsLockStatusline()) == '[caps]' ? 'CAPS' : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#capslock#init(ext)
|
||||
call airline#parts#define_function('capslock', 'airline#extensions#capslock#status')
|
||||
endfunction
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'command_t_loaded', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#commandt#apply(...)
|
||||
if bufname('%') ==# 'GoToFile'
|
||||
call airline#extensions#apply_left_override('CommandT', '')
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_csv', 0) && !exists(':Table')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:column_display = get(g:, 'airline#extensions#csv#column_display', 'Number')
|
||||
|
||||
function! airline#extensions#csv#get_column()
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:color_template = get(g:, 'airline#extensions#ctrlp#color_template', 'insert')
|
||||
|
||||
function! airline#extensions#ctrlp#generate_color_map(dark, light, white)
|
||||
@@ -14,32 +18,43 @@ 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}#palette.ctrlp')
|
||||
let theme = g:airline#themes#{g:airline_theme}#palette.ctrlp
|
||||
function! airline#extensions#ctrlp#load_theme(palette)
|
||||
if exists('a:palette.ctrlp')
|
||||
let theme = a:palette.ctrlp
|
||||
else
|
||||
let s:color_template = has_key(g:airline#themes#{g:airline_theme}#palette, s:color_template) ? s:color_template : 'insert'
|
||||
let s:color_template = has_key(a:palette, s:color_template) ? s:color_template : 'insert'
|
||||
let theme = airline#extensions#ctrlp#generate_color_map(
|
||||
\ 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'])
|
||||
\ a:palette[s:color_template]['airline_c'],
|
||||
\ a:palette[s:color_template]['airline_b'],
|
||||
\ a:palette[s:color_template]['airline_a'])
|
||||
endif
|
||||
for key in keys(theme)
|
||||
call airline#highlighter#exec(key, theme[key])
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Arguments: focus, byfname, s:regexp, prv, item, nxt, marked
|
||||
" Arguments: focus, byfname, regexp, prv, item, nxt, marked
|
||||
function! airline#extensions#ctrlp#ctrlp_airline(...)
|
||||
let regex = a:3 ? '%#CtrlPlight# regex %*' : ''
|
||||
let prv = '%#CtrlPlight# '.a:4.' %#Ctrlparrow1#'.g:airline_left_sep
|
||||
let item = '%#CtrlPwhite# '.a:5.' %#CtrlParrow2#'.g:airline_left_sep
|
||||
let nxt = '%#CtrlPlight# '.a:6.' %#CtrlParrow3#'.g:airline_left_sep
|
||||
let marked = '%#CtrlPdark# '.a:7.' '
|
||||
let focus = '%=%<%#CtrlPdark# '.a:1.' %*'
|
||||
let byfname = '%#CtrlParrow3#'.g:airline_right_alt_sep.'%#CtrlPdark# '.a:2.' %*'
|
||||
let dir = '%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
|
||||
return regex.prv.item.nxt.marked.focus.byfname.dir
|
||||
let b = airline#builder#new({'active': 1})
|
||||
if a:2 == 'file'
|
||||
call b.add_section_spaced('CtrlPlight', 'by fname')
|
||||
endif
|
||||
if a:3
|
||||
call b.add_section_spaced('CtrlPlight', 'regex')
|
||||
endif
|
||||
if get(g:, 'airline#extensions#ctrlp#show_adjacent_modes', 1)
|
||||
call b.add_section_spaced('CtrlPlight', a:4)
|
||||
call b.add_section_spaced('CtrlPwhite', a:5)
|
||||
call b.add_section_spaced('CtrlPlight', a:6)
|
||||
else
|
||||
call b.add_section_spaced('CtrlPwhite', a:5)
|
||||
endif
|
||||
call b.add_section_spaced('CtrlPdark', a:7)
|
||||
call b.split()
|
||||
call b.add_section_spaced('CtrlPdark', a:1)
|
||||
call b.add_section_spaced('CtrlPdark', a:2)
|
||||
call b.add_section_spaced('CtrlPlight', '%{getcwd()}')
|
||||
return b.build()
|
||||
endfunction
|
||||
|
||||
" Argument: len
|
||||
@@ -51,7 +66,7 @@ endfunction
|
||||
|
||||
function! airline#extensions#ctrlp#apply(...)
|
||||
" disable statusline overwrite if ctrlp already did it
|
||||
return match(&statusline, 'CtrlPlight') >= 0 ? -1 : 0
|
||||
return match(&statusline, 'CtrlPwhite') >= 0 ? -1 : 0
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlp#init(ext)
|
||||
@@ -60,5 +75,6 @@ function! airline#extensions#ctrlp#init(ext)
|
||||
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status',
|
||||
\ }
|
||||
call a:ext.add_statusline_func('airline#extensions#ctrlp#apply')
|
||||
call a:ext.add_theme_func('airline#extensions#ctrlp#load_theme')
|
||||
endfunction
|
||||
|
||||
|
||||
18
autoload/airline/extensions/ctrlspace.vim
Normal file
18
autoload/airline/extensions/ctrlspace.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
let s:padding = s:spc . s:spc . s:spc
|
||||
|
||||
function! airline#extensions#ctrlspace#statusline(...)
|
||||
let b = airline#builder#new({ 'active': 1 })
|
||||
call b.add_section('airline_a', s:padding . g:ctrlspace_symbols.cs . s:padding)
|
||||
call b.add_section('airline_b', s:padding . ctrlspace#statusline_mode_segment(s:padding))
|
||||
call b.split()
|
||||
call b.add_section('airline_x', s:spc . ctrlspace#statusline_tab_segment() . s:spc)
|
||||
return b.build()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlspace#init(ext)
|
||||
let g:ctrlspace_statusline_function = 'airline#extensions#ctrlspace#statusline()'
|
||||
endfunction
|
||||
81
autoload/airline/extensions/default.vim
Normal file
81
autoload/airline/extensions/default.vim
Normal file
@@ -0,0 +1,81 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', {
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ })
|
||||
let s:layout = get(g:, 'airline#extensions#default#layout', [
|
||||
\ [ 'a', 'b', 'c' ],
|
||||
\ [ 'x', 'y', 'z', 'warning' ]
|
||||
\ ])
|
||||
|
||||
function! s:get_section(winnr, key, ...)
|
||||
if has_key(s:section_truncate_width, a:key)
|
||||
if winwidth(a:winnr) < s:section_truncate_width[a:key]
|
||||
return ''
|
||||
endif
|
||||
endif
|
||||
let spc = g:airline_symbols.space
|
||||
let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
|
||||
let [prefix, suffix] = [get(a:000, 0, '%('.spc), get(a:000, 1, spc.'%)')]
|
||||
return empty(text) ? '' : prefix.text.suffix
|
||||
endfunction
|
||||
|
||||
function! s:build_sections(builder, context, keys)
|
||||
for key in a:keys
|
||||
if key == 'warning' && !a:context.active
|
||||
continue
|
||||
endif
|
||||
call s:add_section(a:builder, a:context, key)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
if v:version >= 704 || (v:version >= 703 && has('patch81'))
|
||||
function s:add_section(builder, context, key)
|
||||
" i have no idea why the warning section needs special treatment, but it's
|
||||
" needed to prevent separators from showing up
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%(')
|
||||
endif
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%)')
|
||||
endif
|
||||
endfunction
|
||||
else
|
||||
" older version don't like the use of %(%)
|
||||
function s:add_section(builder, context, key)
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%#airline_warning#'.s:get_section(a:context.winnr, a:key))
|
||||
else
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
endif
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function! airline#extensions#default#apply(builder, context)
|
||||
let winnr = a:context.winnr
|
||||
let active = a:context.active
|
||||
|
||||
if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
|
||||
call s:build_sections(a:builder, a:context, s:layout[0])
|
||||
else
|
||||
let text = s:get_section(winnr, 'c')
|
||||
if empty(text)
|
||||
let text = ' %f%m '
|
||||
endif
|
||||
call a:builder.add_section('airline_c'.(a:context.bufnr), text)
|
||||
endif
|
||||
|
||||
call a:builder.split(s:get_section(winnr, 'gutter', '', ''))
|
||||
|
||||
if airline#util#getwinvar(winnr, 'airline_render_right', 1)
|
||||
call s:build_sections(a:builder, a:context, s:layout[1])
|
||||
endif
|
||||
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
53
autoload/airline/extensions/eclim.vim
Normal file
53
autoload/airline/extensions/eclim.vim
Normal file
@@ -0,0 +1,53 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':ProjectCreate')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#eclim#creat_line(...)
|
||||
if &filetype == "tree"
|
||||
let builder = a:1
|
||||
call builder.add_section('airline_a', ' Project ')
|
||||
call builder.add_section('airline_b', ' %f ')
|
||||
call builder.add_section('airline_c', '')
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#eclim#get_warnings()
|
||||
let eclimList = eclim#display#signs#GetExisting()
|
||||
|
||||
if !empty(eclimList)
|
||||
" Remove any non-eclim signs (see eclim#display#signs#Update)
|
||||
" First check for just errors since they are more important.
|
||||
" If there are no errors, then check for warnings.
|
||||
let errorList = filter(copy(eclimList), 'v:val.name =~ "^\\(qf_\\)\\?\\(error\\)$"')
|
||||
|
||||
if (empty(errorList))
|
||||
" use the warnings
|
||||
call filter(eclimList, 'v:val.name =~ "^\\(qf_\\)\\?\\(warning\\)$"')
|
||||
let type = 'W'
|
||||
else
|
||||
" Use the errors
|
||||
let eclimList = errorList
|
||||
let type = 'E'
|
||||
endif
|
||||
|
||||
if !empty(eclimList)
|
||||
let errorsLine = eclimList[0]['line']
|
||||
let errorsNumber = len(eclimList)
|
||||
let errors = "[Eclim:" . type . " line:".string(errorsLine)." (".string(errorsNumber).")]"
|
||||
if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == ''
|
||||
return errors.(g:airline_symbols.space)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#eclim#init(ext)
|
||||
call airline#parts#define_function('eclim', 'airline#extensions#eclim#get_warnings')
|
||||
call a:ext.add_statusline_func('airline#extensions#eclim#creat_line')
|
||||
endfunction
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" we don't actually want this loaded :P
|
||||
finish
|
||||
|
||||
" Due to some potential rendering issues, the use of the `space` variable is
|
||||
" recommended.
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
" 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.
|
||||
" First we define an init function that will be invoked from extensions.vim
|
||||
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)
|
||||
" Here we define a new part for the plugin. This allows users to place this
|
||||
" extension in arbitrary locations.
|
||||
call airline#parts#define_raw('cats', '%{airline#extensions#example#get_cats()}')
|
||||
|
||||
" Next up we add a funcref so that we can run some code prior to the
|
||||
" statusline getting modifed.
|
||||
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.
|
||||
" You can also add a funcref for inactive statuslines.
|
||||
" call a:ext.add_inactive_statusline_func('airline#extensions#example#unapply')
|
||||
endfunction
|
||||
|
||||
@@ -31,10 +32,14 @@ endfunction
|
||||
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()} ')
|
||||
|
||||
" Let's say we want to append to section_c, first we check if there's
|
||||
" already a window-local override, and if not, create it off of the global
|
||||
" section_c.
|
||||
let w:airline_section_c = get(w:, 'airline_section_c', g:airline_section_c)
|
||||
|
||||
" Then we just append this extenion to it, optionally using separators.
|
||||
let w:airline_section_c .= s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#example#get_cats()}'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,46 +1,70 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0) && !get(g:, 'loaded_changes', 0) && !get(g:, 'loaded_quickfixsigns', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
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
|
||||
function! s:get_hunks_signify()
|
||||
let hunks = sy#repo#get_stats()
|
||||
if hunks[0] >= 0
|
||||
return hunks
|
||||
endif
|
||||
return []
|
||||
endfunction
|
||||
|
||||
let hunks = sy#repo#get_stats()
|
||||
if hunks[0] >= 0
|
||||
return hunks
|
||||
endif
|
||||
return []
|
||||
endfunction
|
||||
function! s:is_branch_empty()
|
||||
return exists('*airline#extensions#branch#head') && empty(airline#extensions#branch#head())
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks_gitgutter()
|
||||
if !get(g:, 'gitgutter_enabled', 0) || s:is_branch_empty()
|
||||
return ''
|
||||
endif
|
||||
return GitGutterGetHunkSummary()
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks_changes()
|
||||
if !get(b:, 'changes_view_enabled', 0) || s:is_branch_empty()
|
||||
return []
|
||||
endif
|
||||
let hunks = changes#GetStats()
|
||||
for i in hunks
|
||||
if i > 0
|
||||
return hunks
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks_empty()
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks()
|
||||
if !exists('b:source_func')
|
||||
if get(g:, 'loaded_signify') && sy#buffer_is_active()
|
||||
let b:source_func = 's:get_hunks_signify'
|
||||
elseif exists('*GitGutterGetHunkSummary')
|
||||
function! s:get_hunks()
|
||||
if !get(g:, 'gitgutter_enabled', 0)
|
||||
return ''
|
||||
endif
|
||||
return GitGutterGetHunkSummary()
|
||||
endfunction
|
||||
let b:source_func = 's:get_hunks_gitgutter'
|
||||
elseif exists('*changes#GetStats')
|
||||
let b:source_func = 's:get_hunks_changes'
|
||||
elseif exists('*quickfixsigns#vcsdiff#GetHunkSummary')
|
||||
let b:source_func = 'quickfixsigns#vcsdiff#GetHunkSummary'
|
||||
else
|
||||
function! s:get_hunks()
|
||||
return []
|
||||
endfunction
|
||||
let b:source_func = 's:get_hunks_empty'
|
||||
endif
|
||||
endif
|
||||
return {b:source_func}()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#get_hunks()
|
||||
call <sid>init()
|
||||
if !get(w:, 'airline_active', 0)
|
||||
return ''
|
||||
endif
|
||||
let hunks = s:get_hunks()
|
||||
let string = ''
|
||||
if !empty(hunks)
|
||||
@@ -54,6 +78,6 @@ function! airline#extensions#hunks#get_hunks()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#init(ext)
|
||||
let g:airline_section_b .= '%{airline#extensions#hunks#get_hunks()}'
|
||||
call airline#parts#define_function('hunks', 'airline#extensions#hunks#get_hunks')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#iminsert#get_text()
|
||||
if &iminsert
|
||||
return toupper(get(b:, 'keymap_name', 'lang'))
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#iminsert#init()
|
||||
let g:airline_section_a .= ' '.g:airline_left_alt_sep.' %{airline#extensions#iminsert#get_text()}'
|
||||
endfunction
|
||||
|
||||
32
autoload/airline/extensions/netrw.vim
Normal file
32
autoload/airline/extensions/netrw.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':NetrwSettings')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#netrw#apply(...)
|
||||
if &ft == 'netrw'
|
||||
let spc = g:airline_symbols.space
|
||||
|
||||
call a:1.add_section('airline_a', spc.'netrw'.spc)
|
||||
if exists('*airline#extensions#branch#get_head')
|
||||
call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc)
|
||||
endif
|
||||
call a:1.add_section('airline_c', spc.'%f'.spc)
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_y', spc.'%{airline#extensions#netrw#sortstring()}'.spc)
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#netrw#init(ext)
|
||||
let g:netrw_force_overwrite_statusline = 0
|
||||
call a:ext.add_statusline_func('airline#extensions#netrw#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
function! airline#extensions#netrw#sortstring()
|
||||
let order = (g:netrw_sort_direction =~ 'n') ? '+' : '-'
|
||||
return g:netrw_sort_by . (g:airline_symbols.space) . '[' . order . ']'
|
||||
endfunction
|
||||
55
autoload/airline/extensions/nrrwrgn.vim
Normal file
55
autoload/airline/extensions/nrrwrgn.vim
Normal file
@@ -0,0 +1,55 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_nrrw_rgn', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#nrrwrgn#apply(...)
|
||||
if exists(":WidenRegion") == 2
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists("*nrrwrgn#NrrwRgnStatus()") || empty(nrrwrgn#NrrwRgnStatus())
|
||||
call a:1.add_section('airline_a', printf('%s[Narrowed%s#%d]', spc, spc, b:nrrw_instn))
|
||||
let bufname=(get(b:, 'orig_buf', 0) ? bufname(b:orig_buf) : substitute(bufname('%'), '^Nrrwrgn_\zs.*\ze_\d\+$', submatch(0), ''))
|
||||
call a:1.add_section('airline_c', spc.bufname.spc)
|
||||
call a:1.split()
|
||||
else
|
||||
let dict=nrrwrgn#NrrwRgnStatus()
|
||||
let vmode = { 'v': 'Char ', 'V': 'Line ', '': 'Block '}
|
||||
let mode = dict.visual ? vmode[dict.visual] : vmode['V']
|
||||
let winwidth = winwidth(0)
|
||||
if winwidth < 80
|
||||
let mode = mode[0]
|
||||
endif
|
||||
let title = (winwidth < 80 ? "Nrrw" : "Narrowed ")
|
||||
let multi = (winwidth < 80 ? 'M' : 'Multi')
|
||||
call a:1.add_section('airline_a', printf('[%s%s%s#%d]%s', (dict.multi ? multi : ""),
|
||||
\ title, mode, b:nrrw_instn, spc))
|
||||
let name = dict.fullname
|
||||
if name !=# '[No Name]'
|
||||
if winwidth > 100
|
||||
" need some space
|
||||
let name = fnamemodify(dict.fullname, ':~')
|
||||
if strlen(name) > 8
|
||||
" shorten name
|
||||
let name = substitute(name, '\(.\)[^/\\]*\([/\\]\)', '\1\2', 'g')
|
||||
endif
|
||||
else
|
||||
let name = fnamemodify(dict.fullname, ':t')
|
||||
endif
|
||||
endif
|
||||
let range=(dict.multi ? '' : printf("[%d-%d]", dict.start[1], dict.end[1]))
|
||||
call a:1.add_section('airline_c', printf("%s %s %s", name, range,
|
||||
\ dict.enabled ? (&encoding ==? 'utf-8' ? "\u2713" : '') : '!'))
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_x', get(g:, 'airline_section_x').spc)
|
||||
call a:1.add_section('airline_y', spc.get(g:, 'airline_section_y').spc)
|
||||
call a:1.add_section('airline_z', spc.get(g:, 'airline_section_z'))
|
||||
endif
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#nrrwrgn#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#nrrwrgn#apply')
|
||||
endfunction
|
||||
@@ -1,14 +0,0 @@
|
||||
" 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
|
||||
|
||||
33
autoload/airline/extensions/promptline.vim
Normal file
33
autoload/airline/extensions/promptline.vim
Normal file
@@ -0,0 +1,33 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':PromptlineSnapshot')
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('airline#extensions#promptline#snapshot_file') || !len('airline#extensions#promptline#snapshot_file')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:prompt_snapshot_file = get(g:, 'airline#extensions#promptline#snapshot_file', '')
|
||||
let s:color_template = get(g:, 'airline#extensions#promptline#color_template', 'normal')
|
||||
|
||||
function! airline#extensions#promptline#init(ext)
|
||||
call a:ext.add_theme_func('airline#extensions#promptline#set_prompt_colors')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#promptline#set_prompt_colors(palette)
|
||||
let color_template = has_key(a:palette, s:color_template) ? s:color_template : 'normal'
|
||||
let mode_palette = a:palette[color_template]
|
||||
|
||||
if !has_key(g:, 'promptline_symbols')
|
||||
let g:promptline_symbols = {
|
||||
\ 'left' : g:airline_left_sep,
|
||||
\ 'right' : g:airline_right_sep,
|
||||
\ 'left_alt' : g:airline_left_alt_sep,
|
||||
\ 'right_alt' : g:airline_right_alt_sep}
|
||||
endif
|
||||
|
||||
let promptline_theme = promptline#api#create_theme_from_airline(mode_palette)
|
||||
call promptline#api#create_snapshot_with_theme(s:prompt_snapshot_file, promptline_theme)
|
||||
endfunction
|
||||
37
autoload/airline/extensions/quickfix.vim
Normal file
37
autoload/airline/extensions/quickfix.vim
Normal file
@@ -0,0 +1,37 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix'
|
||||
let g:airline#extensions#quickfix#location_text = 'Location'
|
||||
|
||||
function! airline#extensions#quickfix#apply(...)
|
||||
if &buftype == 'quickfix'
|
||||
let w:airline_section_a = s:get_text()
|
||||
let w:airline_section_b = '%{get(w:, "quickfix_title", "")}'
|
||||
let w:airline_section_c = ''
|
||||
let w:airline_section_x = ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#quickfix#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#quickfix#apply')
|
||||
endfunction
|
||||
|
||||
function! s:get_text()
|
||||
redir => buffers
|
||||
silent ls
|
||||
redir END
|
||||
|
||||
let nr = bufnr('%')
|
||||
for buf in split(buffers, '\n')
|
||||
if match(buf, '\v^\s*'.nr) > -1
|
||||
if match(buf, '\cQuickfix') > -1
|
||||
return g:airline#extensions#quickfix#quickfix_text
|
||||
else
|
||||
return g:airline#extensions#quickfix#location_text
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
" 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
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#syntastic#apply(...)
|
||||
call airline#extensions#append_to_section('warning', '%{SyntasticStatuslineFlag()}')
|
||||
if !exists(':SyntasticCheck')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#syntastic#get_warnings()
|
||||
let errors = SyntasticStatuslineFlag()
|
||||
if strlen(errors) > 0
|
||||
return errors.(g:airline_symbols.space)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#syntastic#apply')
|
||||
call airline#parts#define_function('syntastic', 'airline#extensions#syntastic#get_warnings')
|
||||
endfunction
|
||||
|
||||
|
||||
157
autoload/airline/extensions/tabline.vim
Normal file
157
autoload/airline/extensions/tabline.vim
Normal file
@@ -0,0 +1,157 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
let s:ignore_bufadd_pat = get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree')
|
||||
let s:combined = get(g:, 'airline#extensions#tabline#combined', 1)
|
||||
|
||||
let s:taboo = get(g:, 'airline#extensions#taboo#enabled', 1) && get(g:, 'loaded_taboo', 0)
|
||||
if s:taboo
|
||||
let g:taboo_tabline = 0
|
||||
endif
|
||||
|
||||
function! airline#extensions#tabline#init(ext)
|
||||
if has('gui_running')
|
||||
set guioptions-=e
|
||||
endif
|
||||
|
||||
autocmd User AirlineToggledOn call s:toggle_on()
|
||||
autocmd User AirlineToggledOff call s:toggle_off()
|
||||
|
||||
call s:toggle_on()
|
||||
call a:ext.add_theme_func('airline#extensions#tabline#load_theme')
|
||||
endfunction
|
||||
|
||||
function! s:toggle_off()
|
||||
call airline#extensions#tabline#autoshow#off()
|
||||
call airline#extensions#tabline#tabs#off()
|
||||
call airline#extensions#tabline#buffers#off()
|
||||
endfunction
|
||||
|
||||
function! s:toggle_on()
|
||||
call airline#extensions#tabline#autoshow#on()
|
||||
call airline#extensions#tabline#tabs#on()
|
||||
call airline#extensions#tabline#buffers#on()
|
||||
|
||||
set tabline=%!airline#extensions#tabline#get()
|
||||
endfunction
|
||||
|
||||
function! s:update_tabline()
|
||||
let match = expand('<afile>')
|
||||
if pumvisible()
|
||||
return
|
||||
elseif !get(g:, 'airline#extensions#tabline#enabled', 0)
|
||||
return
|
||||
" return, if buffer matches ignore pattern or is directory (netrw)
|
||||
elseif empty(match)
|
||||
\ || match(match, s:ignore_bufadd_pat) > -1
|
||||
\ || isdirectory(expand("<afile>"))
|
||||
return
|
||||
endif
|
||||
" force re-evaluation of tabline setting
|
||||
set mod!
|
||||
redraw
|
||||
set mod!
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#load_theme(palette)
|
||||
let colors = get(a:palette, 'tabline', {})
|
||||
let l:tab = get(colors, 'airline_tab', a:palette.normal.airline_b)
|
||||
let l:tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
|
||||
let l:tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
|
||||
let l:tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
|
||||
let l:tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
|
||||
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
|
||||
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c)
|
||||
else
|
||||
"Fall back to normal airline_c if modified airline_c isn't present
|
||||
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
|
||||
endif
|
||||
|
||||
let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
|
||||
call airline#highlighter#exec('airline_tab', l:tab)
|
||||
call airline#highlighter#exec('airline_tabsel', l:tabsel)
|
||||
call airline#highlighter#exec('airline_tabtype', l:tabtype)
|
||||
call airline#highlighter#exec('airline_tabfill', l:tabfill)
|
||||
call airline#highlighter#exec('airline_tabmod', l:tabmod)
|
||||
call airline#highlighter#exec('airline_tabmod_unsel', l:tabmodu)
|
||||
call airline#highlighter#exec('airline_tabhid', l:tabhid)
|
||||
endfunction
|
||||
|
||||
let s:current_tabcnt = -1
|
||||
function! airline#extensions#tabline#get()
|
||||
let curtabcnt = tabpagenr('$')
|
||||
if curtabcnt != s:current_tabcnt
|
||||
let s:current_tabcnt = curtabcnt
|
||||
call airline#extensions#tabline#tabs#invalidate()
|
||||
call airline#extensions#tabline#buffers#invalidate()
|
||||
endif
|
||||
|
||||
if !exists('#airline#BufAdd#*')
|
||||
autocmd airline BufAdd * call <sid>update_tabline()
|
||||
endif
|
||||
if s:show_buffers && curtabcnt == 1 || !s:show_tabs
|
||||
return airline#extensions#tabline#buffers#get()
|
||||
else
|
||||
return airline#extensions#tabline#tabs#get()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#title(n)
|
||||
let title = ''
|
||||
if s:taboo
|
||||
let title = TabooTabTitle(a:n)
|
||||
endif
|
||||
|
||||
if empty(title)
|
||||
let buflist = tabpagebuflist(a:n)
|
||||
let winnr = tabpagewinnr(a:n)
|
||||
return airline#extensions#tabline#get_buffer_name(buflist[winnr - 1])
|
||||
endif
|
||||
|
||||
return title
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#get_buffer_name(nr)
|
||||
return airline#extensions#tabline#formatters#{s:formatter}#format(a:nr, airline#extensions#tabline#buflist#list())
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#new_builder()
|
||||
let builder_context = {
|
||||
\ 'active' : 1,
|
||||
\ 'right_sep' : get(g:, 'airline#extensions#tabline#right_sep' , g:airline_right_sep),
|
||||
\ 'right_alt_sep' : get(g:, 'airline#extensions#tabline#right_alt_sep', g:airline_right_alt_sep),
|
||||
\ }
|
||||
if get(g:, 'airline_powerline_fonts', 0)
|
||||
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , g:airline_left_sep)
|
||||
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , g:airline_left_alt_sep)
|
||||
else
|
||||
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , ' ')
|
||||
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|')
|
||||
endif
|
||||
|
||||
return airline#builder#new(builder_context)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr)
|
||||
let cur = bufnr('%')
|
||||
if cur == a:bufnr
|
||||
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
else
|
||||
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
|
||||
let group = 'airline_tabmod_unsel'
|
||||
elseif index(a:tab_bufs, a:bufnr) > -1
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
endif
|
||||
return group
|
||||
endfunction
|
||||
53
autoload/airline/extensions/tabline/autoshow.vim
Normal file
53
autoload/airline/extensions/tabline/autoshow.vim
Normal file
@@ -0,0 +1,53 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:buf_min_count = get(g:, 'airline#extensions#tabline#buffer_min_count', 0)
|
||||
let s:tab_min_count = get(g:, 'airline#extensions#tabline#tab_min_count', 0)
|
||||
|
||||
function! airline#extensions#tabline#autoshow#off()
|
||||
if exists('s:original_tabline')
|
||||
let &tabline = s:original_tabline
|
||||
let &showtabline = s:original_showtabline
|
||||
endif
|
||||
|
||||
augroup airline_tabline_autoshow
|
||||
autocmd!
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#autoshow#on()
|
||||
let [ s:original_tabline, s:original_showtabline ] = [ &tabline, &showtabline ]
|
||||
|
||||
augroup airline_tabline_autoshow
|
||||
autocmd!
|
||||
if s:buf_min_count <= 0 && s:tab_min_count <= 1
|
||||
if &lines > 3
|
||||
set showtabline=2
|
||||
endif
|
||||
else
|
||||
if s:show_buffers == 1
|
||||
autocmd BufEnter * call <sid>show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()))
|
||||
autocmd BufUnload * call <sid>show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()) - 1)
|
||||
else
|
||||
autocmd TabEnter * call <sid>show_tabline(s:tab_min_count, tabpagenr('$'))
|
||||
endif
|
||||
endif
|
||||
|
||||
" Invalidate cache. This has to come after the BufUnload for
|
||||
" s:show_buffers, to invalidate the cache for BufEnter.
|
||||
autocmd BufLeave,BufAdd,BufUnload * call airline#extensions#tabline#buflist#invalidate()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! s:show_tabline(min_count, total_count)
|
||||
if a:total_count >= a:min_count
|
||||
if &showtabline != 2 && &lines > 3
|
||||
set showtabline=2
|
||||
endif
|
||||
else
|
||||
if &showtabline != 0
|
||||
set showtabline=0
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
182
autoload/airline/extensions/tabline/buffers.vim
Normal file
182
autoload/airline/extensions/tabline/buffers.vim
Normal file
@@ -0,0 +1,182 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:buffer_idx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0)
|
||||
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
let s:current_bufnr = -1
|
||||
let s:current_modified = 0
|
||||
let s:current_tabline = ''
|
||||
let s:current_visible_buffers = []
|
||||
|
||||
let s:number_map = &encoding == 'utf-8'
|
||||
\ ? {
|
||||
\ '0': '⁰',
|
||||
\ '1': '¹',
|
||||
\ '2': '²',
|
||||
\ '3': '³',
|
||||
\ '4': '⁴',
|
||||
\ '5': '⁵',
|
||||
\ '6': '⁶',
|
||||
\ '7': '⁷',
|
||||
\ '8': '⁸',
|
||||
\ '9': '⁹'
|
||||
\ }
|
||||
\ : {}
|
||||
|
||||
function! airline#extensions#tabline#buffers#off()
|
||||
augroup airline_tabline_buffers
|
||||
autocmd!
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buffers#on()
|
||||
augroup airline_tabline_buffers
|
||||
autocmd!
|
||||
autocmd BufDelete * call airline#extensions#tabline#buffers#invalidate()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buffers#invalidate()
|
||||
let s:current_bufnr = -1
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buffers#get()
|
||||
call <sid>map_keys()
|
||||
let cur = bufnr('%')
|
||||
if cur == s:current_bufnr
|
||||
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
|
||||
return s:current_tabline
|
||||
endif
|
||||
endif
|
||||
|
||||
let l:index = 1
|
||||
let b = airline#extensions#tabline#new_builder()
|
||||
let tab_bufs = tabpagebuflist(tabpagenr())
|
||||
for nr in s:get_visible_buffers()
|
||||
if nr < 0
|
||||
call b.add_raw('%#airline_tabhid#...')
|
||||
continue
|
||||
endif
|
||||
|
||||
let group = airline#extensions#tabline#group_of_bufnr(tab_bufs, nr)
|
||||
if s:buffer_idx_mode
|
||||
if len(s:number_map) > 0
|
||||
call b.add_section(group, s:spc . get(s:number_map, l:index, '') . '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)' . s:spc)
|
||||
else
|
||||
call b.add_section(group, '['.l:index.s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.']')
|
||||
endif
|
||||
let l:index = l:index + 1
|
||||
else
|
||||
call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
|
||||
endif
|
||||
endfor
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
if s:show_tab_type
|
||||
call b.add_section('airline_tabtype', ' buffers ')
|
||||
endif
|
||||
|
||||
let s:current_bufnr = cur
|
||||
let s:current_tabline = b.build()
|
||||
return s:current_tabline
|
||||
endfunction
|
||||
|
||||
function! s:get_visible_buffers()
|
||||
let buffers = airline#extensions#tabline#buflist#list()
|
||||
let cur = bufnr('%')
|
||||
|
||||
let total_width = 0
|
||||
let max_width = 0
|
||||
|
||||
for nr in buffers
|
||||
let width = len(airline#extensions#tabline#get_buffer_name(nr)) + 4
|
||||
let total_width += width
|
||||
let max_width = max([max_width, width])
|
||||
endfor
|
||||
|
||||
" only show current and surrounding buffers if there are too many buffers
|
||||
let position = index(buffers, cur)
|
||||
let vimwidth = &columns
|
||||
if total_width > vimwidth && position > -1
|
||||
let buf_count = len(buffers)
|
||||
|
||||
" determine how many buffers to show based on the longest buffer width,
|
||||
" use one on the right side and put the rest on the left
|
||||
let buf_max = vimwidth / max_width
|
||||
let buf_right = 1
|
||||
let buf_left = max([0, buf_max - buf_right])
|
||||
|
||||
let start = max([0, position - buf_left])
|
||||
let end = min([buf_count, position + buf_right])
|
||||
|
||||
" fill up available space on the right
|
||||
if position < buf_left
|
||||
let end += (buf_left - position)
|
||||
endif
|
||||
|
||||
" fill up available space on the left
|
||||
if end > buf_count - 1 - buf_right
|
||||
let start -= max([0, buf_right - (buf_count - 1 - position)])
|
||||
endif
|
||||
|
||||
let buffers = eval('buffers[' . start . ':' . end . ']')
|
||||
|
||||
if start > 0
|
||||
call insert(buffers, -1, 0)
|
||||
endif
|
||||
|
||||
if end < buf_count - 1
|
||||
call add(buffers, -1)
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:current_visible_buffers = buffers
|
||||
return buffers
|
||||
endfunction
|
||||
|
||||
function! s:select_tab(buf_index)
|
||||
" no-op when called in the NERDTree buffer
|
||||
if exists('t:NERDTreeBufName') && bufname('%') == t:NERDTreeBufName
|
||||
return
|
||||
endif
|
||||
|
||||
let idx = a:buf_index
|
||||
if s:current_visible_buffers[0] == -1
|
||||
let idx = idx + 1
|
||||
endif
|
||||
|
||||
let buf = get(s:current_visible_buffers, idx, 0)
|
||||
if buf != 0
|
||||
exec 'b!' . buf
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:jump_to_tab(offset)
|
||||
let l = s:current_visible_buffers
|
||||
let i = index(l, bufnr('%'))
|
||||
if i > -1
|
||||
exec 'b!' . l[float2nr(fmod(i + a:offset, len(l)))]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function s:map_keys()
|
||||
if s:buffer_idx_mode
|
||||
noremap <silent> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
|
||||
endif
|
||||
endfunction
|
||||
42
autoload/airline/extensions/tabline/buflist.vim
Normal file
42
autoload/airline/extensions/tabline/buflist.vim
Normal file
@@ -0,0 +1,42 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:excludes = get(g:, 'airline#extensions#tabline#excludes', [])
|
||||
let s:exclude_preview = get(g:, 'airline#extensions#tabline#exclude_preview', 1)
|
||||
|
||||
function! airline#extensions#tabline#buflist#invalidate()
|
||||
unlet! s:current_buffer_list
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buflist#list()
|
||||
if exists('s:current_buffer_list')
|
||||
return s:current_buffer_list
|
||||
endif
|
||||
|
||||
let buffers = []
|
||||
let cur = bufnr('%')
|
||||
for nr in range(1, bufnr('$'))
|
||||
if buflisted(nr) && bufexists(nr)
|
||||
let toadd = 1
|
||||
for ex in s:excludes
|
||||
if match(bufname(nr), ex) >= 0
|
||||
let toadd = 0
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if getbufvar(nr, 'current_syntax') == 'qf'
|
||||
let toadd = 0
|
||||
endif
|
||||
if s:exclude_preview && getbufvar(nr, '&bufhidden') == 'wipe' && getbufvar(nr, '&buftype') == 'nofile'
|
||||
let toadd = 0
|
||||
endif
|
||||
if toadd
|
||||
call add(buffers, nr)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
let s:current_buffer_list = buffers
|
||||
return buffers
|
||||
endfunction
|
||||
|
||||
25
autoload/airline/extensions/tabline/combined.vim
Normal file
25
autoload/airline/extensions/tabline/combined.vim
Normal file
@@ -0,0 +1,25 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! airline#extensions#tabline#combined#get()
|
||||
let curtabnr = tabpagenr()
|
||||
let b = airline#extensions#tabline#new_builder()
|
||||
|
||||
let buffers = tabpagebuflist(curtabnr)
|
||||
for nr in buffers
|
||||
let group = airline#extensions#tabline#group_of_bufnr(buffers, nr)
|
||||
call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
|
||||
endfor
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
|
||||
for tabnr in range(1, tabpagenr('$'))
|
||||
let group = tabnr == curtabnr ? 'airline_tabtype' : 'airline_tab'
|
||||
call b.add_section(group, s:spc . 'tab' . s:spc . tabnr . s:spc . '%' . tabnr . 'X' . 'x' . '%X' . s:spc)
|
||||
endfor
|
||||
return b.build()
|
||||
endfunction
|
||||
39
autoload/airline/extensions/tabline/formatters/default.vim
Normal file
39
autoload/airline/extensions/tabline/formatters/default.vim
Normal file
@@ -0,0 +1,39 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
|
||||
let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
|
||||
let s:fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
|
||||
let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ')
|
||||
let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
|
||||
let s:buf_modified_symbol = g:airline_symbols.modified
|
||||
|
||||
function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
|
||||
let _ = ''
|
||||
|
||||
let name = bufname(a:bufnr)
|
||||
if empty(name)
|
||||
let _ .= '[No Name]'
|
||||
else
|
||||
if s:fnamecollapse
|
||||
let _ .= substitute(fnamemodify(name, s:fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
|
||||
else
|
||||
let _ .= fnamemodify(name, s:fmod)
|
||||
endif
|
||||
if a:bufnr != bufnr('%') && s:fnametruncate && strlen(_) > s:fnametruncate
|
||||
let _ = strpart(_, 0, s:fnametruncate)
|
||||
endif
|
||||
endif
|
||||
|
||||
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name)
|
||||
let _ = s:buf_nr_show ? printf(s:buf_nr_format, a:bufnr) : ''
|
||||
let _ .= substitute(a:buffer_name, '\\', '/', 'g')
|
||||
|
||||
if getbufvar(a:bufnr, '&modified') == 1
|
||||
let _ .= s:buf_modified_symbol
|
||||
endif
|
||||
return _
|
||||
endfunction
|
||||
@@ -0,0 +1,32 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffers)
|
||||
let duplicates = {}
|
||||
let tails = {}
|
||||
let map = {}
|
||||
for nr in a:buffers
|
||||
let name = bufname(nr)
|
||||
if empty(name)
|
||||
let map[nr] = '[No Name]'
|
||||
else
|
||||
let tail = fnamemodify(name, ':s?/\+$??:t')
|
||||
if has_key(tails, tail)
|
||||
let duplicates[nr] = nr
|
||||
endif
|
||||
let tails[tail] = 1
|
||||
let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, tail)
|
||||
endif
|
||||
endfor
|
||||
|
||||
for nr in values(duplicates)
|
||||
let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, fnamemodify(bufname(nr), ':p:.'))
|
||||
endfor
|
||||
|
||||
if has_key(map, a:bufnr)
|
||||
return map[a:bufnr]
|
||||
endif
|
||||
|
||||
" if we get here, the buffer list isn't in sync with the selected buffer yet, fall back to the default
|
||||
return airline#extensions#tabline#formatters#default#format(a:bufnr, a:buffers)
|
||||
endfunction
|
||||
@@ -0,0 +1,91 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:skip_symbol = '…'
|
||||
|
||||
function! airline#extensions#tabline#formatters#unique_tail_improved#format(bufnr, buffers)
|
||||
if len(a:buffers) <= 1 " don't need to compare bufnames if has less than one buffer opened
|
||||
return airline#extensions#tabline#formatters#default#format(a:bufnr, a:buffers)
|
||||
endif
|
||||
|
||||
let curbuf_tail = fnamemodify(bufname(a:bufnr), ':t')
|
||||
let do_deduplicate = 0
|
||||
let path_tokens = {}
|
||||
|
||||
for nr in a:buffers
|
||||
let name = bufname(nr)
|
||||
if !empty(name) && nr != a:bufnr && fnamemodify(name, ':t') == curbuf_tail " only perform actions if curbuf_tail isn't unique
|
||||
let do_deduplicate = 1
|
||||
let tokens = reverse(split(substitute(fnamemodify(name, ':p:h'), '\\', '/', 'g'), '/'))
|
||||
let token_index = 0
|
||||
for token in tokens
|
||||
if token == '' | continue | endif
|
||||
if token == '.' | break | endif
|
||||
if !has_key(path_tokens, token_index)
|
||||
let path_tokens[token_index] = {}
|
||||
endif
|
||||
let path_tokens[token_index][token] = 1
|
||||
let token_index += 1
|
||||
endfor
|
||||
endif
|
||||
endfor
|
||||
|
||||
if do_deduplicate == 1
|
||||
let path = []
|
||||
let token_index = 0
|
||||
for token in reverse(split(substitute(fnamemodify(bufname(a:bufnr), ':p:h'), '\\', '/', 'g'), '/'))
|
||||
if token == '.' | break | endif
|
||||
let duplicated = 0
|
||||
let uniq = 1
|
||||
let single = 1
|
||||
if has_key(path_tokens, token_index)
|
||||
let duplicated = 1
|
||||
if len(keys(path_tokens[token_index])) > 1 | let single = 0 | endif
|
||||
if has_key(path_tokens[token_index], token) | let uniq = 0 | endif
|
||||
endif
|
||||
call insert(path, {'token': token, 'duplicated': duplicated, 'uniq': uniq, 'single': single})
|
||||
let token_index += 1
|
||||
endfor
|
||||
|
||||
let buf_name = [curbuf_tail]
|
||||
let has_uniq = 0
|
||||
let has_skipped = 0
|
||||
for token1 in reverse(path)
|
||||
if !token1['duplicated'] && len(buf_name) > 1
|
||||
call insert(buf_name, s:skip_symbol)
|
||||
let has_skipped = 0
|
||||
break
|
||||
endif
|
||||
|
||||
if has_uniq == 1
|
||||
call insert(buf_name, s:skip_symbol)
|
||||
let has_skipped = 0
|
||||
break
|
||||
endif
|
||||
|
||||
if token1['uniq'] == 0 && token1['single'] == 1
|
||||
let has_skipped = 1
|
||||
else
|
||||
if has_skipped == 1
|
||||
call insert(buf_name, s:skip_symbol)
|
||||
let has_skipped = 0
|
||||
endif
|
||||
call insert(buf_name, token1['token'])
|
||||
endif
|
||||
|
||||
if token1['uniq'] == 1
|
||||
let has_uniq = 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
if has_skipped == 1
|
||||
call insert(buf_name, s:skip_symbol)
|
||||
endif
|
||||
|
||||
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, join(buf_name, '/'))
|
||||
else
|
||||
return airline#extensions#tabline#formatters#default#format(a:bufnr, a:buffers)
|
||||
endif
|
||||
endfunction
|
||||
106
autoload/airline/extensions/tabline/tabs.vim
Normal file
106
autoload/airline/extensions/tabline/tabs.vim
Normal file
@@ -0,0 +1,106 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
|
||||
let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
|
||||
let s:show_close_button = get(g:, 'airline#extensions#tabline#show_close_button', 1)
|
||||
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
let s:close_symbol = get(g:, 'airline#extensions#tabline#close_symbol', 'X')
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
let s:current_modified = 0
|
||||
|
||||
function! airline#extensions#tabline#tabs#off()
|
||||
augroup airline_tabline_tabs
|
||||
autocmd!
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#tabs#on()
|
||||
augroup airline_tabline_tabs
|
||||
autocmd!
|
||||
autocmd BufDelete * call airline#extensions#tabline#tabs#invalidate()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#tabs#invalidate()
|
||||
let s:current_bufnr = -1
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#tabs#get()
|
||||
let curbuf = bufnr('%')
|
||||
let curtab = tabpagenr()
|
||||
call s:map_keys()
|
||||
if curbuf == s:current_bufnr && curtab == s:current_tabnr
|
||||
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified
|
||||
return s:current_tabline
|
||||
endif
|
||||
endif
|
||||
|
||||
let b = airline#extensions#tabline#new_builder()
|
||||
|
||||
let buffers = tabpagebuflist(curtab)
|
||||
for nr in buffers
|
||||
let group = airline#extensions#tabline#group_of_bufnr(buffers, nr)
|
||||
call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
|
||||
endfor
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
|
||||
for i in range(1, tabpagenr('$'))
|
||||
if i == curtab
|
||||
let group = 'airline_tabsel'
|
||||
if g:airline_detect_modified
|
||||
for bi in tabpagebuflist(i)
|
||||
if getbufvar(bi, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
else
|
||||
let group = 'airline_tab'
|
||||
endif
|
||||
" if s:show_tab_nr
|
||||
" if s:tab_nr_type == 0
|
||||
" let tablen = s:spc . '%{len(tabpagebuflist('.i.'))}'
|
||||
" elseif s:tab_nr_type == 1
|
||||
" let tablen = s:spc . i
|
||||
" else "== 2
|
||||
" let tablen = s:spc . i . '.%{len(tabpagebuflist('.i.'))}'
|
||||
" endif
|
||||
" endif
|
||||
call b.add_section(group, '%T'.i.' tab ' . i)
|
||||
endfor
|
||||
|
||||
" if s:show_close_button
|
||||
" call b.add_section('airline_tab', ' %999X'.s:close_symbol.' ')
|
||||
" endif
|
||||
" if s:show_tab_type
|
||||
" call b.add_section('airline_tabtype', ' tabs ')
|
||||
" endif
|
||||
|
||||
let s:current_bufnr = curbuf
|
||||
let s:current_tabnr = curtab
|
||||
let s:current_tabline = b.build()
|
||||
return s:current_tabline
|
||||
endfunction
|
||||
|
||||
function s:map_keys()
|
||||
noremap <silent> <Plug>AirlineSelectTab1 :1tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab2 :2tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab3 :3tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab4 :4tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab5 :5tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab6 :6tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab7 :7tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab8 :8tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab9 :9tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectPrevTab gT
|
||||
" tabn {count} goes to count tab does not go {count} tab pages forward!
|
||||
noremap <silent> <Plug>AirlineSelectNextTab :<C-U>exe repeat(':tabn\|', v:count1)<cr>
|
||||
endfunction
|
||||
@@ -1,12 +1,19 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':TagbarToggle')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:flags = get(g:, 'airline#extensions#tagbar#flags', '')
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
" 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.' ')
|
||||
call builder.add_section('airline_a', s:spc.'Tagbar'.s:spc)
|
||||
call builder.add_section('airline_b', s:spc.a:2.s:spc)
|
||||
call builder.add_section('airline_c', s:spc.a:3.s:spc)
|
||||
return builder.build()
|
||||
endfunction
|
||||
|
||||
@@ -16,11 +23,23 @@ function! airline#extensions#tagbar#inactive_apply(...)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:airline_tagbar_last_lookup_time = 0
|
||||
let s:airline_tagbar_last_lookup_val = ''
|
||||
function! airline#extensions#tagbar#currenttag()
|
||||
if get(w:, 'airline_active', 0)
|
||||
if s:airline_tagbar_last_lookup_time != localtime()
|
||||
let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags)
|
||||
let s:airline_tagbar_last_lookup_time = localtime()
|
||||
endif
|
||||
return s:airline_tagbar_last_lookup_val
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tagbar#init(ext)
|
||||
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
|
||||
call airline#parts#define_function('tagbar', 'airline#extensions#tagbar#currenttag')
|
||||
endfunction
|
||||
|
||||
|
||||
26
autoload/airline/extensions/tmuxline.vim
Normal file
26
autoload/airline/extensions/tmuxline.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':Tmuxline')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:tmuxline_snapshot_file = get(g:, 'airline#extensions#tmuxline#snapshot_file', '')
|
||||
let s:color_template = get(g:, 'airline#extensions#tmuxline#color_template', 'normal')
|
||||
|
||||
function! airline#extensions#tmuxline#init(ext)
|
||||
call a:ext.add_theme_func('airline#extensions#tmuxline#set_tmux_colors')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tmuxline#set_tmux_colors(palette)
|
||||
let color_template = has_key(a:palette, s:color_template) ? s:color_template : 'normal'
|
||||
let mode_palette = a:palette[color_template]
|
||||
|
||||
let tmuxline_theme = tmuxline#api#create_theme_from_airline(mode_palette)
|
||||
call tmuxline#api#set_theme(tmuxline_theme)
|
||||
|
||||
if strlen(s:tmuxline_snapshot_file)
|
||||
call tmuxline#api#snapshot(s:tmuxline_snapshot_file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':UndotreeToggle')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#undotree#apply(...)
|
||||
if exists('t:undotree')
|
||||
if &ft == 'undotree'
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_unite', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
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_b', ' %{get(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} ')
|
||||
call a:1.add_section('airline_y', ' %{get(unite#get_context(), "real_buffer_name", "")} ')
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,13 +1,29 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
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()}')
|
||||
if &filetype =~# "python"
|
||||
if get(g:, 'virtualenv_loaded', 0)
|
||||
let statusline = virtualenv#statusline()
|
||||
else
|
||||
let statusline = fnamemodify($VIRTUAL_ENV, ':t')
|
||||
endif
|
||||
if !empty(statusline)
|
||||
call airline#extensions#append_to_section('x',
|
||||
\ s:spc.g:airline_right_alt_sep.s:spc.statusline)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#virtualenv#update()
|
||||
if &filetype =~# "python"
|
||||
call airline#extensions#virtualenv#apply()
|
||||
call airline#update_statusline()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
|
||||
@@ -10,71 +10,107 @@ 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:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)
|
||||
let s:default_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:long_format = get(g:, 'airline#extensions#whitespace#long_format', 'long[%s]')
|
||||
let s:indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
|
||||
|
||||
let s:initialized = 0
|
||||
let s:enabled = 1
|
||||
let s:max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
|
||||
|
||||
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
|
||||
|
||||
function! s:check_mixed_indent()
|
||||
if s:indent_algo == 1
|
||||
" [<tab>]<space><tab>
|
||||
" spaces before or between tabs are not allowed
|
||||
let t_s_t = '(^\t* +\t\s*\S)'
|
||||
" <tab>(<space> x count)
|
||||
" count of spaces at the end of tabs should be less than tabstop value
|
||||
let t_l_s = '(^\t+ {' . &ts . ',}' . '\S)'
|
||||
return search('\v' . t_s_t . '|' . t_l_s, 'nw')
|
||||
elseif s:indent_algo == 2
|
||||
return search('\v(^\t* +\t\s*\S)', 'nw')
|
||||
else
|
||||
return search('\v(^\t+ +)|(^ +\t+)', 'nw')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#check()
|
||||
if &readonly || !s:enabled
|
||||
if &readonly || !&modifiable || !s:enabled || line('$') > s:max_lines
|
||||
return ''
|
||||
endif
|
||||
|
||||
if !exists('b:airline_whitespace_check')
|
||||
let b:airline_whitespace_check = ''
|
||||
let checks = get(g:, 'airline#extensions#whitespace#checks', s:default_checks)
|
||||
|
||||
let trailing = 0
|
||||
if index(s:checks, 'trailing') > -1
|
||||
let trailing = search(' $', 'nw')
|
||||
if index(checks, 'trailing') > -1
|
||||
try
|
||||
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
|
||||
let trailing = search(regexp, 'nw')
|
||||
catch
|
||||
echomsg 'airline#whitespace: error occured evaluating '. regexp
|
||||
echomsg v:exception
|
||||
return ''
|
||||
endtry
|
||||
endif
|
||||
|
||||
let mixed = 0
|
||||
if index(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
|
||||
if index(checks, 'indent') > -1
|
||||
let mixed = s:check_mixed_indent()
|
||||
endif
|
||||
|
||||
if trailing != 0 || mixed
|
||||
let b:airline_whitespace_check = s:symbol." "
|
||||
let long = 0
|
||||
if index(checks, 'long') > -1 && &tw > 0
|
||||
let long = search('\%>'.&tw.'v.\+', 'nw')
|
||||
endif
|
||||
|
||||
if trailing != 0 || mixed != 0 || long != 0
|
||||
let b:airline_whitespace_check = s:symbol
|
||||
if s:show_message
|
||||
if trailing != 0
|
||||
let b:airline_whitespace_check .= printf(s:trailing_format, trailing).' '
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:trailing_format, trailing)
|
||||
endif
|
||||
if mixed
|
||||
let mixnr = indents[0] == indents[1] ? indents[0] : indents[2]
|
||||
let b:airline_whitespace_check .= printf(s:mixed_indent_format, mixnr).' '
|
||||
if mixed != 0
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_format, mixed)
|
||||
endif
|
||||
if long != 0
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:long_format, long)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return b:airline_whitespace_check
|
||||
endfunction!
|
||||
|
||||
function! airline#extensions#whitespace#apply(...)
|
||||
call airline#extensions#append_to_section('warning', ' %{airline#extensions#whitespace#check()}')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#toggle()
|
||||
if s:enabled
|
||||
autocmd! airline_whitespace CursorHold,BufWritePost
|
||||
augroup airline_whitespace
|
||||
autocmd!
|
||||
augroup END
|
||||
augroup! airline_whitespace
|
||||
let s:enabled = 0
|
||||
else
|
||||
call airline#extensions#whitespace#init()
|
||||
let s:enabled = 1
|
||||
endif
|
||||
|
||||
if exists("g:airline#extensions#whitespace#enabled")
|
||||
let g:airline#extensions#whitespace#enabled = s:enabled
|
||||
if s:enabled && match(g:airline_section_warning, '#whitespace#check') < 0
|
||||
let g:airline_section_warning .= airline#section#create(['whitespace'])
|
||||
call airline#update_statusline()
|
||||
endif
|
||||
endif
|
||||
echo 'Whitespace checking: '.(s:enabled ? 'Enabled' : 'Disabled')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#init(...)
|
||||
if !s:initialized
|
||||
let s:initialized = 1
|
||||
call airline#add_statusline_func('airline#extensions#whitespace#apply')
|
||||
endif
|
||||
call airline#parts#define_function('whitespace', 'airline#extensions#whitespace#check')
|
||||
|
||||
unlet! b:airline_whitespace_check
|
||||
augroup airline_whitespace
|
||||
|
||||
23
autoload/airline/extensions/windowswap.vim
Normal file
23
autoload/airline/extensions/windowswap.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists('g:loaded_windowswap')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
if !exists('g:airline#extensions#windowswap#indicator_text')
|
||||
let g:airline#extensions#windowswap#indicator_text = 'WS'
|
||||
endif
|
||||
|
||||
function! airline#extensions#windowswap#init(ext)
|
||||
call airline#parts#define_function('windowswap', 'airline#extensions#windowswap#get_status')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#windowswap#get_status()
|
||||
if WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr()
|
||||
return g:airline#extensions#windowswap#indicator_text.s:spc
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
30
autoload/airline/extensions/wordcount.vim
Normal file
30
autoload/airline/extensions/wordcount.vim
Normal file
@@ -0,0 +1,30 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:filetypes = get(g:, 'airline#extensions#wordcount#filetypes', '\vhelp|markdown|rst|org|text')
|
||||
let s:format = get(g:, 'airline#extensions#wordcount#format', '%d words')
|
||||
let s:formatter = get(g:, 'airline#extensions#wordcount#formatter', 'default')
|
||||
|
||||
function! s:update()
|
||||
if match(&ft, s:filetypes) > -1
|
||||
if get(b:, 'airline_wordcount_cache', '') is# '' ||
|
||||
\ b:airline_wordcount_cache isnot# get(b:, 'airline_wordcount', '') ||
|
||||
\ get(b:, 'airline_change_tick', 0) != b:changedtick
|
||||
" cache data
|
||||
let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format()
|
||||
let b:airline_wordcount_cache = b:airline_wordcount
|
||||
let b:airline_change_tick = b:changedtick
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#wordcount#apply(...)
|
||||
if &ft =~ s:filetypes
|
||||
call airline#extensions#prepend_to_section('z', '%{get(b:, "airline_wordcount", "")}')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#wordcount#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#wordcount#apply')
|
||||
autocmd BufReadPost,CursorMoved,CursorMovedI * call s:update()
|
||||
endfunction
|
||||
48
autoload/airline/extensions/wordcount/formatters/default.vim
Normal file
48
autoload/airline/extensions/wordcount/formatters/default.vim
Normal file
@@ -0,0 +1,48 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#wordcount#formatters#default#format()
|
||||
let words = string(s:wordcount())
|
||||
if empty(words)
|
||||
return
|
||||
endif
|
||||
let separator = s:get_decimal_group()
|
||||
if words > 999 && !empty(separator)
|
||||
" Format number according to locale, e.g. German: 1.245 or English: 1,245
|
||||
let a = join(reverse(split(words, '.\zs')),'')
|
||||
let a = substitute(a, '...', '&'.separator, 'g')
|
||||
let words = join(reverse(split(a, '.\zs')),'')
|
||||
endif
|
||||
return words . " words" . g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
|
||||
endfunction
|
||||
|
||||
function! s:wordcount()
|
||||
if exists("*wordcount")
|
||||
return wordcount()['words']
|
||||
elseif mode() =~? 's'
|
||||
return
|
||||
else
|
||||
let old_status = v:statusmsg
|
||||
let position = getpos(".")
|
||||
exe "silent normal! g\<c-g>"
|
||||
let stat = v:statusmsg
|
||||
call setpos('.', position)
|
||||
let v:statusmsg = old_status
|
||||
|
||||
let parts = split(stat)
|
||||
if len(parts) > 11
|
||||
return str2nr(parts[11])
|
||||
else
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function s:get_decimal_group()
|
||||
if match(v:lang, '\v\cC|en') > -1
|
||||
return ','
|
||||
elseif match(v:lang, '\v\cde|dk|fr') > -1
|
||||
return '.'
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
@@ -1,16 +1,60 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
|
||||
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running') && (empty($CONEMUBUILD) || &term !=? 'xterm')
|
||||
|
||||
let s:separators = {}
|
||||
let s:accents = {}
|
||||
|
||||
function! s:gui2cui(rgb, fallback)
|
||||
if a:rgb == ''
|
||||
return a:fallback
|
||||
elseif match(a:rgb, '^\%(NONE\|[fb]g\)$') > -1
|
||||
return a:rgb
|
||||
endif
|
||||
let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
|
||||
let rgb = [rgb[0] > 127 ? 4 : 0, rgb[1] > 127 ? 2 : 0, rgb[2] > 127 ? 1 : 0]
|
||||
return rgb[0]+rgb[1]+rgb[2]
|
||||
let rgb = map(split(a:rgb[1:], '..\zs'), '0 + ("0x".v:val)')
|
||||
return airline#msdos#round_msdos_colors(rgb)
|
||||
endfunction
|
||||
|
||||
function! s:get_syn(group, what)
|
||||
" need to pass in mode, known to break on 7.3.547
|
||||
let mode = has('gui_running') || (has("termtruecolor") && &guicolors == 1) ? 'gui' : 'cterm'
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode)
|
||||
if empty(color) || color == -1
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode)
|
||||
endif
|
||||
if empty(color) || color == -1
|
||||
if has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
|
||||
else
|
||||
let color = a:what ==# 'fg' ? 0 : 1
|
||||
endif
|
||||
endif
|
||||
return color
|
||||
endfunction
|
||||
|
||||
function! s:get_array(fg, bg, opts)
|
||||
let fg = a:fg
|
||||
let bg = a:bg
|
||||
return has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
\ ? [ fg, bg, '', '', join(a:opts, ',') ]
|
||||
\ : [ '', '', fg, bg, join(a:opts, ',') ]
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#get_highlight(group, ...)
|
||||
let fg = s:get_syn(a:group, 'fg')
|
||||
let bg = s:get_syn(a:group, 'bg')
|
||||
let reverse = has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
\ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui')
|
||||
\ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')
|
||||
\|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
|
||||
return reverse ? s:get_array(bg, fg, a:000) : s:get_array(fg, bg, a:000)
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#get_highlight2(fg, bg, ...)
|
||||
let fg = s:get_syn(a:fg[0], a:fg[1])
|
||||
let bg = s:get_syn(a:bg[0], a:bg[1])
|
||||
return s:get_array(fg, bg, a:000)
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#exec(group, colors)
|
||||
@@ -21,13 +65,13 @@ function! airline#highlighter#exec(group, colors)
|
||||
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] : '')
|
||||
\ get(colors, 0, '') isnot# '' ? 'guifg='.colors[0] : '',
|
||||
\ get(colors, 1, '') isnot# '' ? 'guibg='.colors[1] : '',
|
||||
\ get(colors, 2, '') isnot# '' ? 'ctermfg='.colors[2] : '',
|
||||
\ get(colors, 3, '') isnot# '' ? 'ctermbg='.colors[3] : '',
|
||||
\ get(colors, 4, '') isnot# '' ? 'gui='.colors[4] : '',
|
||||
\ get(colors, 4, '') isnot# '' ? 'cterm='.colors[4] : '',
|
||||
\ get(colors, 4, '') isnot# '' ? 'term='.colors[4] : '')
|
||||
endfunction
|
||||
|
||||
function! s:exec_separator(dict, from, to, inverse, suffix)
|
||||
@@ -44,15 +88,39 @@ function! s:exec_separator(dict, from, to, inverse, suffix)
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#load_theme()
|
||||
for winnr in filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
call airline#highlighter#highlight_modified_inactive(winbufnr(winnr))
|
||||
endfor
|
||||
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]
|
||||
call <sid>exec_separator({}, a:from, a:to, a:inverse, '')
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#add_accent(accent)
|
||||
let s:accents[a:accent] = 1
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#highlight_modified_inactive(bufnr)
|
||||
if getbufvar(a:bufnr, '&modified')
|
||||
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c')
|
||||
\ ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : []
|
||||
else
|
||||
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c')
|
||||
\ ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : []
|
||||
endif
|
||||
|
||||
if !empty(colors)
|
||||
call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#highlight(modes)
|
||||
let p = g:airline#themes#{g:airline_theme}#palette
|
||||
|
||||
" 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' : ''
|
||||
@@ -60,7 +128,27 @@ function! airline#highlighter#highlight(modes)
|
||||
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])
|
||||
let mode_colors = kvp[1]
|
||||
call airline#highlighter#exec(kvp[0].suffix, mode_colors)
|
||||
|
||||
for accent in keys(s:accents)
|
||||
if !has_key(p.accents, accent)
|
||||
continue
|
||||
endif
|
||||
let colors = copy(mode_colors)
|
||||
if p.accents[accent][0] != ''
|
||||
let colors[0] = p.accents[accent][0]
|
||||
endif
|
||||
if p.accents[accent][2] != ''
|
||||
let colors[2] = p.accents[accent][2]
|
||||
endif
|
||||
if len(colors) >= 5
|
||||
let colors[4] = get(p.accents[accent], 4, '')
|
||||
else
|
||||
call add(colors, get(p.accents[accent], 4, ''))
|
||||
endif
|
||||
call airline#highlighter#exec(kvp[0].suffix.'_'.accent, colors)
|
||||
endfor
|
||||
endfor
|
||||
|
||||
" TODO: optimize this
|
||||
|
||||
124
autoload/airline/init.vim
Normal file
124
autoload/airline/init.vim
Normal file
@@ -0,0 +1,124 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! s:check_defined(variable, default)
|
||||
if !exists(a:variable)
|
||||
let {a:variable} = a:default
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:loaded = 0
|
||||
function! airline#init#bootstrap()
|
||||
if s:loaded
|
||||
return
|
||||
endif
|
||||
let s:loaded = 1
|
||||
|
||||
let g:airline#init#bootstrapping = 1
|
||||
call s:check_defined('g:airline_left_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b0":">")
|
||||
call s:check_defined('g:airline_left_alt_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b1":">")
|
||||
call s:check_defined('g:airline_right_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b2":"<")
|
||||
call s:check_defined('g:airline_right_alt_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b3":"<")
|
||||
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_crypt', 1)
|
||||
call s:check_defined('g:airline_detect_iminsert', 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_mode_map', {})
|
||||
call extend(g:airline_mode_map, {
|
||||
\ '__' : '------',
|
||||
\ 'n' : 'NORMAL',
|
||||
\ 'i' : 'INSERT',
|
||||
\ 'R' : 'REPLACE',
|
||||
\ 'v' : 'VISUAL',
|
||||
\ 'V' : 'V-LINE',
|
||||
\ 'c' : 'COMMAND',
|
||||
\ '' : 'V-BLOCK',
|
||||
\ 's' : 'SELECT',
|
||||
\ 'S' : 'S-LINE',
|
||||
\ '' : 'S-BLOCK',
|
||||
\ 't' : 'TERMINAL',
|
||||
\ }, 'keep')
|
||||
|
||||
call s:check_defined('g:airline_theme_map', {})
|
||||
call extend(g:airline_theme_map, {
|
||||
\ 'Tomorrow.*': 'tomorrow',
|
||||
\ 'base16.*': 'base16',
|
||||
\ 'mo[l|n]okai': 'molokai',
|
||||
\ 'wombat.*': 'wombat',
|
||||
\ '.*zenburn.*': 'zenburn',
|
||||
\ '.*solarized.*': 'solarized',
|
||||
\ }, 'keep')
|
||||
|
||||
call s:check_defined('g:airline_symbols', {})
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'paste': get(g:, 'airline_paste_symbol', 'PASTE'),
|
||||
\ 'readonly': get(g:, 'airline_readonly_symbol', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a2" : 'RO'),
|
||||
\ 'whitespace': get(g:, 'airline_powerline_fonts', 0) ? "\u2739" : '!',
|
||||
\ 'linenr': get(g:, 'airline_linecolumn_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a1" : ':' ),
|
||||
\ 'branch': get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a0" : ''),
|
||||
\ 'modified': '+',
|
||||
\ 'space': ' ',
|
||||
\ 'crypt': get(g:, 'airline_crypt_symbol', nr2char(0x1F512)),
|
||||
\ }, 'keep')
|
||||
|
||||
call airline#parts#define('mode', {
|
||||
\ 'function': 'airline#parts#mode',
|
||||
\ 'accent': 'bold',
|
||||
\ })
|
||||
call airline#parts#define_function('iminsert', 'airline#parts#iminsert')
|
||||
call airline#parts#define_function('paste', 'airline#parts#paste')
|
||||
call airline#parts#define_function('crypt', 'airline#parts#crypt')
|
||||
call airline#parts#define_function('filetype', 'airline#parts#filetype')
|
||||
call airline#parts#define('readonly', {
|
||||
\ 'function': 'airline#parts#readonly',
|
||||
\ 'accent': 'red',
|
||||
\ })
|
||||
call airline#parts#define_raw('file', '%f%m')
|
||||
call airline#parts#define_raw('path', '%F%m')
|
||||
call airline#parts#define('linenr', {
|
||||
\ 'raw': '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#',
|
||||
\ 'accent': 'bold'})
|
||||
call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
|
||||
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace','windowswap'])
|
||||
call airline#parts#define_text('capslock', '')
|
||||
|
||||
unlet g:airline#init#bootstrapping
|
||||
endfunction
|
||||
|
||||
function! airline#init#sections()
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists('g:airline_section_a')
|
||||
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'capslock', 'iminsert'])
|
||||
endif
|
||||
if !exists('g:airline_section_b')
|
||||
let g:airline_section_b = airline#section#create(['hunks', 'branch'])
|
||||
endif
|
||||
if !exists('g:airline_section_c')
|
||||
if exists("+autochdir") && &autochdir == 1
|
||||
let g:airline_section_c = airline#section#create(['%<', 'path', spc, 'readonly'])
|
||||
else
|
||||
let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly'])
|
||||
endif
|
||||
endif
|
||||
if !exists('g:airline_section_gutter')
|
||||
let g:airline_section_gutter = airline#section#create(['%='])
|
||||
endif
|
||||
if !exists('g:airline_section_x')
|
||||
let g:airline_section_x = airline#section#create_right(['tagbar', 'filetype'])
|
||||
endif
|
||||
if !exists('g:airline_section_y')
|
||||
let g:airline_section_y = airline#section#create_right(['ffenc'])
|
||||
endif
|
||||
if !exists('g:airline_section_z')
|
||||
let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', ':%3v '])
|
||||
endif
|
||||
if !exists('g:airline_section_warning')
|
||||
let g:airline_section_warning = airline#section#create(['syntastic', 'eclim', 'whitespace'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
57
autoload/airline/msdos.vim
Normal file
57
autoload/airline/msdos.vim
Normal file
@@ -0,0 +1,57 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" basic 16 msdos from MSDOS
|
||||
" see output of color, should be
|
||||
" 0 Black
|
||||
" 1 DarkBlue
|
||||
" 2 DarkGreen
|
||||
" 3 DarkCyan
|
||||
" 4 DarkRed
|
||||
" 5 DarkMagenta
|
||||
" 6 Brown
|
||||
" 7 LightGray
|
||||
" 8 DarkGray
|
||||
" 9 Blue
|
||||
" 10 Green
|
||||
" 11 Cyan
|
||||
" 12 Red
|
||||
" 13 Magenta
|
||||
" 14 Yellow
|
||||
" 15 White
|
||||
|
||||
let s:basic16 = [
|
||||
\ [ 0x00, 0x00, 0x00 ],
|
||||
\ [ 0x00, 0x00, 0x80 ],
|
||||
\ [ 0x00, 0x80, 0x00 ],
|
||||
\ [ 0x00, 0x80, 0x80 ],
|
||||
\ [ 0x80, 0x00, 0x00 ],
|
||||
\ [ 0x80, 0x00, 0x80 ],
|
||||
\ [ 0x80, 0x80, 0x00 ],
|
||||
\ [ 0xC0, 0xC0, 0xC0 ],
|
||||
\ [ 0x80, 0x80, 0x80 ],
|
||||
\ [ 0x00, 0x00, 0xFF ],
|
||||
\ [ 0x00, 0xFF, 0x00 ],
|
||||
\ [ 0x00, 0xFF, 0xFF ],
|
||||
\ [ 0xFF, 0x00, 0x00 ],
|
||||
\ [ 0xFF, 0x00, 0xFF ],
|
||||
\ [ 0xFF, 0xFF, 0x00 ],
|
||||
\ [ 0xFF, 0xFF, 0xFF ]
|
||||
\ ]
|
||||
|
||||
function! airline#msdos#round_msdos_colors(rgblist)
|
||||
" Check for values from MSDOS 16 color terminal
|
||||
let best = []
|
||||
let min = 100000
|
||||
let list = s:basic16
|
||||
for value in list
|
||||
let t = abs(value[0] - a:rgblist[0]) +
|
||||
\ abs(value[1] - a:rgblist[1]) +
|
||||
\ abs(value[2] - a:rgblist[2])
|
||||
if min > t
|
||||
let min = t
|
||||
let best = value
|
||||
endif
|
||||
endfor
|
||||
return index(s:basic16, best)
|
||||
endfunction
|
||||
83
autoload/airline/parts.vim
Normal file
83
autoload/airline/parts.vim
Normal file
@@ -0,0 +1,83 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:parts = {}
|
||||
|
||||
" PUBLIC API {{{
|
||||
|
||||
function! airline#parts#define(key, config)
|
||||
let s:parts[a:key] = get(s:parts, a:key, {})
|
||||
if exists('g:airline#init#bootstrapping')
|
||||
call extend(s:parts[a:key], a:config, 'keep')
|
||||
else
|
||||
call extend(s:parts[a:key], a:config, 'force')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_function(key, name)
|
||||
call airline#parts#define(a:key, { 'function': a:name })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_text(key, text)
|
||||
call airline#parts#define(a:key, { 'text': a:text })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_raw(key, raw)
|
||||
call airline#parts#define(a:key, { 'raw': a:raw })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_minwidth(key, width)
|
||||
call airline#parts#define(a:key, { 'minwidth': a:width })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_condition(key, predicate)
|
||||
call airline#parts#define(a:key, { 'condition': a:predicate })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_accent(key, accent)
|
||||
call airline#parts#define(a:key, { 'accent': a:accent })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_empty(keys)
|
||||
for key in a:keys
|
||||
call airline#parts#define_raw(key, '')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#parts#get(key)
|
||||
return get(s:parts, a:key, {})
|
||||
endfunction
|
||||
|
||||
" }}}
|
||||
|
||||
function! airline#parts#mode()
|
||||
return get(w:, 'airline_current_mode', '')
|
||||
endfunction
|
||||
|
||||
function! airline#parts#crypt()
|
||||
return g:airline_detect_crypt && exists("+key") && !empty(&key) ? g:airline_symbols.crypt : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#paste()
|
||||
return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#iminsert()
|
||||
if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
|
||||
return toupper(b:keymap_name)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#readonly()
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#filetype()
|
||||
return &filetype
|
||||
endfunction
|
||||
|
||||
function! airline#parts#ffenc()
|
||||
return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '')
|
||||
endfunction
|
||||
|
||||
73
autoload/airline/section.vim
Normal file
73
autoload/airline/section.vim
Normal file
@@ -0,0 +1,73 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
call airline#init#bootstrap()
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! s:wrap_accent(part, value)
|
||||
if exists('a:part.accent')
|
||||
call airline#highlighter#add_accent(a:part.accent)
|
||||
return '%#__accent_'.(a:part.accent).'#'.a:value.'%#__restore__#'
|
||||
endif
|
||||
return a:value
|
||||
endfunction
|
||||
|
||||
function! s:create(parts, append)
|
||||
let _ = ''
|
||||
for idx in range(len(a:parts))
|
||||
let part = airline#parts#get(a:parts[idx])
|
||||
let val = ''
|
||||
|
||||
if exists('part.function')
|
||||
let func = (part.function).'()'
|
||||
elseif exists('part.text')
|
||||
let func = '"'.(part.text).'"'
|
||||
else
|
||||
if a:append > 0 && idx != 0
|
||||
let val .= s:spc.g:airline_left_alt_sep.s:spc
|
||||
endif
|
||||
if a:append < 0 && idx != 0
|
||||
let val = s:spc.g:airline_right_alt_sep.s:spc.val
|
||||
endif
|
||||
if exists('part.raw')
|
||||
let _ .= s:wrap_accent(part, val.(part.raw))
|
||||
continue
|
||||
else
|
||||
let _ .= s:wrap_accent(part, val.a:parts[idx])
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
|
||||
let minwidth = get(part, 'minwidth', 0)
|
||||
|
||||
if a:append > 0 && idx != 0
|
||||
let partval = printf('%%{airline#util#append(%s,%s)}', func, minwidth)
|
||||
elseif a:append < 0 && idx != len(a:parts) - 1
|
||||
let partval = printf('%%{airline#util#prepend(%s,%s)}', func, minwidth)
|
||||
else
|
||||
let partval = printf('%%{airline#util#wrap(%s,%s)}', func, minwidth)
|
||||
endif
|
||||
|
||||
if exists('part.condition')
|
||||
let partval = substitute(partval, '{', '\="{".(part.condition)." ? "', '')
|
||||
let partval = substitute(partval, '}', ' : ""}', '')
|
||||
endif
|
||||
|
||||
let val .= s:wrap_accent(part, partval)
|
||||
let _ .= val
|
||||
endfor
|
||||
return _
|
||||
endfunction
|
||||
|
||||
function! airline#section#create(parts)
|
||||
return s:create(a:parts, 0)
|
||||
endfunction
|
||||
|
||||
function! airline#section#create_left(parts)
|
||||
return s:create(a:parts, 1)
|
||||
endfunction
|
||||
|
||||
function! airline#section#create_right(parts)
|
||||
return s:create(a:parts, -1)
|
||||
endfunction
|
||||
|
||||
@@ -1,77 +1,67 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" generates a dictionary which defines the colors for each highlight group
|
||||
function! airline#themes#generate_color_map(section1, section2, section3, file)
|
||||
" guifg guibg ctermfg ctermbg gui/term
|
||||
return {
|
||||
\ '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! airline#themes#generate_color_map(sect1, sect2, sect3, ...)
|
||||
let palette = {
|
||||
\ 'airline_a': [ a:sect1[0] , a:sect1[1] , a:sect1[2] , a:sect1[3] , get(a:sect1 , 4 , '') ] ,
|
||||
\ 'airline_b': [ a:sect2[0] , a:sect2[1] , a:sect2[2] , a:sect2[3] , get(a:sect2 , 4 , '') ] ,
|
||||
\ 'airline_c': [ a:sect3[0] , a:sect3[1] , a:sect3[2] , a:sect3[3] , get(a:sect3 , 4 , '') ] ,
|
||||
\ }
|
||||
|
||||
function! s:get_syn(group, 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, mode)
|
||||
if a:0 > 0
|
||||
call extend(palette, {
|
||||
\ 'airline_x': [ a:1[0] , a:1[1] , a:1[2] , a:1[3] , get(a:1 , 4 , '' ) ] ,
|
||||
\ 'airline_y': [ a:2[0] , a:2[1] , a:2[2] , a:2[3] , get(a:2 , 4 , '' ) ] ,
|
||||
\ 'airline_z': [ a:3[0] , a:3[1] , a:3[2] , a:3[3] , get(a:3 , 4 , '' ) ] ,
|
||||
\ })
|
||||
else
|
||||
call extend(palette, {
|
||||
\ 'airline_x': [ a:sect3[0] , a:sect3[1] , a:sect3[2] , a:sect3[3] , '' ] ,
|
||||
\ 'airline_y': [ a:sect2[0] , a:sect2[1] , a:sect2[2] , a:sect2[3] , '' ] ,
|
||||
\ 'airline_z': [ a:sect1[0] , a:sect1[1] , a:sect1[2] , a:sect1[3] , '' ] ,
|
||||
\ })
|
||||
endif
|
||||
if empty(color) || color == -1
|
||||
if has('gui_running')
|
||||
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
|
||||
else
|
||||
let color = a:what ==# 'fg' ? 0 : 1
|
||||
endif
|
||||
endif
|
||||
return color
|
||||
endfunction
|
||||
|
||||
function! s:get_array(fg, bg, opts)
|
||||
let fg = a:fg
|
||||
let bg = a:bg
|
||||
return has('gui_running')
|
||||
\ ? [ fg, bg, '', '', join(a:opts, ',') ]
|
||||
\ : [ '', '', fg, bg, join(a:opts, ',') ]
|
||||
return palette
|
||||
endfunction
|
||||
|
||||
function! airline#themes#get_highlight(group, ...)
|
||||
let fg = s:get_syn(a:group, 'fg')
|
||||
let bg = s:get_syn(a:group, 'bg')
|
||||
return s:get_array(fg, bg, a:000)
|
||||
return call('airline#highlighter#get_highlight', [a:group] + a:000)
|
||||
endfunction
|
||||
|
||||
function! airline#themes#get_highlight2(fg, bg, ...)
|
||||
let fg = s:get_syn(a:fg[0], a:fg[1])
|
||||
let bg = s:get_syn(a:bg[0], a:bg[1])
|
||||
return s:get_array(fg, bg, a:000)
|
||||
return call('airline#highlighter#get_highlight2', [a:fg, a:bg] + a:000)
|
||||
endfunction
|
||||
|
||||
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
|
||||
if !has_key(a:palette[mode], 'airline_warning')
|
||||
let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ]
|
||||
endif
|
||||
endfor
|
||||
|
||||
let a:palette.accents = get(a:palette, 'accents', {})
|
||||
let a:palette.accents.bold = [ '', '', '', '', 'bold' ]
|
||||
let a:palette.accents.italic = [ '', '', '', '', 'italic' ]
|
||||
|
||||
if !has_key(a:palette.accents, 'red')
|
||||
let a:palette.accents.red = [ '#ff0000' , '' , 160 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'green')
|
||||
let a:palette.accents.green = [ '#008700' , '' , 22 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'blue')
|
||||
let a:palette.accents.blue = [ '#005fff' , '' , 27 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'yellow')
|
||||
let a:palette.accents.yellow = [ '#dfff00' , '' , 190 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'orange')
|
||||
let a:palette.accents.orange = [ '#df5f00' , '' , 166 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'purple')
|
||||
let a:palette.accents.purple = [ '#af00df' , '' , 128 , '' ]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -15,18 +15,21 @@ let s:V4 = [ '#c7915b' , 173 ] " coffee
|
||||
let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde
|
||||
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 s:IA = [ s:N3[1] , s:N2[1] , s:N3[3] , s:N2[3] , '' ]
|
||||
|
||||
let g:airline#themes#badwolf#palette = {}
|
||||
|
||||
let g:airline#themes#badwolf#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#badwolf#palette.accents = {
|
||||
\ 'red': [ '#ff2c4b' , '' , 196 , '' , '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#badwolf#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#badwolf#palette.normal_modified = {
|
||||
\ 'airline_b': [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#badwolf#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#badwolf#palette.insert_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#badwolf#palette.insert_paste = {
|
||||
@@ -38,10 +41,12 @@ let g:airline#themes#badwolf#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s
|
||||
let g:airline#themes#badwolf#palette.replace_modified = g:airline#themes#badwolf#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#badwolf#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#badwolf#palette.visual_modified = {
|
||||
\ 'airline_c': [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#badwolf#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function! s:load_constant()
|
||||
if get(g:, 'airline#themes#base16#constant', 0)
|
||||
let g:airline#themes#base16#palette = {}
|
||||
|
||||
" Color palette
|
||||
@@ -23,13 +23,11 @@ function! s:load_constant()
|
||||
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 = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
@@ -37,7 +35,7 @@ function! s:load_constant()
|
||||
" 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 = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
|
||||
let g:airline#themes#base16#palette.insert_modified = copy(g:airline#themes#base16#palette.normal_modified)
|
||||
let g:airline#themes#base16#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
@@ -53,57 +51,87 @@ function! s:load_constant()
|
||||
" 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 = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
|
||||
let g:airline#themes#base16#palette.visual_modified = copy(g:airline#themes#base16#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, 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 g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#base16#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
|
||||
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
|
||||
function! airline#themes#base16#refresh()
|
||||
let g:airline#themes#base16#palette = {}
|
||||
|
||||
let g:airline#themes#base16#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffText', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight2(['Visual', 'fg'], ['Visual', 'bg'])
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let group = airline#themes#get_highlight('vimCommand')
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'statusline': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffAdded', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['DiffAdded', 'fg'], ['Normal', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#base16#palette.insert_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['WarningMsg', 'fg'], 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#base16#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#base16#palette.replace_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['Constant', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#base16#palette.visual_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
" Use VertSplit's bg and default fg (reversed) for inactive statusline.
|
||||
let s:VS = airline#themes#get_highlight('VertSplit')
|
||||
let s:IA = [ s:VS[1], 'NONE', s:VS[2], 'NONE', 'reverse']
|
||||
let g:airline#themes#base16#palette.inactive =
|
||||
\ airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:IA, s:IA, s:IA)
|
||||
let s:IM = [ s:VS[1], 'NONE', s:VS[2], 'NONE', 'reverse,italic']
|
||||
let g:airline#themes#base16#palette.inactive_modified =
|
||||
\ airline#themes#generate_color_map(s:IM, s:IM, s:IM, s:IM, s:IM, s:IM)
|
||||
|
||||
" Warnings
|
||||
let s:WI = airline#themes#get_highlight2(['WarningMsg', 'bg'], ['WarningMsg', 'fg'], 'bold')
|
||||
let g:airline#themes#base16#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#base16#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#base16#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#base16#palette.insert.airline_warning =
|
||||
\ g:airline#themes#base16#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#base16#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#base16#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#base16#palette.visual.airline_warning =
|
||||
\ g:airline#themes#base16#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#base16#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#base16#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#base16#palette.replace.airline_warning =
|
||||
\ g:airline#themes#base16#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#base16#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#base16#palette.normal.airline_warning
|
||||
|
||||
endfunction
|
||||
call airline#themes#base16#refresh()
|
||||
endif
|
||||
|
||||
77
autoload/airline/themes/base16color.vim
Normal file
77
autoload/airline/themes/base16color.vim
Normal file
@@ -0,0 +1,77 @@
|
||||
" Normal mode
|
||||
" [ guifg, guibg, ctermfg, ctermbg, opts ]
|
||||
let s:N1 = [ '#141413' , '#CAE682' , 232 , 'green' ] " mode
|
||||
let s:N2 = [ '#CAE682' , '#32322F' , 'green' , 235 ] " info
|
||||
let s:N3 = [ '#CAE682' , '#242424' , 'green' , 234 ] " statusline
|
||||
let s:N4 = [ '#86CD74' , 'DarkGreen' ] " mode modified
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#141413' , '#FDE76E' , 232 , 'yellow' ]
|
||||
let s:I2 = [ '#FDE76E' , '#32322F' , 'yellow' , 235 ]
|
||||
let s:I3 = [ '#FDE76E' , '#242424' , 'yellow' , 234 ]
|
||||
let s:I4 = [ '#FADE3E' , 'yellow' ]
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#141413' , '#B5D3F3' , 232 , 'blue' ]
|
||||
let s:V2 = [ '#B5D3F3' , '#32322F' , 'blue' , 235 ]
|
||||
let s:V3 = [ '#B5D3F3' , '#242424' , 'blue' , 234 ]
|
||||
let s:V4 = [ '#7CB0E6' , 'blue' ]
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [ '#141413' , '#E5786D' , 232 , 'red' ]
|
||||
let s:R2 = [ '#E5786D' , '#32322F' , 'red' , 235 ]
|
||||
let s:R3 = [ '#E5786D' , '#242424' , 'red' , 234 ]
|
||||
let s:R4 = [ '#E55345' , 'red' ]
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#94E42C' , 005 ]
|
||||
|
||||
" Info modified
|
||||
let s:IM = [ '#40403C' , 236 ]
|
||||
|
||||
" Inactive mode
|
||||
let s:IA = [ '#767676' , s:N3[1] , 243 , s:N3[3] , '' ]
|
||||
|
||||
let g:airline#themes#base16color#palette = {}
|
||||
|
||||
let g:airline#themes#base16color#palette.accents = {
|
||||
\ 'red': [ '#E5786D' , '' , 203 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let g:airline#themes#base16color#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#base16color#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#base16color#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#base16color#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#base16color#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#base16color#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#base16color#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#base16color#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#base16color#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] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#base16color#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#base16color#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:N4[0] , '' , s:N4[1] , '' , '' ] }
|
||||
58
autoload/airline/themes/behelit.vim
Normal file
58
autoload/airline/themes/behelit.vim
Normal file
@@ -0,0 +1,58 @@
|
||||
let g:airline#themes#behelit#palette = {}
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#121212', '#5f87ff', 233, 69 ]
|
||||
let s:N2 = [ '#5f87ff', '#262626', 69 , 235 ]
|
||||
let s:N3 = [ '#5f87ff', '#1c1c1c', 69 , 234, 'bold' ]
|
||||
let g:airline#themes#behelit#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#behelit#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#d7005f', '#1c1c1c', 161, 234, 'bold' ],
|
||||
\ }
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#121212', '#00ff87', 233, 48 ]
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#behelit#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#behelit#palette.insert_modified = g:airline#themes#behelit#palette.normal_modified
|
||||
let g:airline#themes#behelit#palette.insert_paste = {
|
||||
\ 'airline_a': [ "#121212", "#5f5faf", 233, 61, '' ],
|
||||
\ }
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#behelit#palette.replace = copy(g:airline#themes#behelit#palette.insert)
|
||||
let g:airline#themes#behelit#palette.replace.airline_a = [ s:I1[0], '#d70057', s:I1[2], 161, '' ]
|
||||
let g:airline#themes#behelit#palette.replace_modified = g:airline#themes#behelit#palette.insert_modified
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#121212', '#5fff5f', 233, 83 ]
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#behelit#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#behelit#palette.visual_modified = g:airline#themes#behelit#palette.normal_modified
|
||||
|
||||
" Inactive window
|
||||
let s:IA1 = [ '#4e4e4e', '#1c1c1c', 239, 234, '' ]
|
||||
let s:IA2 = [ '#4e4e4e', '#262626', 239, 235, '' ]
|
||||
let s:IA3 = [ '#4e4e4e', '#1c1c1c', 239, 234, 'bold' ]
|
||||
let g:airline#themes#behelit#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#behelit#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#5f5f87', '#1c1c1c', 60, 234, 'bold' ],
|
||||
\ }
|
||||
|
||||
" Accents
|
||||
let g:airline#themes#behelit#palette.accents = {
|
||||
\ 'red': [ '#d7005f', '', 161, '' ]
|
||||
\ }
|
||||
|
||||
" Warnings
|
||||
let s:WI = [ '#121212', '#d7005f', 233, 161 ]
|
||||
let g:airline#themes#behelit#palette.normal.airline_warning = s:WI
|
||||
let g:airline#themes#behelit#palette.normal_modified.airline_warning = s:WI
|
||||
let g:airline#themes#behelit#palette.insert.airline_warning = s:WI
|
||||
let g:airline#themes#behelit#palette.insert_modified.airline_warning = s:WI
|
||||
let g:airline#themes#behelit#palette.insert_paste.airline_warning = s:WI
|
||||
let g:airline#themes#behelit#palette.visual.airline_warning = s:WI
|
||||
let g:airline#themes#behelit#palette.visual_modified.airline_warning = s:WI
|
||||
let g:airline#themes#behelit#palette.replace.airline_warning = s:WI
|
||||
let g:airline#themes#behelit#palette.replace_modified.airline_warning = s:WI
|
||||
@@ -20,15 +20,13 @@ let s:cterm_red = 174
|
||||
let s:gui_pink = '#d7afd7'
|
||||
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#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#bubblegum#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#bubblegum#palette.normal_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
@@ -36,7 +34,7 @@ let g:airline#themes#bubblegum#palette.normal_modified = {
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
|
||||
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3, s:file)
|
||||
let g:airline#themes#bubblegum#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
|
||||
let g:airline#themes#bubblegum#palette.insert_modified = copy(g:airline#themes#bubblegum#palette.normal_modified)
|
||||
let g:airline#themes#bubblegum#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
@@ -52,10 +50,21 @@ let g:airline#themes#bubblegum#palette.replace_modified = copy(g:airline#themes#
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
|
||||
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3, s:file)
|
||||
let g:airline#themes#bubblegum#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
|
||||
let g:airline#themes#bubblegum#palette.visual_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#bubblegum#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let s:IA = [s:gui_light_gray, s:gui_med_gray_hi, s:cterm_light_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#bubblegum#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#bubblegum#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
|
||||
" CtrlP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#bubblegum#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, '' ] ,
|
||||
\ [ s:gui_orange, s:gui_med_gray_lo, s:cterm_orange, s:cterm_med_gray_lo, '' ] ,
|
||||
\ [ s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green, 'bold' ] )
|
||||
|
||||
63
autoload/airline/themes/cool.vim
Executable file
63
autoload/airline/themes/cool.vim
Executable file
@@ -0,0 +1,63 @@
|
||||
let g:airline#themes#cool#palette = {}
|
||||
|
||||
" NORMAL
|
||||
let s:N1 = [ '#585858' , '#E4E4E4' , 17 , 190 ]
|
||||
let s:N2 = [ '#E4E4E4' , '#0087AF' , 255 , 238 ]
|
||||
let s:N3 = [ '#EEEEEE' , '#005F87' , 85 , 234 ]
|
||||
let g:airline#themes#cool#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
"let g:airline#themes#cool#palette.normal_modified = {
|
||||
"\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
"\ }
|
||||
|
||||
" INSERT
|
||||
let s:I1 = [ '#585858' , '#E4E4E4' , 17 , 45 ]
|
||||
let s:I2 = [ '#E4E4E4' , '#47AF00' , 255 , 27 ]
|
||||
let s:I3 = [ '#EEEEEE' , '#2E8700' , 15 , 17 ]
|
||||
let g:airline#themes#cool#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
"let g:airline#themes#cool#palette.insert_modified = {
|
||||
"\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
"\ }
|
||||
"let g:airline#themes#cool#palette.insert_paste = {
|
||||
"\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
"\ }
|
||||
|
||||
" REPLACE
|
||||
let s:R1 = [ '#585858' , '#E4E4E4' , 17 , 45 ]
|
||||
let s:R2 = [ '#E4E4E4' , '#AF5F00' , 255 , 27 ]
|
||||
let s:R3 = [ '#EEEEEE' , '#875300' , 15 , 17 ]
|
||||
let g:airline#themes#cool#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
"let g:airline#themes#cool#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
|
||||
"let g:airline#themes#cool#palette.replace_modified = g:airline#themes#cool#palette.insert_modified
|
||||
|
||||
" VISUAL
|
||||
let s:V1 = [ '#585858' , '#E4E4E4' , 232 , 214 ]
|
||||
let s:V2 = [ '#E4E4E4' , '#AF2800' , 232 , 202 ]
|
||||
let s:V3 = [ '#EEEEEE' , '#872800' , 15 , 52 ]
|
||||
let g:airline#themes#cool#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
"let g:airline#themes#cool#palette.visual_modified = {
|
||||
"\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
"\ }
|
||||
|
||||
" INACTIVE
|
||||
let s:IA1 = [ '#585858' , '#E4E4E4' , 239 , 234 , '' ]
|
||||
let s:IA2 = [ '#E4E4E4' , '#466D79' , 239 , 235 , '' ]
|
||||
let s:IA3 = [ '#EEEEEE' , '#324E59' , 239 , 236 , '' ]
|
||||
let g:airline#themes#cool#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
"let g:airline#themes#cool#palette.inactive_modified = {
|
||||
"\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
"\ }
|
||||
|
||||
|
||||
let g:airline#themes#cool#palette.accents = {
|
||||
\ 'red': [ '#ff0000' , '' , 160 , '' ]
|
||||
\ }
|
||||
|
||||
" CTRLP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#cool#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#E4E4E4' , '#00AFA2' , 231 , 98 , '' ],
|
||||
\ [ '#EEEEEE' , '#008787' , 55 , 231 , '' ],
|
||||
\ [ '#585858' , '#E4E4E4' , 189 , 55 , '' ])
|
||||
|
||||
@@ -16,35 +16,22 @@
|
||||
" simply overwrite the previous colors. If you want simultaneous overrides,
|
||||
" then they will need to change different parts of the statusline so they do
|
||||
" not conflict with each other.
|
||||
|
||||
" First let's define some arrays. The s: is just a VimL thing for scoping the
|
||||
" variables to the current script. Without this, these variables would be
|
||||
" declared globally.
|
||||
"
|
||||
" The array is in the format [ guifg, guibg, ctermfg, ctermbg, opts ].
|
||||
" The opts takes in values from ":help attr-list".
|
||||
" First, let's define an empty dictionary and assign it to the "palette"
|
||||
" 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 = {}
|
||||
|
||||
" First let's define some arrays. The s: is just a VimL thing for scoping the
|
||||
" variables to the current script. Without this, these variables would be
|
||||
" declared globally. Now let's declare some colors for normal mode and add it
|
||||
" to the dictionary. The array is in the format:
|
||||
" [ guifg, guibg, ctermfg, ctermbg, opts ]. See "help attr-list" for valid
|
||||
" values for the "opt" value.
|
||||
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
|
||||
" function which generates a dictionary which declares the full colorscheme
|
||||
" for the statusline. See the source code of "autoload/airline/themes.vim"
|
||||
" for the full set of keys available for theming.
|
||||
|
||||
" 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)
|
||||
let g:airline#themes#dark#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
" Here we define overrides for when the buffer is modified. This will be
|
||||
" applied after g:airline#themes#dark#palette.normal, hence why only certain keys are
|
||||
@@ -57,7 +44,7 @@ let g:airline#themes#dark#palette.normal_modified = {
|
||||
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#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#dark#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#dark#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
@@ -74,7 +61,7 @@ let g:airline#themes#dark#palette.replace_modified = g:airline#themes#dark#palet
|
||||
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#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#dark#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#dark#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
@@ -83,7 +70,22 @@ let g:airline#themes#dark#palette.visual_modified = {
|
||||
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)
|
||||
let g:airline#themes#dark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#dark#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Accents are used to give parts within a section a slightly different look or
|
||||
" color. Here we are defining a "red" accent, which is used by the 'readonly'
|
||||
" part by default. Only the foreground colors are specified, so the background
|
||||
" colors are automatically extracted from the underlying section colors. What
|
||||
" this means is that regardless of which section the part is defined in, it
|
||||
" will be red instead of the section's foreground color. You can also have
|
||||
" multiple parts with accents within a section.
|
||||
let g:airline#themes#dark#palette.accents = {
|
||||
\ 'red': [ '#ff0000' , '' , 160 , '' ]
|
||||
\ }
|
||||
|
||||
|
||||
" Here we define the color map for ctrlp. We check for the g:loaded_ctrlp
|
||||
|
||||
59
autoload/airline/themes/distinguished.vim
Normal file
59
autoload/airline/themes/distinguished.vim
Normal file
@@ -0,0 +1,59 @@
|
||||
" vim-airline companion theme of distinguished
|
||||
" (https://github.com/Lokaltog/vim-distinguished)
|
||||
" I have nothing to do with the original
|
||||
" distinguished theme other than being a big fan.
|
||||
" this theme was shamelessly created by modifying
|
||||
" the Ubaryd airline theme.
|
||||
|
||||
let s:gray = [245, '#8a8a8a']
|
||||
let s:golden = [143, '#afaf5f']
|
||||
let s:pink = [131, '#af5f5f']
|
||||
let s:blue = [ 67, '#5f87af']
|
||||
let s:orange = [166, '#d75f00']
|
||||
let s:outerfg = [ 16, '#000000']
|
||||
let s:innerbg = [234, '#1c1c1c']
|
||||
let s:middle = ['#bcbcbc', '#444444', 250, 238]
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:outerfg[1], s:gray[1], s:outerfg[0], s:gray[0]]
|
||||
let s:N3 = [s:gray[1], s:innerbg[1], s:gray[0], s:innerbg[0]]
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:outerfg[1], s:golden[1], s:outerfg[0], s:golden[0]]
|
||||
let s:I3 = [s:golden[1], s:innerbg[1], s:golden[0], s:innerbg[0]]
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:outerfg[1], s:pink[1], s:outerfg[0], s:pink[0]]
|
||||
let s:V3 = [s:pink[1], s:innerbg[1], s:pink[0], s:innerbg[0]]
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [s:outerfg[1], s:blue[1], s:outerfg[0], s:blue[0]]
|
||||
let s:R3 = [s:blue[1], s:innerbg[1], s:blue[0], s:innerbg[0]]
|
||||
|
||||
" Inactive pane
|
||||
let s:IA = [s:middle[1], s:innerbg[1], s:middle[3], s:innerbg[0]]
|
||||
|
||||
let g:airline#themes#distinguished#palette = {}
|
||||
let g:airline#themes#distinguished#palette.accents = {
|
||||
\ 'red': ['#d70000', '', 160, '', '']}
|
||||
|
||||
let g:airline#themes#distinguished#palette.inactive = {
|
||||
\ 'airline_a': s:IA,
|
||||
\ 'airline_b': s:IA,
|
||||
\ 'airline_c': s:IA}
|
||||
|
||||
let g:airline#themes#distinguished#palette.normal = airline#themes#generate_color_map(s:N1, s:middle, s:N3)
|
||||
let g:airline#themes#distinguished#palette.normal_modified = {
|
||||
\ 'airline_a': ['', s:orange[1], '', s:orange[0], ''],
|
||||
\ 'airline_c': [s:orange[1], '', s:orange[0], '', ''],
|
||||
\ 'airline_x': [s:orange[1], '', s:orange[0], '', ''],
|
||||
\ 'airline_z': ['', s:orange[1], '', s:orange[0], '']}
|
||||
|
||||
let g:airline#themes#distinguished#palette.insert = airline#themes#generate_color_map(s:I1, s:middle, s:I3)
|
||||
let g:airline#themes#distinguished#palette.insert_modified = {}
|
||||
|
||||
let g:airline#themes#distinguished#palette.replace = airline#themes#generate_color_map(s:R1, s:middle, s:R3)
|
||||
let g:airline#themes#distinguished#palette.replace_modified = {}
|
||||
|
||||
let g:airline#themes#distinguished#palette.visual = airline#themes#generate_color_map(s:V1, s:middle, s:V3)
|
||||
let g:airline#themes#distinguished#palette.visual_modified = {}
|
||||
62
autoload/airline/themes/durant.vim
Normal file
62
autoload/airline/themes/durant.vim
Normal file
@@ -0,0 +1,62 @@
|
||||
let g:airline#themes#durant#palette = {}
|
||||
|
||||
|
||||
let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ]
|
||||
let s:N2 = [ '#93a1a1' , '#586e75' , 245 , 240 ]
|
||||
let s:N3 = [ '#93a1a1' , '#073642' , 240 , 233 ]
|
||||
let g:airline#themes#durant#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
|
||||
let g:airline#themes#durant#normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#9e9e9e' , '#303030' , 247 , 236 ]
|
||||
let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ]
|
||||
let g:airline#themes#durant#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#durant#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#durant#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#durant#palette.replace = copy(g:airline#themes#durant#palette.insert)
|
||||
let g:airline#themes#durant#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
|
||||
|
||||
let g:airline#themes#durant#palette.replace_modified = g:airline#themes#durant#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ]
|
||||
let s:V2 = [ '#ffffff' , '#44403a' , 255, 238 ]
|
||||
let s:V3 = [ '#90a680' , '#2e2d2a' , 64, 235 ]
|
||||
let g:airline#themes#durant#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#durant#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
|
||||
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
|
||||
let g:airline#themes#durant#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#durant#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#durant#palette.accents = {
|
||||
\ 'red': [ '#ff0000' , '' , 160 , '' ]
|
||||
\ }
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#durant#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
|
||||
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
|
||||
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
|
||||
|
||||
58
autoload/airline/themes/hybrid.vim
Normal file
58
autoload/airline/themes/hybrid.vim
Normal file
@@ -0,0 +1,58 @@
|
||||
" vim-airline companion theme of Hybrid
|
||||
" (https://github.com/w0ng/vim-hybrid)
|
||||
|
||||
let g:airline#themes#hybrid#palette = {}
|
||||
|
||||
function! airline#themes#hybrid#refresh()
|
||||
let s:N1 = airline#themes#get_highlight('DiffAdd')
|
||||
let s:N2 = airline#themes#get_highlight('CursorLine')
|
||||
let s:N3 = airline#themes#get_highlight('PMenu')
|
||||
let g:airline#themes#hybrid#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let modified_group = airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.normal_modified = {
|
||||
\ 'airline_c': airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
\ }
|
||||
|
||||
let warning_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.normal.airline_warning = warning_group
|
||||
let g:airline#themes#hybrid#palette.normal_modified.airline_warning = warning_group
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffText', 'bg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellLocal', 'bg'], 'bold')
|
||||
let s:I3 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellCap', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#hybrid#palette.insert_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.insert.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.insert_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('DiffChange')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#hybrid#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let replace_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.replace_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.replace.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.replace_modified.airline_warning = g:airline#themes#hybrid#palette.replace_modified.airline_warning
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Text', 'fg'], ['Folded', 'bg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V3 = airline#themes#get_highlight2(['Text', 'fg'], ['Error', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#hybrid#palette.visual_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.visual.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.visual_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#hybrid#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#hybrid#palette.inactive_modified = {
|
||||
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#hybrid#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#hybrid#refresh()
|
||||
34
autoload/airline/themes/hybridline.vim
Normal file
34
autoload/airline/themes/hybridline.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
" vim-airline theme based on vim-hybrid and powerline
|
||||
" (https://github.com/w0ng/vim-hybrid)
|
||||
" (https://github.com/Lokaltog/powerline)
|
||||
|
||||
let g:airline#themes#hybridline#palette = {}
|
||||
|
||||
let s:N1 = [ '#282a2e' , '#c5c8c6' , 'black' , 15 ]
|
||||
let s:N2 = [ '#c5c8c6' , '#373b41' , 15 , 8 ]
|
||||
let s:N3 = [ '#ffffff' , '#282a2e' , 255 , 'black' ]
|
||||
let g:airline#themes#hybridline#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#hybridline#palette.normal.airline_a = ['#005f00', '#b5bd68', 22, 10, '']
|
||||
|
||||
let s:I1 = [ '#005f5f' , '#8abeb7' , 23 , 14 ]
|
||||
let s:I2 = [ '#c5c8c6' , '#0087af' , 15 , 31 ]
|
||||
let s:I3 = [ '#ffffff' , '#005f87' , 255 , 24 ]
|
||||
let g:airline#themes#hybridline#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#hybridline#palette.insert_paste = {
|
||||
\ 'airline_a': ['#000000', '#ac4142', 16 , 1, ''] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#hybridline#palette.replace = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#hybridline#palette.replace.airline_a = ['#000000', '#CC6666', 16, 9]
|
||||
|
||||
let g:airline#themes#hybridline#palette.visual = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#hybridline#palette.visual.airline_a = ['#000000', '#de935f', 16, 3]
|
||||
|
||||
let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
|
||||
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
|
||||
let g:airline#themes#hybridline#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
|
||||
let g:airline#themes#hybridline#palette.accents = {
|
||||
\ 'red': [ '#ff0000' , '' , 160 , '' ]
|
||||
\ }
|
||||
@@ -1,6 +1,7 @@
|
||||
let g:airline#themes#jellybeans#palette = {}
|
||||
|
||||
function! s:generate()
|
||||
" The name of the function must be 'refresh'.
|
||||
function! airline#themes#jellybeans#refresh()
|
||||
" This theme is an example of how to use helper functions to extract highlight
|
||||
" values from the corresponding colorscheme. It was written in a hurry, so it
|
||||
" is very minimalistic. If you are a jellybeans user and want to make updates,
|
||||
@@ -11,9 +12,12 @@ 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')
|
||||
let s:file = airline#themes#get_highlight('Constant')
|
||||
|
||||
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.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let g:airline#themes#jellybeans#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#jellybeans#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffb964', '', 215, '', '' ]
|
||||
\ }
|
||||
@@ -21,13 +25,13 @@ function! s:generate()
|
||||
let s:I1 = airline#themes#get_highlight('DiffAdd', 'bold')
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#jellybeans#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#jellybeans#palette.insert_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('WildMenu', 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
|
||||
let g:airline#themes#jellybeans#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#jellybeans#palette.replace_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" Sometimes you want to mix and match colors from different groups, you can do
|
||||
@@ -35,16 +39,14 @@ function! s:generate()
|
||||
let s:V1 = airline#themes#get_highlight2(['TabLineSel', 'bg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#jellybeans#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#jellybeans#palette.visual_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" And of course, you can always do it manually as well.
|
||||
let s:IA = [ '#444444', '#1c1c1c', 237, 234 ]
|
||||
let g:airline#themes#jellybeans#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#jellybeans#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#jellybeans#palette.inactive_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
endfunction
|
||||
|
||||
call s:generate()
|
||||
augroup airline_jellybeans
|
||||
autocmd!
|
||||
autocmd ColorScheme * call <sid>generate()
|
||||
augroup END
|
||||
call airline#themes#jellybeans#refresh()
|
||||
|
||||
|
||||
70
autoload/airline/themes/kalisi.vim
Normal file
70
autoload/airline/themes/kalisi.vim
Normal file
@@ -0,0 +1,70 @@
|
||||
"
|
||||
" Colorscheme: Kalisi for airline. Inspired by powerline.
|
||||
" Arthur Jaron
|
||||
" hifreeo@gmail.com
|
||||
" 24.10.2014
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#0087ff' , '#ffffff','33','231']
|
||||
let s:V2 = [ '#005faf' , '#5fafff','25','75']
|
||||
let s:V3 = [ '#87d7ff' , '#005faf','117','25']
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [ '#d75fff' , '#ffffff','171','231']
|
||||
let s:R2 = [ '#5f005f' , '#d75fff','53','171']
|
||||
let s:R3 = [ '#ff87ff' , '#8700af','213','91']
|
||||
|
||||
let g:airline#themes#kalisi#palette = {}
|
||||
|
||||
|
||||
function! airline#themes#kalisi#refresh()
|
||||
|
||||
let s:StatusLine = airline#themes#get_highlight('StatusLine')
|
||||
let s:StatusLineNC = airline#themes#get_highlight('StatusLineNC')
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#ffffff' , '#e80000','231','160']
|
||||
let s:I2 = [ '#ff0000' , '#5f0000','196','52']
|
||||
let s:I3 = s:StatusLine
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#005f00' , '#afd700','22','148']
|
||||
let s:N2 = [ '#afd700' , '#005f00','148','22']
|
||||
let s:N3 = s:StatusLine
|
||||
|
||||
" Tabline Plugin
|
||||
let g:airline#themes#kalisi#palette.tabline = {
|
||||
\ 'airline_tab': ['#bcbcbc', '#005f00','250','22'],
|
||||
\ 'airline_tabsel': ['#404042', '#A6DB29','238','148'],
|
||||
\ 'airline_tabtype':['#afd700', '#204d20','148','22'],
|
||||
\ 'airline_tabfill': s:StatusLine,
|
||||
\ 'airline_tabhid': ['#c5c5c5', '#404042','251','238'],
|
||||
\ 'airline_tabmod': ['#d7ff00', '#afd700','190','148'],
|
||||
\ 'airline_tabmod_unsel': ['#d7ff00', '#005f00','190','22']
|
||||
\ }
|
||||
|
||||
let g:airline#themes#kalisi#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#kalisi#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#kalisi#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#kalisi#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
|
||||
" Inactive Mode
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#kalisi#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#kalisi#palette.inactive_modified = {
|
||||
\ 'airline_c': ['#d7ff00', s:IA[1],'190',s:IA[3]],
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#kalisi#refresh()
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#kalisi#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ s:StatusLine,
|
||||
\ ['#afd700', '#005f00','148','22'],
|
||||
\ [ '#005f00' , '#afd700' , '22','148']
|
||||
\)
|
||||
|
||||
59
autoload/airline/themes/kolor.vim
Normal file
59
autoload/airline/themes/kolor.vim
Normal file
@@ -0,0 +1,59 @@
|
||||
let g:airline#themes#kolor#palette = {}
|
||||
|
||||
let s:N1 = [ '#e2e2e2' , '#4f3598' , 254 , 56 ]
|
||||
let s:N2 = [ '#ff5fd7' , '#242322' , 206 , 234 ]
|
||||
let s:N3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
|
||||
let g:airline#themes#kolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let g:airline#themes#kolor#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e2e2e2' , '#4f3598' , 254 , 56 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#242322' , '#7eaefd' , 234 , 111 ]
|
||||
let s:I2 = [ '#75d7d8' , '#242322' , 80 , 234 ]
|
||||
let s:I3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
let g:airline#themes#kolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#kolor#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#242322' , '#7eaefd' , 234 , 111 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#kolor#palette.replace = copy(g:airline#themes#kolor#palette.insert)
|
||||
let g:airline#themes#kolor#palette.replace.airline_a = [ s:I2[0] , '#005154' , s:I2[2] , 23 , '' ]
|
||||
let g:airline#themes#kolor#palette.replace_modified = {
|
||||
\ 'airline_c': [ '#e2e2e2' , '#005154' , 254 , 23 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:V1 = [ '#242322' , '#e6987a' , 234 , 180 ]
|
||||
let s:V2 = [ '#dbc570' , '#242322' , 186 , 234 ]
|
||||
let s:V3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
let g:airline#themes#kolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#kolor#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#242322' , '#e6987a' , 234 , 180 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
|
||||
let s:IA2 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 ]
|
||||
let s:IA3 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
|
||||
let g:airline#themes#kolor#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#kolor#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#kolor#palette.accents = {
|
||||
\ 'red': [ '#d96e8a' , '' , 168 , '' ]
|
||||
\ }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#kolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#e2e2e2' , '#4a4a4a' , 254 , 238 , '' ],
|
||||
\ [ '#e2e2e2' , '#242322' , 254 , 234 , '' ],
|
||||
\ [ '#e2e2e2' , '#4f3598' , 254 , 56 , 'bold' ])
|
||||
@@ -24,19 +24,22 @@ let s:RE = [ '#233e09' , 22 ] " oakleaf
|
||||
" Paste mode
|
||||
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 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.accents = {
|
||||
\ 'red': [ '#ef393d' , '' , 196 , '' , '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#laederon#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#laederon#palette.normal_modified = {
|
||||
\ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#laederon#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#laederon#palette.insert_modified = {
|
||||
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#laederon#palette.insert_paste = {
|
||||
@@ -48,10 +51,12 @@ let g:airline#themes#laederon#palette.replace.airline_a = [ s:I1[0] , s:RE[0] ,
|
||||
let g:airline#themes#laederon#palette.replace_modified = g:airline#themes#laederon#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#laederon#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#laederon#palette.visual_modified = {
|
||||
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#laederon#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#laederon#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
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#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#light#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#light#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
@@ -13,7 +12,7 @@ let g:airline#themes#light#palette.normal_modified = {
|
||||
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#005f00' , '#00df87' , 22 , 42 ]
|
||||
let s:I3 = [ '#005f5f' , '#afff87' , 23 , 156 ]
|
||||
let g:airline#themes#light#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#light#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#light#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
@@ -30,7 +29,7 @@ let g:airline#themes#light#palette.replace_modified = g:airline#themes#light#pal
|
||||
let s:V1 = [ '#ffffff' , '#ff5f00' , 255 , 202 ]
|
||||
let s:V2 = [ '#5f0000' , '#ffaf00' , 52 , 214 ]
|
||||
let s:V3 = [ '#df5f00' , '#ffff87' , 166 , 228 ]
|
||||
let g:airline#themes#light#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#light#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#light#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
@@ -39,5 +38,8 @@ let g:airline#themes#light#palette.visual_modified = {
|
||||
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)
|
||||
let g:airline#themes#light#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#light#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '' , 160 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
56
autoload/airline/themes/lucius.vim
Normal file
56
autoload/airline/themes/lucius.vim
Normal file
@@ -0,0 +1,56 @@
|
||||
let g:airline#themes#lucius#palette = {}
|
||||
|
||||
function! airline#themes#lucius#refresh()
|
||||
|
||||
let s:N1 = airline#themes#get_highlight('StatusLine')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#lucius#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let modified_group = airline#themes#get_highlight('Statement')
|
||||
let g:airline#themes#lucius#palette.normal_modified = {
|
||||
\ 'airline_c': [modified_group[0], '', modified_group[2], '', '']
|
||||
\ }
|
||||
|
||||
let warning_group = airline#themes#get_highlight('DiffDelete')
|
||||
let g:airline#themes#lucius#palette.normal.airline_warning = warning_group
|
||||
let g:airline#themes#lucius#palette.normal_modified.airline_warning = warning_group
|
||||
|
||||
let s:I1 = airline#themes#get_highlight('DiffAdd')
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#lucius#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#lucius#palette.insert_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.insert.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.insert_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('DiffChange')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#lucius#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#lucius#palette.replace_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.replace.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.replace_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:V1 = airline#themes#get_highlight('Cursor')
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#lucius#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#lucius#palette.visual_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.visual.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.visual_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#lucius#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#lucius#palette.inactive_modified = {
|
||||
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#lucius#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#lucius#refresh()
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
" (https://github.com/Pychimp/vim-luna)
|
||||
|
||||
let g:airline#themes#luna#palette = {}
|
||||
let s:file = [ '#ffffff' , '' , 231 , '' , '' ]
|
||||
|
||||
let g:airline#themes#luna#palette.accents = {
|
||||
\ 'red': [ '#ffffff' , '' , 231 , '' , '' ],
|
||||
\ }
|
||||
|
||||
|
||||
let s:N1 = [ '#ffffff' , '#005252' , 231 , 36 ]
|
||||
let s:N2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:N3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#luna#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#luna#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
@@ -17,7 +20,7 @@ let g:airline#themes#luna#palette.normal_modified = {
|
||||
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 = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#luna#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#005e5e' , 255 , 52 , '' ] ,
|
||||
\ }
|
||||
@@ -33,13 +36,50 @@ let g:airline#themes#luna#palette.replace_modified = g:airline#themes#luna#palet
|
||||
let s:V1 = [ '#ffff9a' , '#ff8036' , 222 , 208 ]
|
||||
let s:V2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:V3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#luna#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#luna#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#4e4e4e' , '#002b2b' , 59 , 23 , '' ]
|
||||
let g:airline#themes#luna#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#luna#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#luna#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e20000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#luna#palette.tabline = {
|
||||
\ 'airline_tab': ['#2aa198', '#003f3f', 231, 29, ''],
|
||||
\ 'airline_tabsel': ['#ffffff', '#2e8b57', 231, 36, ''],
|
||||
\ 'airline_tabtype': ['#ffffff', '#005252', 231, 36, ''],
|
||||
\ 'airline_tabfill': ['#ffffff', '#002b2b', 231, 23, ''],
|
||||
\ 'airline_tabmod': ['#ffffff', '#780000', 231, 88, ''],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ffffff', '#5f0000', 231, 88 ]
|
||||
let g:airline#themes#luna#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#luna#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.insert.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.visual.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.replace.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
@@ -49,3 +89,4 @@ let g:airline#themes#luna#palette.ctrlp = airline#extensions#ctrlp#generate_colo
|
||||
\ [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] ,
|
||||
\ [ '#ffffff' , '#005252' , 231 , 36 , '' ] ,
|
||||
\ [ '#ffffff' , '#973d45' , 231 , 95 , '' ] )
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
let g:airline#themes#molokai#palette = {}
|
||||
|
||||
let g:airline#themes#molokai#palette.accents = {
|
||||
\ 'red': [ '#66d9ef' , '' , 81 , '' , '' ],
|
||||
\ }
|
||||
|
||||
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#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#molokai#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#molokai#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#e6db74' , 232 , 144 , '' ] ,
|
||||
\ }
|
||||
@@ -19,7 +21,7 @@ let s:I1 = [ '#080808' , '#66d9ef' , 232 , 81 ]
|
||||
let s:I2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:I3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#molokai#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#molokai#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#66d9ef' , 232 , 81 , '' ] ,
|
||||
\ }
|
||||
@@ -38,7 +40,7 @@ let s:V1 = [ '#080808' , '#fd971f' , 232 , 208 ]
|
||||
let s:V2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:V3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#molokai#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#molokai#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#fd971f' , 232 , 208 , '' ] ,
|
||||
\ }
|
||||
@@ -46,7 +48,10 @@ let g:airline#themes#molokai#palette.visual_modified = {
|
||||
|
||||
" Inactive
|
||||
let s:IA = [ '#1b1d1e' , '#465457' , 233 , 67 , '' ]
|
||||
let g:airline#themes#molokai#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#molokai#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#molokai#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#f8f8f0' , '' , 253 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" CtrlP
|
||||
|
||||
15
autoload/airline/themes/monochrome.vim
Normal file
15
autoload/airline/themes/monochrome.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
let g:airline#themes#monochrome#palette = {}
|
||||
|
||||
function! airline#themes#monochrome#refresh()
|
||||
let s:SL = airline#themes#get_highlight('StatusLine')
|
||||
let g:airline#themes#monochrome#palette.normal = airline#themes#generate_color_map(s:SL, s:SL, s:SL)
|
||||
let g:airline#themes#monochrome#palette.insert = g:airline#themes#monochrome#palette.normal
|
||||
let g:airline#themes#monochrome#palette.replace = g:airline#themes#monochrome#palette.normal
|
||||
let g:airline#themes#monochrome#palette.visual = g:airline#themes#monochrome#palette.normal
|
||||
|
||||
let s:SLNC = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#monochrome#palette.inactive = airline#themes#generate_color_map(s:SLNC, s:SLNC, s:SLNC)
|
||||
endfunction
|
||||
|
||||
call airline#themes#monochrome#refresh()
|
||||
|
||||
82
autoload/airline/themes/murmur.vim
Normal file
82
autoload/airline/themes/murmur.vim
Normal file
@@ -0,0 +1,82 @@
|
||||
let g:airline#themes#murmur#palette = {}
|
||||
|
||||
" Color palette
|
||||
let s:cterm_termbg = 237 " Background for branch and file format blocks
|
||||
let s:gui_termbg = '#5F5F5F'
|
||||
let s:cterm_termfg = 144 " Foreground for branch and file format blocks
|
||||
let s:gui_termfg = '#AFAF87'
|
||||
|
||||
let s:cterm_termbg2 = 234 " Background for middle block
|
||||
let s:gui_termbg2 = '#1C1C1C'
|
||||
let s:cterm_termfg2 = 39 " Foreground for middle block
|
||||
let s:gui_termfg2 = '#F5F5F5'
|
||||
|
||||
let s:cterm_normalbg = 27 " Background for normal mode and file position blocks
|
||||
let s:gui_normalbg = '#5F87FF'
|
||||
let s:cterm_normalfg = 15 " Foreground for normal mode and file position blocks
|
||||
let s:gui_normalfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_insertbg = 70 " Background for insert mode and file position blocks
|
||||
let s:gui_insertbg = '#87AF5F'
|
||||
let s:cterm_insertfg = 15 " Foreground for insert mode and file position blocks
|
||||
let s:gui_insertfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_visualbg = 166 " Background for visual mode and file position blocks
|
||||
let s:gui_visualbg = '#ff8c00'
|
||||
let s:cterm_visualfg = 15 " Foreground for visual mode and file position blocks
|
||||
let s:gui_visualfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_replacebg = 88 " Background for replace mode and file position blocks
|
||||
let s:gui_replacebg = '#870000'
|
||||
let s:cterm_replacefg = 15 " Foreground for replace mode and file position blocks
|
||||
let s:gui_replacefg = '#FFFFFF'
|
||||
|
||||
let s:cterm_alert = 88 " Modified file alert color
|
||||
let s:gui_alert = '#870000'
|
||||
|
||||
let s:cterm_inactivebg = 234 " Background for inactive mode
|
||||
let s:gui_inactivebg = '#1C1C1C'
|
||||
let s:cterm_inactivefg = 239 " Foreground for inactive mode
|
||||
let s:gui_inactivefg = '#4E4E4E'
|
||||
|
||||
" Branch and file format
|
||||
let s:BB = [s:gui_termfg, s:gui_termbg, s:cterm_termfg, s:cterm_termbg] " Branch and file format blocks
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_normalfg, s:gui_normalbg, s:cterm_normalfg, s:cterm_normalbg] " Outside blocks in normal mode
|
||||
let s:N2 = [s:gui_termfg2, s:gui_termbg2, s:cterm_normalbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.normal = airline#themes#generate_color_map(s:N1, s:BB, s:N2)
|
||||
let g:airline#themes#murmur#palette.normal_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_insertfg, s:gui_insertbg, s:cterm_insertfg, s:cterm_insertbg] " Outside blocks in insert mode
|
||||
let s:I2 = [s:gui_insertbg, s:gui_termbg2, s:cterm_insertbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.insert = airline#themes#generate_color_map(s:I1, s:BB, s:I2)
|
||||
let g:airline#themes#murmur#palette.insert_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [s:gui_replacefg, s:gui_replacebg, s:cterm_replacefg, s:cterm_replacebg] " Outside blocks in replace mode
|
||||
let s:R2 = [s:gui_termfg, s:gui_termbg2, s:cterm_termfg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.replace = airline#themes#generate_color_map(s:R1, s:BB, s:R2)
|
||||
let g:airline#themes#murmur#palette.replace_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_visualfg, s:gui_visualbg, s:cterm_visualfg, s:cterm_visualbg] " Outside blocks in visual mode
|
||||
let s:V2 = [s:gui_visualbg, s:gui_termbg2, s:cterm_visualbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.visual = airline#themes#generate_color_map(s:V1, s:BB, s:V2)
|
||||
let g:airline#themes#murmur#palette.visual_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Inactive mode
|
||||
let s:IA1 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let s:IA2 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let s:IA3 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let g:airline#themes#murmur#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
|
||||
" CtrlP plugin colors
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#murmur#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [s:gui_normalfg, s:gui_normalbg, s:cterm_normalfg, s:cterm_normalbg, ''],
|
||||
\ [s:gui_termfg, s:gui_termbg, s:cterm_termfg, s:cterm_termbg, ''],
|
||||
\ [s:gui_termfg2, s:gui_termbg2, s:cterm_termfg2, s:cterm_termbg2, 'bold'])
|
||||
65
autoload/airline/themes/papercolor.vim
Normal file
65
autoload/airline/themes/papercolor.vim
Normal file
@@ -0,0 +1,65 @@
|
||||
let g:airline#themes#papercolor#palette = {}
|
||||
|
||||
let g:airline#themes#papercolor#palette.accents = {
|
||||
\ 'red': [ '#66d9ef' , '' , 81 , '' , '' ],
|
||||
\ }
|
||||
|
||||
" Normal Mode:
|
||||
let s:N1 = [ '#585858' , '#e4e4e4' , 240 , 254 ] " Mode
|
||||
let s:N2 = [ '#e4e4e4' , '#0087af' , 254 , 31 ] " Info
|
||||
let s:N3 = [ '#eeeeee' , '#005f87' , 255 , 24 ] " StatusLine
|
||||
|
||||
|
||||
let g:airline#themes#papercolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#papercolor#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#eeeeee' , '#005f87' , 255 , 24 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Insert Mode:
|
||||
let s:I1 = [ '#585858' , '#e4e4e4' , 240 , 254 ] " Mode
|
||||
let s:I2 = [ '#e4e4e4' , '#0087af' , 254 , 31 ] " Info
|
||||
let s:I3 = [ '#eeeeee' , '#005f87' , 255 , 24 ] " StatusLine
|
||||
|
||||
|
||||
let g:airline#themes#papercolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#papercolor#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#eeeeee' , '#005f87' , 255 , 24 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Replace Mode:
|
||||
let g:airline#themes#papercolor#palette.replace = copy(g:airline#themes#papercolor#palette.insert)
|
||||
let g:airline#themes#papercolor#palette.replace.airline_a = [ '#d7005f' , '#e4e4e4' , 161 , 254, '' ]
|
||||
let g:airline#themes#papercolor#palette.replace_modified = {
|
||||
\ 'airline_c': [ '#eeeeee' , '#005f87' , 255 , 24 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Visual Mode:
|
||||
let s:V1 = [ '#005f87', '#e4e4e4', 24, 254 ]
|
||||
let s:V2 = [ '', '#0087af', '', 31 ]
|
||||
let s:V3 = [ '#e4e4e4', '#005f87', 254, 24 ]
|
||||
|
||||
let g:airline#themes#papercolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#papercolor#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#e4e4e4', '#005f87', 254, 24 ] ,
|
||||
\ }
|
||||
|
||||
" Inactive:
|
||||
let s:IA = [ '#585858' , '#e4e4e4' , 240 , 254 , '' ]
|
||||
let g:airline#themes#papercolor#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#papercolor#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#585858' , '#e4e4e4' , 240 , 254 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" CtrlP:
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#papercolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#e4e4e4' , '#005f87' , 254 , 24 , '' ] ,
|
||||
\ [ '#e4e4e4' , '#0087af' , 254 , 31 , '' ] ,
|
||||
\ [ '#585858' , '#e4e4e4' , 240 , 254 , 'bold' ] )
|
||||
|
||||
@@ -26,13 +26,11 @@ let s:V1 = [ '#080808' , '#ffaf00' , 232 , 214 ] " gray3 & brightestora
|
||||
" Replace mode " fg & bg
|
||||
let s:RE = [ '#ffffff' , '#d70000' , 231 , 160 ] " white & brightred
|
||||
|
||||
let s:file = copy(s:N3)
|
||||
|
||||
let g:airline#themes#powerlineish#palette = {}
|
||||
|
||||
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#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
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 = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#powerlineish#palette.insert_replace = {
|
||||
\ 'airline_a': [ s:RE[0] , s:I1[1] , s:RE[1] , s:I1[3] , '' ] }
|
||||
|
||||
@@ -44,5 +42,5 @@ let g:airline#themes#powerlineish#palette.replace.airline_a = [ s:RE[0] , s:RE[1
|
||||
|
||||
|
||||
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)
|
||||
let g:airline#themes#powerlineish#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
|
||||
|
||||
85
autoload/airline/themes/raven.vim
Normal file
85
autoload/airline/themes/raven.vim
Normal file
@@ -0,0 +1,85 @@
|
||||
let g:airline#themes#raven#palette = {}
|
||||
|
||||
let g:airline#themes#raven#palette.accents = {
|
||||
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let s:N2 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let s:N3 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let g:airline#themes#raven#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#raven#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let s:I2 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let s:I3 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let g:airline#themes#raven#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#raven#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#raven#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#2e2e2e' , s:I1[2] , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#raven#palette.replace = copy(g:airline#themes#raven#palette.insert)
|
||||
let g:airline#themes#raven#palette.replace.airline_a = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
|
||||
let g:airline#themes#raven#palette.replace.airline_z = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
|
||||
let g:airline#themes#raven#palette.replace_modified = g:airline#themes#raven#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let s:V2 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let s:V3 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let g:airline#themes#raven#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#raven#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#5e5e5e' , '#222222' , 59 , 235 , '' ]
|
||||
let g:airline#themes#raven#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#raven#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#raven#palette.tabline = {
|
||||
\ 'airline_tab': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabsel': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
|
||||
\ 'airline_tabtype': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabfill': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabmod': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ff0000', '#2e2e2e', 196, 235 ]
|
||||
let g:airline#themes#raven#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#raven#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.insert.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.visual.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.replace.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#raven#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
|
||||
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
|
||||
\ [ '#2e2e2e' , '#a4c639' , 235 , 149 , '' ] )
|
||||
41
autoload/airline/themes/serene.vim
Normal file
41
autoload/airline/themes/serene.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
let g:airline#themes#serene#palette = {}
|
||||
|
||||
let s:guibg = '#080808'
|
||||
let s:termbg = 232
|
||||
let s:termsep = 236
|
||||
let s:guisep = '#303030'
|
||||
|
||||
let s:N1 = [ '#00dfff' , s:guibg , 45 , s:termbg ]
|
||||
let s:N2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:N3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
|
||||
let g:airline#themes#serene#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#serene#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#5fff00' , s:guibg , 82 , s:termbg ]
|
||||
let s:I2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:I3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
let g:airline#themes#serene#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#serene#palette.insert_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
let g:airline#themes#serene#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#serene#palette.replace = {
|
||||
\ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#serene#palette.replace_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
let s:V1 = [ '#dfdf00' , s:guibg , 184 , s:termbg ]
|
||||
let s:V2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:V3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
let g:airline#themes#serene#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#serene#palette.visual_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , s:guisep , 239 , s:termsep , '' ]
|
||||
let g:airline#themes#serene#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2)
|
||||
let g:airline#themes#serene#palette.inactive_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
85
autoload/airline/themes/silver.vim
Normal file
85
autoload/airline/themes/silver.vim
Normal file
@@ -0,0 +1,85 @@
|
||||
let g:airline#themes#silver#palette = {}
|
||||
|
||||
let g:airline#themes#silver#palette.accents = {
|
||||
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let s:N2 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let s:N3 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let g:airline#themes#silver#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#silver#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let s:I2 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let s:I3 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let g:airline#themes#silver#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#silver#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#silver#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#e1e1e1' , s:I1[2] , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#silver#palette.replace = copy(g:airline#themes#silver#palette.insert)
|
||||
let g:airline#themes#silver#palette.replace.airline_a = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
|
||||
let g:airline#themes#silver#palette.replace.airline_z = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
|
||||
let g:airline#themes#silver#palette.replace_modified = g:airline#themes#silver#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let s:V2 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let s:V3 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let g:airline#themes#silver#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#silver#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#a1a1a1' , '#dddddd' , 145 , 188 , '' ]
|
||||
let g:airline#themes#silver#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#silver#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#silver#palette.tabline = {
|
||||
\ 'airline_tab': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabsel': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
|
||||
\ 'airline_tabtype': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabfill': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabmod': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ff0000', '#e1e1e1', 196, 188 ]
|
||||
let g:airline#themes#silver#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#silver#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.insert.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.visual.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.replace.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#silver#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
|
||||
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
|
||||
\ [ '#e1e1e1' , '#007599' , 188 , 30 , '' ] )
|
||||
@@ -5,11 +5,10 @@ let s:guibg2 = '#1c1c1c'
|
||||
let s:termbg = 232
|
||||
let s:termbg2= 234
|
||||
|
||||
let s:file = [ '#ff0000' , '' , 160 , '' , '' ]
|
||||
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 = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#simple#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
|
||||
\ }
|
||||
@@ -18,7 +17,7 @@ let g:airline#themes#simple#palette.normal_modified = {
|
||||
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#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#simple#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
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 , '' ] ,
|
||||
@@ -34,11 +33,14 @@ let g:airline#themes#simple#palette.replace_modified = copy(g:airline#themes#sim
|
||||
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#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#simple#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
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 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)
|
||||
let g:airline#themes#simple#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2)
|
||||
let g:airline#themes#simple#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#df0000', '', 160, '', '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
90
autoload/airline/themes/sol.vim
Normal file
90
autoload/airline/themes/sol.vim
Normal file
@@ -0,0 +1,90 @@
|
||||
" vim-airline companion theme of Sol
|
||||
" (https://github.com/Pychimp/vim-sol)
|
||||
|
||||
let g:airline#themes#sol#palette = {}
|
||||
|
||||
let g:airline#themes#sol#palette.accents = {
|
||||
\ 'red': [ '#ffffff' , '' , 231 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#343434' , '#a0a0a0' , 237 , 248 ]
|
||||
let s:N2 = [ '#343434' , '#b3b3b3' , 237 , 250 ]
|
||||
let s:N3 = [ '#343434' , '#c7c7c7' , 237 , 252 ]
|
||||
let g:airline#themes#sol#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#sol#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#ff6868' , 237 , 209 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#eeeeee' , '#09643f' , 255 , 30 ]
|
||||
let s:I2 = [ '#343434' , '#a3a3a3' , 237 , 249 ]
|
||||
let s:I3 = [ '#343434' , '#b0b0b0' , 237 , 250 ]
|
||||
let g:airline#themes#sol#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#sol#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#343434' , '#ffdbc7' , 237 , 216 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#sol#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#09643f' , s:I1[2] , 30 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#sol#palette.replace = copy(g:airline#themes#sol#palette.insert)
|
||||
let g:airline#themes#sol#palette.replace.airline_a = [ s:I1[0] , '#ff2121' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#sol#palette.replace.airline_z = [ s:I1[0] , '#ff2121' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#sol#palette.replace_modified = g:airline#themes#sol#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#ffff9a' , '#ff6003' , 222 , 202 ]
|
||||
let s:V2 = [ '#343434' , '#a3a3a3' , 237 , 249 ]
|
||||
let s:V3 = [ '#343434' , '#b0b0b0' , 237 , 250 ]
|
||||
let g:airline#themes#sol#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#sol#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#343434' , '#ffdbc7' , 237 , 216 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#777777' , '#c7c7c7' , 244 , 251 , '' ]
|
||||
let g:airline#themes#sol#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#sol#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#ff3535' , '' , 203 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#sol#palette.tabline = {
|
||||
\ 'airline_tab': ['#343434', '#b3b3b3', 237, 250, ''],
|
||||
\ 'airline_tabsel': ['#ffffff', '#004b9a', 231, 31 , ''],
|
||||
\ 'airline_tabtype': ['#343434', '#a0a0a0', 237, 248, ''],
|
||||
\ 'airline_tabfill': ['#343434', '#c7c7c7', 237, 251, ''],
|
||||
\ 'airline_tabmod': ['#343434', '#ffdbc7', 237, 216, ''],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#eeeeee', '#e33900', 255, 166 ]
|
||||
let g:airline#themes#sol#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#sol#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.insert.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.visual.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.replace.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#sol#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#343434' , '#c7c7c7' , 237 , 251 , '' ] ,
|
||||
\ [ '#343434' , '#b3b3b3' , 237 , 250 , '' ] ,
|
||||
\ [ '#eeeeee' , '#007fff' , 255 , 27 , '' ] )
|
||||
@@ -1,35 +1,33 @@
|
||||
let g:airline#themes#solarized#palette = {}
|
||||
|
||||
function! s:generate()
|
||||
function! airline#themes#solarized#refresh()
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Options
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
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
|
||||
let s:tty = &t_Co == 8
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Colors
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Base colors
|
||||
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'}
|
||||
let s:base03 = {'t': s:ansi_colors ? 8 : (s:tty ? '0' : 234), 'g': '#002b36'}
|
||||
let s:base02 = {'t': s:ansi_colors ? '0' : (s:tty ? '0' : 235), 'g': '#073642'}
|
||||
let s:base01 = {'t': s:ansi_colors ? 10 : (s:tty ? '0' : 240), 'g': '#586e75'}
|
||||
let s:base00 = {'t': s:ansi_colors ? 11 : (s:tty ? '7' : 241), 'g': '#657b83'}
|
||||
let s:base0 = {'t': s:ansi_colors ? 12 : (s:tty ? '7' : 244), 'g': '#839496'}
|
||||
let s:base1 = {'t': s:ansi_colors ? 14 : (s:tty ? '7' : 245), 'g': '#93a1a1'}
|
||||
let s:base2 = {'t': s:ansi_colors ? 7 : (s:tty ? '7' : 254), 'g': '#eee8d5'}
|
||||
let s:base3 = {'t': s:ansi_colors ? 15 : (s:tty ? '7' : 230), 'g': '#fdf6e3'}
|
||||
let s:yellow = {'t': s:ansi_colors ? 3 : (s:tty ? '3' : 136), 'g': '#b58900'}
|
||||
let s:orange = {'t': s:ansi_colors ? 9 : (s:tty ? '1' : 166), 'g': '#cb4b16'}
|
||||
let s:red = {'t': s:ansi_colors ? 1 : (s:tty ? '1' : 160), 'g': '#dc322f'}
|
||||
let s:magenta = {'t': s:ansi_colors ? 5 : (s:tty ? '5' : 125), 'g': '#d33682'}
|
||||
let s:violet = {'t': s:ansi_colors ? 13 : (s:tty ? '5' : 61 ), 'g': '#6c71c4'}
|
||||
let s:blue = {'t': s:ansi_colors ? 4 : (s:tty ? '4' : 33 ), 'g': '#268bd2'}
|
||||
let s:cyan = {'t': s:ansi_colors ? 6 : (s:tty ? '6' : 37 ), 'g': '#2aa198'}
|
||||
let s:green = {'t': s:ansi_colors ? 2 : (s:tty ? '2' : 64 ), 'g': '#859900'}
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Simple mappings
|
||||
@@ -37,59 +35,52 @@ function! s:generate()
|
||||
" the specific gui and terminal colors from the base color dicts.
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Normal mode
|
||||
let s:N1 = [s:base2, s:blue, 'bold']
|
||||
if s:background == 'dark'
|
||||
let s:N2 = [s:base2, s:base01, '']
|
||||
let s:N3 = [s:base1, s:base02, '']
|
||||
let s:N1 = [s:base3, s:base1, 'bold']
|
||||
let s:N2 = [s:base2, (s:tty ? s:base01 : s:base00), '']
|
||||
let s:N3 = [s:base01, s:base02, '']
|
||||
else
|
||||
let s:N2 = [s:base2, s:base00, '']
|
||||
let s:N3 = [s:base00, s:base2, '']
|
||||
let s:N1 = [s:base2, s:base00, 'bold']
|
||||
let s:N2 = [(s:tty ? s:base01 : s:base2), s:base1, '']
|
||||
let s:N3 = [s:base1, s:base2, '']
|
||||
endif
|
||||
let s:NF = [s:orange, s:N3[1], '']
|
||||
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], '']
|
||||
let s:NM = [s:base1, s:N3[1], '']
|
||||
let s:NMi = [s:base2, s:N3[1], '']
|
||||
else
|
||||
let s:NM = [s:red, s:N3[1], '']
|
||||
let s:NM = [s:base01, s:N3[1], '']
|
||||
let s:NMi = [s:base02, s:N3[1], '']
|
||||
endif
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:N1[0], s:green, 'bold']
|
||||
if s:reduced
|
||||
let s:I2 = s:N2
|
||||
else
|
||||
if s:background == 'dark'
|
||||
let s:I2 = [s:base00, s:color236, '']
|
||||
else
|
||||
let s:I2 = [s:base00, s:color251, '']
|
||||
endif
|
||||
endif
|
||||
let s:I1 = [s:N1[0], s:yellow, 'bold']
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let s:IF = s:NF
|
||||
let s:IM = s:NM
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:N1[0], s:orange, 'bold']
|
||||
if s:reduced
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
else
|
||||
let s:V2 = s:I2
|
||||
let s:V3 = s:I3
|
||||
endif
|
||||
let s:V1 = [s:N1[0], s:magenta, 'bold']
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let s:VF = s:NF
|
||||
if s:reduced
|
||||
let s:VM = s:NM
|
||||
else
|
||||
let s:VM = s:IM
|
||||
endif
|
||||
let s:VM = s:NM
|
||||
|
||||
" Inactive
|
||||
" Replace mode
|
||||
let s:R1 = [s:N1[0], s:red, '']
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let s:RM = s:NM
|
||||
let s:RF = s:NF
|
||||
|
||||
" Inactive, according to VertSplit in solarized
|
||||
" (bg dark: base00; bg light: base0)
|
||||
if s:background == 'dark'
|
||||
let s:IA = [s:base00, s:base02, '']
|
||||
let s:IA = [s:base02, s:base00, '']
|
||||
else
|
||||
let s:IA = [s:base1, s:base2, '']
|
||||
let s:IA = [s:base2, s:base0, '']
|
||||
endif
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
@@ -99,49 +90,87 @@ function! s:generate()
|
||||
let s:NFa = [s:NF[0].g, s:NF[1].g, s:NF[0].t, s:NF[1].t, s:NF[2]]
|
||||
let s:IFa = [s:IF[0].g, s:IF[1].g, s:IF[0].t, s:IF[1].t, s:IF[2]]
|
||||
let s:VFa = [s:VF[0].g, s:VF[1].g, s:VF[0].t, s:VF[1].t, s:VF[2]]
|
||||
let s:RFa = [s:RF[0].g, s:RF[1].g, s:RF[0].t, s:RF[1].t, s:RF[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.accents = {
|
||||
\ 'red': s:NFa,
|
||||
\ }
|
||||
|
||||
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)
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]])
|
||||
let g:airline#themes#solarized#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:NMi[0].g, '', s:NMi[0].t, '', s:NMi[2]]}
|
||||
|
||||
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)
|
||||
\ [s:N3[0].g, s:N3[1].g, s:N3[0].t, s:N3[1].t, s:N3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.normal.airline_warningmsg = [
|
||||
let g:airline#themes#solarized#palette.normal.airline_warning = [
|
||||
\ s:NW[0].g, s:NW[1].g, s:NW[0].t, s:NW[1].t, s:NW[2]]
|
||||
|
||||
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.normal_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
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)
|
||||
\ [s:I3[0].g, s:I3[1].g, s:I3[0].t, s:I3[1].t, s:I3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.insert.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
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#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
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)
|
||||
\ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.visual.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
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]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.replace = airline#themes#generate_color_map(
|
||||
\ [s:R1[0].g, s:R1[1].g, s:R1[0].t, s:R1[1].t, s:R1[2]],
|
||||
\ [s:R2[0].g, s:R2[1].g, s:R2[0].t, s:R2[1].t, s:R2[2]],
|
||||
\ [s:R3[0].g, s:R3[1].g, s:R3[0].t, s:R3[1].t, s:R3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.replace.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.replace_modified = {
|
||||
\ 'airline_c': [s:RM[0].g, s:RM[1].g,
|
||||
\ s:RM[0].t, s:RM[1].t, s:RM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline = {}
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline.airline_tab = [
|
||||
\ s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline.airline_tabtype = [
|
||||
\ s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]]
|
||||
endfunction
|
||||
|
||||
call s:generate()
|
||||
augroup airline_solarized
|
||||
autocmd!
|
||||
autocmd ColorScheme * call <sid>generate() | call airline#load_theme()
|
||||
augroup END
|
||||
call airline#themes#solarized#refresh()
|
||||
|
||||
|
||||
92
autoload/airline/themes/term.vim
Normal file
92
autoload/airline/themes/term.vim
Normal file
@@ -0,0 +1,92 @@
|
||||
|
||||
" vim-airline 'term' theme
|
||||
" it is using current terminal colorscheme
|
||||
" and in gvim i left colors from 'wombat' theme but i am not using it anyway
|
||||
|
||||
" Normal mode
|
||||
" [ guifg, guibg, ctermfg, ctermbg, opts ]
|
||||
let s:N1 = [ '#141413' , '#CAE682' , 232 , 2 ] " mode
|
||||
let s:N2 = [ '#CAE682' , '#32322F' , 2 , 'black' ] " info
|
||||
let s:N3 = [ '#CAE682' , '#242424' , 2 , 233 ] " statusline
|
||||
let s:N4 = [ '#86CD74' , 10 ] " mode modified
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#141413' , '#FDE76E' , 232 , 3 ]
|
||||
let s:I2 = [ '#FDE76E' , '#32322F' , 3 , 'black' ]
|
||||
let s:I3 = [ '#FDE76E' , '#242424' , 3 , 233 ]
|
||||
let s:I4 = [ '#FADE3E' , 11 ]
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#141413' , '#B5D3F3' , 232 , 4 ]
|
||||
let s:V2 = [ '#B5D3F3' , '#32322F' , 4 , 'black' ]
|
||||
let s:V3 = [ '#B5D3F3' , '#242424' , 4 , 233 ]
|
||||
let s:V4 = [ '#7CB0E6' , 12 ]
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [ '#141413' , '#E5786D' , 232 , 1 ]
|
||||
let s:R2 = [ '#E5786D' , '#32322F' , 1 , 'black' ]
|
||||
let s:R3 = [ '#E5786D' , '#242424' , 1 , 233 ]
|
||||
let s:R4 = [ '#E55345' , 9 ]
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#94E42C' , 6 ]
|
||||
|
||||
" Info modified
|
||||
let s:IM = [ '#40403C' , 238 ]
|
||||
|
||||
" Inactive mode
|
||||
let s:IA = [ '#767676' , s:N3[1] , 243 , s:N3[3] , '' ]
|
||||
|
||||
let g:airline#themes#term#palette = {}
|
||||
|
||||
let g:airline#themes#term#palette.accents = {
|
||||
\ 'red': [ '#E5786D' , '' , 203 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let g:airline#themes#term#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#term#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#term#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#term#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#term#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#term#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#term#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#term#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#term#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] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#term#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#term#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:N4[0] , '' , s:N4[1] , '' , '' ] }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#term#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#DADADA' , '#242424' , 253 , 234 , '' ] ,
|
||||
\ [ '#DADADA' , '#40403C' , 253 , 238 , '' ] ,
|
||||
\ [ '#141413' , '#DADADA' , 232 , 253 , 'bold' ] )
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
let g:airline#themes#tomorrow#palette = {}
|
||||
|
||||
function! s:generate()
|
||||
let s:file = airline#themes#get_highlight('Constant')
|
||||
function! airline#themes#tomorrow#refresh()
|
||||
let g:airline#themes#tomorrow#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
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#palette.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)
|
||||
|
||||
let group = airline#themes#get_highlight('vimCommand')
|
||||
let g:airline#themes#tomorrow#palette.normal_modified = {
|
||||
@@ -16,27 +18,27 @@ function! s:generate()
|
||||
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#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#tomorrow#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
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#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
|
||||
let g:airline#themes#tomorrow#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
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#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#tomorrow#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
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#palette.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)
|
||||
let g:airline#themes#tomorrow#palette.inactive_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
call s:generate()
|
||||
augroup airline_tomorrow
|
||||
autocmd!
|
||||
autocmd ColorScheme * call <sid>generate() | call airline#load_theme()
|
||||
augroup END
|
||||
call airline#themes#tomorrow#refresh()
|
||||
|
||||
|
||||
@@ -24,21 +24,25 @@ let s:RE = [ '#c7915b' , 173 ] " nut
|
||||
" Paste mode
|
||||
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 g:airline#themes#ubaryd#palette = {}
|
||||
|
||||
let g:airline#themes#ubaryd#palette.accents = {
|
||||
\ 'red': [ '#ff7400' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
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#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#ubaryd#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
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#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#ubaryd#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
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 = {
|
||||
@@ -50,9 +54,11 @@ let g:airline#themes#ubaryd#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:
|
||||
let g:airline#themes#ubaryd#palette.replace_modified = g:airline#themes#ubaryd#palette.insert_modified
|
||||
|
||||
|
||||
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 = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
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#palette.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)
|
||||
let g:airline#themes#ubaryd#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
|
||||
43
autoload/airline/themes/understated.vim
Normal file
43
autoload/airline/themes/understated.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
let g:airline#themes#understated#palette = {}
|
||||
|
||||
let s:N1 = ['#FFFFFF', '#5F87FF', 15, 69] " Outside blocks in normal mode (mode and file position)
|
||||
let s:N2 = ['#AFAF87', '#5F5F5F', 144, 59] " Next blocks inside (branch and file format)
|
||||
let s:N3 = ['#AFAF87', '#5F5F5F', 144, 59] " The middle block
|
||||
|
||||
let g:airline#themes#understated#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#understated#palette.normal_modified = {'airline_c': ['#ffffff', '#5f005f', 144, 59, 'bold'] ,}
|
||||
|
||||
let s:I1 = ['#FFFFFF', '#87AF5F', 15, 107] " Outside blocks in normal mode (mode and file position)
|
||||
let s:I2 = ['#AFAF87', '#5F5F5F', 144, 59] " Next blocks inside (branch and file format)
|
||||
let s:I3 = ['#AFAF87', '#5F5F5F', 144, 59] " The middle block
|
||||
let g:airline#themes#understated#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#understated#palette.insert_modified = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, 'bold'] ,}
|
||||
let g:airline#themes#understated#palette.insert_paste = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, ''] ,}
|
||||
|
||||
let g:airline#themes#understated#palette.replace = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#understated#palette.replace.airline_a = ['#FFFFFF', '#870000', 15, 88, '']
|
||||
let g:airline#themes#understated#palette.replace_modified = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, 'bold'] ,}
|
||||
|
||||
let s:V1 = ['#FFFFFF', '#AF5F00', 15, 130]
|
||||
let s:V2 = ['#AFAF87', '#5F5F5F', 144, 59]
|
||||
let s:V3 = ['#AFAF87', '#5F5F5F', 144, 59]
|
||||
let g:airline#themes#understated#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#understated#palette.visual_modified = {'airline_c': [ '#AFAF87', '#5f005f', 144, 59, 'bold'] ,}
|
||||
|
||||
let s:V1 = ['#080808', '#FFAF00', 232, 214]
|
||||
let s:IA1 = ['#4E4E4E', '#1C1C1C', 239, 234, '']
|
||||
let s:IA2 = ['#4E4E4E', '#1C1C1C', 239, 234, '']
|
||||
let s:IA3 = ['#4E4E4E', '#1C1C1C', 239, 234, '']
|
||||
let g:airline#themes#understated#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#understated#palette.inactive_modified = {'airline_c': ['#4E4E4E', '', 239, '', 'bold'] ,}
|
||||
|
||||
let g:airline#themes#understated#palette.accents = {'red': ['#FF0000', '', 88, '']}
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#understated#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ ['#FFFFFF', '#1C1C1C', 15, 234, '' ],
|
||||
\ ['#FFFFFF', '#262626', 15, 235, '' ],
|
||||
\ ['#FFFFFF', '#303030', 15, 236, 'bold'])
|
||||
|
||||
@@ -32,38 +32,37 @@ let s:PA = [ '#94E42C' , 47 ]
|
||||
" Info modified
|
||||
let s:IM = [ '#40403C' , 238 ]
|
||||
|
||||
" File permissions (RO, etc)
|
||||
let s:file = [ '#E5786D' , '' , 203 , '' , '' ]
|
||||
|
||||
" Inactive mode
|
||||
let s:IA = [ '#767676' , s:N3[1] , 243 , s:N3[3] , '' ]
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette = {}
|
||||
|
||||
let g:airline#themes#wombat#palette.accents = {
|
||||
\ 'red': [ '#E5786D' , '' , 203 , '' , '' ],
|
||||
\ }
|
||||
|
||||
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 = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
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#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#wombat#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
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#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#wombat#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
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#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
|
||||
let g:airline#themes#wombat#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
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] , '' ] ,
|
||||
@@ -76,7 +75,9 @@ let g:airline#themes#wombat#palette.insert_paste = {
|
||||
\ 'airline_c': [ s:PA[0] , s:N3[1] , s:PA[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#wombat#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#wombat#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:N4[0] , '' , s:N4[1] , '' , '' ] }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
|
||||
45
autoload/airline/themes/xtermlight.vim
Normal file
45
autoload/airline/themes/xtermlight.vim
Normal file
@@ -0,0 +1,45 @@
|
||||
let g:airline#themes#xtermlight#palette = {}
|
||||
|
||||
let s:N1 = [ '#eeeeee' , '#005fff' , 255 , 27 ]
|
||||
let s:N2 = [ '#000087' , '#00d7ff' , 18 , 45 ]
|
||||
let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ]
|
||||
let g:airline#themes#xtermlight#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#xtermlight#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#d70000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#eeeeee' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#005f00' , '#00d787' , 22 , 42 ]
|
||||
let s:I3 = [ '#005f5f' , '#afff87' , 23 , 156 ]
|
||||
let g:airline#themes#xtermlight#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#xtermlight#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#d70000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#xtermlight#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#xtermlight#palette.replace = copy(g:airline#themes#xtermlight#palette.insert)
|
||||
let g:airline#themes#xtermlight#palette.replace.airline_a = [ s:I2[0] , '#ff0000' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#xtermlight#palette.replace_modified = g:airline#themes#xtermlight#palette.insert_modified
|
||||
|
||||
|
||||
let s:V1 = [ '#eeeeee' , '#ff5f00' , 255 , 202 ]
|
||||
let s:V2 = [ '#5f0000' , '#ffaf00' , 52 , 214 ]
|
||||
let s:V3 = [ '#d75f00' , '#ffff87' , 166 , 228 ]
|
||||
let g:airline#themes#xtermlight#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#xtermlight#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#d70000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#6c6c6c' , '#b2b2b2' , 242 , 249 , '' ]
|
||||
let s:IA2 = [ '#8a8a8a' , '#d0d0d0' , 245 , 252 , '' ]
|
||||
let s:IA3 = [ '#a8a8a8' , '#eeeeee' , 248 , 255 , '' ]
|
||||
let g:airline#themes#xtermlight#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#xtermlight#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#d70000' , '' , 160 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
44
autoload/airline/themes/zenburn.vim
Normal file
44
autoload/airline/themes/zenburn.vim
Normal file
@@ -0,0 +1,44 @@
|
||||
let g:airline#themes#zenburn#palette = {}
|
||||
|
||||
function! airline#themes#zenburn#refresh()
|
||||
let g:airline#themes#zenburn#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Folded', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('NonText')
|
||||
|
||||
let g:airline#themes#zenburn#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let s:Nmod = airline#themes#get_highlight('Comment')
|
||||
let g:airline#themes#zenburn#palette.normal_modified = {
|
||||
\ 'airline_c': s:Nmod
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['String', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['String', 'fg'], ['Folded', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#zenburn#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#zenburn#palette.insert_modified = g:airline#themes#zenburn#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Comment', 'fg'], 'bold')
|
||||
let s:R2 = airline#themes#get_highlight2(['Comment', 'fg'], ['Folded', 'bg'])
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#zenburn#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#zenburn#palette.replace_modified = g:airline#themes#zenburn#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Identifier', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Identifier', 'fg'], ['Folded', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#zenburn#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#zenburn#palette.visual_modified = g:airline#themes#zenburn#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight('NonText')
|
||||
let g:airline#themes#zenburn#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#zenburn#palette.inactive_modified = {
|
||||
\ 'airline_c': s:Nmod
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
call airline#themes#zenburn#refresh()
|
||||
|
||||
@@ -1,6 +1,31 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
call airline#init#bootstrap()
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! airline#util#wrap(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
endif
|
||||
return a:text
|
||||
endfunction
|
||||
|
||||
function! airline#util#append(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
endif
|
||||
let prefix = s:spc == "\ua0" ? s:spc : s:spc.s:spc
|
||||
return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text
|
||||
endfunction
|
||||
|
||||
function! airline#util#prepend(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
endif
|
||||
return empty(a:text) ? '' : a:text.s:spc.g:airline_right_alt_sep.s:spc
|
||||
endfunction
|
||||
|
||||
if v:version >= 704
|
||||
function! airline#util#getwinvar(winnr, key, def)
|
||||
return getwinvar(a:winnr, a:key, a:def)
|
||||
|
||||
657
doc/airline.txt
657
doc/airline.txt
@@ -1,4 +1,5 @@
|
||||
*airline.txt* Lean and mean statusline that's light as air
|
||||
*airline.txt* Lean and mean status/tabline that's light as air
|
||||
*airline*
|
||||
_ _ _ _ ~
|
||||
__ _(_)_ __ ___ __ _(_)_ __| (_)_ __ ___ ~
|
||||
\ \ / / | '_ ` _ \ _____ / _` | | '__| | | '_ \ / _ \ ~
|
||||
@@ -6,7 +7,27 @@
|
||||
\_/ |_|_| |_| |_| \__,_|_|_| |_|_|_| |_|\___| ~
|
||||
~
|
||||
==============================================================================
|
||||
INTRODUCTION *airline*
|
||||
CONTENTS *airline-contents*
|
||||
|
||||
01. Intro ............................................... |airline-intro|
|
||||
02. Features ......................................... |airline-features|
|
||||
03. Name ................................................. |airline-name|
|
||||
04. Configuration ............................... |airline-configuration|
|
||||
05. Commands ......................................... |airline-commands|
|
||||
06. Autocommands ................................. |airline-autocommands|
|
||||
07. Customization ............................... |airline-customization|
|
||||
08. Extensions ..................................... |airline-extensions|
|
||||
09. Advanced Customization ............. |airline-advanced-customization|
|
||||
10. Funcrefs ......................................... |airline-funcrefs|
|
||||
11. Pipeline ......................................... |airline-pipeline|
|
||||
12. Writing Extensions ..................... |airline-writing-extensions|
|
||||
13. Writing Themes ..................................... |airline-themes|
|
||||
14. Troubleshooting ........................... |airline-troubleshooting|
|
||||
15. Contributions ............................... |airline-contributions|
|
||||
16. License ........................................... |airline-license|
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *airline-intro*
|
||||
|
||||
vim-airline is a fast and lightweight alternative to powerline, written
|
||||
in 100% vimscript with no outside dependencies.
|
||||
@@ -19,7 +40,7 @@ FEATURES *airline-features*
|
||||
* 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
|
||||
* fully customizable; if you know a little 'statusline' syntax you can
|
||||
tweak it to your needs.
|
||||
* extremely easy to write themes.
|
||||
|
||||
@@ -49,8 +70,11 @@ values):
|
||||
* enable paste detection >
|
||||
let g:airline_detect_paste=1
|
||||
<
|
||||
* enable crypt detection >
|
||||
let g:airline_detect_crypt=1
|
||||
<
|
||||
* enable iminsert detection >
|
||||
let g:airline_detect_iminsert=1
|
||||
let g:airline_detect_iminsert=0
|
||||
<
|
||||
* determine whether inactive windows should have the left section collapsed to
|
||||
only the filename of that buffer. >
|
||||
@@ -71,7 +95,8 @@ values):
|
||||
endif
|
||||
endfunction
|
||||
<
|
||||
* enable/disable usage of patched powerline font symbols >
|
||||
* enable/disable automatic population of the `g:airline_symbols` dictionary
|
||||
with powerline symbols. >
|
||||
let g:airline_powerline_fonts=0
|
||||
<
|
||||
* define the set of text to display for each mode. >
|
||||
@@ -105,6 +130,11 @@ values):
|
||||
heavily) >
|
||||
let g:airline_exclude_preview = 0
|
||||
<
|
||||
* disable the Airline customization for selective windows (this is a
|
||||
window-local variable so you can disable it for only some windows) >
|
||||
let w:airline_disabled = 1
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
COMMANDS *airline-commands*
|
||||
|
||||
@@ -115,61 +145,84 @@ COMMANDS *airline-commands*
|
||||
Toggles whitespace detection.
|
||||
|
||||
:AirlineToggle *:AirlineToggle*
|
||||
Toggles between the standard `statusline`
|
||||
Toggles between the standard 'statusline' and airline.
|
||||
|
||||
:AirlineRefresh *:AirlineRefresh*
|
||||
Refreshes all highlight groups and redraws the statusline.
|
||||
|
||||
==============================================================================
|
||||
AUTOCOMMANDS *airline-autocommands*
|
||||
|
||||
Airline comes with some user-defined autocommands.
|
||||
|
||||
|AirlineAfterInit| after plugin is initialized, but before the statusline
|
||||
is replaced
|
||||
|AirlineToggledOn| after airline is activated and replaced the statusline
|
||||
|AirlineToggledOff| after airline is deactivated and the statusline is
|
||||
restored to the original
|
||||
|
||||
==============================================================================
|
||||
CUSTOMIZATION *airline-customization*
|
||||
|
||||
The following are some unicode symbols for customizing the left/right
|
||||
separators, as well as the powerline font glyths.
|
||||
>
|
||||
separators, as well as the powerline font glyphs.
|
||||
|
||||
Note: You must define the dictionary first before setting values. Also, it's a
|
||||
good idea to check whether it exists as to avoid accidentally overwriting
|
||||
its contents. >
|
||||
if !exists('g:airline_symbols')
|
||||
let g:airline_symbols = {}
|
||||
endif
|
||||
|
||||
" unicode symbols
|
||||
let g:airline_left_sep = '»'
|
||||
let g:airline_left_sep = '▶'
|
||||
let g:airline_right_sep = '«'
|
||||
let g:airline_right_sep = '◀'
|
||||
let g:airline_linecolumn_prefix = '␊ '
|
||||
let g:airline_linecolumn_prefix = ' '
|
||||
let g:airline_linecolumn_prefix = '¶ '
|
||||
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 = 'Ξ'
|
||||
let g:airline_symbols.crypt = '🔒'
|
||||
let g:airline_symbols.linenr = '␊'
|
||||
let g:airline_symbols.linenr = ''
|
||||
let g:airline_symbols.linenr = '¶'
|
||||
let g:airline_symbols.branch = '⎇'
|
||||
let g:airline_symbols.paste = 'ρ'
|
||||
let g:airline_symbols.paste = 'Þ'
|
||||
let g:airline_symbols.paste = '∥'
|
||||
let g:airline_symbols.whitespace = 'Ξ'
|
||||
|
||||
" 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#extensions#branch#symbol = ' '
|
||||
let g:airline#extensions#readonly#symbol = ''
|
||||
let g:airline_linecolumn_prefix = ' '
|
||||
let g:airline_symbols.branch = ''
|
||||
let g:airline_symbols.readonly = ''
|
||||
let g:airline_symbols.linenr = ''
|
||||
|
||||
" old vim-powerline symbols
|
||||
let g:airline_left_sep = '⮀'
|
||||
let g:airline_left_alt_sep = '⮁'
|
||||
let g:airline_right_sep = '⮂'
|
||||
let g:airline_right_alt_sep = '⮃'
|
||||
let g:airline#extensions#branch#symbol = '⭠'
|
||||
let g:airline#extensions#readonly#symbol = '⭤'
|
||||
let g:airline_linecolumn_prefix = '⭡'
|
||||
let g:airline_symbols.branch = '⭠'
|
||||
let g:airline_symbols.readonly = '⭤'
|
||||
let g:airline_symbols.linenr = '⭡'
|
||||
<
|
||||
|
||||
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.
|
||||
Note: If you define any section variables it will replace the default values
|
||||
entirely. If you want to disable only certain parts of a section you can try
|
||||
using variables defined in the |airline-configuration| or |airline-extensions|
|
||||
section.
|
||||
>
|
||||
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_a (mode, crypt, paste, iminsert)
|
||||
let g:airline_section_b (hunks, branch)
|
||||
let g:airline_section_c (bufferline or filename)
|
||||
let g:airline_section_gutter (readonly, csv)
|
||||
let g:airline_section_x (tagbar, virtualenv, filetype)
|
||||
let g:airline_section_x (tagbar, filetype, virtualenv)
|
||||
let g:airline_section_y (fileencoding, fileformat)
|
||||
let g:airline_section_z (percentage, line number, column number)
|
||||
let g:airline_section_warning (syntastic, whitespace)
|
||||
@@ -185,9 +238,71 @@ EXTENSIONS *airline-extensions*
|
||||
Most extensions are enabled by default and lazily loaded when the
|
||||
corresponding plugin (if any) is detected.
|
||||
|
||||
*airline-branch*
|
||||
By default, airline will attempt to load any extension it can find in the
|
||||
'runtimepath'. On some systems this can result in an undesirable startup
|
||||
cost. You can disable the check with the following flag. >
|
||||
let g:airline#extensions#disable_rtp_load = 1
|
||||
<
|
||||
Note: Third party plugins that rely on this behavior will be affected. You
|
||||
will need to manually load them.
|
||||
|
||||
Alternatively, if you want a minimalistic setup and would rather opt-in which
|
||||
extensions get loaded instead of disabling each individually, you can declare
|
||||
the following list variable: >
|
||||
" an empty list disables all extensions
|
||||
let g:airline_extensions = []
|
||||
|
||||
" or only load what you want
|
||||
let g:airline_extensions = ['branch', 'tabline']
|
||||
<
|
||||
------------------------------------- *airline-default*
|
||||
The default extension understands all of the `g:` variables in the
|
||||
|airline-configuration| section, however it also has some more fine-tuned
|
||||
configuration values that you can use.
|
||||
|
||||
* control which sections get truncated and at what width. >
|
||||
let g:airline#extensions#default#section_truncate_width = {
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ }
|
||||
|
||||
" Note: set to an empty dictionary to disable truncation.
|
||||
let g:airline#extensions#default#section_truncate_width = {}
|
||||
<
|
||||
* configure the layout of the sections by specifying an array of two arrays
|
||||
(first array is the left side, second array is the right side). >
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'a', 'b', 'c' ],
|
||||
\ [ 'x', 'y', 'z', 'warning' ]
|
||||
\ ]
|
||||
<
|
||||
------------------------------------- *airline-quickfix*
|
||||
The quickfix extension is a simple built-in extension which determines
|
||||
whether the buffer is a quickfix or location list buffer, and adjusts the
|
||||
title accordingly.
|
||||
|
||||
* configure the title text for quickfix buffers >
|
||||
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix'
|
||||
<
|
||||
* configure the title text for location list buffers >
|
||||
let g:airline#extensions#quickfix#location_text = 'Location'
|
||||
<
|
||||
|
||||
------------------------------------- *airline-bufferline*
|
||||
vim-bufferline <https://github.com/bling/vim-bufferline>
|
||||
|
||||
* enable/disable bufferline integration >
|
||||
let g:airline#extensions#bufferline#enabled = 1
|
||||
<
|
||||
* determine whether bufferline will overwrite customization variables >
|
||||
let g:airline#extensions#bufferline#overwrite_variables = 1
|
||||
<
|
||||
------------------------------------- *airline-branch*
|
||||
fugitive.vim <https://github.com/tpope/vim-fugitive>
|
||||
lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
|
||||
vcscommand <http://www.vim.org/scripts/script.php?script_id=90>
|
||||
|
||||
* enable/disable fugitive/lawrencium integration >
|
||||
let g:airline#extensions#branch#enabled = 1
|
||||
@@ -195,19 +310,49 @@ lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
|
||||
* change the text for when no branch is detected >
|
||||
let g:airline#extensions#branch#empty_message = ''
|
||||
<
|
||||
*airline-syntastic*
|
||||
* use vcscommand.vim if available >
|
||||
let g:airline#extensions#branch#use_vcscommand = 0
|
||||
<
|
||||
* truncate long branch names to a fixed length >
|
||||
let g:airline#extensions#branch#displayed_head_limit = 10
|
||||
<
|
||||
* customize formatting of branch name >
|
||||
" default value leaves the name unmodifed
|
||||
let g:airline#extensions#branch#format = 0
|
||||
|
||||
" to only show the tail, e.g. a branch 'feature/foo' becomes 'foo', use
|
||||
let g:airline#extensions#branch#format = 1
|
||||
|
||||
" to truncate all path sections but the last one, e.g. a branch
|
||||
" 'foo/bar/baz' becomes 'f/b/baz', use
|
||||
let g:airline#extensions#branch#format = 2
|
||||
|
||||
" if a string is provided, it should be the name of a function that
|
||||
" takes a string and returns the desired value
|
||||
let g:airline#extensions#branch#format = 'CustomBranchName'
|
||||
function! CustomBranchName(name)
|
||||
return '[' . a:name . ']'
|
||||
endfunction
|
||||
<
|
||||
------------------------------------- *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/>
|
||||
------------------------------------- *airline-tagbar*
|
||||
tagbar <https://github.com/majutsushi/tagbar>
|
||||
|
||||
* enable/disable tagbar integration >
|
||||
let g:airline#extensions#tagbar#enabled = 1
|
||||
<
|
||||
*airline-csv*
|
||||
* change how tags are displayed (:help tagbar-statusline) >
|
||||
let g:airline#extensions#tagbar#flags = '' (default)
|
||||
let g:airline#extensions#tagbar#flags = 'f'
|
||||
let g:airline#extensions#tagbar#flags = 's'
|
||||
let g:airline#extensions#tagbar#flags = 'p'
|
||||
<
|
||||
------------------------------------- *airline-csv*
|
||||
csv.vim <https://github.com/chrisbra/csv.vim>
|
||||
|
||||
* enable/disable csv integration for displaying the current column. >
|
||||
@@ -217,11 +362,13 @@ csv.vim <https://github.com/chrisbra/csv.vim>
|
||||
let g:airline#extensions#csv#column_display = 'Number' (default)
|
||||
let g:airline#extensions#csv#column_display = 'Name'
|
||||
<
|
||||
*airline-hunks*
|
||||
------------------------------------- *airline-hunks*
|
||||
vim-gitgutter <https://github.com/airblade/vim-gitgutter>
|
||||
vim-signify <https://github.com/mhinz/vim-signify>
|
||||
changesPlugin <https://github.com/chrisbra/changesPlugin>
|
||||
quickfixsigns <https://github.com/tomtom/quickfixsigns_vim>
|
||||
|
||||
* enable/disable showing a summary of changed hunks under source control.
|
||||
* 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. >
|
||||
@@ -230,24 +377,7 @@ vim-signify <https://github.com/mhinz/vim-signify>
|
||||
* 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*
|
||||
------------------------------------- *airline-ctrlp*
|
||||
ctrlp <https://github.com/kien/ctrlp.vim>
|
||||
|
||||
* configure which mode colors should ctrlp window use (takes effect
|
||||
@@ -257,20 +387,388 @@ ctrlp <https://github.com/kien/ctrlp.vim>
|
||||
let g:airline#extensions#ctrlp#color_template = 'visual'
|
||||
let g:airline#extensions#ctrlp#color_template = 'replace'
|
||||
<
|
||||
*airline-virtualenv*
|
||||
|
||||
* configure whether to show the previous and next modes (mru, buffer, etc...)
|
||||
>
|
||||
let g:airline#extensions#ctrlp#show_adjacent_modes = 1
|
||||
<
|
||||
------------------------------------- *airline-virtualenv*
|
||||
virtualenv <https://github.com/jmcantrell/vim-virtualenv>
|
||||
|
||||
* enable/disable virtualenv integration >
|
||||
let g:airline#extensions#virtualenv#enabled = 1
|
||||
<
|
||||
------------------------------------- *airline-eclim*
|
||||
eclim <https://eclim.org>
|
||||
|
||||
* enable/disable eclim integration, which works well with the
|
||||
|airline-syntastic| extension. >
|
||||
let g:airline#extensions#eclim#enabled = 1
|
||||
|
||||
------------------------------------- *airline-wordcount*
|
||||
* enable/disable word counting. >
|
||||
let g:airline#extensions#wordcount#enabled = 1
|
||||
<
|
||||
* regex of filetypes to enable word counting. >
|
||||
" the default value matches filetypes typically used for documentation
|
||||
" such as markdown and help files.
|
||||
let g:airline#extensions#wordcount#filetypes = ...
|
||||
(default: markdown,rst,org,help,text)
|
||||
|
||||
* defines the name of a formatter for word count will be displayed: >
|
||||
" The default will try to guess LC_NUMERIC and format number accordingly
|
||||
" e.g. 1,042 in English and 1.042 in German locale
|
||||
let g:airline#extensions#wordcount#formatter = 'default'
|
||||
|
||||
" here is how you can define a 'foo' formatter:
|
||||
" create a file in the dir autoload/airline/extensions/wordcount/formatters/
|
||||
" called foo.vim
|
||||
" this example needs at least Vim > 7.4.1042
|
||||
function! airline#extensions#wordcount#formatters#foo#format()
|
||||
return (wordcount()['words'] == 0 ? 'NONE' :
|
||||
\ wordcount()['words'] > 100 ? 'okay' : 'not enough')
|
||||
endfunction
|
||||
let g:airline#extensions#wordline#formatter = 'foo'
|
||||
<
|
||||
------------------------------------- *airline-whitespace*
|
||||
* enable/disable detection of whitespace errors. >
|
||||
let g:airline#extensions#whitespace#enabled = 1
|
||||
<
|
||||
* customize the type of mixed indent checking to perform. >
|
||||
" must be all spaces or all tabs before the first non-whitespace character
|
||||
let g:airline#extensions#whitespace#mixed_indent_algo = 0 (default)
|
||||
|
||||
" certain number of spaces are allowed after tabs, but not in between
|
||||
" this algorithm works well for /** */ style comments in a tab-indented file
|
||||
let g:airline#extensions#whitespace#mixed_indent_algo = 1
|
||||
|
||||
" spaces are allowed after tabs, but not in between
|
||||
" this algorithm works well with programming styles that use tabs for
|
||||
" indentation and spaces for alignment
|
||||
let g:airline#extensions#whitespace#mixed_indent_algo = 2
|
||||
<
|
||||
* customize the whitespace symbol. >
|
||||
let g:airline#extensions#whitespace#symbol = '!'
|
||||
<
|
||||
* configure which whitespace checks to enable. >
|
||||
let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing', 'long' ]
|
||||
<
|
||||
* configure the maximum number of lines where whitespace checking is enabled. >
|
||||
let g:airline#extensions#whitespace#max_lines = 20000
|
||||
<
|
||||
* 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]'
|
||||
let g:airline#extensions#whitespace#long_format = 'long[%s]'
|
||||
|
||||
* configure custom trailing whitespace regexp rule >
|
||||
let g:airline#extensions#whitespace#trailing_regexp = '\s$'
|
||||
<
|
||||
------------------------------------- *airline-tabline*
|
||||
* enable/disable enhanced tabline. >
|
||||
let g:airline#extensions#tabline#enabled = 0
|
||||
<
|
||||
* enable/disable displaying buffers with a single tab. >
|
||||
let g:airline#extensions#tabline#show_buffers = 1
|
||||
<
|
||||
* enable/disable displaying tabs, regardless of number. >
|
||||
let g:airline#extensions#tabline#show_tabs = 1
|
||||
<
|
||||
* configure filename match rules to exclude from the tabline. >
|
||||
let g:airline#extensions#tabline#excludes = []
|
||||
|
||||
* enable/disable display preview window buffer in the tabline.
|
||||
let g:airline#extensions#tabline#exclude_preview = 1
|
||||
|
||||
* configure how numbers are displayed in tab mode. >
|
||||
let g:airline#extensions#tabline#tab_nr_type = 0 " # of splits (default)
|
||||
let g:airline#extensions#tabline#tab_nr_type = 1 " tab number
|
||||
let g:airline#extensions#tabline#tab_nr_type = 2 " splits and tab number
|
||||
<
|
||||
* enable/disable displaying tab number in tabs mode. >
|
||||
let g:airline#extensions#tabline#show_tab_nr = 1
|
||||
|
||||
* enable/disable displaying tab type (far right)
|
||||
let g:airline#extensions#tabline#show_tab_type = 1
|
||||
|
||||
* enable/disable displaying index of the buffer.
|
||||
|
||||
When enabled, numbers will be displayed in the tabline and mappings will be
|
||||
exposed to allow you to select a buffer directly. Up to 9 mappings will be
|
||||
exposed.
|
||||
|
||||
let g:airline#extensions#tabline#buffer_idx_mode = 1
|
||||
nmap <leader>1 <Plug>AirlineSelectTab1
|
||||
nmap <leader>2 <Plug>AirlineSelectTab2
|
||||
nmap <leader>3 <Plug>AirlineSelectTab3
|
||||
nmap <leader>4 <Plug>AirlineSelectTab4
|
||||
nmap <leader>5 <Plug>AirlineSelectTab5
|
||||
nmap <leader>6 <Plug>AirlineSelectTab6
|
||||
nmap <leader>7 <Plug>AirlineSelectTab7
|
||||
nmap <leader>8 <Plug>AirlineSelectTab8
|
||||
nmap <leader>9 <Plug>AirlineSelectTab9
|
||||
nmap <leader>- <Plug>AirlineSelectPrevTab
|
||||
nmap <leader>+ <Plug>AirlineSelectNextTab
|
||||
|
||||
Note: Mappings will be ignored within a NERDTree buffer.
|
||||
|
||||
Note: In buffer_idx_mode these mappings won't change the
|
||||
current tab, but switch to the buffer visible in that tab.
|
||||
Use |gt| for switching tabs.
|
||||
In tabmode, those mappings will switch to the specified tab.
|
||||
|
||||
* defines the name of a formatter for how buffer names are displayed. >
|
||||
let g:airline#extensions#tabline#formatter = 'default'
|
||||
|
||||
" here is how you can define a 'foo' formatter:
|
||||
" create a file in the dir autoload/airline/extensions/tabline/formatters/
|
||||
" called foo.vim
|
||||
function! airline#extensions#tabline#formatters#foo#format(bufnr, buffers)
|
||||
return fnamemodify(bufname(a:bufnr), ':t')
|
||||
endfunction
|
||||
let g:airline#extensions#tabline#formatter = 'foo'
|
||||
<
|
||||
|
||||
Note: the following variables are only used by the 'default' formatter.
|
||||
When no disambiguation is needed, both 'unique_tail_improved' and
|
||||
'unique_tail' delegate formatting to 'default', so these variables also
|
||||
control rendering of unique filenames when using these formatters.
|
||||
|
||||
* configure whether buffer numbers should be shown. >
|
||||
let g:airline#extensions#tabline#buffer_nr_show = 0
|
||||
<
|
||||
* configure how buffer numbers should be formatted with |printf|. >
|
||||
let g:airline#extensions#tabline#buffer_nr_format = '%s: '
|
||||
<
|
||||
* configure the formatting of filenames (see |filename-modifiers|). >
|
||||
let g:airline#extensions#tabline#fnamemod = ':p:.'
|
||||
<
|
||||
* configure collapsing parent directories in buffer name. >
|
||||
let g:airline#extensions#tabline#fnamecollapse = 1
|
||||
<
|
||||
* configure truncating non-active buffer names to specified length. >
|
||||
let g:airline#extensions#tabline#fnametruncate = 0
|
||||
|
||||
" The `unique_tail` algorithm will display the tail of the filename, unless
|
||||
" there is another file of the same name, in which it will display it along
|
||||
" with the containing parent directory.
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail'
|
||||
|
||||
" The `unique_tail_improved` - another algorithm, that will smartly uniquify
|
||||
" buffers names with similar filename, suppressing common parts of paths.
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
|
||||
<
|
||||
* configure the minimum number of buffers needed to show the tabline. >
|
||||
let g:airline#extensions#tabline#buffer_min_count = 0
|
||||
<
|
||||
Note: this setting only applies to a single tab and when `show_buffers` is
|
||||
true.
|
||||
|
||||
* configure the minimum number of tabs needed to show the tabline. >
|
||||
let g:airline#extensions#tabline#tab_min_count = 0
|
||||
<
|
||||
Note: this setting only applies when `show_buffers` is false.
|
||||
|
||||
* configure separators for the tabline only. >
|
||||
let g:airline#extensions#tabline#left_sep = ''
|
||||
let g:airline#extensions#tabline#left_alt_sep = ''
|
||||
let g:airline#extensions#tabline#right_sep = ''
|
||||
let g:airline#extensions#tabline#right_alt_sep = ''
|
||||
|
||||
* configure whether close button should be shown
|
||||
let g:airline#extensions#tabline#show_close_button = 1
|
||||
|
||||
* configure symbol used to represent close button
|
||||
let g:airline#extensions#tabline#close_symbol = 'X'
|
||||
|
||||
* configure pattern to be ignored on BufAdd autocommand >
|
||||
" fixes unneccessary redraw, when e.g. opening Gundo window
|
||||
let airline#extensions#tabline#ignore_bufadd_pat =
|
||||
\ '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree'
|
||||
|
||||
<
|
||||
Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
|
||||
|
||||
------------------------------------- *airline-tmuxline*
|
||||
tmuxline <https://github.com/edkolev/tmuxline.vim>
|
||||
|
||||
* enable/disable tmuxline integration >
|
||||
let g:airline#extensions#tmuxline#enabled = 0
|
||||
<
|
||||
* configure which mode colors should be used in tmux statusline >
|
||||
let airline#extensions#tmuxline#color_template = 'normal' (default)
|
||||
let airline#extensions#tmuxline#color_template = 'insert'
|
||||
let airline#extensions#tmuxline#color_template = 'visual'
|
||||
let airline#extensions#tmuxline#color_template = 'replace'
|
||||
<
|
||||
* if specified, setting this option will trigger writing to the file whenever the
|
||||
airline theme is applied, i.e. when :AirlineTheme is executed and on vim
|
||||
startup >
|
||||
airline#extensions#tmuxline#snapshot_file = "~/.tmux-statusline-colors.conf"
|
||||
<
|
||||
------------------------------------- *airline-promptline*
|
||||
promptline <https://github.com/edkolev/promptline.vim>
|
||||
|
||||
* configure the path to the snapshot .sh file. Mandatory option. The created
|
||||
file should be sourced by the shell on login >
|
||||
" in .vimrc
|
||||
airline#extensions#promptline#snapshot_file = "~/.shell_prompt.sh"
|
||||
|
||||
" in .bashrc/.zshrc
|
||||
[ -f ~/.shell_prompt.sh ] && source ~/.shell_prompt.sh
|
||||
<
|
||||
* enable/disable promptline integration >
|
||||
let g:airline#extensions#promptline#enabled = 0
|
||||
<
|
||||
* configure which mode colors should be used in prompt >
|
||||
let airline#extensions#promptline#color_template = 'normal' (default)
|
||||
let airline#extensions#promptline#color_template = 'insert'
|
||||
let airline#extensions#promptline#color_template = 'visual'
|
||||
let airline#extensions#promptline#color_template = 'replace'
|
||||
<
|
||||
------------------------------------- *airline-nrrwrgn*
|
||||
NrrwRgn <https://github.com/chrisbra/NrrwRgn>
|
||||
|
||||
* enable/disable NrrwRgn integration >
|
||||
let g:airline#extensions#nrrwrgn#enabled = 1
|
||||
|
||||
------------------------------------- *airline-capslock*
|
||||
vim-capslock <https://github.com/tpope/vim-capslock>
|
||||
|
||||
* enable/disable vim-capslock integration >
|
||||
let g:airline#extensions#capslock#enabled = 1
|
||||
|
||||
------------------------------------- *airline-windowswap*
|
||||
vim-windowswap <https://github.com/wesQ3/vim-windowswap>
|
||||
|
||||
* enable/disable vim-windowswap integration >
|
||||
let g:airline#extensions#windowswap#enabled = 1
|
||||
|
||||
* set marked window indicator string >
|
||||
let g:airline#extensions#windowswap#indicator_text = 'WS'
|
||||
<
|
||||
------------------------------------- *airline-taboo*
|
||||
taboo.vim <https://github.com/gcmt/taboo.vim>
|
||||
|
||||
* enable/disable taboo.vim integration >
|
||||
let g:airline#extensions#taboo#enabled = 1
|
||||
<
|
||||
------------------------------------- *airline-ctrlspace*
|
||||
vim-ctrlspace <https://github.com/szw/vim-ctrlspace>
|
||||
|
||||
* enable/disable vim-ctrlspace integration >
|
||||
let g:airline#extensions#ctrlspace#enabled = 1
|
||||
<
|
||||
==============================================================================
|
||||
ADVANCED CUSTOMIZATION *airline-advanced-customization*
|
||||
|
||||
The defaults will accommodate the mass majority of users with minimal
|
||||
configuration. However, if you want to reposition sections or contents you can
|
||||
do so with built-in helper functions, which makes it possible to create
|
||||
sections in a more declarative style.
|
||||
|
||||
------------------------------------- *airline-parts*
|
||||
A part is something that contains metadata that eventually gets rendered into
|
||||
the statusline. You can define parts that contain constant strings or
|
||||
functions. Defining parts is needed if you want to use features like automatic
|
||||
insertion of separators or hiding based on window width.
|
||||
|
||||
For example, this is how you would define a part function: >
|
||||
call airline#parts#define_function('foo', 'GetFooText')
|
||||
<
|
||||
Here is how you would define a part that is visible only if the window width
|
||||
greater than a minimum width. >
|
||||
call airline#parts#define_minwidth('foo', 50)
|
||||
<
|
||||
Parts can be configured to be visible conditionally. >
|
||||
call airline#parts#define_condition('foo', 'getcwd() =~ "work_dir"')
|
||||
<
|
||||
|
||||
Now add part "foo" to section section airline_section_y: >
|
||||
let g:airline_section_y = airline#section#create_right(['ffenc','foo'])
|
||||
<
|
||||
Note: Part definitions are combinative; e.g. the two examples above modify the
|
||||
same `foo` part.
|
||||
|
||||
Note: Look at the source code and tests for the full API.
|
||||
|
||||
------------------------------------- *airline-predefined-parts*
|
||||
Before is a list of parts that are predefined by vim-airline.
|
||||
|
||||
* `mode` displays the current mode
|
||||
* `iminsert` displays the current insert method
|
||||
* `paste` displays the paste indicator
|
||||
* crypt displays the crypted indicator
|
||||
* `filetype` displays the file type
|
||||
* `readonly` displays the read only indicator
|
||||
* `file` displays the filename and modified indicator
|
||||
* `ffenc` displays the file format and encoding
|
||||
|
||||
And the following are defined for their respective extensions:
|
||||
|
||||
`hunks`, `branch`, `tagbar`, `syntastic`, `whitespace`
|
||||
|
||||
------------------------------------- *airline-accents*
|
||||
Accents can be defined on any part, like so: >
|
||||
call airline#parts#define_accent('foo', 'red')
|
||||
<
|
||||
This will override the colors of that part by using what is defined in that
|
||||
particular accent. In the above example, the `red` accent is used, which means
|
||||
regardless of which section the part is used in, it will have red foreground
|
||||
colors instead of the section's default foreground color.
|
||||
|
||||
The following accents are defined by default. Themes can define their variants
|
||||
of the colors, but defaults will be provided if missing. >
|
||||
bold, italic, red, green, blue, yellow, orange, purple
|
||||
<
|
||||
The defaults configure the mode and line number parts to be bold, and the
|
||||
readonly part to be red.
|
||||
|
||||
------------------------------------- *airline-sections*
|
||||
Once a part is defined, you can use helper functions to generate the
|
||||
statuslines for each section. For example, to use the part above, we could
|
||||
define a section like this: >
|
||||
function! AirlineInit()
|
||||
let g:airline_section_a = airline#section#create(['mode', ' ', 'foo'])
|
||||
let g:airline_section_b = airline#section#create_left(['ffenc','file'])
|
||||
let g:airline_section_c = airline#section#create(['%{getcwd()}'])
|
||||
endfunction
|
||||
autocmd User AirlineAfterInit call AirlineInit()
|
||||
<
|
||||
This will create a section with the `mode`, followed by a space, and our `foo`
|
||||
part in section `a`. Section `b` will have two parts with a left-side
|
||||
separator. And section `c` will contain the current path. You may notice that
|
||||
the space and cwd are not defined parts. For convenience, if a part of that
|
||||
key does not exist, it will be inserted as is. The unit tests will be a good
|
||||
resource for possibilities.
|
||||
|
||||
Note: The use of |VimEnter| is important, because most extensions are lazily
|
||||
loaded, so we must give them a chance to define their parts before we can use
|
||||
them.
|
||||
|
||||
Note: The `airline#section#create` function and friends will do its best to
|
||||
create a section with the appropriate separators, but it only works for
|
||||
function and text parts. Special 'statusline' items like %f or raw/undefined
|
||||
parts will not work as it is not possible to inspect their widths/contents
|
||||
before rendering to the statusline.
|
||||
|
||||
==============================================================================
|
||||
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.
|
||||
and you can tap into this functionality to extend it for you needs. This is
|
||||
the most powerful way to customize the statusline, and sometimes it may be
|
||||
easier to go this route than the above methods.
|
||||
|
||||
*add_statusline_func*
|
||||
Every section can have two values. The default value is the global `g:`
|
||||
variable which is used in the absence of a `w:` value. This makes it very easy
|
||||
to override only certain parts of the statusline by only defining window-local
|
||||
variables for a subset of all sections.
|
||||
|
||||
------------------------------------- *add_statusline_func*
|
||||
The following is an example of how you can extend vim-airline to support a
|
||||
new plugin. >
|
||||
function! MyPlugin(...)
|
||||
@@ -283,7 +781,10 @@ new plugin. >
|
||||
endfunction
|
||||
call airline#add_statusline_func('MyPlugin')
|
||||
<
|
||||
*remove_statusline_func*
|
||||
Notice that only the left side of the statusline is overwritten. This means
|
||||
the right side (the line/column numbers, etc) will be intact.
|
||||
|
||||
------------------------------------- *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')
|
||||
@@ -293,33 +794,39 @@ temporary override. >
|
||||
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: >
|
||||
is invoked and passed two 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! 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())
|
||||
call builder.split()
|
||||
call builder.add_section('airline_z', '%p%%')
|
||||
|
||||
return -1
|
||||
" tell the core to use the contents of the builder
|
||||
return 1
|
||||
endfunction
|
||||
<
|
||||
The above example uses various example highlight groups to demonstrate
|
||||
that you can use any combination from the loaded colorscheme. However, if
|
||||
you want colors to change between modes, you should use one of the section
|
||||
highlight groups, e.g. `airline_a` and `airline_b`.
|
||||
|
||||
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',
|
||||
'bufnr': 'the current buffer for this window',
|
||||
}
|
||||
<
|
||||
|
||||
*airline-pipeline-return-codes*
|
||||
------------------------------------- *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
|
||||
@@ -332,24 +839,17 @@ 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
|
||||
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
|
||||
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
|
||||
@@ -358,7 +858,8 @@ For contributions into the plugin, here are the following guidelines:
|
||||
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.
|
||||
See the source of |example.vim| for documented code of how to write one.
|
||||
Looking at the other extensions is also a good resource.
|
||||
|
||||
==============================================================================
|
||||
WRITING THEMES *airline-themes*
|
||||
@@ -383,7 +884,7 @@ A. You need to set up your terminal correctly. For more details, see
|
||||
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
|
||||
A. This is the default setting of 'laststatus'. If you want it to appear all
|
||||
the time, add the following to your vimrc: >
|
||||
set laststatus=2
|
||||
<
|
||||
@@ -414,7 +915,7 @@ Contributions and pull requests are welcome.
|
||||
==============================================================================
|
||||
LICENSE *airline-license*
|
||||
|
||||
MIT License. Copyright © 2013 Bailey Ling.
|
||||
MIT License. Copyright © 2013-2016 Bailey Ling.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline)
|
||||
@@ -6,84 +6,36 @@ if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline)
|
||||
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 are obsolete. Please read the documentation about the branch extension.'
|
||||
endif
|
||||
|
||||
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_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_mode_map', {
|
||||
\ '__' : '------',
|
||||
\ 'n' : 'NORMAL',
|
||||
\ 'i' : 'INSERT',
|
||||
\ 'R' : 'REPLACE',
|
||||
\ 'v' : 'VISUAL',
|
||||
\ 'V' : 'V-LINE',
|
||||
\ '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', '')
|
||||
call s:check_defined('g:airline_section_c', '%f%m')
|
||||
call s:check_defined('g:airline_section_gutter', '%=')
|
||||
call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}")
|
||||
call s:check_defined('g:airline_section_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}")
|
||||
call s:check_defined('g:airline_section_z', '%3p%% '.g:airline_linecolumn_prefix.'%3l:%3c')
|
||||
call s:check_defined('g:airline_section_warning', '__')
|
||||
|
||||
let s:airline_initialized = 0
|
||||
let s:airline_theme_defined = 0
|
||||
function! s:init()
|
||||
if !s:airline_initialized
|
||||
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
|
||||
if s:airline_initialized
|
||||
return
|
||||
endif
|
||||
let s:airline_initialized = 1
|
||||
|
||||
call airline#extensions#load()
|
||||
call airline#init#sections()
|
||||
|
||||
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
|
||||
|
||||
silent doautocmd User AirlineAfterInit
|
||||
endfunction
|
||||
|
||||
function! s:on_window_changed()
|
||||
if pumvisible()
|
||||
if pumvisible() && (!&previewwindow || g:airline_exclude_preview)
|
||||
return
|
||||
endif
|
||||
call <sid>init()
|
||||
call s:init()
|
||||
call airline#update_statusline()
|
||||
endfunction
|
||||
|
||||
function! s:on_colorscheme_changed()
|
||||
call <sid>init()
|
||||
call s:init()
|
||||
if !s:airline_theme_defined
|
||||
if airline#switch_matching_theme()
|
||||
return
|
||||
@@ -104,11 +56,14 @@ function! s:airline_toggle()
|
||||
au!
|
||||
augroup END
|
||||
augroup! airline
|
||||
|
||||
if exists("s:stl")
|
||||
let &stl = s:stl
|
||||
endif
|
||||
|
||||
silent doautocmd User AirlineToggledOff
|
||||
else
|
||||
let s:stl = &stl
|
||||
let s:stl = &statusline
|
||||
augroup airline
|
||||
autocmd!
|
||||
|
||||
@@ -118,16 +73,19 @@ function! s:airline_toggle()
|
||||
autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter')
|
||||
|
||||
autocmd ColorScheme * call <sid>on_colorscheme_changed()
|
||||
autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost *
|
||||
autocmd VimEnter,WinEnter,BufWinEnter,FileType,BufUnload,VimResized *
|
||||
\ 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()
|
||||
call s:on_window_changed()
|
||||
endif
|
||||
|
||||
silent doautocmd User AirlineToggledOn
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -135,6 +93,7 @@ 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#switch_theme(a:1)
|
||||
@@ -142,9 +101,14 @@ function! s:airline_theme(...)
|
||||
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()
|
||||
command! -bar -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
|
||||
command! -bar AirlineToggleWhitespace call airline#extensions#whitespace#toggle()
|
||||
command! -bar AirlineToggle call s:airline_toggle()
|
||||
command! -bar AirlineRefresh call airline#load_theme() | call airline#update_statusline()
|
||||
|
||||
call airline#init#bootstrap()
|
||||
call s:airline_toggle()
|
||||
|
||||
autocmd VimEnter * call airline#deprecation#check()
|
||||
|
||||
|
||||
87
t/airline.vim
Normal file
87
t/airline.vim
Normal file
@@ -0,0 +1,87 @@
|
||||
let g:airline_theme = 'dark'
|
||||
|
||||
source plugin/airline.vim
|
||||
doautocmd VimEnter
|
||||
|
||||
function! MyFuncref(...)
|
||||
call a:1.add_raw('hello world')
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! MyIgnoreFuncref(...)
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! MyAppend1(...)
|
||||
call a:1.add_raw('hello')
|
||||
endfunction
|
||||
|
||||
function! MyAppend2(...)
|
||||
call a:1.add_raw('world')
|
||||
endfunction
|
||||
|
||||
describe 'airline'
|
||||
before
|
||||
let g:airline_statusline_funcrefs = []
|
||||
end
|
||||
|
||||
it 'should run user funcrefs first'
|
||||
call airline#add_statusline_func('MyFuncref')
|
||||
let &statusline = ''
|
||||
call airline#update_statusline()
|
||||
Expect airline#statusline(1) =~ 'hello world'
|
||||
end
|
||||
|
||||
it 'should not change the statusline with -1'
|
||||
call airline#add_statusline_funcref(function('MyIgnoreFuncref'))
|
||||
let &statusline = 'foo'
|
||||
call airline#update_statusline()
|
||||
Expect &statusline == 'foo'
|
||||
end
|
||||
|
||||
it 'should support multiple chained funcrefs'
|
||||
call airline#add_statusline_func('MyAppend1')
|
||||
call airline#add_statusline_func('MyAppend2')
|
||||
call airline#update_statusline()
|
||||
Expect airline#statusline(1) =~ 'helloworld'
|
||||
end
|
||||
|
||||
it 'should allow users to redefine sections'
|
||||
let g:airline_section_a = airline#section#create(['mode', 'mode'])
|
||||
call airline#update_statusline()
|
||||
Expect airline#statusline(1) =~ '%{airline#util#wrap(airline#parts#mode(),0)}%#airline_a#%#airline_a_bold#%{airline#util#wrap(airline#parts#mode(),0)}%#airline_a#'
|
||||
end
|
||||
|
||||
it 'should remove funcrefs properly'
|
||||
let c = len(g:airline_statusline_funcrefs)
|
||||
call airline#add_statusline_func('MyIgnoreFuncref')
|
||||
call airline#remove_statusline_func('MyIgnoreFuncref')
|
||||
Expect len(g:airline_statusline_funcrefs) == c
|
||||
end
|
||||
|
||||
it 'should overwrite the statusline with active and inactive splits'
|
||||
wincmd s
|
||||
Expect airline#statusline(1) !~ 'inactive'
|
||||
Expect airline#statusline(2) =~ 'inactive'
|
||||
wincmd c
|
||||
end
|
||||
|
||||
it 'should collapse the inactive split if the variable is set true'
|
||||
let g:airline_inactive_collapse = 1
|
||||
wincmd s
|
||||
Expect getwinvar(2, '&statusline') !~ 'airline#parts#mode'
|
||||
wincmd c
|
||||
end
|
||||
|
||||
it 'should not collapse the inactive split if the variable is set false'
|
||||
let g:airline_inactive_collapse = 0
|
||||
wincmd s
|
||||
Expect getwinvar(2, '&statusline') != 'airline#parts#mode'
|
||||
wincmd c
|
||||
end
|
||||
|
||||
it 'should include check_mode'
|
||||
Expect airline#statusline(1) =~ 'airline#check_mode'
|
||||
end
|
||||
end
|
||||
|
||||
106
t/builder.vim
Normal file
106
t/builder.vim
Normal file
@@ -0,0 +1,106 @@
|
||||
let g:airline_theme = 'dark'
|
||||
call airline#init#bootstrap()
|
||||
|
||||
describe 'active builder'
|
||||
before
|
||||
let s:builder = airline#builder#new({'active': 1})
|
||||
end
|
||||
|
||||
it 'should start with an empty statusline'
|
||||
let stl = s:builder.build()
|
||||
Expect stl == ''
|
||||
end
|
||||
|
||||
it 'should transition colors from one to the next'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Normal#hello%#Normal_to_Search#>%#Search#world'
|
||||
end
|
||||
|
||||
it 'should reuse highlight group if background colors match'
|
||||
highlight Foo1 ctermfg=1 ctermbg=2
|
||||
highlight Foo2 ctermfg=1 ctermbg=2
|
||||
call s:builder.add_section('Foo1', 'hello')
|
||||
call s:builder.add_section('Foo2', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Foo1#hello>world'
|
||||
end
|
||||
|
||||
it 'should switch highlight groups if foreground colors differ'
|
||||
highlight Foo1 ctermfg=1 ctermbg=2
|
||||
highlight Foo2 ctermfg=2 ctermbg=2
|
||||
call s:builder.add_section('Foo1', 'hello')
|
||||
call s:builder.add_section('Foo2', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Foo1#hello%#Foo1_to_Foo2#>%#Foo2#world'
|
||||
end
|
||||
|
||||
it 'should split left/right sections'
|
||||
call s:builder.split()
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%='
|
||||
end
|
||||
|
||||
it 'after split, sections use the right separator'
|
||||
call s:builder.split()
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ 'hello%#Normal_to_Search#<%#Search#world'
|
||||
end
|
||||
|
||||
it 'should not repeat the same highlight group'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
let stl = s:builder.build()
|
||||
Expect stl == '%#Normal#hello>hello'
|
||||
end
|
||||
|
||||
it 'should replace accent groups with the specified group'
|
||||
call s:builder.add_section('Normal', '%#__accent_foo#hello')
|
||||
let stl = s:builder.build()
|
||||
Expect stl == '%#Normal#%#Normal_foo#hello'
|
||||
end
|
||||
|
||||
it 'should replace two accent groups with correct groups'
|
||||
call s:builder.add_section('Normal', '%#__accent_foo#hello%#__accent_bar#world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Normal_foo#hello%#Normal_bar#world'
|
||||
end
|
||||
|
||||
it 'should special restore group should go back to previous group'
|
||||
call s:builder.add_section('Normal', '%#__restore__#')
|
||||
let stl = s:builder.build()
|
||||
Expect stl !~ '%#__restore__#'
|
||||
Expect stl =~ '%#Normal#'
|
||||
end
|
||||
|
||||
it 'should blend colors from the left through the split to the right'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.split()
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ 'Normal_to_Search'
|
||||
end
|
||||
end
|
||||
|
||||
describe 'inactive builder'
|
||||
before
|
||||
let s:builder = airline#builder#new({'active': 0})
|
||||
end
|
||||
|
||||
it 'should transition colors from one to the next'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Normal_inactive#hello%#Normal_to_Search_inactive#>%#Search_inactive#world'
|
||||
end
|
||||
|
||||
it 'should not render accents'
|
||||
call s:builder.add_section('Normal', '%#__accent_foo#hello%#foo#foo%#__accent_bar#world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl == '%#Normal_inactive#hello%#foo_inactive#fooworld'
|
||||
end
|
||||
end
|
||||
|
||||
31
t/commands.vim
Normal file
31
t/commands.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
source plugin/airline.vim
|
||||
doautocmd VimEnter
|
||||
|
||||
describe 'commands'
|
||||
it 'should toggle off and on'
|
||||
execute 'AirlineToggle'
|
||||
Expect exists('#airline') to_be_false
|
||||
execute 'AirlineToggle'
|
||||
Expect exists('#airline') to_be_true
|
||||
end
|
||||
|
||||
it 'should toggle whitespace off and on'
|
||||
call airline#extensions#load()
|
||||
execute 'AirlineToggleWhitespace'
|
||||
Expect exists('#airline_whitespace') to_be_false
|
||||
execute 'AirlineToggleWhitespace'
|
||||
Expect exists('#airline_whitespace') to_be_true
|
||||
end
|
||||
|
||||
it 'should display theme name with no args'
|
||||
execute 'AirlineTheme simple'
|
||||
Expect g:airline_theme == 'simple'
|
||||
execute 'AirlineTheme dark'
|
||||
Expect g:airline_theme == 'dark'
|
||||
end
|
||||
|
||||
it 'should have a refresh command'
|
||||
Expect exists(':AirlineRefresh') to_be_true
|
||||
end
|
||||
end
|
||||
|
||||
31
t/extensions_default.vim
Normal file
31
t/extensions_default.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'c', 'a', 'b', 'warning' ],
|
||||
\ [ 'x', 'z', 'y' ]
|
||||
\ ]
|
||||
|
||||
source plugin/airline.vim
|
||||
doautocmd VimEnter
|
||||
|
||||
describe 'default'
|
||||
before
|
||||
let s:builder = airline#builder#new({'active': 1})
|
||||
end
|
||||
|
||||
it 'should use the layout'
|
||||
call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 })
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ 'airline_c_to_airline_a'
|
||||
Expect stl =~ 'airline_a_to_airline_b'
|
||||
Expect stl =~ 'airline_b_to_airline_warning'
|
||||
Expect stl =~ 'airline_x_to_airline_z'
|
||||
Expect stl =~ 'airline_z_to_airline_y'
|
||||
end
|
||||
|
||||
it 'should only render warning section in active splits'
|
||||
wincmd s
|
||||
Expect airline#statusline(1) =~ 'warning'
|
||||
Expect airline#statusline(2) !~ 'warning'
|
||||
wincmd c
|
||||
end
|
||||
end
|
||||
|
||||
21
t/highlighter.vim
Normal file
21
t/highlighter.vim
Normal file
@@ -0,0 +1,21 @@
|
||||
let g:airline_theme = 'dark'
|
||||
|
||||
describe 'highlighter'
|
||||
it 'should create separator highlight groups'
|
||||
hi Foo1 ctermfg=1 ctermbg=2
|
||||
hi Foo2 ctermfg=3 ctermbg=4
|
||||
call airline#highlighter#add_separator('Foo1', 'Foo2', 0)
|
||||
let hl = airline#highlighter#get_highlight('Foo1_to_Foo2')
|
||||
Expect hl == [ '', '', '4', '2', '' ]
|
||||
end
|
||||
|
||||
it 'should populate accent colors'
|
||||
Expect exists('g:airline#themes#dark#palette.normal.airline_c_red') to_be_false
|
||||
Expect hlID('airline_c_red') == 0
|
||||
call airline#themes#patch(g:airline#themes#dark#palette)
|
||||
call airline#highlighter#add_accent('red')
|
||||
call airline#highlighter#highlight(['normal'])
|
||||
Expect hlID('airline_c_red') != 0
|
||||
end
|
||||
end
|
||||
|
||||
77
t/init.vim
Normal file
77
t/init.vim
Normal file
@@ -0,0 +1,77 @@
|
||||
let s:sections = ['a', 'b', 'c', 'gutter', 'x', 'y', 'z', 'warning']
|
||||
|
||||
function! s:clear()
|
||||
for key in s:sections
|
||||
unlet! g:airline_section_{key}
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
call airline#init#bootstrap()
|
||||
|
||||
describe 'init sections'
|
||||
before
|
||||
call s:clear()
|
||||
call airline#init#sections()
|
||||
end
|
||||
|
||||
after
|
||||
call s:clear()
|
||||
end
|
||||
|
||||
it 'section a should have mode, paste, iminsert'
|
||||
Expect g:airline_section_a =~ 'mode'
|
||||
Expect g:airline_section_a =~ 'paste'
|
||||
Expect g:airline_section_a =~ 'iminsert'
|
||||
end
|
||||
|
||||
it 'section b should be blank because no extensions are installed'
|
||||
Expect g:airline_section_b == ''
|
||||
end
|
||||
|
||||
it 'section c should be file'
|
||||
Expect g:airline_section_c == '%<%f%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#'
|
||||
end
|
||||
|
||||
it 'section x should be filetype'
|
||||
Expect g:airline_section_x == '%{airline#util#wrap(airline#parts#filetype(),0)}'
|
||||
end
|
||||
|
||||
it 'section y should be fenc and ff'
|
||||
Expect g:airline_section_y =~ 'ff'
|
||||
Expect g:airline_section_y =~ 'fenc'
|
||||
end
|
||||
|
||||
it 'section z should be line numbers'
|
||||
Expect g:airline_section_z =~ '%3p%%'
|
||||
Expect g:airline_section_z =~ '%4l'
|
||||
Expect g:airline_section_z =~ '%3v'
|
||||
end
|
||||
|
||||
it 'should not redefine sections already defined'
|
||||
for s in s:sections
|
||||
let g:airline_section_{s} = s
|
||||
endfor
|
||||
call airline#init#bootstrap()
|
||||
for s in s:sections
|
||||
Expect g:airline_section_{s} == s
|
||||
endfor
|
||||
end
|
||||
|
||||
it 'all default statusline extensions should be blank'
|
||||
Expect airline#parts#get('hunks').raw == ''
|
||||
Expect airline#parts#get('branch').raw == ''
|
||||
Expect airline#parts#get('tagbar').raw == ''
|
||||
Expect airline#parts#get('syntastic').raw == ''
|
||||
Expect airline#parts#get('eclim').raw == ''
|
||||
Expect airline#parts#get('whitespace').raw == ''
|
||||
end
|
||||
end
|
||||
|
||||
describe 'init parts'
|
||||
it 'should not redefine parts already defined'
|
||||
call airline#parts#define_raw('linenr', 'bar')
|
||||
call airline#init#sections()
|
||||
Expect g:airline_section_z =~ 'bar'
|
||||
end
|
||||
end
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user