mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-07 12:44:26 +08:00
Compare commits
631 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
410429a95c | ||
|
|
4395405628 | ||
|
|
48423832d4 | ||
|
|
e8cc5f8b84 | ||
|
|
1104639708 | ||
|
|
d8d08ada7b | ||
|
|
f60a8cc7a3 | ||
|
|
a45a96c881 | ||
|
|
ea32215b08 | ||
|
|
f28a706020 | ||
|
|
4fa37e5e20 | ||
|
|
4540ea428a | ||
|
|
a7eb735f2e | ||
|
|
6c43fdea96 | ||
|
|
8fde76dd63 | ||
|
|
23fb126322 | ||
|
|
ff0f7df41f | ||
|
|
5d4ddeec10 | ||
|
|
ab948735be | ||
|
|
0bfae15d97 | ||
|
|
2f2797becb | ||
|
|
ad5194244b | ||
|
|
5cf193fa28 | ||
|
|
78e1a2c8db | ||
|
|
595d270398 | ||
|
|
7453b5e15c | ||
|
|
5ab8b754d8 | ||
|
|
0485b48dbb | ||
|
|
67f5a0ba20 | ||
|
|
7418df5583 | ||
|
|
67594b4da4 | ||
|
|
0e70dac030 | ||
|
|
adbfda43f8 | ||
|
|
63f9abd3f2 | ||
|
|
cf9eebcc45 | ||
|
|
e7edb4c75a | ||
|
|
e6ab7bdf6d | ||
|
|
8c080fdf80 | ||
|
|
d0652caf69 | ||
|
|
20d3aae20f | ||
|
|
8af213d3f9 | ||
|
|
8c7515aade | ||
|
|
7cfcc4871a | ||
|
|
faa7a18242 | ||
|
|
37231dac3a | ||
|
|
13ea57b98a | ||
|
|
5e0b10c005 | ||
|
|
d632c88751 | ||
|
|
d39076a07d | ||
|
|
a2f54ef6e6 | ||
|
|
da78d4a7bb | ||
|
|
8023f6f5dc | ||
|
|
2c5aa75d5f | ||
|
|
e4ef624ea8 | ||
|
|
1dc8eac3d2 | ||
|
|
651ad0a0c4 | ||
|
|
525144bf1c | ||
|
|
1d072bf019 | ||
|
|
cc219dbc10 | ||
|
|
31906ac7b2 | ||
|
|
447cf71ef2 | ||
|
|
fb5ecd4703 | ||
|
|
0ae3d36515 | ||
|
|
c1c1f7fc31 | ||
|
|
08a8779268 | ||
|
|
b48b166a22 | ||
|
|
9e6a917c52 | ||
|
|
1043f9c0ce | ||
|
|
faaf58b2c5 | ||
|
|
a65000211f | ||
|
|
e7de5f451a | ||
|
|
7efa5067ef | ||
|
|
3d148154e1 | ||
|
|
ac86003ac3 | ||
|
|
b160ffaaf4 | ||
|
|
7352c8ee9e | ||
|
|
cb30971901 | ||
|
|
62c383cefc | ||
|
|
af3f209d7a | ||
|
|
0ced03ebf3 | ||
|
|
73f365cfb9 | ||
|
|
de925becf6 | ||
|
|
050945f087 | ||
|
|
ae85179c3a | ||
|
|
0022de3b78 | ||
|
|
87d60febaf | ||
|
|
fdb74f549d | ||
|
|
89094025c0 | ||
|
|
42b59a05bf | ||
|
|
b2bf331d6b | ||
|
|
ef3746d022 | ||
|
|
3f927b587d | ||
|
|
d8adbfa135 | ||
|
|
f57c5daf66 | ||
|
|
da3f3bf1d7 | ||
|
|
9d1196f40a | ||
|
|
d6a42528a1 | ||
|
|
7c234a0139 | ||
|
|
ddbc454315 | ||
|
|
dbb4d3236b | ||
|
|
2d4cb5c1ad | ||
|
|
8c860b7045 | ||
|
|
ffe0fafa2d | ||
|
|
c34b29beb4 | ||
|
|
31730c6ec8 | ||
|
|
905522cd8b | ||
|
|
9c2c0816f5 | ||
|
|
c88f04cd1a | ||
|
|
e60611691f | ||
|
|
6e223196ff | ||
|
|
5ed7c81b6d | ||
|
|
e685bae41e | ||
|
|
44045bc280 | ||
|
|
450e2535af | ||
|
|
512d03d81b | ||
|
|
e7560025d1 | ||
|
|
d7fd8ca649 | ||
|
|
ce44577f1b | ||
|
|
e5c4306698 | ||
|
|
90af4618f5 | ||
|
|
1887b782e3 | ||
|
|
392ea2b185 | ||
|
|
b7a74b1748 | ||
|
|
1d8408a7f8 | ||
|
|
e50b34ff63 | ||
|
|
141f9358a2 | ||
|
|
1f2ac998d7 | ||
|
|
3cc0bfc390 | ||
|
|
d7f4fbf529 | ||
|
|
70ca735af0 | ||
|
|
2711863088 | ||
|
|
6d81660fd8 | ||
|
|
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 |
@@ -1,4 +1,8 @@
|
||||
language: ruby
|
||||
before_install:
|
||||
- curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/simple.vim" -o autoload/airline/themes/simple.vim
|
||||
- curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/molokai.vim" -o autoload/airline/themes/molokai.vim
|
||||
- mkdir colors && curl -f -L 'https://raw.githubusercontent.com/tomasr/molokai/master/colors/molokai.vim' -o colors/molokai.vim
|
||||
rvm:
|
||||
- 1.9.3
|
||||
script: rake ci
|
||||
|
||||
120
CHANGELOG.md
Normal file
120
CHANGELOG.md
Normal file
@@ -0,0 +1,120 @@
|
||||
# Change Log
|
||||
|
||||
This is the Changelog for the vim-airline project.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.8] - 2016-03-09
|
||||
- Changes
|
||||
- Airline converted to an organization and moved to new [repository](https://github.com/vim-airline/vim-airline)
|
||||
- Themes have been split into an separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
|
||||
- Improvements
|
||||
- Extensions
|
||||
- branch: support Git and Mercurial simultaneously, untracked files
|
||||
- whitespace: new mixed-indent rule
|
||||
- Windows support
|
||||
- Many bug fixes
|
||||
- Support for Neovim
|
||||
- New features
|
||||
- Many new themes
|
||||
- Extensions/integration
|
||||
- [taboo](https://github.com/gcmt/taboo.vim)
|
||||
- [vim-ctrlspace](https://github.com/szw/vim-ctrlspace)
|
||||
- [quickfixsigns](https://github.com/tomtom/quickfixsigns_vim)
|
||||
- [YouCompleteMe](https://github.com/Valloric/YouCompleteMe)
|
||||
- [po.vim](http://www.vim.org/scripts/script.php?script_id=695)
|
||||
- [unicode.vim](https://github.com/chrisbra/unicode.vim)
|
||||
- wordcount
|
||||
- crypt indicator
|
||||
- byte order mark indicator
|
||||
- Tabline's tab mode can display splits simultaneously
|
||||
|
||||
## [0.7] - 2014-12-10
|
||||
- New features
|
||||
- accents support; allowing multiple colors/styles in the same section
|
||||
- extensions: eclim
|
||||
- themes: understated, monochrome, murmur, sol, lucius
|
||||
- Improvements
|
||||
- solarized theme; support for 8 color terminals
|
||||
- tabline resizes dynamically based on number of open buffers
|
||||
- miscellaneous bug fixes
|
||||
|
||||
## [0.6] - 2013-10-08
|
||||
|
||||
- New features
|
||||
- accents support; allowing multiple colors/styles in the same section
|
||||
- extensions: eclim
|
||||
- themes: understated, monochrome, murmur, sol, lucius
|
||||
- Improvements
|
||||
- solarized theme; support for 8 color terminals
|
||||
- tabline resizes dynamically based on number of open buffers
|
||||
- miscellaneous bug fixes
|
||||
|
||||
## [0.5] - 2013-09-13
|
||||
|
||||
- New features
|
||||
- smart tabline extension which displays all buffers when only one tab is visible
|
||||
- automatic section truncation when the window resizes
|
||||
- support for a declarative style of configuration, allowing parts to contain metadata such as minimum window width or conditional visibility
|
||||
- themes: zenburn, serene
|
||||
- Other
|
||||
- a sizable chunk of vim-airline is now running through a unit testing suite, automated via Travis CI
|
||||
|
||||
## [0.4] - 2013-08-26
|
||||
|
||||
- New features
|
||||
- integration with csv.vim and vim-virtualenv
|
||||
- hunks extension for vim-gitgutter and vim-signify
|
||||
- automatic theme switching with matching colorschemes
|
||||
- commands: AirlineToggle
|
||||
- themes: base16 (all variants)
|
||||
- Improvements
|
||||
- integration with undotree, tagbar, and unite
|
||||
- Other
|
||||
- refactored core and exposed statusline builder and pipeline
|
||||
- all extension related g:airline_variables have been deprecated in favor of g:airline#extensions# variables
|
||||
- extensions found in the runtimepath outside of the default distribution will be automatically loaded
|
||||
|
||||
## [0.3] - 2013-08-12
|
||||
|
||||
- New features
|
||||
- first-class integration with tagbar
|
||||
- white space detection for trailing spaces and mixed indentation
|
||||
- introduced warning section for syntastic and white space detection
|
||||
- improved ctrlp integration: colors are automatically selected based on the current airline theme
|
||||
- new themes: molokai, bubblegum, jellybeans, tomorrow
|
||||
- Bug fixes
|
||||
- improved handling of eventignore used by other plugins
|
||||
- Other
|
||||
- code cleaned up for clearer separation between core functionality and extensions
|
||||
- introduced color extraction from highlight groups, allowing themes to be generated off of the active colorscheme (e.g. jellybeans and tomorrow)
|
||||
- License changed to MIT
|
||||
|
||||
## [0.2] - 2013-07-28
|
||||
|
||||
- New features
|
||||
- iminsert detection
|
||||
- integration with vimshell, vimfiler, commandt, lawrencium
|
||||
- enhanced bufferline theming
|
||||
- support for ctrlp theming
|
||||
- support for custom window excludes
|
||||
- New themes
|
||||
- luna and wombat
|
||||
- Bug fixes
|
||||
- refresh branch name after switching with a shell command
|
||||
|
||||
## [0.1] - 2013-07-17
|
||||
|
||||
- Initial release
|
||||
- integration with other plugins: netrw, unite, nerdtree, undotree, gundo, tagbar, minibufexplr, ctrlp
|
||||
- support for themes: 8 included
|
||||
|
||||
[Unreleased]: https://github.com/vim-airline/vim-airline/compare/v0.8...HEAD
|
||||
[0.8]: https://github.com/vim-airline/vim-airline/compare/v0.7...v0.8
|
||||
[0.7]: https://github.com/vim-airline/vim-airline/compare/v0.6...v0.7
|
||||
[0.6]: https://github.com/vim-airline/vim-airline/compare/v0.5...v0.6
|
||||
[0.5]: https://github.com/vim-airline/vim-airline/compare/v0.4...v0.5
|
||||
[0.4]: https://github.com/vim-airline/vim-airline/compare/v0.3...v0.4
|
||||
[0.3]: https://github.com/vim-airline/vim-airline/compare/v0.2...v0.3
|
||||
[0.2]: https://github.com/vim-airline/vim-airline/compare/v0.1...v0.2
|
||||
[0.1]: https://github.com/vim-airline/vim-airline/releases/tag/v0.1
|
||||
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
|
||||
14
ISSUE_TEMPLATE.md
Normal file
14
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,14 @@
|
||||
#### environment
|
||||
|
||||
- vim: ????
|
||||
- vim-airline: ????
|
||||
- OS: ????
|
||||
- terminal: ????
|
||||
|
||||
#### actual behavior
|
||||
|
||||
????
|
||||
|
||||
#### expected behavior
|
||||
|
||||
????
|
||||
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"),
|
||||
|
||||
117
README.md
117
README.md
@@ -1,18 +1,24 @@
|
||||
# vim-airline [](https://travis-ci.org/bling/vim-airline)
|
||||
# vim-airline [](https://travis-ci.org/vim-airline/vim-airline)
|
||||
|
||||
Lean & mean status/tabline for vim that's light as air.
|
||||
|
||||

|
||||

|
||||
|
||||
# Features
|
||||
|
||||
* 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].
|
||||
* 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 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.
|
||||
* Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others.
|
||||
Note these are now external to this plugin. See [below][46] for detail.
|
||||
* Supports 7.2 as the minimum Vim version.
|
||||
* Stable release cycle; bleeding edge changes happen on the `dev` branch, and after they have gone through a [full regression test][33] will eventually be merged in the stable master branch. Releases typically occur every 2 weeks.
|
||||
* 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
|
||||
@@ -21,6 +27,20 @@ If you don't like the defaults, you can replace all sections with standard `stat
|
||||
|
||||

|
||||
|
||||
## Themes
|
||||
|
||||
Themes have moved to
|
||||
another repository as of [this commit][45].
|
||||
|
||||
Install the themes as you would this plugin (Vundle example):
|
||||
|
||||
```vim
|
||||
Plugin 'vim-airline/vim-airline'
|
||||
Plugin 'vim-airline/vim-airline-themes'
|
||||
```
|
||||
|
||||
See https://github.com/vim-airline/vim-airline-themes for more.
|
||||
|
||||
## Automatic truncation
|
||||
|
||||
Sections and parts within sections can be configured to automatically hide when the window size shrinks.
|
||||
@@ -37,6 +57,11 @@ This is disabled by default; add the following to your vimrc to enable the exten
|
||||
|
||||
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).
|
||||
@@ -62,6 +87,15 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
|
||||
#### [virtualenv][31]
|
||||

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

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

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

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

|
||||
|
||||
Sections can contain accents, which allows for very granular control of visuals (see configuration [here](https://github.com/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.
|
||||
@@ -102,11 +140,14 @@ I wrote the initial version on an airplane, and since it's light as air it turne
|
||||
This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:
|
||||
|
||||
* [Pathogen][11]
|
||||
* `git clone https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline`
|
||||
* `git clone https://github.com/vim-airline/vim-airline ~/.vim/bundle/vim-airline`
|
||||
* Remember to run `:Helptags` to generate help tags
|
||||
* [NeoBundle][12]
|
||||
* `NeoBundle 'bling/vim-airline'`
|
||||
* `NeoBundle 'vim-airline/vim-airline'`
|
||||
* [Vundle][13]
|
||||
* `Bundle 'bling/vim-airline'`
|
||||
* `Plugin 'vim-airline/vim-airline'`
|
||||
* [Plug][40]
|
||||
* `Plug 'vim-airline/vim-airline'`
|
||||
* [VAM][22]
|
||||
* `call vam#ActivateAddons([ 'vim-airline' ])`
|
||||
* manual
|
||||
@@ -116,6 +157,9 @@ 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.
|
||||
@@ -126,33 +170,33 @@ Finally, you can add the convenience variable `let g:airline_powerline_fonts = 1
|
||||
|
||||
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
|
||||
@@ -163,27 +207,40 @@ 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/bling/vim-airline/wiki/Test-Plan
|
||||
[33]: https://github.com/vim-airline/vim-airline/wiki/Test-Plan
|
||||
[34]: http://eclim.org
|
||||
[35]: https://github.com/edkolev/tmuxline.vim
|
||||
[36]: https://github.com/edkolev/promptline.vim
|
||||
[37]: https://github.com/gcmt/taboo.vim
|
||||
[38]: https://github.com/szw/vim-ctrlspace
|
||||
[39]: https://github.com/tomtom/quickfixsigns_vim
|
||||
[40]: https://github.com/junegunn/vim-plug
|
||||
[41]: https://github.com/bling
|
||||
[42]: https://github.com/chrisbra
|
||||
[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer
|
||||
[44]: https://github.com/mhartington
|
||||
[45]: https://github.com/vim-airline/vim-airline/commit/d7fd8ca649e441b3865551a325b10504cdf0711b
|
||||
[46]: https://github.com/vim-airline/vim-airline#themes
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', [])
|
||||
|
||||
let s:sections = ['a','b','c','gutter','x','y','z','warning']
|
||||
let s:sections = ['a','b','c','gutter','x','y','z', 'error', 'warning']
|
||||
let s:inactive_funcrefs = []
|
||||
|
||||
function! airline#add_statusline_func(name)
|
||||
@@ -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,13 +32,11 @@ function! airline#add_inactive_statusline_func(name)
|
||||
endfunction
|
||||
|
||||
function! airline#load_theme()
|
||||
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')
|
||||
@@ -40,21 +44,48 @@ 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()
|
||||
|
||||
" 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 existing = g:airline_theme
|
||||
let theme = substitute(g:colors_name, '-', '_', 'g')
|
||||
try
|
||||
let palette = g:airline#themes#{g:colors_name}#palette
|
||||
call airline#switch_theme(g:colors_name)
|
||||
let palette = g:airline#themes#{theme}#palette
|
||||
call airline#switch_theme(theme)
|
||||
return 1
|
||||
catch
|
||||
for map in items(g:airline_theme_map)
|
||||
if match(g:colors_name, map[0]) > -1
|
||||
call airline#switch_theme(map[1])
|
||||
try
|
||||
let palette = g:airline#themes#{map[1]}#palette
|
||||
call airline#switch_theme(map[1])
|
||||
catch
|
||||
call airline#switch_theme(existing)
|
||||
endtry
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
@@ -64,7 +95,13 @@ function! airline#switch_matching_theme()
|
||||
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, 'bufnr': winbufnr(nr) }
|
||||
call s:invoke_funcrefs(context, s:inactive_funcrefs)
|
||||
@@ -96,7 +133,12 @@ function! s:invoke_funcrefs(context, funcrefs)
|
||||
endfunction
|
||||
|
||||
function! airline#statusline(winnr)
|
||||
return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
|
||||
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)
|
||||
@@ -110,6 +152,8 @@ function! airline#check_mode(winnr)
|
||||
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
|
||||
@@ -119,16 +163,22 @@ function! airline#check_mode(winnr)
|
||||
let w:airline_current_mode = get(g:airline_mode_map, '__')
|
||||
endif
|
||||
|
||||
if g:airline_detect_modified
|
||||
if &modified
|
||||
call add(l:mode, 'modified')
|
||||
endif
|
||||
if g:airline_detect_modified && &modified
|
||||
call add(l:mode, 'modified')
|
||||
endif
|
||||
|
||||
if g:airline_detect_paste && &paste
|
||||
call add(l:mode, 'paste')
|
||||
endif
|
||||
|
||||
if g:airline_detect_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)
|
||||
|
||||
@@ -1,49 +1,127 @@
|
||||
" 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 ? self._context.left_alt_sep : self._context.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 ? self._context.left_sep : self._context.right_sep
|
||||
endif
|
||||
endif
|
||||
|
||||
if self._curgroup != a:group
|
||||
let self._line .= '%#'.a:group.'#'
|
||||
endif
|
||||
|
||||
let self._line .= 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 g:airline_gui_mode ==# 'gui'
|
||||
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 = ''
|
||||
let builder._sections = []
|
||||
|
||||
call extend(builder._context, {
|
||||
\ 'left_sep': g:airline_left_sep,
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#deprecation#check()
|
||||
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
|
||||
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables are obsolete. Please read the documentation about the branch extension.'
|
||||
endif
|
||||
|
||||
let tests = [
|
||||
\ [ 'g:airline_paste_symbol', 'g:airline_symbols.paste' ],
|
||||
\ [ 'g:airline_readonly_symbol', 'g:airline_symbols.readonly' ],
|
||||
\ [ 'g:airline_linecolumn_prefix', 'g:airline_symbols.linenr' ],
|
||||
\ [ 'g:airline_branch_prefix', 'g:airline_symbols.branch' ],
|
||||
\ [ 'g:airline_branch_empty_message', 'g:airline#extensions#branch#empty_message' ],
|
||||
\ [ 'g:airline_detect_whitespace', 'g:airline#extensions#whitespace#enabled|show_message' ],
|
||||
\ [ 'g:airline_enable_hunks', 'g:airline#extensions#hunks#enabled' ],
|
||||
\ [ 'g:airline_enable_tagbar', 'g:airline#extensions#tagbar#enabled' ],
|
||||
\ [ 'g:airline_enable_csv', 'g:airline#extensions#csv#enabled' ],
|
||||
\ [ 'g:airline_enable_branch', 'g:airline#extensions#branch#enabled' ],
|
||||
\ [ 'g:airline_enable_bufferline', 'g:airline#extensions#bufferline#enabled' ],
|
||||
\ [ 'g:airline_enable_syntastic', 'g:airline#extensions#syntastic#enabled' ],
|
||||
\ ]
|
||||
for test in tests
|
||||
if exists(test[0])
|
||||
let max = winwidth(0) - 16
|
||||
let msg = printf('The variable %s is deprecated and may not work in the future. It has been replaced with %s. Please read the documentation.', test[0], test[1])
|
||||
echom msg[:max].'...'
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:ext = {}
|
||||
@@ -20,13 +20,12 @@ endfunction
|
||||
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 = {}
|
||||
@@ -50,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#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 = ''
|
||||
@@ -127,10 +121,27 @@ 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()
|
||||
|
||||
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:, 'airline#extensions#ycm#enabled', 0)
|
||||
call airline#extensions#ycm#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_vimfiler', 0)
|
||||
let g:vimfiler_force_overwrite_statusline = 0
|
||||
endif
|
||||
@@ -139,6 +150,10 @@ function! airline#extensions#load()
|
||||
call airline#extensions#ctrlp#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'CtrlSpaceLoaded', 0)
|
||||
call airline#extensions#ctrlspace#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'command_t_loaded', 0)
|
||||
call airline#extensions#commandt#init(s:ext)
|
||||
endif
|
||||
@@ -147,17 +162,17 @@ function! airline#extensions#load()
|
||||
call airline#extensions#undotree#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#hunks#enabled', 1) && get(g:, 'airline_enable_hunks', 1))
|
||||
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter'))
|
||||
if get(g:, 'airline#extensions#hunks#enabled', 1)
|
||||
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter') || exists('g:loaded_changes') || exists('g:loaded_quickfixsigns'))
|
||||
call airline#extensions#hunks#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#tagbar#enabled', 1) && get(g:, 'airline_enable_tagbar', 1))
|
||||
if get(g:, 'airline#extensions#tagbar#enabled', 1)
|
||||
\ && exists(':TagbarToggle')
|
||||
call airline#extensions#tagbar#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#csv#enabled', 1) && get(g:, 'airline_enable_csv', 1))
|
||||
if get(g:, 'airline#extensions#csv#enabled', 1)
|
||||
\ && (get(g:, 'loaded_csv', 0) || exists(':Table'))
|
||||
call airline#extensions#csv#init(s:ext)
|
||||
endif
|
||||
@@ -167,45 +182,88 @@ function! airline#extensions#load()
|
||||
let s:filetype_regex_overrides['^int-'] = ['vimshell','%{substitute(&ft, "int-", "", "")}']
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#branch#enabled', 1) && get(g:, 'airline_enable_branch', 1))
|
||||
\ && (get(g:, 'loaded_fugitive', 0) || get(g:, 'loaded_lawrencium', 0))
|
||||
if get(g:, 'airline#extensions#branch#enabled', 1)
|
||||
\ && (exists('*fugitive#head') || exists('*lawrencium#statusline') ||
|
||||
\ (get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')))
|
||||
call airline#extensions#branch#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#bufferline#enabled', 1) && get(g:, 'airline_enable_bufferline', 1))
|
||||
if get(g:, 'airline#extensions#bufferline#enabled', 1)
|
||||
\ && exists('*bufferline#get_status_string')
|
||||
call airline#extensions#bufferline#init(s:ext)
|
||||
endif
|
||||
|
||||
if 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 (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
|
||||
if (get(g:, 'airline#extensions#eclim#enabled', 1) && exists(':ProjectCreate'))
|
||||
call airline#extensions#eclim#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#syntastic#enabled', 1)
|
||||
\ && exists(':SyntasticCheck')
|
||||
call airline#extensions#syntastic#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#whitespace#enabled', 1) && get(g:, 'airline_detect_whitespace', 1))
|
||||
if get(g:, 'airline#extensions#whitespace#enabled', 1)
|
||||
call airline#extensions#whitespace#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#po#enabled', 1) && executable('msgfmt')
|
||||
call airline#extensions#po#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#wordcount#enabled', 1)
|
||||
call airline#extensions#wordcount#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#enabled', 0)
|
||||
call airline#extensions#tabline#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")
|
||||
" 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
|
||||
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#unicode#enabled', 1) && exists(':UnicodeTable') == 2
|
||||
call airline#extensions#unicode#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#capslock#enabled', 1) && exists('*CapsLockStatusline'))
|
||||
call airline#extensions#capslock#init(s:ext)
|
||||
endif
|
||||
|
||||
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,50 +1,215 @@
|
||||
" 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', g:airline_symbols.branch)
|
||||
|
||||
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')
|
||||
|
||||
if !s:has_fugitive && !s:has_lawrencium && !s:has_vcscommand
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:git_dirs = {}
|
||||
let s:untracked_git = {}
|
||||
let s:untracked_hg = {}
|
||||
|
||||
let s:head_format = get(g:, 'airline#extensions#branch#format', 0)
|
||||
if s:head_format == 1
|
||||
function! s:format_name(name)
|
||||
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
|
||||
|
||||
function! s:get_git_branch(path)
|
||||
if !s:has_fugitive
|
||||
return ''
|
||||
endif
|
||||
|
||||
let name = fugitive#head(7)
|
||||
if empty(name)
|
||||
if has_key(s:git_dirs, a:path)
|
||||
return s:git_dirs[a:path]
|
||||
endif
|
||||
|
||||
let dir = fugitive#extract_git_dir(a:path)
|
||||
if empty(dir)
|
||||
let name = ''
|
||||
else
|
||||
try
|
||||
let line = join(readfile(dir . '/HEAD'))
|
||||
if strpart(line, 0, 16) == 'ref: refs/heads/'
|
||||
let name = strpart(line, 16)
|
||||
else
|
||||
" raw commit hash
|
||||
let name = strpart(line, 0, 7)
|
||||
endif
|
||||
catch
|
||||
let name = ''
|
||||
endtry
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:git_dirs[a:path] = name
|
||||
return name
|
||||
endfunction
|
||||
|
||||
function! s:get_git_untracked(file)
|
||||
let untracked = ''
|
||||
if empty(a:file)
|
||||
return untracked
|
||||
endif
|
||||
if has_key(s:untracked_git, a:file)
|
||||
let untracked = s:untracked_git[a:file]
|
||||
else
|
||||
let output = system('git status --porcelain -- '. a:file)
|
||||
if output[0:1] is# '??' && output[3:-2] is? a:file
|
||||
let untracked = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists)
|
||||
endif
|
||||
let s:untracked_git[a:file] = untracked
|
||||
endif
|
||||
return untracked
|
||||
endfunction
|
||||
|
||||
function! s:get_hg_untracked(file)
|
||||
if s:has_lawrencium
|
||||
" delete cache when unlet b:airline head?
|
||||
let untracked = ''
|
||||
if empty(a:file)
|
||||
return untracked
|
||||
endif
|
||||
if has_key(s:untracked_hg, a:file)
|
||||
let untracked = s:untracked_hg[a:file]
|
||||
else
|
||||
let untracked = (system('hg status -u -- '. a:file)[0] is# '?' ?
|
||||
\ get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists) : '')
|
||||
let s:untracked_hg[a:file] = untracked
|
||||
endif
|
||||
return untracked
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_hg_branch()
|
||||
if s:has_lawrencium
|
||||
return lawrencium#statusline()
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#head()
|
||||
if exists('b:airline_head') && !empty(b:airline_head)
|
||||
return b:airline_head
|
||||
endif
|
||||
|
||||
let b:airline_head = ''
|
||||
let l:heads = {}
|
||||
let l:vcs_priority = get(g:, "airline#extensions#branch#vcs_priority", ["git", "mercurial"])
|
||||
let found_fugitive_head = 0
|
||||
|
||||
let l:git_head = s:get_git_branch(expand("%:p:h"))
|
||||
let l:hg_head = s:get_hg_branch()
|
||||
|
||||
if !empty(l:git_head)
|
||||
let found_fugitive_head = 1
|
||||
let l:heads.git = (!empty(l:hg_head) ? "git:" : '') . s:format_name(l:git_head)
|
||||
let l:git_untracked = s:get_git_untracked(expand("%:p"))
|
||||
let l:heads.git .= l:git_untracked
|
||||
endif
|
||||
|
||||
if !empty(l:hg_head)
|
||||
let l:heads.mercurial = (!empty(l:git_head) ? "hg:" : '') . s:format_name(l:hg_head)
|
||||
let l:hg_untracked = s:get_hg_untracked(expand("%:p"))
|
||||
let l:heads.mercurial.= l:hg_untracked
|
||||
endif
|
||||
|
||||
if empty(l:heads)
|
||||
if s:has_vcscommand
|
||||
call VCSCommandEnableBufferSetup()
|
||||
if exists('b:VCSCommandBufferInfo')
|
||||
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, ''))
|
||||
endif
|
||||
endif
|
||||
else
|
||||
for vcs in l:vcs_priority
|
||||
if has_key(l:heads, vcs)
|
||||
if !empty(b:airline_head)
|
||||
let b:airline_head = b:airline_head . " | "
|
||||
endif
|
||||
let b:airline_head = b:airline_head . l:heads[vcs]
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if 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)].(&encoding ==? 'utf-8' ? '…' : '.')
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||
let b:airline_head = ''
|
||||
endif
|
||||
return b:airline_head
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#get_head()
|
||||
let head = ''
|
||||
|
||||
if s:has_fugitive && !exists('b:mercurial_dir')
|
||||
let head = fugitive#head()
|
||||
|
||||
if empty(head) && s:has_fugitive_detect && !exists('b:git_dir')
|
||||
call fugitive#detect(getcwd())
|
||||
let head = fugitive#head()
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(head)
|
||||
if s:has_lawrencium
|
||||
let head = lawrencium#statusline()
|
||||
endif
|
||||
endif
|
||||
|
||||
return empty(head) || !s:check_in_path()
|
||||
\ ? s:empty_message
|
||||
\ : printf('%s%s', empty(s:symbol) ? '' : s:symbol.' ', head)
|
||||
let head = airline#extensions#branch#head()
|
||||
let empty_message = get(g:, 'airline#extensions#branch#empty_message', '')
|
||||
let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
|
||||
return empty(head)
|
||||
\ ? empty_message
|
||||
\ : 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:h'))
|
||||
let root = fnamemodify(root, ':h')
|
||||
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! s:reset_untracked_cache()
|
||||
if exists("s:untracked_git")
|
||||
let s:untracked_git={}
|
||||
endif
|
||||
if exists("s:untracked_hg")
|
||||
let s:untracked_hg={}
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
call airline#parts#define_function('branch', 'airline#extensions#branch#get_head')
|
||||
|
||||
autocmd BufReadPost * unlet! b:airline_file_in_root
|
||||
autocmd CursorHold,ShellCmdPost,CmdwinLeave * unlet! b:airline_head
|
||||
autocmd User AirlineBeforeRefresh unlet! b:airline_head
|
||||
autocmd BufWritePost,ShellCmdPost * call s:reset_untracked_cache()
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,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('*bufferline#get_status_string')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:overwrite = get(g:, 'airline#extensions#bufferline#overwrite_variables', 1)
|
||||
|
||||
function! airline#extensions#bufferline#init(ext)
|
||||
@@ -11,7 +15,7 @@ function! airline#extensions#bufferline#init(ext)
|
||||
let g:bufferline_active_highlight = 'bufferline_selected'
|
||||
let g:bufferline_active_buffer_left = ''
|
||||
let g:bufferline_active_buffer_right = ''
|
||||
let g:bufferline_separator = ' '
|
||||
let g:bufferline_separator = g:airline_symbols.space
|
||||
endif
|
||||
|
||||
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
|
||||
|
||||
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)
|
||||
@@ -29,17 +33,28 @@ function! airline#extensions#ctrlp#load_theme(palette)
|
||||
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)
|
||||
|
||||
17
autoload/airline/extensions/ctrlspace.vim
Normal file
17
autoload/airline/extensions/ctrlspace.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" 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_b', '⌗' . s:padding . ctrlspace#api#StatuslineModeSegment(s:padding))
|
||||
call b.split()
|
||||
call b.add_section('airline_x', s:spc . ctrlspace#api#StatuslineTabSegment() . s:spc)
|
||||
return b.build()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlspace#init(ext)
|
||||
let g:CtrlSpaceStatuslineFunction = "airline#extensions#ctrlspace#statusline()"
|
||||
endfunction
|
||||
@@ -1,15 +1,18 @@
|
||||
" 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:section_use_groups = get(g:, 'airline#extensions#default#section_use_groupitems', 1)
|
||||
let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', {
|
||||
\ 'b': 88,
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ 'warning': 80,
|
||||
\ 'error': 80,
|
||||
\ })
|
||||
let s:layout = get(g:, 'airline#extensions#default#layout', [
|
||||
\ [ 'a', 'b', 'c' ],
|
||||
\ [ 'x', 'y', 'z', 'warning' ]
|
||||
\ [ 'x', 'y', 'z', 'warning', 'error' ]
|
||||
\ ])
|
||||
|
||||
function! s:get_section(winnr, key, ...)
|
||||
@@ -18,43 +21,73 @@ function! s:get_section(winnr, 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, '%( '), get(a:000, 1, ' %)')]
|
||||
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
|
||||
if (key == 'warning' || key == 'error') && !a:context.active
|
||||
continue
|
||||
endif
|
||||
|
||||
" i have no idea why the warning section needs special treatment, but it's
|
||||
" needed to prevent separators from showing up
|
||||
if key == 'warning'
|
||||
call a:builder.add_raw('%(')
|
||||
endif
|
||||
call a:builder.add_section('airline_'.key, s:get_section(a:context.winnr, key))
|
||||
if key == 'warning'
|
||||
call a:builder.add_raw('%)')
|
||||
endif
|
||||
call s:add_section(a:builder, a:context, key)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" There still is a highlighting bug when using groups %(%) in the statusline,
|
||||
" deactivate it, until this is properly fixed:
|
||||
" https://groups.google.com/d/msg/vim_dev/sb1jmVirXPU/mPhvDnZ-CwAJ
|
||||
if s:section_use_groups && (v:version >= 704 || (v:version >= 703 && has('patch81')))
|
||||
function s:add_section(builder, context, key)
|
||||
" i have no idea why the warning section needs special treatment, but it's
|
||||
" needed to prevent separators from showing up
|
||||
if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
|
||||
return
|
||||
endif
|
||||
if (a:key == 'warning' || a:key == 'error')
|
||||
call a:builder.add_raw('%(')
|
||||
endif
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
if (a:key == 'warning' || a:key == 'error')
|
||||
call a:builder.add_raw('%)')
|
||||
endif
|
||||
endfunction
|
||||
else
|
||||
" older version don't like the use of %(%)
|
||||
function s:add_section(builder, context, key)
|
||||
if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
|
||||
return
|
||||
endif
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%#airline_warning#'.s:get_section(a:context.winnr, a:key))
|
||||
elseif a:key == 'error'
|
||||
call a:builder.add_raw('%#airline_error#'.s:get_section(a:context.winnr, a:key))
|
||||
else
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
endif
|
||||
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 <sid>build_sections(a:builder, a:context, s:layout[0])
|
||||
call s:build_sections(a:builder, a:context, s:layout[0])
|
||||
else
|
||||
call a:builder.add_section('airline_c'.(a:context.bufnr), ' %f%m ')
|
||||
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 <sid>build_sections(a:builder, a:context, s:layout[1])
|
||||
call s:build_sections(a:builder, a:context, s:layout[1])
|
||||
endif
|
||||
|
||||
return 1
|
||||
|
||||
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,6 +1,13 @@
|
||||
" 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
|
||||
@@ -32,7 +39,7 @@ function! airline#extensions#example#apply(...)
|
||||
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 .= ' '.g:airline_left_alt_sep.' %{airline#extensions#example#get_cats()}'
|
||||
let w:airline_section_c .= s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#example#get_cats()}'
|
||||
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 !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', ['+', '~', '-'])
|
||||
|
||||
@@ -12,29 +16,49 @@ function! s:get_hunks_signify()
|
||||
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)
|
||||
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
|
||||
|
||||
let s:source_func = ''
|
||||
function! s:get_hunks()
|
||||
if empty(s:source_func)
|
||||
if get(g:, 'loaded_signify', 0)
|
||||
let s:source_func = 's:get_hunks_signify'
|
||||
if !exists('b:source_func')
|
||||
if get(g:, 'loaded_signify') && sy#buffer_is_active()
|
||||
let b:source_func = 's:get_hunks_signify'
|
||||
elseif exists('*GitGutterGetHunkSummary')
|
||||
let s:source_func = 's:get_hunks_gitgutter'
|
||||
let b:source_func = 's:get_hunks_gitgutter'
|
||||
elseif exists('*changes#GetStats')
|
||||
let b:source_func = 's:get_hunks_changes'
|
||||
elseif exists('*quickfixsigns#vcsdiff#GetHunkSummary')
|
||||
let b:source_func = 'quickfixsigns#vcsdiff#GetHunkSummary'
|
||||
else
|
||||
let s:source_func = 's:get_hunks_empty'
|
||||
let b:source_func = 's:get_hunks_empty'
|
||||
endif
|
||||
endif
|
||||
return {s:source_func}()
|
||||
return {b:source_func}()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#get_hunks()
|
||||
|
||||
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
|
||||
36
autoload/airline/extensions/po.vim
Normal file
36
autoload/airline/extensions/po.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#extensions#po#apply(...)
|
||||
if &ft ==# 'po'
|
||||
call airline#extensions#prepend_to_section('z', '%{airline#extensions#po#stats()}')
|
||||
autocmd airline BufWritePost * unlet! b:airline_po_stats
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#po#stats()
|
||||
if exists('b:airline_po_stats') && !empty(b:airline_po_stats)
|
||||
return b:airline_po_stats
|
||||
endif
|
||||
|
||||
let airline_po_stats = system('msgfmt --statistics -o /dev/null -- '. expand('%:p'))
|
||||
if v:shell_error
|
||||
return ''
|
||||
endif
|
||||
try
|
||||
let b:airline_po_stats = '['. split(airline_po_stats, '\n')[0]. ']'
|
||||
catch
|
||||
let b:airline_po_stats = ''
|
||||
endtry
|
||||
if exists("g:airline#extensions#po#displayed_limit")
|
||||
let w:displayed_po_limit = g:airline#extensions#po#displayed_limit
|
||||
if len(b:airline_po_stats) > w:displayed_po_limit - 1
|
||||
let b:airline_po_stats = b:airline_po_stats[0:(w:displayed_po_limit - 1)].(&encoding==?'utf-8' ? '…' : '.')
|
||||
endif
|
||||
endif
|
||||
return b:airline_po_stats
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#po#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#po#apply')
|
||||
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,10 +1,14 @@
|
||||
" 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(':SyntasticCheck')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#syntastic#get_warnings()
|
||||
let errors = SyntasticStatuslineFlag()
|
||||
if strlen(errors) > 0
|
||||
return errors.' '
|
||||
return errors.(g:airline_symbols.space)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
@@ -1,170 +1,182 @@
|
||||
" 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:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
|
||||
let s:excludes = get(g:, 'airline#extensions#tabline#excludes', [])
|
||||
let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
|
||||
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:builder_context = {
|
||||
\ 'active' : 1,
|
||||
\ 'left_sep' : get(g:, 'airline#extensions#tabline#left_sep' , g:airline_left_sep),
|
||||
\ 'left_alt_sep' : get(g:, 'airline#extensions#tabline#left_alt_sep' , g:airline_left_alt_sep),
|
||||
\ '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),
|
||||
\ }
|
||||
let s:taboo = get(g:, 'airline#extensions#taboo#enabled', 1) && get(g:, 'loaded_taboo', 0)
|
||||
if s:taboo
|
||||
let g:taboo_tabline = 0
|
||||
endif
|
||||
|
||||
let s:buf_min_count = get(g:, 'airline#extensions#tabline#buffer_min_count', 0)
|
||||
let s:buf_len = 0
|
||||
|
||||
" TODO: temporary
|
||||
let s:buf_max = get(g:, 'airline#extensions#tabline#buffer_max', winwidth(0) / 16)
|
||||
let s:ctrlspace = get(g:, 'CtrlSpaceLoaded', 0)
|
||||
|
||||
function! airline#extensions#tabline#init(ext)
|
||||
if has('gui_running')
|
||||
set guioptions-=e
|
||||
endif
|
||||
|
||||
set tabline=%!airline#extensions#tabline#get()
|
||||
|
||||
if s:buf_min_count <= 0
|
||||
set showtabline=2
|
||||
else
|
||||
autocmd CursorMoved * call <sid>cursormove()
|
||||
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()
|
||||
call airline#extensions#tabline#ctrlspace#off()
|
||||
endfunction
|
||||
|
||||
function! s:toggle_on()
|
||||
call airline#extensions#tabline#autoshow#on()
|
||||
call airline#extensions#tabline#tabs#on()
|
||||
call airline#extensions#tabline#buffers#on()
|
||||
call airline#extensions#tabline#ctrlspace#on()
|
||||
|
||||
set tabline=%!airline#extensions#tabline#get()
|
||||
endfunction
|
||||
|
||||
function! s:update_tabline()
|
||||
if get(g:, 'airline#extensions#tabline#disable_refresh', 0)
|
||||
return
|
||||
endif
|
||||
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
|
||||
doautocmd User BufMRUChange
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#load_theme(palette)
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
let colors = get(a:palette, 'tabline', {})
|
||||
" Theme for tabs on the left
|
||||
let l:tab = get(colors, 'airline_tab', a:palette.normal.airline_b)
|
||||
let l:tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
|
||||
let l:tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
|
||||
let l:tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
|
||||
let l:tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
|
||||
let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
|
||||
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
|
||||
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c)
|
||||
else
|
||||
"Fall back to normal airline_c if modified airline_c isn't present
|
||||
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
|
||||
endif
|
||||
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
|
||||
|
||||
function! s:cursormove()
|
||||
let c = len(s:get_buffer_list())
|
||||
if c > s:buf_min_count
|
||||
if &showtabline != 2
|
||||
set showtabline=2
|
||||
endif
|
||||
" Theme for tabs on the right
|
||||
let l:tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a)
|
||||
let l:tab_right = get(colors, 'airline_tab_right', a:palette.inactive.airline_c)
|
||||
let l:tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a)
|
||||
let l:tabhid_right = get(colors, 'airline_tabhid_right', a:palette.normal.airline_c)
|
||||
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
|
||||
let l:tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal_modified.airline_c)
|
||||
else
|
||||
if &showtabline != 0
|
||||
set showtabline=0
|
||||
endif
|
||||
"Fall back to normal airline_c if modified airline_c isn't present
|
||||
let l:tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c)
|
||||
endif
|
||||
call airline#highlighter#exec('airline_tab_right', l:tab_right)
|
||||
call airline#highlighter#exec('airline_tabsel_right', l:tabsel_right)
|
||||
call airline#highlighter#exec('airline_tabmod_right', l:tabmod_right)
|
||||
call airline#highlighter#exec('airline_tabhid_right', l:tabhid_right)
|
||||
call airline#highlighter#exec('airline_tabmod_unsel_right', l:tabmodu_right)
|
||||
endfunction
|
||||
|
||||
let s:current_tabcnt = -1
|
||||
function! airline#extensions#tabline#get()
|
||||
if s:show_buffers && tabpagenr('$') == 1
|
||||
return s:get_buffers()
|
||||
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()
|
||||
call airline#extensions#tabline#ctrlspace#invalidate()
|
||||
endif
|
||||
|
||||
if !exists('#airline#BufAdd#*')
|
||||
autocmd airline BufAdd * call <sid>update_tabline()
|
||||
endif
|
||||
if s:ctrlspace
|
||||
return airline#extensions#tabline#ctrlspace#get()
|
||||
elseif s:show_buffers && curtabcnt == 1 || !s:show_tabs
|
||||
return airline#extensions#tabline#buffers#get()
|
||||
else
|
||||
return s:get_tabs()
|
||||
return airline#extensions#tabline#tabs#get()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#title(n)
|
||||
let buflist = tabpagebuflist(a:n)
|
||||
let winnr = tabpagewinnr(a:n)
|
||||
return airline#extensions#tabline#get_buffer_name(buflist[winnr - 1])
|
||||
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}(a:nr, get(s:, 'current_buffer_list', []))
|
||||
return airline#extensions#tabline#formatters#{s:formatter}#format(a:nr, airline#extensions#tabline#buflist#list())
|
||||
endfunction
|
||||
|
||||
function! s:get_buffer_list()
|
||||
let buffers = []
|
||||
let cur = bufnr('%')
|
||||
for nr in range(1, bufnr('$'))
|
||||
if buflisted(nr) && bufexists(nr)
|
||||
for ex in s:excludes
|
||||
if match(bufname(nr), ex)
|
||||
continue
|
||||
endif
|
||||
endfor
|
||||
call add(buffers, nr)
|
||||
endif
|
||||
endfor
|
||||
|
||||
" TODO: temporary fix; force the active buffer to be first when there are many buffers open
|
||||
if len(buffers) > s:buf_max && index(buffers, cur) > -1
|
||||
while buffers[1] != cur
|
||||
let first = remove(buffers, 0)
|
||||
call add(buffers, first)
|
||||
endwhile
|
||||
let buffers = buffers[:s:buf_max]
|
||||
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
|
||||
|
||||
let s:current_buffer_list = buffers
|
||||
return buffers
|
||||
return airline#builder#new(builder_context)
|
||||
endfunction
|
||||
|
||||
function! s:get_buffers()
|
||||
let b = airline#builder#new(s:builder_context)
|
||||
function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr)
|
||||
let cur = bufnr('%')
|
||||
let tab_bufs = tabpagebuflist(tabpagenr())
|
||||
for nr in s:get_buffer_list()
|
||||
if cur == nr
|
||||
if g:airline_detect_modified && getbufvar(nr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
if cur == a:bufnr
|
||||
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
if index(tab_bufs, nr) > -1
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
endif
|
||||
call b.add_section(group, '%( %{airline#extensions#tabline#get_buffer_name('.nr.')} %)')
|
||||
endfor
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabtype', ' buffers ')
|
||||
return b.build()
|
||||
endfunction
|
||||
|
||||
function! s:get_tabs()
|
||||
let b = airline#builder#new(s:builder_context)
|
||||
for i in range(1, tabpagenr('$'))
|
||||
if i == tabpagenr()
|
||||
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
|
||||
else
|
||||
endif
|
||||
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'
|
||||
endif
|
||||
let val = '%('
|
||||
if s:tab_nr_type == 0
|
||||
let val .= ' %{len(tabpagebuflist('.i.'))}'
|
||||
else
|
||||
let val .= ' '.i
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
call b.add_section(group, val.'%'.i.'T %{airline#extensions#tabline#title('.i.')} %)')
|
||||
endfor
|
||||
call b.add_raw('%T')
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tab', ' %999XX ')
|
||||
call b.add_section('airline_tabtype', ' tabs ')
|
||||
return b.build()
|
||||
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
|
||||
205
autoload/airline/extensions/tabline/buffers.vim
Normal file
205
autoload/airline/extensions/tabline/buffers.vim
Normal file
@@ -0,0 +1,205 @@
|
||||
" 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:buffers_label = get(g:, 'airline#extensions#tabline#buffers_label', 'buffers')
|
||||
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()
|
||||
autocmd User BufMRUChange call airline#extensions#tabline#buflist#invalidate()
|
||||
autocmd User BufMRUChange 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 nr == cur
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
endif
|
||||
|
||||
" Neovim feature: Have clickable buffers
|
||||
if has("tablineat")
|
||||
call b.add_raw('%'.nr.'@airline#extensions#tabline#buffers#switchbuf@')
|
||||
endif
|
||||
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
|
||||
if has("tablineat")
|
||||
call b.add_raw('%X')
|
||||
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_spaced('airline_tabtype', s:buffers_label)
|
||||
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
|
||||
|
||||
function airline#extensions#tabline#buffers#switchbuf(minwid, clicks, button, modifiers) abort
|
||||
" Run the following code only on a single left mouse button click without modifiers pressed
|
||||
" works only in recent NeoVim with has('tablineat')
|
||||
if a:clicks == 1 && a:button is# 'l' && a:modifiers !~# '[^ ]'
|
||||
sil execute 'buffer' a:minwid
|
||||
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 list = (exists('g:did_bufmru') && g:did_bufmru) ? BufMRUList() : range(1, bufnr("$"))
|
||||
|
||||
let buffers = []
|
||||
" If this is too slow, we can switch to a different algorithm.
|
||||
" Basically branch 535 already does it, but since it relies on
|
||||
" BufAdd autocommand, I'd like to avoid this if possible.
|
||||
for nr in list
|
||||
if buflisted(nr)
|
||||
" Do not add to the bufferlist, if either
|
||||
" 1) buffername matches exclude pattern
|
||||
" 2) buffer is a quickfix buffer
|
||||
" 3) exclude preview windows (if 'bufhidden' == wipe
|
||||
" and 'buftype' == nofile
|
||||
if (!empty(s:excludes) && match(bufname(nr), join(s:excludes, '\|')) > -1) ||
|
||||
\ (getbufvar(nr, 'current_syntax') == 'qf') ||
|
||||
\ (s:exclude_preview && getbufvar(nr, '&bufhidden') == 'wipe'
|
||||
\ && getbufvar(nr, '&buftype') == 'nofile')
|
||||
continue
|
||||
endif
|
||||
call add(buffers, nr)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let s:current_buffer_list = buffers
|
||||
return buffers
|
||||
endfunction
|
||||
|
||||
144
autoload/airline/extensions/tabline/ctrlspace.vim
Normal file
144
autoload/airline/extensions/tabline/ctrlspace.vim
Normal file
@@ -0,0 +1,144 @@
|
||||
" MIT License. Copyright (c) 2016 Kevin Sapper
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
let s:current_tabline = ''
|
||||
|
||||
let s:buffers_label = get(g:, 'airline#extensions#tabline#buffers_label', 'buffers')
|
||||
let s:tabs_label = get(g:, 'airline#extensions#tabline#tabs_label', 'tabs')
|
||||
let s:switch_buffers_and_tabs = get(g:, 'airline#extensions#tabline#switch_buffers_and_tabs', 0)
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#off()
|
||||
augroup airline_tabline_ctrlspace
|
||||
autocmd!
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#on()
|
||||
augroup airline_tabline_ctrlspace
|
||||
autocmd!
|
||||
autocmd BufDelete * call airline#extensions#tabline#ctrlspace#invalidate()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#invalidate()
|
||||
let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pos)
|
||||
if a:pos == 0
|
||||
let pos_extension = ''
|
||||
else
|
||||
let pos_extension = '_right'
|
||||
endif
|
||||
|
||||
let s:buffer_list = ctrlspace#api#BufferList(a:cur_tab)
|
||||
for buffer in s:buffer_list
|
||||
if a:cur_buf == buffer.index
|
||||
if buffer.modified
|
||||
let group = 'airline_tabmod'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabsel'.pos_extension
|
||||
endif
|
||||
else
|
||||
if buffer.modified
|
||||
let group = 'airline_tabmod_unsel'.pos_extension
|
||||
elseif buffer.visible
|
||||
let group = 'airline_tab'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabhid'.pos_extension
|
||||
endif
|
||||
endif
|
||||
|
||||
let buf_name = '%(%{airline#extensions#tabline#get_buffer_name('.buffer.index.')}%)'
|
||||
call a:builder.add_section_spaced(group, buf_name)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#add_tab_section(builder, pos)
|
||||
if a:pos == 0
|
||||
let pos_extension = ''
|
||||
else
|
||||
let pos_extension = '_right'
|
||||
endif
|
||||
|
||||
for tab in s:tab_list
|
||||
if tab.current
|
||||
if tab.modified
|
||||
let group = 'airline_tabmod'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabsel'.pos_extension
|
||||
endif
|
||||
else
|
||||
if tab.modified
|
||||
let group = 'airline_tabmod_unsel'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabhid'.pos_extension
|
||||
endif
|
||||
endif
|
||||
|
||||
call a:builder.add_section_spaced(group, tab.title.ctrlspace#api#TabBuffersNumber(tab.index))
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#get()
|
||||
let cur_buf = bufnr('%')
|
||||
|
||||
let s:tab_list = ctrlspace#api#TabList()
|
||||
for tab in s:tab_list
|
||||
if tab.current
|
||||
let cur_tab = tab.index
|
||||
endif
|
||||
endfor
|
||||
|
||||
if cur_buf == s:current_bufnr && cur_tab == s:current_tabnr
|
||||
return s:current_tabline
|
||||
endif
|
||||
|
||||
let builder = airline#extensions#tabline#new_builder()
|
||||
|
||||
" Add left tabline content
|
||||
if s:show_buffers == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 0)
|
||||
elseif s:show_tabs == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 0)
|
||||
else
|
||||
if s:switch_buffers_and_tabs == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 0)
|
||||
else
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 0)
|
||||
endif
|
||||
endif
|
||||
|
||||
call builder.add_section('airline_tabfill', '')
|
||||
call builder.split()
|
||||
call builder.add_section('airline_tabfill', '')
|
||||
|
||||
" Add right tabline content
|
||||
if s:show_buffers == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
elseif s:show_tabs == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
else
|
||||
if s:switch_buffers_and_tabs == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 1)
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
else
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 1)
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:current_bufnr = cur_buf
|
||||
let s:current_tabnr = cur_tab
|
||||
let s:current_tabline = builder.build()
|
||||
return s:current_tabline
|
||||
endfunction
|
||||
@@ -1,19 +1,16 @@
|
||||
" 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: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(bufnr, buffers)
|
||||
function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
|
||||
let _ = ''
|
||||
|
||||
if s:buf_nr_show
|
||||
let _ .= printf(s:buf_nr_format, a:bufnr)
|
||||
endif
|
||||
|
||||
let name = bufname(a:bufnr)
|
||||
if empty(name)
|
||||
let _ .= '[No Name]'
|
||||
@@ -23,12 +20,20 @@ function! airline#extensions#tabline#formatters#default(bufnr, buffers)
|
||||
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
|
||||
110
autoload/airline/extensions/tabline/tabs.vim
Normal file
110
autoload/airline/extensions/tabline/tabs.vim
Normal file
@@ -0,0 +1,110 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
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: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:close_symbol = get(g:, 'airline#extensions#tabline#close_symbol', 'X')
|
||||
let s:tabs_label = get(g:, 'airline#extensions#tabline#tabs_label', 'tabs')
|
||||
let s:show_splits = get(g:, 'airline#extensions#tabline#show_splits', 1)
|
||||
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()
|
||||
|
||||
for i in range(1, tabpagenr('$'))
|
||||
if i == curtab
|
||||
let group = 'airline_tabsel_right'
|
||||
if g:airline_detect_modified
|
||||
for bi in tabpagebuflist(i)
|
||||
if getbufvar(bi, '&modified')
|
||||
let group = 'airline_tabmod_right'
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
let s:current_modified = (group == 'airline_tabmod_right') ? 1 : 0
|
||||
else
|
||||
let group = 'airline_tab_right'
|
||||
endif
|
||||
let val = '%('
|
||||
if s:show_tab_nr
|
||||
if s:tab_nr_type == 0
|
||||
let val .= (g:airline_symbols.space).'%{len(tabpagebuflist('.i.'))}'
|
||||
elseif s:tab_nr_type == 1
|
||||
let val .= (g:airline_symbols.space).i
|
||||
else "== 2
|
||||
let val .= (g:airline_symbols.space).i.'.%{len(tabpagebuflist('.i.'))}'
|
||||
endif
|
||||
endif
|
||||
call b.add_section(group, val.'%'.i.'T %{airline#extensions#tabline#title('.i.')} %)')
|
||||
endfor
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
|
||||
if s:show_close_button
|
||||
call b.add_section('airline_tab_right', ' %999X'.s:close_symbol.' ')
|
||||
endif
|
||||
|
||||
if s:show_splits == 1
|
||||
let buffers = tabpagebuflist(curtab)
|
||||
for nr in buffers
|
||||
let group = airline#extensions#tabline#group_of_bufnr(buffers, nr)
|
||||
call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)')
|
||||
endfor
|
||||
elseif s:show_tab_type == 1
|
||||
call b.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
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,14 +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
|
||||
|
||||
@@ -18,9 +23,15 @@ 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)
|
||||
return tagbar#currenttag('%s', '', s:flags)
|
||||
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
|
||||
|
||||
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'
|
||||
|
||||
22
autoload/airline/extensions/unicode.vim
Normal file
22
autoload/airline/extensions/unicode.vim
Normal file
@@ -0,0 +1,22 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_unicodePlugin', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#unicode#apply(...)
|
||||
if exists(":UnicodeTable") == 2 && bufname('') ==# 'UnicodeTable'
|
||||
call airline#parts#define('unicode', {
|
||||
\ 'text': '[UnicodeTable]',
|
||||
\ 'accent': 'bold' })
|
||||
let w:airline_section_a = airline#section#create(['unicode'])
|
||||
let w:airline_section_b = ''
|
||||
let w:airline_section_c = ''
|
||||
let w:airline_section_y = ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#unicode#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#unicode#apply')
|
||||
endfunction
|
||||
@@ -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_unite', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#unite#apply(...)
|
||||
if &ft == 'unite'
|
||||
call a:1.add_section('airline_a', ' Unite ')
|
||||
|
||||
@@ -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,67 +1,133 @@
|
||||
" 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
|
||||
|
||||
" for backwards compatibility
|
||||
if exists('g:airline_detect_whitespace')
|
||||
let s:show_message = g:airline_detect_whitespace == 1
|
||||
else
|
||||
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
|
||||
endif
|
||||
|
||||
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
|
||||
let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)
|
||||
let s:checks = get(g:, 'airline#extensions#whitespace#checks', ['indent', 'trailing'])
|
||||
let s:default_checks = ['indent', 'trailing', 'mixed-indent-file']
|
||||
|
||||
let s:trailing_format = get(g:, 'airline#extensions#whitespace#trailing_format', 'trailing[%s]')
|
||||
let s:mixed_indent_format = get(g:, 'airline#extensions#whitespace#mixed_indent_format', 'mixed-indent[%s]')
|
||||
let s:long_format = get(g:, 'airline#extensions#whitespace#long_format', 'long[%s]')
|
||||
let s:mixed_indent_file_format = get(g:, 'airline#extensions#whitespace#mixed_indent_file_format', 'mix-indent-file[%s]')
|
||||
let s:indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
|
||||
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file'] }
|
||||
|
||||
let s: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! s:check_mixed_indent_file()
|
||||
if stridx(&ft, 'c') == 0 || stridx(&ft, 'cpp') == 0 || stridx(&ft, 'javascript') == 0
|
||||
" for C/CPP only allow /** */ comment style with one space before the '*'
|
||||
let head_spc = '\v(^ +\*@!)'
|
||||
else
|
||||
let head_spc = '\v(^ +)'
|
||||
endif
|
||||
let indent_tabs = search('\v(^\t+)', 'nw')
|
||||
let indent_spc = search(head_spc, 'nw')
|
||||
if indent_tabs > 0 && indent_spc > 0
|
||||
return printf("%d:%d", indent_tabs, indent_spc)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#check()
|
||||
if &readonly || !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('^ \{2,}', 'nb'), search('^ \{2,}', 'n'), search('^\t', 'nb'), search('^\t', 'n')]
|
||||
let mixed = indents[0] != 0 && indents[1] != 0 && indents[2] != 0 && indents[3] != 0
|
||||
let check = 'indent'
|
||||
if index(checks, check) > -1 && index(get(s:skip_check_ft, &ft, []), check) < 0
|
||||
let mixed = s:check_mixed_indent()
|
||||
endif
|
||||
|
||||
if trailing != 0 || mixed
|
||||
let b:airline_whitespace_check = s:symbol.' '
|
||||
let mixed_file = ''
|
||||
let check = 'mixed-indent-file'
|
||||
if index(checks, check) > -1 && index(get(s:skip_check_ft, &ft, []), check) < 0
|
||||
let mixed_file = s:check_mixed_indent_file()
|
||||
endif
|
||||
|
||||
let long = 0
|
||||
if index(checks, 'long') > -1 && &tw > 0
|
||||
let long = search('\%>'.&tw.'v.\+', 'nw')
|
||||
endif
|
||||
|
||||
if trailing != 0 || mixed != 0 || long != 0 || !empty(mixed_file)
|
||||
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
|
||||
if !empty(mixed_file)
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_file_format, mixed_file)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return b:airline_whitespace_check
|
||||
endfunction!
|
||||
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
|
||||
|
||||
|
||||
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
|
||||
|
||||
36
autoload/airline/extensions/wordcount.vim
Normal file
36
autoload/airline/extensions/wordcount.vim
Normal file
@@ -0,0 +1,36 @@
|
||||
" 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
|
||||
let l:mode = mode()
|
||||
if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S'
|
||||
let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format()
|
||||
let b:airline_change_tick = b:changedtick
|
||||
else
|
||||
if get(b:, 'airline_wordcount_cache', '') is# '' ||
|
||||
\ b:airline_wordcount_cache isnot# get(b:, 'airline_wordcount', '') ||
|
||||
\ get(b:, 'airline_change_tick', 0) != b:changedtick
|
||||
" cache data
|
||||
let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format()
|
||||
let b:airline_wordcount_cache = b:airline_wordcount
|
||||
let b:airline_change_tick = b:changedtick
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
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
|
||||
58
autoload/airline/extensions/wordcount/formatters/default.vim
Normal file
58
autoload/airline/extensions/wordcount/formatters/default.vim
Normal file
@@ -0,0 +1,58 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#wordcount#formatters#default#format()
|
||||
let words = string(s:wordcount())
|
||||
if empty(words)
|
||||
return
|
||||
endif
|
||||
let separator = s:get_decimal_group()
|
||||
if words > 999 && !empty(separator)
|
||||
" Format number according to locale, e.g. German: 1.245 or English: 1,245
|
||||
let a = join(reverse(split(words, '.\zs')),'')
|
||||
let a = substitute(a, '...', '&'.separator, 'g')
|
||||
let words = join(reverse(split(a, '.\zs')),'')
|
||||
endif
|
||||
return words . " words" . g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
|
||||
endfunction
|
||||
|
||||
function! s:wordcount()
|
||||
if exists("*wordcount")
|
||||
let l:mode = mode()
|
||||
if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S'
|
||||
let l:visual_words = wordcount()['visual_words']
|
||||
if l:visual_words != ''
|
||||
return l:visual_words
|
||||
else
|
||||
return 0
|
||||
endif
|
||||
else
|
||||
return wordcount()['words']
|
||||
endif
|
||||
elseif mode() =~? 's'
|
||||
return
|
||||
else
|
||||
let old_status = v:statusmsg
|
||||
let position = getpos(".")
|
||||
exe "silent normal! g\<c-g>"
|
||||
let stat = v:statusmsg
|
||||
call setpos('.', position)
|
||||
let v:statusmsg = old_status
|
||||
|
||||
let parts = split(stat)
|
||||
if len(parts) > 11
|
||||
return str2nr(parts[11])
|
||||
else
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function s:get_decimal_group()
|
||||
if match(v:lang, '\v\cC|en') > -1
|
||||
return ','
|
||||
elseif match(v:lang, '\v\cde|dk|fr|pt') > -1
|
||||
return '.'
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
36
autoload/airline/extensions/ycm.vim
Normal file
36
autoload/airline/extensions/ycm.vim
Normal file
@@ -0,0 +1,36 @@
|
||||
" MIT License. Copyright (c) 2015 Evgeny Firsov.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
let s:error_symbol = get(g:, 'airline#extensions#ycm#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#ycm#warning_symbol', 'W:')
|
||||
|
||||
function! airline#extensions#ycm#init(ext)
|
||||
call airline#parts#define_function('ycm_error_count', 'airline#extensions#ycm#get_error_count')
|
||||
call airline#parts#define_function('ycm_warning_count', 'airline#extensions#ycm#get_warning_count')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ycm#get_error_count()
|
||||
if exists(':YcmDiag')
|
||||
let cnt = youcompleteme#GetErrorCount()
|
||||
|
||||
if cnt != 0
|
||||
return s:error_symbol.cnt
|
||||
endif
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ycm#get_warning_count()
|
||||
if exists(':YcmDiag')
|
||||
let cnt = youcompleteme#GetWarningCount()
|
||||
|
||||
if cnt != 0
|
||||
return s:warning_symbol.cnt.s:spc
|
||||
endif
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
@@ -1,31 +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
|
||||
|
||||
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') ? 'gui' : 'cterm'
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode)
|
||||
if !exists("g:airline_gui_mode")
|
||||
let g:airline_gui_mode = airline#init#gui_mode()
|
||||
endif
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode)
|
||||
if empty(color) || color == -1
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode)
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode)
|
||||
endif
|
||||
if empty(color) || color == -1
|
||||
if has('gui_running')
|
||||
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
|
||||
else
|
||||
let color = a:what ==# 'fg' ? 0 : 1
|
||||
endif
|
||||
let color = 'NONE'
|
||||
endif
|
||||
return color
|
||||
endfunction
|
||||
@@ -33,7 +33,7 @@ endfunction
|
||||
function! s:get_array(fg, bg, opts)
|
||||
let fg = a:fg
|
||||
let bg = a:bg
|
||||
return has('gui_running')
|
||||
return g:airline_gui_mode ==# 'gui'
|
||||
\ ? [ fg, bg, '', '', join(a:opts, ',') ]
|
||||
\ : [ '', '', fg, bg, join(a:opts, ',') ]
|
||||
endfunction
|
||||
@@ -41,7 +41,10 @@ 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 = synIDattr(synIDtrans(hlID(a:group)), 'reverse', has('gui_running') ? 'gui' : 'term')
|
||||
let reverse = g:airline_gui_mode ==# 'gui'
|
||||
\ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui')
|
||||
\ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')
|
||||
\|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
|
||||
return reverse ? s:get_array(bg, fg, a:000) : s:get_array(fg, bg, a:000)
|
||||
endfunction
|
||||
|
||||
@@ -52,23 +55,40 @@ function! airline#highlighter#get_highlight2(fg, bg, ...)
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#exec(group, colors)
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
let colors = a:colors
|
||||
if s:is_win32term
|
||||
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
|
||||
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
|
||||
endif
|
||||
exec printf('hi %s %s %s %s %s %s %s %s',
|
||||
\ a:group,
|
||||
\ get(colors, 0, '') != '' ? 'guifg='.colors[0] : '',
|
||||
\ get(colors, 1, '') != '' ? 'guibg='.colors[1] : '',
|
||||
\ get(colors, 2, '') != '' ? 'ctermfg='.colors[2] : '',
|
||||
\ get(colors, 3, '') != '' ? 'ctermbg='.colors[3] : '',
|
||||
\ get(colors, 4, '') != '' ? 'gui='.colors[4] : '',
|
||||
\ get(colors, 4, '') != '' ? 'cterm='.colors[4] : '',
|
||||
\ get(colors, 4, '') != '' ? 'term='.colors[4] : '')
|
||||
let cmd= printf('hi %s %s %s %s %s %s %s %s',
|
||||
\ a:group, s:Get(colors, 0, 'guifg=', ''), s:Get(colors, 1, 'guibg=', ''),
|
||||
\ s:Get(colors, 2, 'ctermfg=', ''), s:Get(colors, 3, 'ctermbg=', ''),
|
||||
\ s:Get(colors, 4, 'gui=', ''), s:Get(colors, 4, 'cterm=', ''),
|
||||
\ s:Get(colors, 4, 'term=', ''))
|
||||
let old_hi = airline#highlighter#get_highlight(a:group)
|
||||
if len(colors) == 4
|
||||
call add(colors, '')
|
||||
endif
|
||||
if old_hi != colors
|
||||
exe cmd
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:Get(dict, key, prefix, default)
|
||||
if get(a:dict, a:key, a:default) isnot# a:default
|
||||
return a:prefix. get(a:dict, a:key)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:exec_separator(dict, from, to, inverse, suffix)
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
let l:from = airline#themes#get_highlight(a:from.a:suffix)
|
||||
let l:to = airline#themes#get_highlight(a:to.a:suffix)
|
||||
let group = a:from.'_to_'.a:to.a:suffix
|
||||
@@ -82,6 +102,9 @@ function! s:exec_separator(dict, from, to, inverse, suffix)
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#load_theme()
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
for winnr in filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
call airline#highlighter#highlight_modified_inactive(winbufnr(winnr))
|
||||
endfor
|
||||
@@ -94,6 +117,10 @@ function! airline#highlighter#add_separator(from, to, 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')
|
||||
@@ -109,6 +136,8 @@ function! airline#highlighter#highlight_modified_inactive(bufnr)
|
||||
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' : ''
|
||||
@@ -116,7 +145,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
|
||||
|
||||
@@ -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! s:check_defined(variable, default)
|
||||
@@ -9,19 +9,25 @@ endfunction
|
||||
|
||||
let s:loaded = 0
|
||||
function! airline#init#bootstrap()
|
||||
if s:loaded | return | endif | let s:loaded = 1
|
||||
if s:loaded
|
||||
return
|
||||
endif
|
||||
let s:loaded = 1
|
||||
|
||||
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)?"":"<")
|
||||
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_gui_mode', airline#init#gui_mode())
|
||||
|
||||
call s:check_defined('g:airline_mode_map', {})
|
||||
call extend(g:airline_mode_map, {
|
||||
@@ -36,53 +42,80 @@ function! airline#init#bootstrap()
|
||||
\ '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',
|
||||
\ '\CTomorrow': 'tomorrow',
|
||||
\ 'base16': 'base16',
|
||||
\ 'mo[l|n]okai': 'molokai',
|
||||
\ 'wombat.*': 'wombat',
|
||||
\ '.*zenburn.*': 'zenburn',
|
||||
\ '.*solarized.*': 'solarized',
|
||||
\ '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) ? '' : 'RO'),
|
||||
\ 'whitespace': get(g:, 'airline_powerline_fonts', 0) ? '✹' : '!',
|
||||
\ 'linenr': get(g:, 'airline_linecolumn_prefix', get(g:, 'airline_powerline_fonts', 0) ? '' : ':' ),
|
||||
\ 'branch': get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? '' : ''),
|
||||
\ 'paste': 'PASTE',
|
||||
\ 'readonly': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a2" : 'RO',
|
||||
\ 'whitespace': get(g:, 'airline_powerline_fonts', 0) ? "\u2739" : '!',
|
||||
\ 'linenr': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a1" : ':',
|
||||
\ 'branch': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a0" : '',
|
||||
\ 'notexists': "\u2204",
|
||||
\ 'modified': '+',
|
||||
\ 'space': ' ',
|
||||
\ 'crypt': get(g:, 'airline_crypt_symbol', nr2char(0x1F512)),
|
||||
\ }, 'keep')
|
||||
|
||||
call airline#parts#define_function('mode', 'airline#parts#mode')
|
||||
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',
|
||||
\ 'highlight': 'airline_file',
|
||||
\ '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', 'whitespace'])
|
||||
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic',
|
||||
\ 'eclim', 'whitespace','windowswap', 'ycm_error_count', 'ycm_warning_count'])
|
||||
call airline#parts#define_text('capslock', '')
|
||||
|
||||
unlet g:airline#init#bootstrapping
|
||||
endfunction
|
||||
|
||||
function! airline#init#gui_mode()
|
||||
return ((has('nvim') && exists('$NVIM_TUI_ENABLE_TRUE_COLOR'))
|
||||
\ || has('gui_running') || (has("termtruecolor") && &guicolors == 1)) ?
|
||||
\ 'gui' : 'cterm'
|
||||
endfunction
|
||||
|
||||
function! airline#init#sections()
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists('g:airline_section_a')
|
||||
let g:airline_section_a = airline#section#create_left(['mode', 'paste', 'iminsert'])
|
||||
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')
|
||||
let g:airline_section_c = airline#section#create(['%<', 'file'])
|
||||
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([' ', 'readonly', '%='])
|
||||
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'])
|
||||
@@ -91,10 +124,13 @@ function! airline#init#sections()
|
||||
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_right(['%3p%% %{g:airline_symbols.linenr} %3l:%3c '])
|
||||
let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', ':%3v '])
|
||||
endif
|
||||
if !exists('g:airline_section_error')
|
||||
let g:airline_section_error = airline#section#create(['ycm_error_count', 'syntastic', 'eclim'])
|
||||
endif
|
||||
if !exists('g:airline_section_warning')
|
||||
let g:airline_section_warning = airline#section#create(['syntastic', 'whitespace'])
|
||||
let g:airline_section_warning = airline#section#create(['ycm_warning_count', '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
|
||||
@@ -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 s:parts = {}
|
||||
@@ -7,7 +7,11 @@ let s:parts = {}
|
||||
|
||||
function! airline#parts#define(key, config)
|
||||
let s:parts[a:key] = get(s:parts, a:key, {})
|
||||
call extend(s:parts[a:key], a:config)
|
||||
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)
|
||||
@@ -30,6 +34,10 @@ 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, '')
|
||||
@@ -46,6 +54,10 @@ 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
|
||||
@@ -58,7 +70,11 @@ function! airline#parts#iminsert()
|
||||
endfunction
|
||||
|
||||
function! airline#parts#readonly()
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
if &readonly && &modifiable && !filereadable(bufname('%'))
|
||||
return '[noperm]'
|
||||
else
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#parts#filetype()
|
||||
@@ -66,6 +82,6 @@ function! airline#parts#filetype()
|
||||
endfunction
|
||||
|
||||
function! airline#parts#ffenc()
|
||||
return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '')
|
||||
return printf('%s%s%s', &fenc, &l:bomb ? '[BOM]' : '', strlen(&ff) > 0 ? '['.&ff.']' : '')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
" 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! 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.highlight')
|
||||
let val .= '%#'.(part.highlight).'#'
|
||||
endif
|
||||
|
||||
if exists('part.function')
|
||||
let func = (part.function).'()'
|
||||
@@ -19,16 +24,16 @@ function! s:create(parts, append)
|
||||
let func = '"'.(part.text).'"'
|
||||
else
|
||||
if a:append > 0 && idx != 0
|
||||
let val .= ' '.g:airline_left_alt_sep.' '
|
||||
let val .= s:spc.g:airline_left_alt_sep.s:spc
|
||||
endif
|
||||
if a:append < 0 && idx != 0
|
||||
let val = ' '.g:airline_right_alt_sep.' '.val
|
||||
let val = s:spc.g:airline_right_alt_sep.s:spc.val
|
||||
endif
|
||||
if exists('part.raw')
|
||||
let _ .= val.(part.raw)
|
||||
let _ .= s:wrap_accent(part, val.(part.raw))
|
||||
continue
|
||||
else
|
||||
let _ .= val.a:parts[idx]
|
||||
let _ .= s:wrap_accent(part, val.a:parts[idx])
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
@@ -44,11 +49,11 @@ function! s:create(parts, append)
|
||||
endif
|
||||
|
||||
if exists('part.condition')
|
||||
let partval = substitute(partval, '{', '{'.(part.condition).' ? ', '')
|
||||
let partval = substitute(partval, '{', '\="{".(part.condition)." ? "', '')
|
||||
let partval = substitute(partval, '}', ' : ""}', '')
|
||||
endif
|
||||
|
||||
let val .= partval
|
||||
let val .= s:wrap_accent(part, partval)
|
||||
let _ .= val
|
||||
endfor
|
||||
return _
|
||||
|
||||
@@ -1,18 +1,29 @@
|
||||
" 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 , '' ) ] ,
|
||||
\ }
|
||||
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 , '') ] ,
|
||||
\ }
|
||||
|
||||
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
|
||||
|
||||
return palette
|
||||
endfunction
|
||||
|
||||
function! airline#themes#get_highlight(group, ...)
|
||||
@@ -28,27 +39,32 @@ function! airline#themes#patch(palette)
|
||||
if !has_key(a:palette[mode], 'airline_warning')
|
||||
let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ]
|
||||
endif
|
||||
endfor
|
||||
|
||||
" 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_error')
|
||||
let a:palette[mode]['airline_error'] = [ '#000000', '#990000', 232, 160 ]
|
||||
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
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
let s:N1 = [ '#141413' , '#aeee00' , 232 , 154 ] " blackestgravel & lime
|
||||
let s:N2 = [ '#f4cf86' , '#45413b' , 222 , 238 ] " dirtyblonde & deepgravel
|
||||
let s:N3 = [ '#8cffba' , '#242321' , 121 , 235 ] " saltwatertaffy & darkgravel
|
||||
let s:N4 = [ '#666462' , 241 ] " mediumgravel
|
||||
|
||||
let s:I1 = [ '#141413' , '#0a9dff' , 232 , 39 ] " blackestgravel & tardis
|
||||
let s:I2 = [ '#f4cf86' , '#005fff' , 222 , 27 ] " dirtyblonde & facebook
|
||||
let s:I3 = [ '#0a9dff' , '#242321' , 39 , 235 ] " tardis & darkgravel
|
||||
|
||||
let s:V1 = [ '#141413' , '#ffa724' , 232 , 214 ] " blackestgravel & orange
|
||||
let s:V2 = [ '#000000' , '#fade3e' , 16 , 221 ] " coal & dalespale
|
||||
let s:V3 = [ '#000000' , '#b88853' , 16 , 137 ] " coal & toffee
|
||||
let s:V4 = [ '#c7915b' , 173 ] " coffee
|
||||
|
||||
let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde
|
||||
let s:RE = [ '#ff9eb8' , 211 ] " dress
|
||||
|
||||
let s:file = [ '#ff2c4b' , '' , 196 , '' , '' ]
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
|
||||
|
||||
let g:airline#themes#badwolf#palette = {}
|
||||
|
||||
let g:airline#themes#badwolf#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#badwolf#palette.normal_modified = {
|
||||
\ 'airline_b': [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#badwolf#palette.insert_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#badwolf#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.replace = copy(airline#themes#badwolf#palette.insert)
|
||||
let g:airline#themes#badwolf#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#badwolf#palette.replace_modified = g:airline#themes#badwolf#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#badwolf#palette.visual_modified = {
|
||||
\ 'airline_c': [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#badwolf#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
function! s:load_constant()
|
||||
let g:airline#themes#base16#palette = {}
|
||||
|
||||
" Color palette
|
||||
let s:gui_dark_gray = '#202020'
|
||||
let s:cterm_dark_gray = 234
|
||||
let s:gui_med_gray_hi = '#303030'
|
||||
let s:cterm_med_gray_hi = 236
|
||||
let s:gui_med_gray_lo = '#3a3a3a'
|
||||
let s:cterm_med_gray_lo = 237
|
||||
let s:gui_light_gray = '#505050'
|
||||
let s:cterm_light_gray = 239
|
||||
let s:gui_green = '#99cc99'
|
||||
let s:cterm_green = 151
|
||||
let s:gui_blue = '#6a9fb5'
|
||||
let s:cterm_blue = 67
|
||||
let s:gui_purple = '#aa759f'
|
||||
let s:cterm_purple = 139
|
||||
let s:gui_orange = '#d28445'
|
||||
let s:cterm_orange = 173
|
||||
let s:gui_red = '#ac4142'
|
||||
let s:cterm_red = 131
|
||||
let s:gui_pink = '#d7afd7'
|
||||
let s:cterm_pink = 182
|
||||
|
||||
let s:file = ['#ff0000', '', 160, '', '']
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
|
||||
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
|
||||
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
|
||||
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3, s:file)
|
||||
let g:airline#themes#base16#palette.insert_modified = copy(g:airline#themes#base16#palette.normal_modified)
|
||||
let g:airline#themes#base16#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
\ }
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#base16#palette.replace = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
|
||||
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
let g:airline#themes#base16#palette.replace_modified = copy(g:airline#themes#base16#palette.insert_modified)
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
|
||||
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3, s:file)
|
||||
let g:airline#themes#base16#palette.visual_modified = copy(g:airline#themes#base16#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#base16#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! s:load_dynamic()
|
||||
let g:airline#themes#base16#palette = {}
|
||||
let s:file = airline#themes#get_highlight('Constant')
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffText', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Visual')
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
|
||||
let group = airline#themes#get_highlight('vimCommand')
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'statusline': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['DiffAdded', 'bg'], ['DiffAdded', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['DiffAdded', 'fg'], ['Normal', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#base16#palette.insert_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight2(['WarningMsg', 'bg'], ['WarningMsg', 'fg'], 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#base16#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
|
||||
let g:airline#themes#base16#palette.replace_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Constant', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#base16#palette.visual_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg'])
|
||||
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#base16#palette.inactive_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
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
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
" Color palette
|
||||
let s:gui_dark_gray = '#303030'
|
||||
let s:cterm_dark_gray = 236
|
||||
let s:gui_med_gray_hi = '#444444'
|
||||
let s:cterm_med_gray_hi = 238
|
||||
let s:gui_med_gray_lo = '#3a3a3a'
|
||||
let s:cterm_med_gray_lo = 237
|
||||
let s:gui_light_gray = '#b2b2b2'
|
||||
let s:cterm_light_gray = 249
|
||||
let s:gui_green = '#afd787'
|
||||
let s:cterm_green = 150
|
||||
let s:gui_blue = '#87afd7'
|
||||
let s:cterm_blue = 110
|
||||
let s:gui_purple = '#afafd7'
|
||||
let s:cterm_purple = 146
|
||||
let s:gui_orange = '#d7af5f'
|
||||
let s:cterm_orange = 179
|
||||
let s:gui_red = '#d78787'
|
||||
let s:cterm_red = 174
|
||||
let s:gui_pink = '#d7afd7'
|
||||
let s:cterm_pink = 182
|
||||
|
||||
let 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_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
|
||||
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3, s:file)
|
||||
let g:airline#themes#bubblegum#palette.insert_modified = copy(g:airline#themes#bubblegum#palette.normal_modified)
|
||||
let g:airline#themes#bubblegum#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
\ }
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#bubblegum#palette.replace = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
|
||||
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
let g:airline#themes#bubblegum#palette.replace_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
|
||||
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3, s:file)
|
||||
let g:airline#themes#bubblegum#palette.visual_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#bubblegum#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#bubblegum#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
|
||||
@@ -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,12 +70,24 @@ 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
|
||||
" variable so that related functionality is loaded iff the user is using
|
||||
" ctrlp. Note that this is optional, and if you do not define ctrlp colors
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
let g:airline#themes#jellybeans#palette = {}
|
||||
|
||||
function! s:generate()
|
||||
" This theme is an example of how to use helper functions to extract highlight
|
||||
" values from the corresponding colorscheme. It was written in a hurry, so it
|
||||
" is very minimalistic. If you are a jellybeans user and want to make updates,
|
||||
" please send pull requests.
|
||||
|
||||
" Here are examples where the entire highlight group is copied and an airline
|
||||
" compatible color array is generated.
|
||||
let s:N1 = airline#themes#get_highlight('DbgCurrent', 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('NonText')
|
||||
let 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.normal_modified = {
|
||||
\ 'airline_c': [ '#ffb964', '', 215, '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight('DiffAdd', 'bold')
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#jellybeans#palette.insert_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('WildMenu', 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
|
||||
let g:airline#themes#jellybeans#palette.replace_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" Sometimes you want to mix and match colors from different groups, you can do
|
||||
" that with this method.
|
||||
let s:V1 = airline#themes#get_highlight2(['TabLineSel', 'bg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#jellybeans#palette.visual_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" And of course, you can always do it manually as well.
|
||||
let s:IA = [ '#444444', '#1c1c1c', 237, 234 ]
|
||||
let g:airline#themes#jellybeans#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
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
|
||||
@@ -1,59 +0,0 @@
|
||||
" vim-airline companion theme of Laederon
|
||||
" (https://github.com/Donearm/Laederon)
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ] " blackestgravel & snow
|
||||
let s:N2 = [ '#ffffff' , '#44403a' , 255, 238 ] " snow & deepgravel
|
||||
let s:N3 = [ '#90a680' , '#2e2d2a' , 64, 235 ] " dilutedpaint & darkgravel
|
||||
let s:N4 = [ '#777470' , 240 ] " gravel
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#1a1a18' , '#1693a5' , 232 , 62 ] " blackestgravel & crystallake
|
||||
let s:I2 = [ '#515744' , '#44403a' , 101 , 238 ] " lichen & deepgravel
|
||||
let s:I3 = [ '#1693a5' , '#2e2d2a' , 39 , 235 ] " crystallake & darkgravel
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#1a1a18' , '#ab3e5d' , 232 , 161 ] " blackestgravel & raspberry
|
||||
let s:V2 = [ '#000000' , '#908571' , 16 , 252 ] " coal & winterterrain
|
||||
let s:V3 = [ '#ab3e5d' , '#8c7f77' , 161 , 245 ] " raspberry & wetcoldterrain
|
||||
let s:V4 = [ '#515744' , 101 ] " lichen
|
||||
|
||||
" Replace mode
|
||||
let s:RE = [ '#233e09' , 22 ] " oakleaf
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#ab3e5d' , 161 ] " raspberry
|
||||
|
||||
let s: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.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_modified = {
|
||||
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#laederon#palette.insert_paste = {
|
||||
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.replace = copy(airline#themes#laederon#palette.insert)
|
||||
let g:airline#themes#laederon#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#laederon#palette.replace_modified = g:airline#themes#laederon#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#laederon#palette.visual_modified = {
|
||||
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#laederon#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
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_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#005f00' , '#00df87' , 22 , 42 ]
|
||||
let s:I3 = [ '#005f5f' , '#afff87' , 23 , 156 ]
|
||||
let g:airline#themes#light#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#light#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#light#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#light#palette.replace = copy(g:airline#themes#light#palette.insert)
|
||||
let g:airline#themes#light#palette.replace.airline_a = [ s:I2[0] , '#ff0000' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#light#palette.replace_modified = g:airline#themes#light#palette.insert_modified
|
||||
|
||||
|
||||
let s:V1 = [ '#ffffff' , '#ff5f00' , 255 , 202 ]
|
||||
let s:V2 = [ '#5f0000' , '#ffaf00' , 52 , 214 ]
|
||||
let s:V3 = [ '#df5f00' , '#ffff87' , 166 , 228 ]
|
||||
let g:airline#themes#light#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#light#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#666666' , '#b2b2b2' , 242 , 249 , '' ]
|
||||
let s:IA2 = [ '#8a8a8a' , '#d0d0d0' , 245 , 252 , '' ]
|
||||
let s:IA3 = [ '#a8a8a8' , '#ffffff' , 248 , 255 , '' ]
|
||||
let g:airline#themes#light#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3, s:file)
|
||||
let g:airline#themes#light#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '' , 160 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
" vim-airline companion theme of Luna
|
||||
" (https://github.com/Pychimp/vim-luna)
|
||||
|
||||
let g:airline#themes#luna#palette = {}
|
||||
let s:file = [ '#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_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#789f00' , 231 , 106 ]
|
||||
let s:I2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:I3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#luna#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#005e5e' , 255 , 52 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#luna#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#luna#palette.replace = copy(g:airline#themes#luna#palette.insert)
|
||||
let g:airline#themes#luna#palette.replace.airline_a = [ s:I2[0] , '#920000' , s:I2[2] , 88 , '' ]
|
||||
let g:airline#themes#luna#palette.replace_modified = g:airline#themes#luna#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#ffff9a' , '#ff8036' , 222 , 208 ]
|
||||
let s:V2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:V3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#luna#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#4e4e4e' , '#002b2b' , 59 , 23 , '' ]
|
||||
let g:airline#themes#luna#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#luna#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#450000' , '' , 52 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#luna#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] ,
|
||||
\ [ '#ffffff' , '#005252' , 231 , 36 , '' ] ,
|
||||
\ [ '#ffffff' , '#973d45' , 231 , 95 , '' ] )
|
||||
|
||||
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, ''],
|
||||
\ }
|
||||
@@ -1,63 +0,0 @@
|
||||
let g:airline#themes#molokai#palette = {}
|
||||
|
||||
|
||||
let s:file = [ '#66d9ef' , '' , 81 , '' , '' ]
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#080808' , '#e6db74' , 232 , 144 ] " mode
|
||||
let s:N2 = [ '#f8f8f0' , '#232526' , 253 , 16 ] " info
|
||||
let s:N3 = [ '#f8f8f0' , '#465457' , 253 , 67 ] " statusline
|
||||
|
||||
let g:airline#themes#molokai#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#molokai#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#e6db74' , 232 , 144 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#080808' , '#66d9ef' , 232 , 81 ]
|
||||
let s:I2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:I3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#molokai#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#66d9ef' , 232 , 81 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#molokai#palette.replace = copy(g:airline#themes#molokai#palette.insert)
|
||||
let g:airline#themes#molokai#palette.replace.airline_a = [ s:I1[0] , '#ef5939' , s:I1[2] , 166 , '' ]
|
||||
let g:airline#themes#molokai#palette.replace_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#ef5939' , 232 , 166 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#080808' , '#fd971f' , 232 , 208 ]
|
||||
let s:V2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:V3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#molokai#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#fd971f' , 232 , 208 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Inactive
|
||||
let s:IA = [ '#1b1d1e' , '#465457' , 233 , 67 , '' ]
|
||||
let g:airline#themes#molokai#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#molokai#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#f8f8f0' , '' , 253 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" CtrlP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#molokai#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#f8f8f0' , '#465457' , 253 , 67 , '' ] ,
|
||||
\ [ '#f8f8f0' , '#232526' , 253 , 16 , '' ] ,
|
||||
\ [ '#080808' , '#e6db74' , 232 , 144 , 'bold' ] )
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
" Theme to mimic the default colorscheme of powerline
|
||||
" Not 100% the same so it's powerline... ish.
|
||||
"
|
||||
" Differences from default powerline:
|
||||
" * Paste indicator isn't colored different
|
||||
" * Far right hand section matches the color of the mode indicator
|
||||
"
|
||||
" Differences from other airline themes:
|
||||
" * No color differences when you're in a modified buffer
|
||||
" * Visual mode only changes the mode section. Otherwise
|
||||
" it appears the same as normal mode
|
||||
|
||||
" Normal mode " fg & bg
|
||||
let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ] " darkestgreen & brightgreen
|
||||
let s:N2 = [ '#9e9e9e' , '#303030' , 247 , 236 ] " gray8 & gray2
|
||||
let s:N3 = [ '#ffffff' , '#121212' , 231 , 233 ] " white & gray4
|
||||
|
||||
" Insert mode " fg & bg
|
||||
let s:I1 = [ '#005f5f' , '#ffffff' , 23 , 231 ] " darkestcyan & white
|
||||
let s:I2 = [ '#5fafd7' , '#0087af' , 74 , 31 ] " darkcyan & darkblue
|
||||
let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ] " mediumcyan & darkestblue
|
||||
|
||||
" Visual mode " fg & bg
|
||||
let s:V1 = [ '#080808' , '#ffaf00' , 232 , 214 ] " gray3 & brightestorange
|
||||
|
||||
" 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.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#powerlineish#palette.insert_replace = {
|
||||
\ 'airline_a': [ s:RE[0] , s:I1[1] , s:RE[1] , s:I1[3] , '' ] }
|
||||
|
||||
let g:airline#themes#powerlineish#palette.visual = {
|
||||
\ 'airline_a': [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , '' ] }
|
||||
|
||||
let g:airline#themes#powerlineish#palette.replace = copy(airline#themes#powerlineish#palette.normal)
|
||||
let g:airline#themes#powerlineish#palette.replace.airline_a = [ s:RE[0] , s:RE[1] , s:RE[2] , s:RE[3] , '' ]
|
||||
|
||||
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
|
||||
let g:airline#themes#powerlineish#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
let g:airline#themes#serene#palette = {}
|
||||
|
||||
let s:guibg = '#080808'
|
||||
let s:termbg = 232
|
||||
let s:termsep = 236
|
||||
let s:guisep = '#303030'
|
||||
|
||||
let s:file = [ '#ff0000' , s:guibg , 160 , s:termbg , '' ]
|
||||
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, s:file)
|
||||
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, s:file)
|
||||
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, 243 , s:termbg ]
|
||||
let g:airline#themes#serene#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
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, s:file)
|
||||
let g:airline#themes#serene#palette.inactive_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
@@ -1,47 +0,0 @@
|
||||
let g:airline#themes#simple#palette = {}
|
||||
|
||||
let s:guibg = '#080808'
|
||||
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_modified = {
|
||||
\ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ s:guibg, '#5fff00' , s:termbg , 82 ]
|
||||
let s:I2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
|
||||
let s:I3 = [ '#767676' , s:guibg, 243 , s:termbg ]
|
||||
let g:airline#themes#simple#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#simple#palette.insert_modified = copy(g:airline#themes#simple#palette.normal_modified)
|
||||
let g:airline#themes#simple#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#simple#palette.replace = {
|
||||
\ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#simple#palette.replace_modified = copy(g:airline#themes#simple#palette.normal_modified)
|
||||
|
||||
|
||||
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_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_modified = {
|
||||
\ 'airline_c': [ '#df0000', '', 160, '', '' ] ,
|
||||
\ }
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
let g:airline#themes#solarized#palette = {}
|
||||
|
||||
function! s:generate()
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Options
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
let s:reduced = get(g:, 'airline_solarized_reduced', 1)
|
||||
let s:background = get(g:, 'airline_solarized_bg', &background)
|
||||
let s:ansi_colors = get(g:, 'solarized_termcolors', 16) != 256 && &t_Co >= 16 ? 1 : 0
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" 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'}
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Simple mappings
|
||||
" NOTE: These are easily tweakable mappings. The actual mappings get
|
||||
" 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, '']
|
||||
else
|
||||
let s:N2 = [s:base2, s:base00, '']
|
||||
let s:N3 = [s:base00, 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], '']
|
||||
else
|
||||
let s:NM = [s:red, s:N3[1], '']
|
||||
endif
|
||||
|
||||
" Insert mode
|
||||
if s:reduced
|
||||
let s:I1 = [s:N1[0], s:green, 'bold']
|
||||
let s:I2 = s:N2
|
||||
else
|
||||
let s:I1 = [s:N1[0], s:orange, 'bold']
|
||||
if s:background == 'dark'
|
||||
let s:I2 = [s:base00, s:color236, '']
|
||||
else
|
||||
let s:I2 = [s:base00, s:color251, '']
|
||||
endif
|
||||
endif
|
||||
let s:I3 = s:N3
|
||||
let s:IF = s:NF
|
||||
let s:IM = s:NM
|
||||
|
||||
" Visual mode
|
||||
if s:reduced
|
||||
let s:V1 = [s:N1[0], s:orange, 'bold']
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
else
|
||||
let s:V1 = [s:N1[0], s:green, 'bold']
|
||||
let s:V2 = s:I2
|
||||
let s:V3 = s:I3
|
||||
endif
|
||||
let s:VF = s:NF
|
||||
if s:reduced
|
||||
let s:VM = s:NM
|
||||
else
|
||||
let s:VM = s:IM
|
||||
endif
|
||||
|
||||
" Inactive
|
||||
if s:background == 'dark'
|
||||
let s:IA = [s:base00, s:base02, '']
|
||||
else
|
||||
let s:IA = [s:base1, s:base2, '']
|
||||
endif
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Actual mappings
|
||||
" WARNING: Don't modify this section unless necessary.
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
let s:NFa = [s:NF[0].g, s:NF[1].g, s:NF[0].t, s:NF[1].t, s:NF[2]]
|
||||
let s:IFa = [s:IF[0].g, s:IF[1].g, s:IF[0].t, s:IF[1].t, s:IF[2]]
|
||||
let s:VFa = [s:VF[0].g, s:VF[1].g, s:VF[0].t, s:VF[1].t, s:VF[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.inactive = airline#themes#generate_color_map(
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ s:NFa)
|
||||
let g:airline#themes#solarized#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:NM[0].g, '', s:NM[0].t, '', s:NM[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)
|
||||
|
||||
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)
|
||||
|
||||
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.visual = airline#themes#generate_color_map(
|
||||
\ [s:V1[0].g, s:V1[1].g, s:V1[0].t, s:V1[1].t, s:V1[2]],
|
||||
\ [s:V2[0].g, s:V2[1].g, s:V2[0].t, s:V2[1].t, s:V2[2]],
|
||||
\ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]],
|
||||
\ s:VFa)
|
||||
|
||||
let g:airline#themes#solarized#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.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
|
||||
@@ -1,45 +0,0 @@
|
||||
let g:airline#themes#tomorrow#palette = {}
|
||||
|
||||
function! s:generate()
|
||||
let s:file = 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 group = airline#themes#get_highlight('vimCommand')
|
||||
let g:airline#themes#tomorrow#palette.normal_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['MoreMsg', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['MoreMsg', 'fg'], ['Normal', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#tomorrow#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#tomorrow#palette.insert_modified = g:airline#themes#tomorrow#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('Error', 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#tomorrow#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
|
||||
let g:airline#themes#tomorrow#palette.replace_modified = g:airline#themes#tomorrow#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Constant', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#tomorrow#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#tomorrow#palette.visual_modified = g:airline#themes#tomorrow#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg'])
|
||||
let g:airline#themes#tomorrow#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
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
|
||||
@@ -1,60 +0,0 @@
|
||||
" vim-airline companion theme of Ubaryd
|
||||
" (https://github.com/Donearm/Ubaryd)
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#141413' , '#c7b386' , 232 , 252 ] " blackestgravel & bleaksand
|
||||
let s:N2 = [ '#c7b386' , '#45413b' , 252, 238 ] " bleaksand & deepgravel
|
||||
let s:N3 = [ '#b88853' , '#242321' , 137, 235 ] " toffee & darkgravel
|
||||
let s:N4 = [ '#857f78' , 243 ] " gravel
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#1a1a18' , '#fade3e' , 232 , 221 ] " blackestgravel & warmcorn
|
||||
let s:I2 = [ '#c7b386' , '#45413b' , 252 , 238 ] " bleaksand & deepgravel
|
||||
let s:I3 = [ '#f4cf86' , '#242321' , 222 , 235 ] " lighttannedskin & darkgravel
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#1c1b1a' , '#9a4820' , 233 , 88 ] " blackgravel & warmadobe
|
||||
let s:V2 = [ '#000000' , '#88633f' , 16 , 95 ] " coal & cappuccino
|
||||
let s:V3 = [ '#88633f' , '#c7b386' , 95 , 252 ] " cappuccino & bleaksand
|
||||
let s:V4 = [ '#c14c3d' , 160 ] " tannedumbrella
|
||||
|
||||
" Replace mode
|
||||
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.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_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_modified = {
|
||||
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#ubaryd#palette.insert_paste = {
|
||||
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.replace = copy(airline#themes#ubaryd#palette.insert)
|
||||
let g:airline#themes#ubaryd#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#ubaryd#palette.replace_modified = g:airline#themes#ubaryd#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#ubaryd#palette.visual_modified = {
|
||||
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
let g:airline#themes#ubaryd#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#ubaryd#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
" vim-airline companion theme of Wombat
|
||||
" looks great with wombat256 vim colorscheme
|
||||
|
||||
" Normal mode
|
||||
" [ guifg, guibg, ctermfg, ctermbg, opts ]
|
||||
let s:N1 = [ '#141413' , '#CAE682' , 232 , 192 ] " mode
|
||||
let s:N2 = [ '#CAE682' , '#32322F' , 192 , 236 ] " info
|
||||
let s:N3 = [ '#CAE682' , '#242424' , 192 , 234 ] " statusline
|
||||
let s:N4 = [ '#86CD74' , 113 ] " mode modified
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#141413' , '#FDE76E' , 232 , 227 ]
|
||||
let s:I2 = [ '#FDE76E' , '#32322F' , 227 , 236 ]
|
||||
let s:I3 = [ '#FDE76E' , '#242424' , 227 , 234 ]
|
||||
let s:I4 = [ '#FADE3E' , 221 ]
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#141413' , '#B5D3F3' , 232 , 153 ]
|
||||
let s:V2 = [ '#B5D3F3' , '#32322F' , 153 , 236 ]
|
||||
let s:V3 = [ '#B5D3F3' , '#242424' , 153 , 234 ]
|
||||
let s:V4 = [ '#7CB0E6' , 111 ]
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [ '#141413' , '#E5786D' , 232 , 173 ]
|
||||
let s:R2 = [ '#E5786D' , '#32322F' , 173 , 236 ]
|
||||
let s:R3 = [ '#E5786D' , '#242424' , 173 , 234 ]
|
||||
let s:R4 = [ '#E55345' , 203 ]
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#94E42C' , 47 ]
|
||||
|
||||
" Info modified
|
||||
let s:IM = [ '#40403C' , 238 ]
|
||||
|
||||
" File permissions (RO, etc)
|
||||
let s:file = [ '#E5786D' , '' , 203 , '' , '' ]
|
||||
|
||||
" Inactive mode
|
||||
let s:IA = [ '#767676' , s:N3[1] , 243 , s:N3[3] , '' ]
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette = {}
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
let g:airline#themes#wombat#palette.normal_modified = {
|
||||
\ 'airline_a': [ s:N1[0] , s:N4[0] , s:N1[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:N4[0] , s:IM[0] , s:N4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:N4[0] , s:N3[1] , s:N4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file)
|
||||
let g:airline#themes#wombat#palette.insert_modified = {
|
||||
\ 'airline_a': [ s:I1[0] , s:I4[0] , s:I1[2] , s:I4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:I4[0] , s:IM[0] , s:I4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:I4[0] , s:N3[1] , s:I4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file)
|
||||
let g:airline#themes#wombat#palette.visual_modified = {
|
||||
\ 'airline_a': [ s:V1[0] , s:V4[0] , s:V1[2] , s:V4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:V4[0] , s:IM[0] , s:V4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:V4[0] , s:N3[1] , s:V4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file)
|
||||
let g:airline#themes#wombat#palette.replace_modified = {
|
||||
\ 'airline_a': [ s:R1[0] , s:R4[0] , s:R1[2] , s:R4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:R4[0] , s:IM[0] , s:R4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:R4[0] , s:N3[1] , s:R4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#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#wombat#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
|
||||
let g:airline#themes#wombat#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:N4[0] , '' , s:N4[1] , '' , '' ] }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#wombat#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#DADADA' , '#242424' , 253 , 234 , '' ] ,
|
||||
\ [ '#DADADA' , '#40403C' , 253 , 238 , '' ] ,
|
||||
\ [ '#141413' , '#DADADA' , 232 , 253 , 'bold' ] )
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
let g:airline#themes#zenburn#palette = {}
|
||||
|
||||
function! s:generate()
|
||||
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 s:file = airline#themes#get_highlight('Constant')
|
||||
|
||||
let g:airline#themes#zenburn#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
|
||||
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, s:file)
|
||||
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, s:file)
|
||||
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, s:file)
|
||||
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, s:file)
|
||||
let g:airline#themes#zenburn#palette.inactive_modified = {
|
||||
\ 'airline_c': s:Nmod
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
call s:generate()
|
||||
augroup airline_zenburn
|
||||
autocmd!
|
||||
autocmd ColorScheme * call <sid>generate()
|
||||
augroup END
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" 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
|
||||
@@ -14,14 +15,15 @@ function! airline#util#append(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
endif
|
||||
return empty(a:text) ? '' : ' '.g:airline_left_alt_sep.' '.a:text
|
||||
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.' '.g:airline_right_alt_sep.' '
|
||||
return empty(a:text) ? '' : a:text.s:spc.g:airline_right_alt_sep.s:spc
|
||||
endfunction
|
||||
|
||||
if v:version >= 704
|
||||
|
||||
513
doc/airline.txt
513
doc/airline.txt
@@ -1,4 +1,5 @@
|
||||
*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,6 +70,9 @@ 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=0
|
||||
<
|
||||
@@ -58,8 +82,12 @@ values):
|
||||
<
|
||||
* themes are automatically selected based on the matching colorscheme. this
|
||||
can be overridden by defining a value. >
|
||||
let g:airline_theme=
|
||||
let g:airline_theme='dark'
|
||||
<
|
||||
Note: Only the dark theme is distributed with vim-airline. For more themes,
|
||||
checkout the vim-airline-themes repository
|
||||
(github.com/vim-airline/vim-airline-themes)
|
||||
|
||||
* if you want to patch the airline theme before it gets applied, you can
|
||||
supply the name of a function where you can modify the palette. >
|
||||
let g:airline_theme_patch_func = 'AirlineThemePatch'
|
||||
@@ -72,7 +100,7 @@ values):
|
||||
endfunction
|
||||
<
|
||||
* enable/disable automatic population of the `g:airline_symbols` dictionary
|
||||
with powerline symbols.
|
||||
with powerline symbols. >
|
||||
let g:airline_powerline_fonts=0
|
||||
<
|
||||
* define the set of text to display for each mode. >
|
||||
@@ -106,6 +134,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*
|
||||
|
||||
@@ -116,22 +149,41 @@ 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
|
||||
|
||||
Note: You must define the dictionary first before setting values: >
|
||||
let g:airline_symbols = {}
|
||||
>
|
||||
" 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_symbols.crypt = '🔒'
|
||||
let g:airline_symbols.linenr = '␊'
|
||||
let g:airline_symbols.linenr = ''
|
||||
let g:airline_symbols.linenr = '¶'
|
||||
@@ -139,6 +191,7 @@ Note: You must define the dictionary first before setting values: >
|
||||
let g:airline_symbols.paste = 'ρ'
|
||||
let g:airline_symbols.paste = 'Þ'
|
||||
let g:airline_symbols.paste = '∥'
|
||||
let g:airline_symbols.notexists = '∄'
|
||||
let g:airline_symbols.whitespace = 'Ξ'
|
||||
|
||||
" powerline symbols
|
||||
@@ -165,19 +218,20 @@ with the usual statusline syntax.
|
||||
|
||||
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|
|
||||
using variables defined in the |airline-configuration| or |airline-extensions|
|
||||
section.
|
||||
>
|
||||
variable names default contents
|
||||
----------------------------------------------------------------------------
|
||||
let g:airline_section_a (mode, paste, iminsert)
|
||||
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, 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)
|
||||
let g:airline_section_error (ycm_error_count, syntastic, eclim)
|
||||
let g:airline_section_warning (ycm_warning_count, whitespace)
|
||||
|
||||
" here is an example of how you could replace the branch indicator with
|
||||
" the current working directory, followed by the filename.
|
||||
@@ -190,6 +244,23 @@ EXTENSIONS *airline-extensions*
|
||||
Most extensions are enabled by default and lazily loaded when the
|
||||
corresponding plugin (if any) is detected.
|
||||
|
||||
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
|
||||
@@ -197,15 +268,40 @@ configuration values that you can use.
|
||||
|
||||
* control which sections get truncated and at what width. >
|
||||
let g:airline#extensions#default#section_truncate_width = {
|
||||
\ 'b': 88,
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ })
|
||||
\ 'warning': 80,
|
||||
\ 'error': 80,
|
||||
\ }
|
||||
|
||||
" 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', 'error', 'warning' ]
|
||||
\ ]
|
||||
<
|
||||
* configure the layout to not use %(%) grouping items in the statusline.
|
||||
Try setting this to zero, if you notice bleeding color artifacts >
|
||||
let airline#extensions#default#section_use_groupitems = 1
|
||||
<
|
||||
------------------------------------- *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>
|
||||
|
||||
@@ -218,6 +314,7 @@ vim-bufferline <https://github.com/bling/vim-bufferline>
|
||||
------------------------------------- *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
|
||||
@@ -225,6 +322,34 @@ lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
|
||||
* change the text for when no branch is detected >
|
||||
let g:airline#extensions#branch#empty_message = ''
|
||||
<
|
||||
* define the order in which the branches of different vcs systems will be
|
||||
displayed on the statusline (currently only for fugitive and lawrencium) >
|
||||
let g:airline#extensions#branch#vcs_priority = ["git", "mercurial"]
|
||||
<
|
||||
* 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>
|
||||
|
||||
@@ -232,13 +357,13 @@ syntastic <https://github.com/scrooloose/syntastic>
|
||||
let g:airline#extensions#syntastic#enabled = 1
|
||||
<
|
||||
------------------------------------- *airline-tagbar*
|
||||
tagbar <https://github.com/majutsushi/>
|
||||
tagbar <https://github.com/majutsushi/tagbar>
|
||||
|
||||
* enable/disable tagbar integration >
|
||||
let g:airline#extensions#tagbar#enabled = 1
|
||||
<
|
||||
* change how tags are displayed (:help tagbar-statusline) >
|
||||
let g:airline#extensions#tagbar#flags = '' "default
|
||||
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'
|
||||
@@ -256,6 +381,8 @@ csv.vim <https://github.com/chrisbra/csv.vim>
|
||||
------------------------------------- *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. >
|
||||
let g:airline#extensions#hunks#enabled = 1
|
||||
@@ -276,21 +403,78 @@ ctrlp <https://github.com/kien/ctrlp.vim>
|
||||
let g:airline#extensions#ctrlp#color_template = 'visual'
|
||||
let g:airline#extensions#ctrlp#color_template = 'replace'
|
||||
<
|
||||
|
||||
* 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' ]
|
||||
" indent: mixed indent within a line
|
||||
" long: overlong lines
|
||||
" trailing: trailing whitespace
|
||||
" mixed-indent-file: different indentation in different lines
|
||||
let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing', 'long', 'mixed-indent-file' ]
|
||||
<
|
||||
* 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
|
||||
@@ -298,36 +482,101 @@ virtualenv <https://github.com/jmcantrell/vim-virtualenv>
|
||||
* 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]'
|
||||
let g:airline#extensions#whitespace#mixed_indent_file_format = 'mix-indent-file[%s]'
|
||||
|
||||
* configure custom trailing whitespace regexp rule >
|
||||
let g:airline#extensions#whitespace#trailing_regexp = '\s$'
|
||||
<
|
||||
------------------------------------- *airline-tabline*
|
||||
* enable/disable enhanced tabline. >
|
||||
Note: If you're using the ctrlspace tabline only the option marked with (c)
|
||||
are supported!
|
||||
|
||||
* enable/disable enhanced tabline. (c)
|
||||
let g:airline#extensions#tabline#enabled = 0
|
||||
<
|
||||
* enable/disable displaying buffers with a single tab. >
|
||||
|
||||
* enable/disable displaying open splits per tab (only when tabs are opened). >
|
||||
let g:airline#extensions#tabline#show_splits = 1
|
||||
*
|
||||
* switch position of buffers and tabs on splited tabline (c)
|
||||
let g:airline#extensions#tabline#switch_buffers_and_tabs = 0
|
||||
|
||||
* enable/disable displaying buffers with a single tab. (c)
|
||||
let g:airline#extensions#tabline#show_buffers = 1
|
||||
<
|
||||
* enable/disable displaying tabs, regardless of number. (c)
|
||||
let g:airline#extensions#tabline#show_tabs = 1
|
||||
<
|
||||
* configure filename match rules to exclude from the tabline. >
|
||||
let g:airline#extensions#tabline#excludes = []
|
||||
<
|
||||
* configure how numbers are calculated in tab mode. >
|
||||
|
||||
* 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
|
||||
<
|
||||
* defines the name of a formatter for how buffer names are displayed. >
|
||||
* 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
|
||||
|
||||
* rename label for buffers (default: 'buffers') (c)
|
||||
let g:airline#extensions#tabline#buffers_label = 'b'
|
||||
|
||||
* rename label for tabs (default: 'tabs') (c)
|
||||
let g:airline#extensions#tabline#tabs_label = 't'
|
||||
|
||||
* 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. (c)
|
||||
let g:airline#extensions#tabline#formatter = 'default'
|
||||
|
||||
" here is how you can define a 'foo' formatter:
|
||||
function! airline#extensions#tabline#formatters#foo(bufnr, buffers)
|
||||
" 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|. >
|
||||
* 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|). >
|
||||
@@ -335,24 +584,157 @@ virtualenv <https://github.com/jmcantrell/vim-virtualenv>
|
||||
<
|
||||
* 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.
|
||||
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 = ''
|
||||
<
|
||||
Note: Enabling this extension will modify |showtabline| and |guioptions|.
|
||||
|
||||
* 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'.
|
||||
|
||||
* enable Refresh of tabline buffers on |BufAdd| autocommands
|
||||
(set this to one, if you note 'AirlineTablineRefresh', however, this
|
||||
won't update airline on |:badd| commands) >
|
||||
let airline#extensions#tabline#disable_refresh = 0
|
||||
|
||||
------------------------------------- *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
|
||||
|
||||
To make the vim-ctrlspace integration work you will need to make the
|
||||
ctrlspace statusline function call the correct airline function. Therefore
|
||||
add the following line into your .vimrc:
|
||||
|
||||
let g:CtrlSpaceStatuslineFunction = "airline#extensions#ctrlspace#statusline()"
|
||||
<
|
||||
------------------------------------- *airline-ycm*
|
||||
YouCompleteMe <https://github.com/Valloric/YouCompleteMe>
|
||||
|
||||
Shows number of errors and warnings in the current file detected by YCM.
|
||||
|
||||
* enable/disable YCM integration >
|
||||
let g:airline#extensions#ycm#enabled = 1
|
||||
|
||||
* set error count prefix >
|
||||
let g:airline#extensions#ycm#error_symbol = 'E:'
|
||||
|
||||
* set warning count prefix >
|
||||
let g:airline#extensions#ycm#warning_symbol = 'W:'
|
||||
<
|
||||
------------------------------------- *airline-po*
|
||||
po.vim <http://www.vim.org/scripts/script.php?script_id=2530>
|
||||
|
||||
* enable/disable po integration >
|
||||
let g:airline#extensions#po#enabled = 1
|
||||
<
|
||||
* truncate width names to a fixed length >
|
||||
let g:airline#extensions#po#displayed_limit = 0
|
||||
<
|
||||
==============================================================================
|
||||
ADVANCED CUSTOMIZATION *airline-advanced-customization*
|
||||
|
||||
The defaults will accomodate the mass majority of users with minimal
|
||||
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.
|
||||
@@ -373,11 +755,47 @@ greater than a minimum width. >
|
||||
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
|
||||
@@ -387,7 +805,7 @@ define a section like this: >
|
||||
let g:airline_section_b = airline#section#create_left(['ffenc','file'])
|
||||
let g:airline_section_c = airline#section#create(['%{getcwd()}'])
|
||||
endfunction
|
||||
autocmd VimEnter * call AirlineInit()
|
||||
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
|
||||
@@ -396,13 +814,13 @@ 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
|
||||
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
|
||||
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.
|
||||
|
||||
@@ -415,7 +833,7 @@ the most powerful way to customize the statusline, and sometimes it may be
|
||||
easier to go this route than the above methods.
|
||||
|
||||
Every section can have two values. The default value is the global `g:`
|
||||
variable which is used in the absense of a `w:` value. This makes it very easy
|
||||
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.
|
||||
|
||||
@@ -463,7 +881,7 @@ to your liking. Here is an example: >
|
||||
return 1
|
||||
endfunction
|
||||
<
|
||||
The above example uses various some example highlight groups to demonstrate
|
||||
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`.
|
||||
@@ -492,15 +910,15 @@ WRITING EXTENSIONS *airline-writing-extensions*
|
||||
|
||||
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
|
||||
@@ -520,9 +938,12 @@ VimL syntax to write a theme, but if you've written in any programming
|
||||
language before it will be easy to pick up.
|
||||
|
||||
The |dark.vim| theme fully documents this procedure and will guide you through
|
||||
the process. The |jellybeans.vim| theme is another example of how to write a
|
||||
theme, but instead of manually declaring colors, it extracts the values from
|
||||
highlight groups.
|
||||
the process.
|
||||
|
||||
For other examples, you can visit the official themes repository at
|
||||
<https://github.com/vim-airline/vim-airline-themes>. It also includes
|
||||
examples such as |jellybeans.vim| which define colors by extracting highlight
|
||||
groups from the underlying colorscheme.
|
||||
|
||||
==============================================================================
|
||||
TROUBLESHOOTING *airline-troubleshooting*
|
||||
@@ -535,7 +956,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
|
||||
<
|
||||
@@ -554,9 +975,14 @@ A. Certain themes are derived from the active colorscheme by extracting colors
|
||||
their intended matching colorschemes, but will be hit or miss when loaded
|
||||
with other colorschemes.
|
||||
|
||||
Q. Themes are missing
|
||||
A. Themes have been extracted into the vim-airlines-themes repository. Simply
|
||||
clone https://github.com/vim-airline/vim-airline-themes and everything
|
||||
should work again.
|
||||
|
||||
|
||||
Solutions to other common problems can be found in the Wiki:
|
||||
<https://github.com/bling/vim-airline/wiki/FAQ>
|
||||
<https://github.com/vim-airline/vim-airline/wiki/FAQ>
|
||||
|
||||
==============================================================================
|
||||
CONTRIBUTIONS *airline-contributions*
|
||||
@@ -566,7 +992,6 @@ 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,40 +6,46 @@ if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline)
|
||||
endif
|
||||
let g:loaded_airline = 1
|
||||
|
||||
" autocmd VimEnter * call airline#deprecation#check()
|
||||
|
||||
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#init#bootstrap()
|
||||
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
|
||||
if s:airline_initialized
|
||||
return
|
||||
endif
|
||||
let s:airline_initialized = 1
|
||||
|
||||
call airline#extensions#load()
|
||||
call airline#init#sections()
|
||||
|
||||
let s:theme_in_vimrc = exists('g:airline_theme')
|
||||
if s:theme_in_vimrc
|
||||
try
|
||||
let palette = g:airline#themes#{g:airline_theme}#palette
|
||||
catch
|
||||
echom 'Could not resolve airline theme "' . g:airline_theme . '". Themes have been migrated to github.com/vim-airline/vim-airline-themes.'
|
||||
let g:airline_theme = 'dark'
|
||||
endtry
|
||||
silent call airline#switch_theme(g:airline_theme)
|
||||
else
|
||||
let g:airline_theme = 'dark'
|
||||
silent call s:on_colorscheme_changed()
|
||||
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()
|
||||
if !s:airline_theme_defined
|
||||
if airline#switch_matching_theme()
|
||||
return
|
||||
endif
|
||||
call s:init()
|
||||
let g:airline_gui_mode = airline#init#gui_mode()
|
||||
if !s:theme_in_vimrc
|
||||
call airline#switch_matching_theme()
|
||||
endif
|
||||
|
||||
" couldn't find a match, or theme was defined, just refresh
|
||||
@@ -60,8 +66,10 @@ function! s:airline_toggle()
|
||||
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!
|
||||
|
||||
@@ -70,17 +78,21 @@ function! s:airline_toggle()
|
||||
\ | call <sid>on_window_changed()
|
||||
autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter')
|
||||
|
||||
autocmd ColorScheme * call <sid>on_colorscheme_changed()
|
||||
autocmd GUIEnter,ColorScheme * call <sid>on_colorscheme_changed()
|
||||
autocmd VimEnter,WinEnter,BufWinEnter,FileType,BufUnload,VimResized *
|
||||
\ call <sid>on_window_changed()
|
||||
|
||||
autocmd TabEnter * :unlet! w:airline_lastmode
|
||||
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
|
||||
|
||||
@@ -88,6 +100,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)
|
||||
@@ -95,9 +108,17 @@ 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()
|
||||
function! s:airline_refresh()
|
||||
silent doautocmd User AirlineBeforeRefresh
|
||||
call airline#load_theme()
|
||||
call airline#update_statusline()
|
||||
endfunction
|
||||
|
||||
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 s:airline_refresh()
|
||||
|
||||
call airline#init#bootstrap()
|
||||
call s:airline_toggle()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
let g:airline_theme = 'dark'
|
||||
call airline#init#bootstrap()
|
||||
call airline#init#sections()
|
||||
|
||||
source plugin/airline.vim
|
||||
doautocmd VimEnter
|
||||
|
||||
function! MyFuncref(...)
|
||||
call a:1.add_raw('hello world')
|
||||
@@ -49,7 +49,7 @@ describe 'airline'
|
||||
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#util#wrap(airline#parts#mode(),0)}'
|
||||
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'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
let g:airline_theme = 'dark'
|
||||
call airline#init#bootstrap()
|
||||
|
||||
describe 'active builder'
|
||||
@@ -12,9 +13,27 @@ describe 'active builder'
|
||||
|
||||
it 'should transition colors from one to the next'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('NonText', 'world')
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Normal#hello%#Normal_to_NonText#>%#NonText#world'
|
||||
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'
|
||||
@@ -26,9 +45,9 @@ describe 'active builder'
|
||||
it 'after split, sections use the right separator'
|
||||
call s:builder.split()
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('NonText', 'world')
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Normal#hello%#Normal_to_NonText#<%#NonText#world'
|
||||
Expect stl =~ 'hello%#Normal_to_Search#<%#Search#world'
|
||||
end
|
||||
|
||||
it 'should not repeat the same highlight group'
|
||||
@@ -37,6 +56,33 @@ describe 'active builder'
|
||||
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'
|
||||
@@ -46,9 +92,15 @@ describe 'inactive builder'
|
||||
|
||||
it 'should transition colors from one to the next'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('NonText', 'world')
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Normal_inactive#hello%#Normal_to_NonText_inactive#>%#NonText_inactive#world'
|
||||
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
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
call airline#init#bootstrap()
|
||||
call airline#init#sections()
|
||||
|
||||
source plugin/airline.vim
|
||||
doautocmd VimEnter
|
||||
|
||||
describe 'commands'
|
||||
it 'should toggle off and on'
|
||||
@@ -24,6 +22,14 @@ describe 'commands'
|
||||
Expect g:airline_theme == 'simple'
|
||||
execute 'AirlineTheme dark'
|
||||
Expect g:airline_theme == 'dark'
|
||||
execute 'AirlineTheme doesnotexist'
|
||||
Expect g:airline_theme == 'dark'
|
||||
colors molokai
|
||||
Expect g:airline_theme == 'molokai'
|
||||
end
|
||||
|
||||
it 'should have a refresh command'
|
||||
Expect exists(':AirlineRefresh') to_be_true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
call airline#init#bootstrap()
|
||||
call airline#init#sections()
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'c', 'a', 'b', 'warning' ],
|
||||
\ [ 'x', 'z', 'y' ]
|
||||
\ ]
|
||||
|
||||
source plugin/airline.vim
|
||||
doautocmd VimEnter
|
||||
|
||||
describe 'default'
|
||||
before
|
||||
@@ -8,10 +12,6 @@ describe 'default'
|
||||
end
|
||||
|
||||
it 'should use the layout'
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'c', 'a', 'b', 'warning' ],
|
||||
\ [ 'x', 'z', 'y' ]
|
||||
\ ]
|
||||
call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 })
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ 'airline_c_to_airline_a'
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
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
|
||||
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
|
||||
|
||||
20
t/init.vim
20
t/init.vim
@@ -6,10 +6,11 @@ function! s:clear()
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
describe 'init'
|
||||
call airline#init#bootstrap()
|
||||
|
||||
describe 'init sections'
|
||||
before
|
||||
call s:clear()
|
||||
call airline#init#bootstrap()
|
||||
call airline#init#sections()
|
||||
end
|
||||
|
||||
@@ -28,7 +29,7 @@ describe 'init'
|
||||
end
|
||||
|
||||
it 'section c should be file'
|
||||
Expect g:airline_section_c == '%<%f%m'
|
||||
Expect g:airline_section_c == '%<%f%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#'
|
||||
end
|
||||
|
||||
it 'section x should be filetype'
|
||||
@@ -42,8 +43,8 @@ describe 'init'
|
||||
|
||||
it 'section z should be line numbers'
|
||||
Expect g:airline_section_z =~ '%3p%%'
|
||||
Expect g:airline_section_z =~ '%3l'
|
||||
Expect g:airline_section_z =~ '%3c'
|
||||
Expect g:airline_section_z =~ '%4l'
|
||||
Expect g:airline_section_z =~ '%3v'
|
||||
end
|
||||
|
||||
it 'should not redefine sections already defined'
|
||||
@@ -61,7 +62,16 @@ describe 'init'
|
||||
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
|
||||
|
||||
|
||||
@@ -30,5 +30,10 @@ describe 'parts'
|
||||
call airline#parts#define_condition('part', '1')
|
||||
Expect airline#parts#get('part').condition == '1'
|
||||
end
|
||||
|
||||
it 'can define a accent'
|
||||
call airline#parts#define_accent('part', 'red')
|
||||
Expect airline#parts#get('part').accent == 'red'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
call airline#init#bootstrap()
|
||||
call airline#extensions#load()
|
||||
|
||||
function! SectionSpec()
|
||||
endfunction
|
||||
|
||||
@@ -11,6 +8,11 @@ describe 'section'
|
||||
call airline#parts#define_function('func', 'SectionSpec')
|
||||
end
|
||||
|
||||
it 'should be able to reference default parts'
|
||||
let s = airline#section#create(['paste'])
|
||||
Expect s == '%{airline#util#wrap(airline#parts#paste(),0)}'
|
||||
end
|
||||
|
||||
it 'should create sections with no separators'
|
||||
let s = airline#section#create(['text', 'raw', 'func'])
|
||||
Expect s == '%{airline#util#wrap("text",0)}raw%{airline#util#wrap(SectionSpec(),0)}'
|
||||
@@ -26,16 +28,24 @@ describe 'section'
|
||||
Expect s == '%{airline#util#prepend("text",0)}%{airline#util#wrap("text",0)}'
|
||||
end
|
||||
|
||||
it 'should prefix with highlight group if provided'
|
||||
it 'should prefix with accent group if provided and restore afterwards'
|
||||
call airline#parts#define('hi', {
|
||||
\ 'raw': 'hello',
|
||||
\ 'highlight': 'hlgroup',
|
||||
\ 'accent': 'red',
|
||||
\ })
|
||||
let s = airline#section#create(['hi'])
|
||||
Expect s == '%#hlgroup#hello'
|
||||
Expect s == '%#__accent_red#hello%#__restore__#'
|
||||
end
|
||||
|
||||
it 'should accent functions'
|
||||
call airline#parts#define_function('hi', 'Hello')
|
||||
call airline#parts#define_accent('hi', 'bold')
|
||||
let s = airline#section#create(['hi'])
|
||||
Expect s == '%#__accent_bold#%{airline#util#wrap(Hello(),0)}%#__restore__#'
|
||||
end
|
||||
|
||||
it 'should parse out a section from the distro'
|
||||
call airline#extensions#load()
|
||||
let s = airline#section#create(['whitespace'])
|
||||
Expect s =~ 'airline#extensions#whitespace#check'
|
||||
end
|
||||
|
||||
35
t/themes.vim
35
t/themes.vim
@@ -28,10 +28,41 @@ describe 'themes'
|
||||
|
||||
it 'should pass args through correctly'
|
||||
let hl = airline#themes#get_highlight('Foo', 'bold', 'italic')
|
||||
Expect hl == ['', '', 0, 1, 'bold,italic']
|
||||
Expect hl == ['', '', 'NONE', 'NONE', 'bold,italic']
|
||||
|
||||
let hl = airline#themes#get_highlight2(['Foo','bg'], ['Foo','fg'], 'italic', 'bold')
|
||||
Expect hl == ['', '', 1, 0, 'italic,bold']
|
||||
Expect hl == ['', '', 'NONE', 'NONE', 'italic,bold']
|
||||
end
|
||||
|
||||
it 'should generate color map with mirroring'
|
||||
let map = airline#themes#generate_color_map(
|
||||
\ [ 1, 1, 1, 1, '1' ],
|
||||
\ [ 2, 2, 2, 2, '2' ],
|
||||
\ [ 3, 3, 3, 3, '3' ],
|
||||
\ )
|
||||
Expect map.airline_a[0] == 1
|
||||
Expect map.airline_b[0] == 2
|
||||
Expect map.airline_c[0] == 3
|
||||
Expect map.airline_x[0] == 3
|
||||
Expect map.airline_y[0] == 2
|
||||
Expect map.airline_z[0] == 1
|
||||
end
|
||||
|
||||
it 'should generate color map with full set of colors'
|
||||
let map = airline#themes#generate_color_map(
|
||||
\ [ 1, 1, 1, 1, '1' ],
|
||||
\ [ 2, 2, 2, 2, '2' ],
|
||||
\ [ 3, 3, 3, 3, '3' ],
|
||||
\ [ 4, 4, 4, 4, '4' ],
|
||||
\ [ 5, 5, 5, 5, '5' ],
|
||||
\ [ 6, 6, 6, 6, '6' ],
|
||||
\ )
|
||||
Expect map.airline_a[0] == 1
|
||||
Expect map.airline_b[0] == 2
|
||||
Expect map.airline_c[0] == 3
|
||||
Expect map.airline_x[0] == 4
|
||||
Expect map.airline_y[0] == 5
|
||||
Expect map.airline_z[0] == 6
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user