mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-07 12:44:26 +08:00
Compare commits
999 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0f96df97f | ||
|
|
39ac0a93e5 | ||
|
|
e3cfd3643b | ||
|
|
3d9071e6b6 | ||
|
|
bd468dacfe | ||
|
|
c047abfe96 | ||
|
|
bc63a60b0f | ||
|
|
f9ccb57e76 | ||
|
|
31f5a9307d | ||
|
|
fa11b8855b | ||
|
|
904ac4eb0b | ||
|
|
ada0ba8ae3 | ||
|
|
426c8bb8ef | ||
|
|
df0c1731db | ||
|
|
f6a95d3a6f | ||
|
|
ffac12cbbe | ||
|
|
b2e1dbad6f | ||
|
|
b3a574b4a3 | ||
|
|
7f6dfbefd1 | ||
|
|
5b1c92979c | ||
|
|
9dc546c699 | ||
|
|
14691bb00e | ||
|
|
b20e181bc8 | ||
|
|
49671d0a11 | ||
|
|
cd0b15b195 | ||
|
|
c3ee263d5b | ||
|
|
2eaf57ece8 | ||
|
|
c850f485ad | ||
|
|
464633baad | ||
|
|
d441b3f7b6 | ||
|
|
f05f649be8 | ||
|
|
cfd373a5a2 | ||
|
|
6ceaffc49a | ||
|
|
78e67897a4 | ||
|
|
e66d65ebf4 | ||
|
|
4d8a06a5a9 | ||
|
|
6c6c6c104f | ||
|
|
f3d6a3542a | ||
|
|
e8fd2057a8 | ||
|
|
8c36d2b595 | ||
|
|
a993ae5d42 | ||
|
|
f08078d683 | ||
|
|
99971aa24d | ||
|
|
d57344a3c3 | ||
|
|
496de8b745 | ||
|
|
71dc6f0257 | ||
|
|
09b5eb952c | ||
|
|
a334a89e59 | ||
|
|
ce6cf6f07e | ||
|
|
b7367c605a | ||
|
|
18200bfad3 | ||
|
|
33a633766d | ||
|
|
776f7aa948 | ||
|
|
62f3d1d412 | ||
|
|
6516b1b4dc | ||
|
|
fc021cf4e8 | ||
|
|
6508558c3d | ||
|
|
08e9aa5386 | ||
|
|
0609a1f945 | ||
|
|
2e99805dbf | ||
|
|
726b730f0a | ||
|
|
7e004804d1 | ||
|
|
d81cdacb1e | ||
|
|
c44bbc66f5 | ||
|
|
61e2c7f86a | ||
|
|
4d825bdb64 | ||
|
|
07ac69570b | ||
|
|
68f5f1e50d | ||
|
|
3f34ff56b8 | ||
|
|
f045452743 | ||
|
|
13993d120e | ||
|
|
7190164451 | ||
|
|
a0298263b7 | ||
|
|
2390022e33 | ||
|
|
57bbe050c7 | ||
|
|
dd508340ea | ||
|
|
2f17e368b5 | ||
|
|
0f6cfcdfc2 | ||
|
|
264c1fefd2 | ||
|
|
ae024293e4 | ||
|
|
ecf10d0e58 | ||
|
|
11e6492849 | ||
|
|
dcf76b0992 | ||
|
|
82a6097b01 | ||
|
|
7957bd1d32 | ||
|
|
110594c91a | ||
|
|
012229fe08 | ||
|
|
a60eabb82f | ||
|
|
fce8585239 | ||
|
|
326b37cf13 | ||
|
|
1b8ecb6336 | ||
|
|
0756b9a4aa | ||
|
|
251ed064e8 | ||
|
|
c33c1de079 | ||
|
|
9903fee60e | ||
|
|
487d262901 | ||
|
|
a1c112cafd | ||
|
|
bcd37fc115 | ||
|
|
aec0a1a15a | ||
|
|
da8035d8a8 | ||
|
|
cda5647a29 | ||
|
|
f5676d1fa1 | ||
|
|
a92b12e1c6 | ||
|
|
d342c3cb1e | ||
|
|
c3434164b2 | ||
|
|
8715d13cc5 | ||
|
|
44da0a4761 | ||
|
|
c7fb175d35 | ||
|
|
59f3669a42 | ||
|
|
60eb44c94e | ||
|
|
723987eca9 | ||
|
|
964f53a418 | ||
|
|
a8ccef61ba | ||
|
|
4cc255a384 | ||
|
|
eac10a104f | ||
|
|
5aef1b90e5 | ||
|
|
821372b9cf | ||
|
|
db45cdd994 | ||
|
|
781c40bb3d | ||
|
|
9bee0e923e | ||
|
|
66e49d9a15 | ||
|
|
b790fd2120 | ||
|
|
c3a814dbae | ||
|
|
a141918faa | ||
|
|
11bc0ba843 | ||
|
|
45c9621157 | ||
|
|
feca81fb86 | ||
|
|
4f95970228 | ||
|
|
7d871137be | ||
|
|
6a05b92716 | ||
|
|
55716a1cc2 | ||
|
|
acb93da0d8 | ||
|
|
add75907d5 | ||
|
|
eab6d35852 | ||
|
|
1bb1ce594a | ||
|
|
044a90ed55 | ||
|
|
981b83003f | ||
|
|
a1680cc36d | ||
|
|
30a3c4f549 | ||
|
|
c7d4710f76 | ||
|
|
6e1e6686e7 | ||
|
|
a6e07b6a55 | ||
|
|
4db6d11962 | ||
|
|
ac799f6021 | ||
|
|
92bf1b0b39 | ||
|
|
08570b6dcb | ||
|
|
64e925d675 | ||
|
|
315cf0deec | ||
|
|
0f91e21710 | ||
|
|
02ffdfe0e5 | ||
|
|
a280ea4a18 | ||
|
|
a7b84f5b67 | ||
|
|
b84e13f1d7 | ||
|
|
c7e05efb76 | ||
|
|
5a065e8b82 | ||
|
|
15bc732df4 | ||
|
|
33310c5b24 | ||
|
|
c4a4a20b8d | ||
|
|
3ad4a18d85 | ||
|
|
a76f523be5 | ||
|
|
f7c818a0ff | ||
|
|
d9acbc53b0 | ||
|
|
0df2c9b12e | ||
|
|
00f718691a | ||
|
|
d66b507b02 | ||
|
|
8209ca7da1 | ||
|
|
902921931e | ||
|
|
ae394294c3 | ||
|
|
bf3cc5ad9d | ||
|
|
47bdae9067 | ||
|
|
2876715b56 | ||
|
|
023fe122c5 | ||
|
|
fbf96559c9 | ||
|
|
2ba64a88fd | ||
|
|
f0b969549a | ||
|
|
47c36d2819 | ||
|
|
aee733aa87 | ||
|
|
c75106f12d | ||
|
|
4b1913ad13 | ||
|
|
df2f380c9e | ||
|
|
b9f55455fb | ||
|
|
d2ac3d5755 | ||
|
|
e72a7e2c8d | ||
|
|
2528de7d81 | ||
|
|
7396dc7a10 | ||
|
|
51bb8dd7e0 | ||
|
|
5b7b9cf656 | ||
|
|
0b47adf087 | ||
|
|
3914d5b475 | ||
|
|
ecff00a559 | ||
|
|
18f93ac96b | ||
|
|
75f53ef6e5 | ||
|
|
a2e0ed982f | ||
|
|
84bf60c405 | ||
|
|
896c14bded | ||
|
|
700c9b9740 | ||
|
|
724beb0c73 | ||
|
|
fb85c0a91a | ||
|
|
d13305fc5d | ||
|
|
7844d8bf72 | ||
|
|
4a342afb90 | ||
|
|
275ec4fe63 | ||
|
|
d9e68039b8 | ||
|
|
3cd8daa162 | ||
|
|
e6b6f36d90 | ||
|
|
a7bff3b30b | ||
|
|
5ecc25d6d6 | ||
|
|
6db0af6f8d | ||
|
|
9b41fe5de9 | ||
|
|
1328610188 | ||
|
|
ada8cd7641 | ||
|
|
349d01ba39 | ||
|
|
3f87d28abb | ||
|
|
71814fb19f | ||
|
|
b99da65412 | ||
|
|
6286b6d8d8 | ||
|
|
5907d3909e | ||
|
|
57f2619c67 | ||
|
|
1837b2ee39 | ||
|
|
d3ec54d42e | ||
|
|
2b0fe51f99 | ||
|
|
a8f92cc68a | ||
|
|
4237bfb052 | ||
|
|
88dedb586a | ||
|
|
5d2d764368 | ||
|
|
6819443d6a | ||
|
|
980e78b4bf | ||
|
|
7480245ebf | ||
|
|
f93894f6ac | ||
|
|
e1a4cd764f | ||
|
|
d29c7b27fa | ||
|
|
3305410982 | ||
|
|
e0791cc1a0 | ||
|
|
7a286639c5 | ||
|
|
2711c73a47 | ||
|
|
cf47d63f71 | ||
|
|
abd310bb31 | ||
|
|
f60cf736db | ||
|
|
26aa528c42 | ||
|
|
958f78335e | ||
|
|
167602d5b9 | ||
|
|
78c4438469 | ||
|
|
9912ce13a4 | ||
|
|
63111e9810 | ||
|
|
2e2a66c5a0 | ||
|
|
3ebbc57725 | ||
|
|
55a9721c22 | ||
|
|
7f1cfb0c3f | ||
|
|
85696f28a9 | ||
|
|
e4968d7a40 | ||
|
|
8c634887bf | ||
|
|
c2ffb8b3ec | ||
|
|
eb58badee2 | ||
|
|
8c1a7a5343 | ||
|
|
dec9b8e65c | ||
|
|
e5a51f9fca | ||
|
|
e02176aca1 | ||
|
|
b7d3feb4d2 | ||
|
|
a3bdb10aea | ||
|
|
927c910af1 | ||
|
|
a104e40b10 | ||
|
|
9a2ed35ff9 | ||
|
|
02816a3cb6 | ||
|
|
182675dc10 | ||
|
|
ab49a1c7ae | ||
|
|
5db4c408bd | ||
|
|
6c4f3277f1 | ||
|
|
6cdcaf13b1 | ||
|
|
3a2323feac | ||
|
|
c76019ac9e | ||
|
|
a90ac37cb3 | ||
|
|
2ef81d4140 | ||
|
|
3b5f2bd470 | ||
|
|
88130fd377 | ||
|
|
7215a1fdd5 | ||
|
|
ebda798080 | ||
|
|
c17ad9a123 | ||
|
|
73d8abff2f | ||
|
|
4d0233ebdb | ||
|
|
d283a25e3f | ||
|
|
ce83c39bed | ||
|
|
133a76d2d4 | ||
|
|
c518f79aab | ||
|
|
9d28f0dcc7 | ||
|
|
30652c05c4 | ||
|
|
90cf752c90 | ||
|
|
3b631ef0c4 | ||
|
|
3985ece131 | ||
|
|
45878a7947 | ||
|
|
503b9977fb | ||
|
|
69aa1e93b3 | ||
|
|
645f65d8d9 | ||
|
|
45236ba7c7 | ||
|
|
a25757ac64 | ||
|
|
d78f686ce5 | ||
|
|
6ba65b2c8c | ||
|
|
708c76e22c | ||
|
|
d03c3fa7b9 | ||
|
|
72e457d8c2 | ||
|
|
2e3cdeb808 | ||
|
|
66991f53fa | ||
|
|
a3d5e84417 | ||
|
|
c386332570 | ||
|
|
125d3443e4 | ||
|
|
18da5aa699 | ||
|
|
1ee057362d | ||
|
|
450fa168ea | ||
|
|
e0dd3d8125 | ||
|
|
bc985301db | ||
|
|
6c8d0f5e6a | ||
|
|
77ab703a55 | ||
|
|
3b304f36ae | ||
|
|
7afc60af25 | ||
|
|
e415c5301f | ||
|
|
8c4bf37588 | ||
|
|
33663d7df2 | ||
|
|
009f7932fb | ||
|
|
f0093ceaa6 | ||
|
|
3e13bab201 | ||
|
|
d719d0664a | ||
|
|
640d6762f7 | ||
|
|
58328b347c | ||
|
|
4a1f65841c | ||
|
|
1f84ad886c | ||
|
|
c88dca5c96 | ||
|
|
dd368b3e31 | ||
|
|
20a6fe2b9f | ||
|
|
f3aae5f72b | ||
|
|
52ce640534 | ||
|
|
396cc92261 | ||
|
|
b044b4b204 | ||
|
|
a1b7479b54 | ||
|
|
ccc4c9f430 | ||
|
|
e72ec51e59 | ||
|
|
78ca75af6e | ||
|
|
6e2a9e38cd | ||
|
|
a5d9a4bcb2 | ||
|
|
7bf1d9b1fb | ||
|
|
27acd851a7 | ||
|
|
0ad4f97c1a | ||
|
|
bd613e69b6 | ||
|
|
4d645711e5 | ||
|
|
031cb31056 | ||
|
|
9f186d899a | ||
|
|
cfb107c75f | ||
|
|
a763c6b53f | ||
|
|
8a3e3e2794 | ||
|
|
ea46192561 | ||
|
|
81f089322a | ||
|
|
571f892fcd | ||
|
|
cdaa5117b0 | ||
|
|
e7a5c97df1 | ||
|
|
9e3fcc4cdb | ||
|
|
f0a508b121 | ||
|
|
942458f19b | ||
|
|
d3f8873469 | ||
|
|
09ab45a2fb | ||
|
|
195f2e1dae | ||
|
|
97f3f84881 | ||
|
|
c07b28d199 | ||
|
|
3b225a1322 | ||
|
|
f430246aff | ||
|
|
57cda93aad | ||
|
|
89e484ac59 | ||
|
|
20de588fd1 | ||
|
|
2b45581f1c | ||
|
|
db907f5598 | ||
|
|
3e25ca5a5a | ||
|
|
e357f88de6 | ||
|
|
f4caf598fa | ||
|
|
42e5c82d64 | ||
|
|
5345c8fafa | ||
|
|
9bd2c40e7d | ||
|
|
ab6acdee41 | ||
|
|
5df7d961bc | ||
|
|
b6a98bcd10 | ||
|
|
b77f326b33 | ||
|
|
06272275b5 | ||
|
|
2c05a48a26 | ||
|
|
4c74a95045 | ||
|
|
50bfe8dd68 | ||
|
|
a01d03a78a | ||
|
|
3ec22a524c | ||
|
|
8cd7e35027 | ||
|
|
e553433430 | ||
|
|
5147d385a5 | ||
|
|
232b6415d9 | ||
|
|
e8b6312dd9 | ||
|
|
04bc544db2 | ||
|
|
5fc5a43802 | ||
|
|
c2b2351d99 | ||
|
|
470e9870f1 | ||
|
|
e5f9ccad8e | ||
|
|
3535243c50 | ||
|
|
69ad039d07 | ||
|
|
d8eb12845f | ||
|
|
a8c4424244 | ||
|
|
6ee75bdbde | ||
|
|
a96681d459 | ||
|
|
e9a7a12d9e | ||
|
|
c65d7fe36b | ||
|
|
96352f9b53 | ||
|
|
2ec563bd57 | ||
|
|
83ceae726e | ||
|
|
711f50a567 | ||
|
|
c0695feb13 | ||
|
|
4e24036782 | ||
|
|
039fd6b50f | ||
|
|
a2e20bc3ca | ||
|
|
0c307d5f73 | ||
|
|
d54613d2dd | ||
|
|
846d85aaa1 | ||
|
|
72e5f04f7c | ||
|
|
e79188c3bd | ||
|
|
61c624ef6c | ||
|
|
e03afa1733 | ||
|
|
afcda0510e | ||
|
|
b78c2ec475 | ||
|
|
4f43e5c93d | ||
|
|
0205baa963 | ||
|
|
b6eaa60a88 | ||
|
|
39c61288e8 | ||
|
|
72ca1c344f | ||
|
|
42522f994a | ||
|
|
a10d321809 | ||
|
|
a914cfb754 | ||
|
|
313a6fcad2 | ||
|
|
825aec9e4d | ||
|
|
62952b3887 | ||
|
|
b2f301f73c | ||
|
|
174b7e1962 | ||
|
|
6ab0098ced | ||
|
|
feee9bcf3c | ||
|
|
583ae3d5f9 | ||
|
|
560092a9ec | ||
|
|
f86f1e8103 | ||
|
|
811360a095 | ||
|
|
c8a5efc11e | ||
|
|
e7d18fe427 | ||
|
|
0a352c9f5b | ||
|
|
ac032b752a | ||
|
|
b101175683 | ||
|
|
fde2511201 | ||
|
|
57e564b227 | ||
|
|
7d082c03b2 | ||
|
|
87cdf8f6c4 | ||
|
|
52c0afadb9 | ||
|
|
258f3e5630 | ||
|
|
2e3055541e | ||
|
|
d2b697d27b | ||
|
|
ed95adea1e | ||
|
|
7f3d6287b5 | ||
|
|
1891933e59 | ||
|
|
9168b73411 | ||
|
|
c436592559 | ||
|
|
e16ff7cc88 | ||
|
|
9eb51f48f4 | ||
|
|
7865dc8149 | ||
|
|
466198adc0 | ||
|
|
8e64138ef4 | ||
|
|
d593359500 | ||
|
|
b3722b1e82 | ||
|
|
a950a2938a | ||
|
|
0c368681dd | ||
|
|
bcb52a1feb | ||
|
|
13bd4701ed | ||
|
|
4a47cd70cd | ||
|
|
f76ede3b28 | ||
|
|
396b49be4c | ||
|
|
e14f6579d7 | ||
|
|
b4ad02f906 | ||
|
|
703241942a | ||
|
|
7813a54912 | ||
|
|
223624d3e9 | ||
|
|
3a23eeac42 | ||
|
|
b57022bfc2 | ||
|
|
70dd0655d2 | ||
|
|
46b0b6bf5a | ||
|
|
c9a0c62b1b | ||
|
|
17d2db93fd | ||
|
|
ba7d8c59f7 | ||
|
|
d46fb524bd | ||
|
|
fb6231b479 | ||
|
|
134c0204f3 | ||
|
|
7f19896dc6 | ||
|
|
fbd791e7f0 | ||
|
|
52663545a9 | ||
|
|
9876a0a2de | ||
|
|
ac9e4092ef | ||
|
|
3c6135d75f | ||
|
|
2ea22c1aaa | ||
|
|
9d89375b8f | ||
|
|
727a2b48d9 | ||
|
|
7e6986651c | ||
|
|
f8c85e3e53 | ||
|
|
d624a44500 | ||
|
|
078537f1e2 | ||
|
|
72478dee02 | ||
|
|
dd2740f510 | ||
|
|
db01efd508 | ||
|
|
b2bbe7dbc2 | ||
|
|
562d060b08 | ||
|
|
d8b62aa426 | ||
|
|
f1574c4e0a | ||
|
|
69b132a6f4 | ||
|
|
583121bbc9 | ||
|
|
b66c1ef070 | ||
|
|
8a01eff1c2 | ||
|
|
8776a3e058 | ||
|
|
7df411d59b | ||
|
|
1a79d148dc | ||
|
|
b56a064377 | ||
|
|
9a95964256 | ||
|
|
e7e4769dc1 | ||
|
|
a1db013d3f | ||
|
|
92d3637384 | ||
|
|
3a857617e3 | ||
|
|
85cbdd8de3 | ||
|
|
9b1770f246 | ||
|
|
bfac656da9 | ||
|
|
d60323d623 | ||
|
|
a2431f2adb | ||
|
|
e83ed24088 | ||
|
|
706cee277a | ||
|
|
73a1238205 | ||
|
|
a69834f7dc | ||
|
|
a0ea8db1fc | ||
|
|
5e2ef0cd83 | ||
|
|
c375d050a8 | ||
|
|
7cd7972bbe | ||
|
|
dfc0cb772a | ||
|
|
7cb5c24151 | ||
|
|
781b4ea6a2 | ||
|
|
17b6bd9c8f | ||
|
|
0357b4fcbe | ||
|
|
4c39344cc1 | ||
|
|
718107c107 | ||
|
|
04be981de9 | ||
|
|
ccdc3d6c60 | ||
|
|
ee8173e41d | ||
|
|
53c8aa4fd6 | ||
|
|
b67509189b | ||
|
|
d4a239f14a | ||
|
|
3ebd7ad64b | ||
|
|
4e93a90441 | ||
|
|
c02d774b05 | ||
|
|
241f324b39 | ||
|
|
cebfc9a64b | ||
|
|
2dae2b364e | ||
|
|
a314038280 | ||
|
|
258430db82 | ||
|
|
433d5d8f97 | ||
|
|
545617f4f4 | ||
|
|
e7056db27a | ||
|
|
3899f848a7 | ||
|
|
02ecb8631d | ||
|
|
6dae3452db | ||
|
|
3bd6cb5ee4 | ||
|
|
b97d7a11f4 | ||
|
|
516870bf9f | ||
|
|
0ea4daa103 | ||
|
|
98fe4eabd4 | ||
|
|
2af2bdb424 | ||
|
|
5fe511c20b | ||
|
|
58e7e276fa | ||
|
|
6a155fabda | ||
|
|
69020706b2 | ||
|
|
14ab47cae6 | ||
|
|
64d91665fe | ||
|
|
be6e3db68b | ||
|
|
8964603844 | ||
|
|
2dc2748804 | ||
|
|
06351e86df | ||
|
|
45e5c907be | ||
|
|
4f8a16c31e | ||
|
|
81ccd3bdf6 | ||
|
|
c39e5f82cc | ||
|
|
f706edee9f | ||
|
|
57ca6c9e78 | ||
|
|
ffa3d59af2 | ||
|
|
75a0199a7d | ||
|
|
78439b2b35 | ||
|
|
2be9a044e0 | ||
|
|
7a736021ee | ||
|
|
f5359f9177 | ||
|
|
3c33251ee7 | ||
|
|
1c052e39b1 | ||
|
|
29c556dba4 | ||
|
|
5ee2cd9acf | ||
|
|
3d667c32d3 | ||
|
|
513afd25bc | ||
|
|
45d77ca909 | ||
|
|
c1704a2de0 | ||
|
|
73152217fb | ||
|
|
da457ae5ea | ||
|
|
7a720bbbd7 | ||
|
|
6e3c0c1c14 | ||
|
|
65b9aa4856 | ||
|
|
c058922358 | ||
|
|
afee79bbe0 | ||
|
|
0b1df0c524 | ||
|
|
73aea86a7a | ||
|
|
168b18ff0a | ||
|
|
c0cb03f48b | ||
|
|
54e4772ef8 | ||
|
|
5eaf658b9c | ||
|
|
f6155d11fb | ||
|
|
afb75adc11 | ||
|
|
ea98b42a0d | ||
|
|
7612aaf701 | ||
|
|
43e3ef5428 | ||
|
|
d00f7b35d2 | ||
|
|
36c7f5a2a3 | ||
|
|
62fa44f8b3 | ||
|
|
460ed02864 | ||
|
|
4b5441a8f7 | ||
|
|
53dcd8a49c | ||
|
|
657cf773ad | ||
|
|
797ad1ea79 | ||
|
|
64188c395f | ||
|
|
62eb44a9d6 | ||
|
|
4d0c4f6b1e | ||
|
|
fdd29caef4 | ||
|
|
a6c04644ef | ||
|
|
8fda614d0d | ||
|
|
a710cb99dd | ||
|
|
63dc4ba2a4 | ||
|
|
e1f7bffe71 | ||
|
|
c6f5d8b823 | ||
|
|
98b329daf1 | ||
|
|
e715bce77b | ||
|
|
409e8b0cbd | ||
|
|
5b00d54cd6 | ||
|
|
fadd737a29 | ||
|
|
ece61f346e | ||
|
|
fbfea6daee | ||
|
|
39f046664d | ||
|
|
bc095bcde1 | ||
|
|
5c24c3c504 | ||
|
|
72b316c871 | ||
|
|
41df6668c7 | ||
|
|
8d681c7119 | ||
|
|
7b9b68f15d | ||
|
|
f51f73773d | ||
|
|
429cfcd71e | ||
|
|
6c8f33f192 | ||
|
|
74aacca55d | ||
|
|
64f06309b1 | ||
|
|
5a170c5ef0 | ||
|
|
4d39cb6f20 | ||
|
|
985f3d3eca | ||
|
|
83b6dd11a8 | ||
|
|
70c16f4c46 | ||
|
|
8d8d9afaef | ||
|
|
e67b2847ea | ||
|
|
ba94fa12b9 | ||
|
|
eef069d7bc | ||
|
|
99cd26cda4 | ||
|
|
46f854fc83 | ||
|
|
bd4cb97e85 | ||
|
|
0d05196426 | ||
|
|
4ca34804b2 | ||
|
|
727208d766 | ||
|
|
a4840f1585 | ||
|
|
62dfab26de | ||
|
|
8171fcaf2e | ||
|
|
811e51575c | ||
|
|
2d7f5b2cc1 | ||
|
|
30f078daf5 | ||
|
|
eaf2034163 | ||
|
|
cf5632bb94 | ||
|
|
9bcb6ae64e | ||
|
|
a8dfdd40b7 | ||
|
|
64a3bfd439 | ||
|
|
d36085a5b0 | ||
|
|
9dfc4d0c04 | ||
|
|
ad3eee7e72 | ||
|
|
057b429b02 | ||
|
|
b91f729586 | ||
|
|
81b58028f0 | ||
|
|
a5f7b9520a | ||
|
|
86e7d19df1 | ||
|
|
e1627d2144 | ||
|
|
1b9035cc51 | ||
|
|
b8c1b26f0e | ||
|
|
1e77e6cbcc | ||
|
|
39039aceb2 | ||
|
|
5652b576b0 | ||
|
|
abcb3c4bb3 | ||
|
|
95237f6604 | ||
|
|
a5fab144aa | ||
|
|
3f2247593a | ||
|
|
0c251e20a7 | ||
|
|
1bb8b6278e | ||
|
|
a79e35b5e3 | ||
|
|
168dd7970a | ||
|
|
066d936076 | ||
|
|
377010ea6e | ||
|
|
f402b78be9 | ||
|
|
8f83231078 | ||
|
|
dba50e9eea | ||
|
|
842e562359 | ||
|
|
5ee24f5d87 | ||
|
|
9afebc9233 | ||
|
|
79899c76bf | ||
|
|
b2461f612e | ||
|
|
73146e3e73 | ||
|
|
ae4a978509 | ||
|
|
bc7aa0c812 | ||
|
|
582958d6c5 | ||
|
|
c8048973cd | ||
|
|
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 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
doc/tags
|
||||
*.lock
|
||||
.vim-flavor
|
||||
*.swp
|
||||
|
||||
@@ -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
|
||||
|
||||
191
CHANGELOG.md
Normal file
191
CHANGELOG.md
Normal file
@@ -0,0 +1,191 @@
|
||||
# Change Log
|
||||
|
||||
This is the Changelog for the vim-airline project.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.10] - 2018-12-15
|
||||
- New features
|
||||
- Extensions:
|
||||
- [LanguageClient](https://github.com/autozimu/LanguageClient-neovim)
|
||||
- [vim-gutentags](https://github.com/ludovicchabant/vim-gutentags)
|
||||
- [vim-localsearch](https://github.com/mox-mox/vim-localsearch)
|
||||
- [xtabline](https://github.com/mg979/vim-xtabline)
|
||||
- [vim-grepper](https://github.com/mhinz/vim-grepper)
|
||||
- Add custom AirlineModeChanged autocommand, allowing to call user defined commands
|
||||
whenever airline displays a different mode
|
||||
- New :AirlineExtensions command, to show which extensions have been loaded
|
||||
- Detect several new modes (e.g. completion, virtual replace, etc)
|
||||
- Improvements
|
||||
- Various performance improvements, should Vim keep responsive, even when
|
||||
many highlighting groups need to be re-created
|
||||
- Rework tabline extension
|
||||
- Refactor [vim-ctrlspace](https://github.com/szw/vim-ctrlspace) extension
|
||||
- Refactor the wordcount extension
|
||||
- Reworked the po extension
|
||||
- Allow to disable line numbers for the [Ale Extension](https://github.com/w0rp/ale)
|
||||
- [fugitive](https://github.com/tpope/vim-fugitive) plugin has been refactored
|
||||
causing adjustments for vim-airline, also uses Fugitives new API calls
|
||||
- some improvements to Vims terminal mode
|
||||
- Allow to use alternative seperators for inactive windows (#1236)
|
||||
- Statusline can be set to inactive, whenever Vim loses focus (using FocusLost autocommand)
|
||||
|
||||
## [0.9] - 2018-01-15
|
||||
- Changes
|
||||
- Look of default Airline Symbols has been improved [#1397](https://github.com/vim-airline/vim-airline/issues/1397)
|
||||
- Airline does now set `laststatus=2` if needed
|
||||
- Syntastic extension now displays warnings and errors separately
|
||||
- Updates on Resize and SessionLoad events
|
||||
- Add `maxlinenr` symbol to `airline_section_z`
|
||||
- Add quickfix title to inactive windows
|
||||
- Improvements
|
||||
- Many performance improvements (using caching and async feature when possible)
|
||||
- Cache changes to highlighting groups if `g:airline_highlighting_cache = 1` is set
|
||||
- Allow to skip empty sections by setting `g:airline_skip_empty_sections` variable
|
||||
- Make use of improved Vim Script API, if available (e.g. getwininfo())
|
||||
- Support for Vims terminal feature (very experimental since it hasn't been stabilized yet)
|
||||
- More configuration for the tabline extension (with clickable buffers for Neovim)
|
||||
- Works better on smaller window sizes
|
||||
- Make airline aware of git worktrees
|
||||
- Improvements to the fugitive extension [#1603](https://github.com/vim-airline/vim-airline/issues/1603)
|
||||
- Allows for configurable fileformat output if `g:airline#parts#ffenc#skip_expected_string` is set
|
||||
- Improvements to the documentation
|
||||
- New features
|
||||
- Full async support for Vim 8 and Neovim
|
||||
- Extensions:
|
||||
- [vim-bufmru](https://github.com/mildred/vim-bufmru)
|
||||
- [xkb-switch](https://github.com/ierton/xkb-switch)
|
||||
- [input-source-switcher](https://github.com/vovkasm/input-source-switcher)
|
||||
- [vimagit](https://github.com/jreybert/vimagit)
|
||||
- [denite](https://github.com/Shougo/denite.nvim)
|
||||
- [dein](https://github.com/Shougo/dein.vim)
|
||||
- [vimtex](https://github.com/lervag/vimtex)
|
||||
- [minpac](https://github.com/k-takata/minpac/)
|
||||
- [vim-cursormode](https://github.com/vheon/vim-cursormode)
|
||||
- [Neomake](https://github.com/neomake/neomake)
|
||||
- [Ale](https://github.com/w0rp/ale)
|
||||
- [vim-obsession](https://github.com/tpope/vim-obsession)
|
||||
- spell (can also display Spell language)
|
||||
- keymap
|
||||
- Formatters:
|
||||
- Formatters for JavaScript [#1617](https://github.com/vim-airline/vim-airline/issues/1617)
|
||||
- Tabline: Allow for custom formatter for `tab_nr_type` [#1418](https://github.com/vim-airline/vim-airline/issues/1418)
|
||||
- Customizable wordcount formatter [#1584](https://github.com/vim-airline/vim-airline/issues/1584)
|
||||
- Add User autocommand for Theme changing [#1226](https://github.com/vim-airline/vim-airline/issues/1226)
|
||||
- Shows mercurial mq status if hg mq extension is enabled
|
||||
|
||||
## [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.9...HEAD
|
||||
[0.9]: https://github.com/vim-airline/vim-airline/compare/v0.8...v0.9
|
||||
[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
|
||||
21
ISSUE_TEMPLATE.md
Normal file
21
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,21 @@
|
||||
#### environment
|
||||
|
||||
- vim: ????
|
||||
- vim-airline: ????
|
||||
- OS: ????
|
||||
- Have you reproduced with a minimal vimrc: ???
|
||||
- What is your airline configuration: ???
|
||||
if you are using terminal:
|
||||
- terminal: ????
|
||||
- $TERM variable: ???
|
||||
- color configuration (:set t_Co?):
|
||||
if you are using Neovim:
|
||||
- does it happen in Vim: ???
|
||||
|
||||
#### actual behavior
|
||||
|
||||
????
|
||||
|
||||
#### expected behavior
|
||||
|
||||
????
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 2013-2015 Bailey Ling
|
||||
Copyright (C) 2013-2018 Bailey Ling et al.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the "Software"),
|
||||
|
||||
213
README.md
213
README.md
@@ -1,16 +1,76 @@
|
||||
# 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.
|
||||
|
||||

|
||||

|
||||
|
||||
When the plugin is correctly loaded, Vim will draw a nice statusline at the
|
||||
bottom of each window.
|
||||
|
||||
That line consists of several sections, each one displaying some piece of
|
||||
information. By default (without configuration) this line will look like this:
|
||||
|
||||
```
|
||||
+-----------------------------------------------------------------------------+
|
||||
|~ |
|
||||
|~ |
|
||||
|~ VIM - Vi IMproved |
|
||||
|~ |
|
||||
|~ version 8.0 |
|
||||
|~ by Bram Moolenaar et al. |
|
||||
|~ Vim is open source and freely distributable |
|
||||
|~ |
|
||||
|~ type :h :q<Enter> to exit |
|
||||
|~ type :help<Enter> or <F1> for on-line help |
|
||||
|~ type :help version8<Enter> for version info |
|
||||
|~ |
|
||||
|~ |
|
||||
+-----------------------------------------------------------------------------+
|
||||
| A | B | C X | Y | Z | [...] |
|
||||
+-----------------------------------------------------------------------------+
|
||||
```
|
||||
|
||||
The statusline is the colored line at the bottom, which contains the sections
|
||||
(possibly in different colors):
|
||||
|
||||
section|meaning (example)
|
||||
-------|------------------
|
||||
A | displays the mode + additional flags like crypt/spell/paste (INSERT)
|
||||
B | VCS information (branch, hunk summary) (master)
|
||||
C | filename + read-only flag (~/.vim/vimrc RO)
|
||||
X | filetype (vim)
|
||||
Y | file encoding[fileformat] (utf-8[unix])
|
||||
Z | current position in the file
|
||||
[...] | additional sections (warning/errors/statistics) from external plugins (e.g. YCM, syntastic, ...)
|
||||
|
||||
The information in Section Z looks like this:
|
||||
|
||||
`10% ☰ 10/100 ln : 20`
|
||||
|
||||
This means:
|
||||
```
|
||||
10% - 10 percent down the top of the file
|
||||
☰ 10 - current line 10
|
||||
/100 ln - of 100 lines
|
||||
: 20 - current column 20
|
||||
```
|
||||
|
||||
For a better look, those sections can be colored differently, depending on various conditions
|
||||
(e.g. the mode or whether the current file is 'modified')
|
||||
|
||||
# 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], [eclim][34], [lawrencium][21], [virtualenv][31], [tmuxline][35].
|
||||
* 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], [vim-bufmru][47], [vimagit][50], [denite][51] and more.
|
||||
* Looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols.
|
||||
* Optimized for speed; it loads in under a millisecond.
|
||||
* Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki.
|
||||
* Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others.
|
||||
Note these are now external to this plugin. See [below][46] for detail.
|
||||
* Supports 7.2 as the minimum Vim version.
|
||||
* The master branch tries to be as stable as possible, and new features are merged in only after they have gone through a [full regression test][33].
|
||||
* Unit testing suite.
|
||||
@@ -21,6 +81,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.
|
||||
@@ -42,6 +116,26 @@ Separators can be configured independently for the tabline, so here is how you c
|
||||
let g:airline#extensions#tabline#left_sep = ' '
|
||||
let g:airline#extensions#tabline#left_alt_sep = '|'
|
||||
|
||||
In addition, you can also choose which path formatter airline uses. This affects how file paths are
|
||||
displayed in each individual tab as well as the current buffer indicator in the upper right.
|
||||
To do so, set the `formatter` field with:
|
||||
|
||||
let g:airline#extensions#tabline#formatter = 'default'
|
||||
|
||||
Here is a complete list of formatters with screenshots:
|
||||
|
||||
#### `default`
|
||||

|
||||
|
||||
#### `jsformatter`
|
||||

|
||||
|
||||
#### `unique_tail`
|
||||

|
||||
|
||||
#### `unique_tail_improved`
|
||||

|
||||
|
||||
## 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).
|
||||
@@ -52,6 +146,9 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
|
||||
#### [unite.vim][9]
|
||||

|
||||
|
||||
#### [denite.nvim][51]
|
||||

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

|
||||
|
||||
@@ -64,6 +161,9 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
|
||||
#### hunks ([vim-gitgutter][29] & [vim-signify][30])
|
||||

|
||||
|
||||
#### [vimagit][50]
|
||||

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

|
||||
|
||||
@@ -73,6 +173,21 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
|
||||
#### [promptline][36]
|
||||

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

|
||||
|
||||
#### [xkb-switch][48]/[xkb-layout][49]
|
||||

|
||||
|
||||
#### [vimtex][53]
|
||||

|
||||
|
||||
#### [localsearch][54]
|
||||

|
||||
|
||||
#### [LanguageClient][57]
|
||||

|
||||
|
||||
## Extras
|
||||
|
||||
vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also:
|
||||
@@ -88,7 +203,7 @@ 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/bling/vim-airline/issues/299#issuecomment-25772886)).
|
||||
Sections can contain accents, which allows for very granular control of visuals (see configuration [here](https://github.com/vim-airline/vim-airline/issues/299#issuecomment-25772886)).
|
||||
|
||||

|
||||
|
||||
@@ -116,25 +231,22 @@ 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`
|
||||
* Remember to run `:Helptags` to generate help tags
|
||||
* [NeoBundle][12]
|
||||
* `NeoBundle 'bling/vim-airline'`
|
||||
* [Vundle][13]
|
||||
* `Plugin 'bling/vim-airline'`
|
||||
* [VAM][22]
|
||||
* `call vam#ActivateAddons([ 'vim-airline' ])`
|
||||
* manual
|
||||
* copy all of the files into your `~/.vim` directory
|
||||
| Plugin Manager | Install with... |
|
||||
| ------------- | ------------- |
|
||||
| [Pathogen][11] | `git clone https://github.com/vim-airline/vim-airline ~/.vim/bundle/vim-airline`<br/>Remember to run `:Helptags` to generate help tags |
|
||||
| [NeoBundle][12] | `NeoBundle 'vim-airline/vim-airline'` |
|
||||
| [Vundle][13] | `Plugin 'vim-airline/vim-airline'` |
|
||||
| [Plug][40] | `Plug 'vim-airline/vim-airline'` |
|
||||
| [VAM][22] | `call vam#ActivateAddons([ 'vim-airline' ])` |
|
||||
| [Dein][52] | `call dein#add('vim-airline/vim-airline')` |
|
||||
| [minpac][55] | `call minpac#add('vim-airline/vim-airline')` |
|
||||
| pack feature (native Vim 8 package feature)| `git clone https://github.com/vim-airline/vim-airline ~/.vim/pack/dist/start/vim-airline`<br/>Remember to run `:helptags` to generate help tags |
|
||||
| manual | copy all of the files into your `~/.vim` directory |
|
||||
|
||||
# Configuration
|
||||
# Documentation
|
||||
|
||||
`: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.
|
||||
@@ -151,37 +263,29 @@ 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.
|
||||
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 (e.g. `:let g:airline_extensions = []`).
|
||||
|
||||
Also, you can enable caching of the various syntax highlighting groups. This will try to prevent some of the more expensive `:hi` calls in Vim, which seem to be expensive in the Vim core at the expense of possibly not being one hundred percent correct all the time (especially if you often change highlighting groups yourself using `:hi` commands). To set this up do `:let g:airline_highlighting_cache = 1`. A `:AirlineRefresh` will however clear the cache.
|
||||
|
||||
In addition you might want to check out the [dark_minimal theme][56], which does not change highlighting groups once they are defined. Also please check the [FAQ][27] for more information on how to diagnose and fix the problem.
|
||||
|
||||
# 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-2015 Bailey Ling.
|
||||
|
||||
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||
MIT License. Copyright (c) 2013-2017 Bailey Ling & Contributors.
|
||||
|
||||
[1]: https://github.com/Lokaltog/vim-powerline
|
||||
[2]: https://github.com/Lokaltog/powerline
|
||||
@@ -192,11 +296,11 @@ MIT License. Copyright (c) 2013-2015 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
|
||||
[13]: https://github.com/VundleVim/Vundle.vim
|
||||
[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
|
||||
@@ -209,13 +313,34 @@ MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
[24]: https://github.com/chriskempson/tomorrow-theme
|
||||
[25]: https://github.com/tomasr/molokai
|
||||
[26]: https://github.com/nanotech/jellybeans.vim
|
||||
[27]: https://github.com/bling/vim-airline/wiki/FAQ
|
||||
[27]: https://github.com/vim-airline/vim-airline/wiki/FAQ
|
||||
[28]: https://github.com/chrisbra/csv.vim
|
||||
[29]: https://github.com/airblade/vim-gitgutter
|
||||
[30]: https://github.com/mhinz/vim-signify
|
||||
[31]: https://github.com/jmcantrell/vim-virtualenv
|
||||
[32]: https://github.com/chriskempson/base16-vim
|
||||
[33]: https://github.com/bling/vim-airline/wiki/Test-Plan
|
||||
[33]: https://github.com/vim-airline/vim-airline/wiki/Test-Plan
|
||||
[34]: http://eclim.org
|
||||
[35]: https://github.com/edkolev/tmuxline.vim
|
||||
[36]: https://github.com/edkolev/promptline.vim
|
||||
[37]: https://github.com/gcmt/taboo.vim
|
||||
[38]: https://github.com/szw/vim-ctrlspace
|
||||
[39]: https://github.com/tomtom/quickfixsigns_vim
|
||||
[40]: https://github.com/junegunn/vim-plug
|
||||
[41]: https://github.com/bling
|
||||
[42]: https://github.com/chrisbra
|
||||
[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer
|
||||
[44]: https://github.com/mhartington
|
||||
[45]: https://github.com/vim-airline/vim-airline/commit/d7fd8ca649e441b3865551a325b10504cdf0711b
|
||||
[46]: https://github.com/vim-airline/vim-airline#themes
|
||||
[47]: https://github.com/mildred/vim-bufmru
|
||||
[48]: https://github.com/ierton/xkb-switch
|
||||
[49]: https://github.com/vovkasm/input-source-switcher
|
||||
[50]: https://github.com/jreybert/vimagit
|
||||
[51]: https://github.com/Shougo/denite.nvim
|
||||
[52]: https://github.com/Shougo/dein.vim
|
||||
[53]: https://github.com/lervag/vimtex
|
||||
[54]: https://github.com/mox-mox/vim-localsearch
|
||||
[55]: https://github.com/k-takata/minpac/
|
||||
[56]: https://github.com/vim-airline/vim-airline-themes/blob/master/autoload/airline/themes/dark_minimal.vim
|
||||
[57]: https://github.com/autozimu/LanguageClient-neovim
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
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 = []
|
||||
let s:contexts = {}
|
||||
let s:core_funcrefs = [
|
||||
\ function('airline#extensions#apply'),
|
||||
\ function('airline#extensions#default#apply') ]
|
||||
|
||||
|
||||
function! airline#add_statusline_func(name)
|
||||
call airline#add_statusline_funcref(function(a:name))
|
||||
@@ -12,9 +19,7 @@ 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
|
||||
call airline#util#warning(printf('The airline statusline funcref "%s" has already been added.', string(a:function)))
|
||||
return
|
||||
endif
|
||||
call add(g:airline_statusline_funcrefs, a:function)
|
||||
@@ -32,6 +37,7 @@ function! airline#add_inactive_statusline_func(name)
|
||||
endfunction
|
||||
|
||||
function! airline#load_theme()
|
||||
let g:airline_theme = get(g:, 'airline_theme', 'dark')
|
||||
if exists('*airline#themes#{g:airline_theme}#refresh')
|
||||
call airline#themes#{g:airline_theme}#refresh()
|
||||
endif
|
||||
@@ -46,39 +52,69 @@ function! airline#load_theme()
|
||||
|
||||
call airline#highlighter#load_theme()
|
||||
call airline#extensions#load_theme()
|
||||
call airline#update_statusline()
|
||||
endfunction
|
||||
|
||||
function! airline#switch_theme(name)
|
||||
" Load an airline theme
|
||||
function! airline#switch_theme(name, ...)
|
||||
let silent = get(a:000, '0', 0)
|
||||
" get all available themes
|
||||
let themes = airline#util#themes('')
|
||||
let err = 0
|
||||
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 index(themes, a:name) == -1
|
||||
" Theme not available
|
||||
if !silent
|
||||
call airline#util#warning(printf('The specified theme "%s" cannot be found.', a:name))
|
||||
endif
|
||||
throw "not-found"
|
||||
let err = 1
|
||||
else
|
||||
exe "ru autoload/airline/themes/". a:name. ".vim"
|
||||
let g:airline_theme = a:name
|
||||
endif
|
||||
catch /^Vim/
|
||||
" catch only Vim errors, not "not-found"
|
||||
call airline#util#warning(printf('There is an error in theme "%s".', a:name))
|
||||
if &vbs
|
||||
call airline#util#warning(v:exception)
|
||||
endif
|
||||
let err = 1
|
||||
endtry
|
||||
|
||||
if err
|
||||
if exists('g:airline_theme')
|
||||
return
|
||||
else
|
||||
let g:airline_theme = 'dark'
|
||||
endif
|
||||
endtry
|
||||
endif
|
||||
|
||||
let w:airline_lastmode = ''
|
||||
call airline#update_statusline()
|
||||
unlet! w:airline_lastmode
|
||||
call airline#load_theme()
|
||||
|
||||
call airline#util#doautocmd('AirlineAfterTheme')
|
||||
|
||||
" this is required to prevent clobbering the startup info message, i don't know why...
|
||||
call airline#check_mode(winnr())
|
||||
endfunction
|
||||
|
||||
" Try to load the right theme for the current colorscheme
|
||||
function! airline#switch_matching_theme()
|
||||
if exists('g:colors_name')
|
||||
let existing = g:airline_theme
|
||||
let theme = tr(tolower(g:colors_name), '-', '_')
|
||||
try
|
||||
let palette = g:airline#themes#{g:colors_name}#palette
|
||||
call airline#switch_theme(g:colors_name)
|
||||
call airline#switch_theme(theme, 1)
|
||||
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
|
||||
call airline#switch_theme(map[1], 1)
|
||||
catch
|
||||
call airline#switch_theme(existing)
|
||||
endtry
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
@@ -87,31 +123,57 @@ function! airline#switch_matching_theme()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" Update the statusline
|
||||
function! airline#update_statusline()
|
||||
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)
|
||||
endfor
|
||||
if airline#util#getwinvar(winnr(), 'airline_disabled', 0)
|
||||
return
|
||||
endif
|
||||
let range = filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
" create inactive statusline
|
||||
call airline#update_statusline_inactive(range)
|
||||
|
||||
unlet! w:airline_render_left
|
||||
unlet! w:airline_render_right
|
||||
for section in s:sections
|
||||
unlet! w:airline_section_{section}
|
||||
endfor
|
||||
unlet! w:airline_render_left w:airline_render_right
|
||||
exe 'unlet! ' 'w:airline_section_'. join(s:sections, ' w:airline_section_')
|
||||
|
||||
" Now create the active statusline
|
||||
let w:airline_active = 1
|
||||
let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) }
|
||||
call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
|
||||
endfunction
|
||||
|
||||
let s:contexts = {}
|
||||
let s:core_funcrefs = [
|
||||
\ function('airline#extensions#apply'),
|
||||
\ function('airline#extensions#default#apply') ]
|
||||
" Function to be called to make all statuslines inactive
|
||||
" Triggered on FocusLost autocommand
|
||||
function! airline#update_statusline_focuslost()
|
||||
if get(g:, 'airline_focuslost_inactive', 0)
|
||||
let bufnr=bufnr('%')
|
||||
call airline#highlighter#highlight_modified_inactive(bufnr)
|
||||
call airline#highlighter#highlight(['inactive'], bufnr)
|
||||
call airline#update_statusline_inactive(range(1, winnr('$')))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Function to draw inactive statuslines for inactive windows
|
||||
function! airline#update_statusline_inactive(range)
|
||||
if airline#util#getwinvar(winnr(), 'airline_disabled', 0)
|
||||
return
|
||||
endif
|
||||
for nr in a:range
|
||||
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) }
|
||||
if get(g:, 'airline_inactive_alt_sep', 0)
|
||||
call extend(context, {
|
||||
\ 'left_sep': g:airline_left_alt_sep,
|
||||
\ 'right_sep': g:airline_right_alt_sep }, 'keep')
|
||||
endif
|
||||
call s:invoke_funcrefs(context, s:inactive_funcrefs)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Gather output from all funcrefs which will later be returned by the
|
||||
" airline#statusline() function
|
||||
function! s:invoke_funcrefs(context, funcrefs)
|
||||
let builder = airline#builder#new(a:context)
|
||||
let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context)
|
||||
@@ -122,6 +184,8 @@ function! s:invoke_funcrefs(context, funcrefs)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Main statusline function per window
|
||||
" will be set to the statusline option
|
||||
function! airline#statusline(winnr)
|
||||
if has_key(s:contexts, a:winnr)
|
||||
return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
|
||||
@@ -131,20 +195,40 @@ function! airline#statusline(winnr)
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Check if mode as changed
|
||||
function! airline#check_mode(winnr)
|
||||
if !has_key(s:contexts, a:winnr)
|
||||
return ''
|
||||
endif
|
||||
let context = s:contexts[a:winnr]
|
||||
|
||||
if get(w:, 'airline_active', 1)
|
||||
let l:m = mode()
|
||||
let l:m = mode(1)
|
||||
if l:m ==# "i"
|
||||
let l:mode = ['insert']
|
||||
elseif l:m ==# "R"
|
||||
elseif l:m[0] ==# "i"
|
||||
let l:mode = ['insert']
|
||||
elseif l:m ==# "Rv"
|
||||
let l:mode =['replace']
|
||||
elseif l:m[0] ==# "R"
|
||||
let l:mode = ['replace']
|
||||
elseif l:m =~# '\v(v|V||s|S|)'
|
||||
elseif l:m[0] =~# '\v(v|V||s|S|)'
|
||||
let l:mode = ['visual']
|
||||
elseif l:m ==# "t"
|
||||
let l:mode = ['terminal']
|
||||
elseif l:m[0] ==# "c"
|
||||
let l:mode = ['commandline']
|
||||
elseif l:m ==# "no" " does not work, most likely, Vim does not refresh the statusline in OP mode
|
||||
let l:mode = ['normal']
|
||||
elseif l:m[0:1] ==# 'ni'
|
||||
let l:mode = ['normal']
|
||||
let l:m = 'ni'
|
||||
else
|
||||
let l:mode = ['normal']
|
||||
endif
|
||||
if index(['Rv', 'no', 'ni', 'ix', 'ic'], l:m) == -1
|
||||
let l:m = l:m[0]
|
||||
endif
|
||||
let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
|
||||
else
|
||||
let l:mode = ['inactive']
|
||||
@@ -159,6 +243,14 @@ function! airline#check_mode(winnr)
|
||||
call add(l:mode, 'paste')
|
||||
endif
|
||||
|
||||
if g:airline_detect_crypt && exists("+key") && !empty(&key)
|
||||
call add(l:mode, 'crypt')
|
||||
endif
|
||||
|
||||
if g:airline_detect_spell && &spell
|
||||
call add(l:mode, 'spell')
|
||||
endif
|
||||
|
||||
if &readonly || ! &modifiable
|
||||
call add(l:mode, 'readonly')
|
||||
endif
|
||||
@@ -166,10 +258,10 @@ function! airline#check_mode(winnr)
|
||||
let mode_string = join(l:mode)
|
||||
if get(w:, 'airline_lastmode', '') != mode_string
|
||||
call airline#highlighter#highlight_modified_inactive(context.bufnr)
|
||||
call airline#highlighter#highlight(l:mode)
|
||||
call airline#highlighter#highlight(l:mode, context.bufnr)
|
||||
call airline#util#doautocmd('AirlineModeChanged')
|
||||
let w:airline_lastmode = mode_string
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
||||
259
autoload/airline/async.vim
Normal file
259
autoload/airline/async.vim
Normal file
@@ -0,0 +1,259 @@
|
||||
" MIT License. Copyright (c) 2013-2018 C.Brabandt et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:untracked_jobs = {}
|
||||
let s:mq_jobs = {}
|
||||
let s:po_jobs = {}
|
||||
|
||||
" Generic functions handling on exit event of the various async functions
|
||||
function! s:untracked_output(dict, buf)
|
||||
if a:buf =~? ('^'. a:dict.cfg['untracked_mark'])
|
||||
let a:dict.cfg.untracked[a:dict.file] = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists)
|
||||
else
|
||||
let a:dict.cfg.untracked[a:dict.file] = ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" also called from branch extension (for non-async vims)
|
||||
function! airline#async#mq_output(buf, file)
|
||||
let buf=a:buf
|
||||
if !empty(a:buf)
|
||||
if a:buf =~# 'no patches applied' ||
|
||||
\ a:buf =~# "unknown command 'qtop'" ||
|
||||
\ a:buf =~# "abort"
|
||||
let buf = ''
|
||||
elseif exists("b:mq") && b:mq isnot# buf
|
||||
" make sure, statusline is updated
|
||||
unlet! b:airline_head
|
||||
endif
|
||||
let b:mq = buf
|
||||
endif
|
||||
if has_key(s:mq_jobs, a:file)
|
||||
call remove(s:mq_jobs, a:file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:po_output(buf, file)
|
||||
if !empty(a:buf)
|
||||
let b:airline_po_stats = printf("%s", a:buf)
|
||||
else
|
||||
let b:airline_po_stats = ''
|
||||
endif
|
||||
if has_key(s:po_jobs, a:file)
|
||||
call remove(s:po_jobs, a:file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:valid_dir(dir)
|
||||
if empty(a:dir) || !isdirectory(a:dir)
|
||||
return getcwd()
|
||||
endif
|
||||
return a:dir
|
||||
endfunction
|
||||
|
||||
if v:version >= 800 && has("job")
|
||||
" Vim 8.0 with Job feature
|
||||
" TODO: Check if we need the cwd option for the job_start() functions
|
||||
" (only works starting with Vim 8.0.0902)
|
||||
|
||||
function! s:on_stdout(channel, msg) dict abort
|
||||
let self.buf .= a:msg
|
||||
endfunction
|
||||
|
||||
function! s:on_exit_mq(channel) dict abort
|
||||
call airline#async#mq_output(self.buf, self.file)
|
||||
endfunction
|
||||
|
||||
function! s:on_exit_untracked(channel) dict abort
|
||||
call s:untracked_output(self, self.buf)
|
||||
if has_key(s:untracked_jobs, self.file)
|
||||
call remove(s:untracked_jobs, self.file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:on_exit_po(channel) dict abort
|
||||
call s:po_output(self.buf, self.file)
|
||||
call airline#extensions#po#shorten()
|
||||
endfunction
|
||||
|
||||
function! airline#async#get_mq_async(cmd, file)
|
||||
if g:airline#init#is_windows && &shell =~ 'cmd'
|
||||
let cmd = a:cmd
|
||||
else
|
||||
let cmd = ['sh', '-c', a:cmd]
|
||||
endif
|
||||
|
||||
let options = {'cmd': a:cmd, 'buf': '', 'file': a:file}
|
||||
if has_key(s:mq_jobs, a:file)
|
||||
if job_status(get(s:mq_jobs, a:file)) == 'run'
|
||||
return
|
||||
elseif has_key(s:mq_jobs, a:file)
|
||||
call remove(s:mq_jobs, a:file)
|
||||
endif
|
||||
endif
|
||||
let id = job_start(cmd, {
|
||||
\ 'err_io': 'out',
|
||||
\ 'out_cb': function('s:on_stdout', options),
|
||||
\ 'close_cb': function('s:on_exit_mq', options)})
|
||||
let s:mq_jobs[a:file] = id
|
||||
endfunction
|
||||
|
||||
function! airline#async#get_msgfmt_stat(cmd, file)
|
||||
if g:airline#init#is_windows || !executable('msgfmt')
|
||||
" no msgfmt on windows?
|
||||
return
|
||||
else
|
||||
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)]
|
||||
endif
|
||||
|
||||
let options = {'buf': '', 'file': a:file}
|
||||
if has_key(s:po_jobs, a:file)
|
||||
if job_status(get(s:po_jobs, a:file)) == 'run'
|
||||
return
|
||||
elseif has_key(s:po_jobs, a:file)
|
||||
call remove(s:po_jobs, a:file)
|
||||
endif
|
||||
endif
|
||||
let id = job_start(cmd, {
|
||||
\ 'err_io': 'out',
|
||||
\ 'out_cb': function('s:on_stdout', options),
|
||||
\ 'close_cb': function('s:on_exit_po', options)})
|
||||
let s:po_jobs[a:file] = id
|
||||
endfunction
|
||||
|
||||
function! airline#async#vim_vcs_untracked(config, file)
|
||||
if g:airline#init#is_windows && &shell =~ 'cmd'
|
||||
let cmd = a:config['cmd'] . shellescape(a:file)
|
||||
else
|
||||
let cmd = ['sh', '-c', a:config['cmd'] . shellescape(a:file)]
|
||||
endif
|
||||
|
||||
let options = {'cfg': a:config, 'buf': '', 'file': a:file}
|
||||
if has_key(s:untracked_jobs, a:file)
|
||||
if job_status(get(s:untracked_jobs, a:file)) == 'run'
|
||||
return
|
||||
elseif has_key(s:untracked_jobs, a:file)
|
||||
call remove(s:untracked_jobs, a:file)
|
||||
endif
|
||||
endif
|
||||
let id = job_start(cmd, {
|
||||
\ 'err_io': 'out',
|
||||
\ 'out_cb': function('s:on_stdout', options),
|
||||
\ 'close_cb': function('s:on_exit_untracked', options)})
|
||||
let s:untracked_jobs[a:file] = id
|
||||
endfunction
|
||||
|
||||
elseif has("nvim")
|
||||
" NVim specific functions
|
||||
|
||||
function! s:nvim_output_handler(job_id, data, event) dict
|
||||
if a:event == 'stdout' || a:event == 'stderr'
|
||||
let self.buf .= join(a:data)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:nvim_untracked_job_handler(job_id, data, event) dict
|
||||
if a:event == 'exit'
|
||||
call s:untracked_output(self, self.buf)
|
||||
if has_key(s:untracked_jobs, self.file)
|
||||
call remove(s:untracked_jobs, self.file)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:nvim_mq_job_handler(job_id, data, event) dict
|
||||
if a:event == 'exit'
|
||||
call airline#async#mq_output(self.buf, self.file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:nvim_po_job_handler(job_id, data, event) dict
|
||||
if a:event == 'exit'
|
||||
call s:po_output(self.buf, self.file)
|
||||
call airline#extensions#po#shorten()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#async#nvim_get_mq_async(cmd, file)
|
||||
let config = {
|
||||
\ 'buf': '',
|
||||
\ 'file': a:file,
|
||||
\ 'cwd': s:valid_dir(fnamemodify(a:file, ':p:h')),
|
||||
\ 'on_stdout': function('s:nvim_output_handler'),
|
||||
\ 'on_stderr': function('s:nvim_output_handler'),
|
||||
\ 'on_exit': function('s:nvim_mq_job_handler')
|
||||
\ }
|
||||
if g:airline#init#is_windows && &shell =~ 'cmd'
|
||||
let cmd = a:cmd
|
||||
else
|
||||
let cmd = ['sh', '-c', a:cmd]
|
||||
endif
|
||||
|
||||
if has_key(s:mq_jobs, a:file)
|
||||
call remove(s:mq_jobs, a:file)
|
||||
endif
|
||||
let id = jobstart(cmd, config)
|
||||
let s:mq_jobs[a:file] = id
|
||||
endfunction
|
||||
|
||||
function! airline#async#nvim_get_msgfmt_stat(cmd, file)
|
||||
let config = {
|
||||
\ 'buf': '',
|
||||
\ 'file': a:file,
|
||||
\ 'cwd': s:valid_dir(fnamemodify(a:file, ':p:h')),
|
||||
\ 'on_stdout': function('s:nvim_output_handler'),
|
||||
\ 'on_stderr': function('s:nvim_output_handler'),
|
||||
\ 'on_exit': function('s:nvim_po_job_handler')
|
||||
\ }
|
||||
if g:airline#init#is_windows && &shell =~ 'cmd'
|
||||
" no msgfmt on windows?
|
||||
return
|
||||
else
|
||||
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)]
|
||||
endif
|
||||
|
||||
if has_key(s:po_jobs, a:file)
|
||||
call remove(s:po_jobs, a:file)
|
||||
endif
|
||||
let id = jobstart(cmd, config)
|
||||
let s:po_jobs[a:file] = id
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
" Should work in either Vim pre 8 or Nvim
|
||||
function! airline#async#nvim_vcs_untracked(cfg, file, vcs)
|
||||
let cmd = a:cfg.cmd . shellescape(a:file)
|
||||
let id = -1
|
||||
let config = {
|
||||
\ 'buf': '',
|
||||
\ 'vcs': a:vcs,
|
||||
\ 'cfg': a:cfg,
|
||||
\ 'file': a:file,
|
||||
\ 'cwd': s:valid_dir(fnamemodify(a:file, ':p:h'))
|
||||
\ }
|
||||
if has("nvim")
|
||||
call extend(config, {
|
||||
\ 'on_stdout': function('s:nvim_output_handler'),
|
||||
\ 'on_exit': function('s:nvim_untracked_job_handler')})
|
||||
if has_key(s:untracked_jobs, config.file)
|
||||
" still running
|
||||
return
|
||||
endif
|
||||
try
|
||||
let id = jobstart(cmd, config)
|
||||
catch
|
||||
" catch-all, jobstart() failed, fall back to system()
|
||||
let id=-1
|
||||
endtry
|
||||
let s:untracked_jobs[a:file] = id
|
||||
endif
|
||||
" vim without job feature or nvim jobstart failed
|
||||
if id < 1
|
||||
let output=system(cmd)
|
||||
call s:untracked_output(config, output)
|
||||
call airline#extensions#branch#update_untracked_config(a:file, a:vcs)
|
||||
endif
|
||||
endfunction
|
||||
@@ -1,25 +1,40 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:prototype = {}
|
||||
|
||||
function! s:prototype.split(...)
|
||||
function! s:prototype.split(...) dict
|
||||
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))
|
||||
function! s:prototype.add_section_spaced(group, contents) dict
|
||||
let spc = empty(a:contents) ? '' : g:airline_symbols.space
|
||||
call self.add_section(a:group, spc.a:contents.spc)
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_section(group, contents)
|
||||
function! s:prototype.add_section(group, contents) dict
|
||||
call add(self._sections, [a:group, a:contents])
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_raw(text)
|
||||
function! s:prototype.add_raw(text) dict
|
||||
call add(self._sections, ['', a:text])
|
||||
endfunction
|
||||
|
||||
function! s:get_prev_group(sections, i)
|
||||
function! s:prototype.insert_section(group, contents, position) dict
|
||||
call insert(self._sections, [a:group, a:contents], a:position)
|
||||
endfunction
|
||||
|
||||
function! s:prototype.insert_raw(text, position) dict
|
||||
call insert(self._sections, ['', a:text], a:position)
|
||||
endfunction
|
||||
|
||||
function! s:prototype.get_position() dict
|
||||
return len(self._sections)
|
||||
endfunction
|
||||
|
||||
function! airline#builder#get_prev_group(sections, i)
|
||||
let x = a:i - 1
|
||||
while x >= 0
|
||||
let group = a:sections[x][0]
|
||||
@@ -31,18 +46,54 @@ function! s:get_prev_group(sections, i)
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:prototype.build()
|
||||
function! airline#builder#get_next_group(sections, i)
|
||||
let x = a:i + 1
|
||||
let l = len(a:sections)
|
||||
while x < l
|
||||
let group = a:sections[x][0]
|
||||
if group != '' && group != '|'
|
||||
return group
|
||||
endif
|
||||
let x = x + 1
|
||||
endwhile
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:prototype.build() dict
|
||||
let side = 1
|
||||
let line = ''
|
||||
let i = 0
|
||||
let length = len(self._sections)
|
||||
let split = 0
|
||||
let is_empty = 0
|
||||
let prev_group = ''
|
||||
|
||||
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)
|
||||
let pgroup = prev_group
|
||||
let prev_group = airline#builder#get_prev_group(self._sections, i)
|
||||
if group ==# 'airline_c' && &buftype ==# 'terminal' && self._context.active
|
||||
let group = 'airline_term'
|
||||
elseif group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr')
|
||||
let group = 'airline_c'. self._context.bufnr
|
||||
elseif prev_group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr')
|
||||
let prev_group = 'airline_c'. self._context.bufnr
|
||||
endif
|
||||
if is_empty
|
||||
let prev_group = pgroup
|
||||
endif
|
||||
let is_empty = s:section_is_empty(self, contents)
|
||||
|
||||
if is_empty
|
||||
" need to fix highlighting groups, since we
|
||||
" have skipped a section, we actually need
|
||||
" the previous previous group and so the
|
||||
" seperator goes from the previous previous group
|
||||
" to the current group
|
||||
let pgroup = group
|
||||
endif
|
||||
|
||||
if group == ''
|
||||
let line .= contents
|
||||
@@ -54,30 +105,35 @@ function! s:prototype.build()
|
||||
if prev_group == ''
|
||||
let line .= '%#'.group.'#'
|
||||
elseif split
|
||||
let line .= s:get_transitioned_seperator(self, prev_group, group, side)
|
||||
if !is_empty
|
||||
let line .= s:get_transitioned_seperator(self, prev_group, group, side)
|
||||
endif
|
||||
let split = 0
|
||||
else
|
||||
let line .= s:get_seperator(self, prev_group, group, side)
|
||||
if !is_empty
|
||||
let line .= s:get_seperator(self, prev_group, group, side)
|
||||
endif
|
||||
endif
|
||||
let line .= s:get_accented_line(self, group, contents)
|
||||
let line .= is_empty ? '' : s:get_accented_line(self, group, contents)
|
||||
endif
|
||||
|
||||
let i = i + 1
|
||||
endwhile
|
||||
|
||||
if !self._context.active
|
||||
"let line = substitute(line, '%#airline_c#', '%#airline_c'.self._context.bufnr.'#', '')
|
||||
let line = substitute(line, '%#.\{-}\ze#', '\0_inactive', 'g')
|
||||
endif
|
||||
return line
|
||||
endfunction
|
||||
|
||||
function! s:should_change_group(group1, group2)
|
||||
function! airline#builder#should_change_group(group1, group2)
|
||||
if a:group1 == a:group2
|
||||
return 0
|
||||
endif
|
||||
let color1 = airline#highlighter#get_highlight(a:group1)
|
||||
let color2 = airline#highlighter#get_highlight(a:group2)
|
||||
if has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
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]
|
||||
@@ -86,15 +142,21 @@ 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.'#'
|
||||
if get(a:self._context, 'tabline', 0) && get(g:, 'airline#extensions#tabline#alt_sep', 0) && a:group ==# 'airline_tabsel' && a:side
|
||||
call airline#highlighter#add_separator(a:prev_group, a:group, 0)
|
||||
let line .= '%#'.a:prev_group.'_to_'.a:group.'#'
|
||||
let line .= a:self._context.right_sep.'%#'.a:group.'#'
|
||||
else
|
||||
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.'#'
|
||||
endif
|
||||
return line
|
||||
endfunction
|
||||
|
||||
function! s:get_seperator(self, prev_group, group, side)
|
||||
if s:should_change_group(a:prev_group, a:group)
|
||||
if airline#builder#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
|
||||
@@ -103,6 +165,7 @@ endfunction
|
||||
|
||||
function! s:get_accented_line(self, group, contents)
|
||||
if a:self._context.active
|
||||
" active window
|
||||
let contents = []
|
||||
let content_parts = split(a:contents, '__accent')
|
||||
for cpart in content_parts
|
||||
@@ -112,12 +175,60 @@ function! s:get_accented_line(self, group, contents)
|
||||
let line = join(contents, a:group)
|
||||
let line = substitute(line, '__restore__', a:group, 'g')
|
||||
else
|
||||
" inactive window
|
||||
let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g')
|
||||
let line = substitute(line, '%#__restore__#', '', 'g')
|
||||
endif
|
||||
return line
|
||||
endfunction
|
||||
|
||||
function! s:section_is_empty(self, content)
|
||||
let start=1
|
||||
|
||||
" do not check for inactive windows or the tabline
|
||||
if a:self._context.active == 0
|
||||
return 0
|
||||
elseif get(a:self._context, 'tabline', 0)
|
||||
return 0
|
||||
endif
|
||||
|
||||
" only check, if airline#skip_empty_sections == 1
|
||||
if get(g:, 'airline_skip_empty_sections', 0) == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" only check, if airline#skip_empty_sections == 1
|
||||
if get(w:, 'airline_skip_empty_sections', -1) == 0
|
||||
return 0
|
||||
endif
|
||||
" assume accents sections to be never empty
|
||||
" (avoides, that on startup the mode message becomes empty)
|
||||
if match(a:content, '%#__accent_[^#]*#.*__restore__#') > -1
|
||||
return 0
|
||||
endif
|
||||
if empty(a:content)
|
||||
return 1
|
||||
endif
|
||||
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
|
||||
if empty(list)
|
||||
return 0 " no function in statusline text
|
||||
endif
|
||||
while len(list) > 0
|
||||
let expr = list[0]
|
||||
try
|
||||
" catch all exceptions, just in case
|
||||
if !empty(eval(expr))
|
||||
return 0
|
||||
endif
|
||||
catch
|
||||
return 0
|
||||
endtry
|
||||
let start += 1
|
||||
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
|
||||
endw
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! airline#builder#new(context)
|
||||
let builder = copy(s:prototype)
|
||||
let builder._context = a:context
|
||||
@@ -131,4 +242,3 @@ function! airline#builder#new(context)
|
||||
\ }, 'keep')
|
||||
return builder
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#debug#profile1()
|
||||
profile start airline-profile-switch.log
|
||||
profile func *
|
||||
@@ -47,4 +49,3 @@ function! airline#debug#profile3()
|
||||
profile pause
|
||||
noautocmd qall!
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#deprecation#check()
|
||||
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
|
||||
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables are obsolete. Please read the documentation about the branch extension.'
|
||||
endif
|
||||
|
||||
let tests = [
|
||||
\ [ 'g:airline_paste_symbol', 'g:airline_symbols.paste' ],
|
||||
\ [ 'g:airline_readonly_symbol', 'g:airline_symbols.readonly' ],
|
||||
\ [ 'g:airline_linecolumn_prefix', 'g:airline_symbols.linenr' ],
|
||||
\ [ 'g:airline_branch_prefix', 'g:airline_symbols.branch' ],
|
||||
\ [ 'g:airline_branch_empty_message', 'g:airline#extensions#branch#empty_message' ],
|
||||
\ [ 'g:airline_detect_whitespace', 'g:airline#extensions#whitespace#enabled|show_message' ],
|
||||
\ [ 'g:airline_enable_hunks', 'g:airline#extensions#hunks#enabled' ],
|
||||
\ [ 'g:airline_enable_tagbar', 'g:airline#extensions#tagbar#enabled' ],
|
||||
\ [ 'g:airline_enable_csv', 'g:airline#extensions#csv#enabled' ],
|
||||
\ [ 'g:airline_enable_branch', 'g:airline#extensions#branch#enabled' ],
|
||||
\ [ 'g:airline_enable_bufferline', 'g:airline#extensions#bufferline#enabled' ],
|
||||
\ [ 'g:airline_enable_syntastic', 'g:airline#extensions#syntastic#enabled' ],
|
||||
\ [ 'g:airline_enable_eclim', 'g:airline#extensions#eclim#enabled' ],
|
||||
\ ]
|
||||
for test in tests
|
||||
if exists(test[0])
|
||||
let max = winwidth(0) - 16
|
||||
let msg = printf('The variable %s is deprecated and may not work in the future. It has been replaced with %s. Please read the documentation.', test[0], test[1])
|
||||
echom msg[:max].'...'
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:loaded_ext = []
|
||||
let s:ext = {}
|
||||
let s:ext._theme_funcrefs = []
|
||||
|
||||
@@ -20,7 +23,7 @@ endfunction
|
||||
let s:script_path = tolower(resolve(expand('<sfile>:p:h')))
|
||||
|
||||
let s:filetype_overrides = {
|
||||
\ 'nerdtree': [ 'NERD', '' ],
|
||||
\ 'nerdtree': [ get(g:, 'NERDTreeStatusline', 'NERD'), '' ],
|
||||
\ 'gundo': [ 'Gundo', '' ],
|
||||
\ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ],
|
||||
\ 'minibufexpl': [ 'MiniBufExplorer', '' ],
|
||||
@@ -54,9 +57,7 @@ function! airline#extensions#apply_left_override(section1, section2)
|
||||
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
|
||||
@@ -69,6 +70,11 @@ function! airline#extensions#apply(...)
|
||||
let w:airline_render_right = 1
|
||||
endif
|
||||
|
||||
if &buftype == 'terminal'
|
||||
let w:airline_section_x = ''
|
||||
let w:airline_section_y = ''
|
||||
endif
|
||||
|
||||
if &previewwindow
|
||||
let w:airline_section_a = 'Preview'
|
||||
let w:airline_section_b = ''
|
||||
@@ -111,24 +117,46 @@ function! airline#extensions#load_theme()
|
||||
call airline#util#exec_funcrefs(s:ext._theme_funcrefs, g:airline#themes#{g:airline_theme}#palette)
|
||||
endfunction
|
||||
|
||||
function! s:sync_active_winnr()
|
||||
if exists('#airline') && winnr() != s:active_winnr
|
||||
call airline#update_statusline()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
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()
|
||||
let s:loaded_ext = []
|
||||
|
||||
if exists('g:airline_extensions')
|
||||
for ext in g:airline_extensions
|
||||
try
|
||||
call airline#extensions#{ext}#init(s:ext)
|
||||
catch /^Vim\%((\a\+)\)\=:E117/ " E117, function does not exist
|
||||
call airline#util#warning("Extension '".ext."' not installed, ignoring!")
|
||||
endtry
|
||||
endfor
|
||||
return
|
||||
endif
|
||||
|
||||
call airline#extensions#quickfix#init(s:ext)
|
||||
call add(s:loaded_ext, 'quickfix')
|
||||
|
||||
if get(g:, 'loaded_unite', 0)
|
||||
call airline#extensions#unite#init(s:ext)
|
||||
call add(s:loaded_ext, 'unite')
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_denite', 0)
|
||||
call airline#extensions#denite#init(s:ext)
|
||||
call add(s:loaded_ext, 'denite')
|
||||
endif
|
||||
|
||||
if exists(':NetrwSettings')
|
||||
call airline#extensions#netrw#init(s:ext)
|
||||
call add(s:loaded_ext, 'netrw')
|
||||
endif
|
||||
|
||||
if has("terminal") || has('nvim')
|
||||
call airline#extensions#term#init(s:ext)
|
||||
call add(s:loaded_ext, 'term')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#ycm#enabled', 0)
|
||||
call airline#extensions#ycm#init(s:ext)
|
||||
call add(s:loaded_ext, 'ycm')
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_vimfiler', 0)
|
||||
@@ -137,29 +165,51 @@ function! airline#extensions#load()
|
||||
|
||||
if get(g:, 'loaded_ctrlp', 0)
|
||||
call airline#extensions#ctrlp#init(s:ext)
|
||||
call add(s:loaded_ext, 'ctrlp')
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_localsearch', 0)
|
||||
call airline#extensions#localsearch#init(s:ext)
|
||||
call add(s:loaded_ext, 'localsearch')
|
||||
endif
|
||||
|
||||
if get(g:, 'CtrlSpaceLoaded', 0)
|
||||
call airline#extensions#ctrlspace#init(s:ext)
|
||||
call add(s:loaded_ext, 'ctrlspace')
|
||||
endif
|
||||
|
||||
if get(g:, 'command_t_loaded', 0)
|
||||
call airline#extensions#commandt#init(s:ext)
|
||||
call add(s:loaded_ext, 'commandt')
|
||||
endif
|
||||
|
||||
if exists(':UndotreeToggle')
|
||||
call airline#extensions#undotree#init(s:ext)
|
||||
call add(s:loaded_ext, 'undotree')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#hunks#enabled', 1) && get(g:, 'airline_enable_hunks', 1))
|
||||
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter') || exists('g:loaded_changes'))
|
||||
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)
|
||||
call add(s:loaded_ext, 'hunks')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#tagbar#enabled', 1) && get(g:, 'airline_enable_tagbar', 1))
|
||||
if get(g:, 'airline#extensions#vimagit#enabled', 1)
|
||||
\ && (exists('g:loaded_magit'))
|
||||
call airline#extensions#vimagit#init(s:ext)
|
||||
call add(s:loaded_ext, 'vimagit')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tagbar#enabled', 1)
|
||||
\ && exists(':TagbarToggle')
|
||||
call airline#extensions#tagbar#init(s:ext)
|
||||
call add(s:loaded_ext, 'tagbar')
|
||||
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)
|
||||
call add(s:loaded_ext, 'csv')
|
||||
endif
|
||||
|
||||
if exists(':VimShell')
|
||||
@@ -167,56 +217,145 @@ 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))
|
||||
\ && (exists('*fugitive#head') || exists('*lawrencium#statusline') ||
|
||||
\ (get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')))
|
||||
if get(g:, 'airline#extensions#branch#enabled', 1) && (
|
||||
\ airline#util#has_fugitive() ||
|
||||
\ airline#util#has_lawrencium() ||
|
||||
\ airline#util#has_vcscommand() ||
|
||||
\ airline#util#has_custom_scm())
|
||||
call airline#extensions#branch#init(s:ext)
|
||||
call add(s:loaded_ext, 'branch')
|
||||
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)
|
||||
call add(s:loaded_ext, 'bufferline')
|
||||
endif
|
||||
|
||||
if isdirectory($VIRTUAL_ENV) && get(g:, 'airline#extensions#virtualenv#enabled', 1)
|
||||
if get(g:, 'airline#extensions#fugitiveline#enabled', 1)
|
||||
\ && airline#util#has_fugitive()
|
||||
\ && index(s:loaded_ext, 'bufferline') == -1
|
||||
call airline#extensions#fugitiveline#init(s:ext)
|
||||
call add(s:loaded_ext, 'fugitiveline')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#virtualenv#enabled', 1) && (exists(':VirtualEnvList') || isdirectory($VIRTUAL_ENV)))
|
||||
call airline#extensions#virtualenv#init(s:ext)
|
||||
call add(s:loaded_ext, 'virtualenv')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#eclim#enabled', 1) && exists(':ProjectCreate'))
|
||||
call airline#extensions#eclim#init(s:ext)
|
||||
call add(s:loaded_ext, 'eclim')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
|
||||
if get(g:, 'airline#extensions#syntastic#enabled', 1)
|
||||
\ && exists(':SyntasticCheck')
|
||||
call airline#extensions#syntastic#init(s:ext)
|
||||
call add(s:loaded_ext, 'syntastic')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#whitespace#enabled', 1) && get(g:, 'airline_detect_whitespace', 1))
|
||||
if (get(g:, 'airline#extensions#ale#enabled', 1) && exists(':ALELint'))
|
||||
call airline#extensions#ale#init(s:ext)
|
||||
call add(s:loaded_ext, 'ale')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#languageclient#enabled', 1) && exists(':LanguageClientStart'))
|
||||
call airline#extensions#languageclient#init(s:ext)
|
||||
call add(s:loaded_ext, 'languageclient')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#whitespace#enabled', 1)
|
||||
call airline#extensions#whitespace#init(s:ext)
|
||||
call add(s:loaded_ext, 'whitespace')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#neomake#enabled', 1) && exists(':Neomake'))
|
||||
call airline#extensions#neomake#init(s:ext)
|
||||
call add(s:loaded_ext, 'neomake')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#po#enabled', 1) && executable('msgfmt')
|
||||
call airline#extensions#po#init(s:ext)
|
||||
call add(s:loaded_ext, 'po')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#wordcount#enabled', 1)
|
||||
call airline#extensions#wordcount#init(s:ext)
|
||||
call add(s:loaded_ext, 'wordcount')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#enabled', 0)
|
||||
call airline#extensions#tabline#init(s:ext)
|
||||
call add(s:loaded_ext, 'tabline')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tmuxline#enabled', 1) && exists(':Tmuxline')
|
||||
call airline#extensions#tmuxline#init(s:ext)
|
||||
call add(s:loaded_ext, 'tmuxline')
|
||||
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)
|
||||
call add(s:loaded_ext, 'promptline')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#nrrwrgn#enabled', 1) && exists(':NR') == 2
|
||||
call airline#extensions#nrrwrgn#init(s:ext)
|
||||
call add(s:loaded_ext, 'nrrwrgn')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#unicode#enabled', 1) && exists(':UnicodeTable') == 2
|
||||
call airline#extensions#unicode#init(s:ext)
|
||||
call add(s:loaded_ext, 'unicode')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#capslock#enabled', 1) && exists('*CapsLockStatusline'))
|
||||
call airline#extensions#capslock#init(s:ext)
|
||||
call add(s:loaded_ext, 'capslock')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#gutentags#enabled', 1) && get(g:, 'loaded_gutentags', 0))
|
||||
call airline#extensions#gutentags#init(s:ext)
|
||||
call add(s:loaded_ext, 'gutentags')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#grepper#enabled', 1) && get(g:, 'loaded_grepper', 0))
|
||||
call airline#extensions#grepper#init(s:ext)
|
||||
call add(s:loaded_ext, 'grepper')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#xkblayout#enabled', 1) && exists('g:XkbSwitchLib'))
|
||||
call airline#extensions#xkblayout#init(s:ext)
|
||||
call add(s:loaded_ext, 'xkblayout')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap'))
|
||||
call airline#extensions#keymap#init(s:ext)
|
||||
call add(s:loaded_ext, 'keymap')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#windowswap#enabled', 1) && get(g:, 'loaded_windowswap', 0))
|
||||
call airline#extensions#windowswap#init(s:ext)
|
||||
call add(s:loaded_ext, 'windowswap')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#obsession#enabled', 1) && exists('*ObsessionStatus'))
|
||||
call airline#extensions#obsession#init(s:ext)
|
||||
call add(s:loaded_ext, 'obsession')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#vimtex#enabled', 1)
|
||||
runtime autoload/vimtex.vim
|
||||
if exists('*vimtex#init')
|
||||
call airline#extensions#vimtex#init(s:ext)
|
||||
call add(s:loaded_ext, 'vimtex')
|
||||
endif
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#cursormode#enabled', 0))
|
||||
call airline#extensions#cursormode#init(s:ext)
|
||||
call add(s:loaded_ext, 'cursormode')
|
||||
endif
|
||||
|
||||
if !get(g:, 'airline#extensions#disable_rtp_load', 0)
|
||||
@@ -228,7 +367,8 @@ function! airline#extensions#load()
|
||||
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)
|
||||
if !get(g:, 'airline#extensions#'.name.'#enabled', 1) ||
|
||||
\ index(s:loaded_ext, name) > -1
|
||||
continue
|
||||
endif
|
||||
try
|
||||
@@ -240,3 +380,6 @@ function! airline#extensions#load()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#get_loaded_extensions()
|
||||
return s:loaded_ext
|
||||
endfunction
|
||||
|
||||
88
autoload/airline/extensions/ale.vim
Normal file
88
autoload/airline/extensions/ale.vim
Normal file
@@ -0,0 +1,88 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bjorn Neergaard, w0rp et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! s:airline_ale_count(cnt, symbol)
|
||||
return a:cnt ? a:symbol. a:cnt : ''
|
||||
endfunction
|
||||
|
||||
function! s:airline_ale_get_line_number(cnt, type) abort
|
||||
if a:cnt == 0
|
||||
return ''
|
||||
endif
|
||||
|
||||
let buffer = bufnr('')
|
||||
let problem_type = (a:type ==# 'error') ? 'E' : 'W'
|
||||
let problems = copy(ale#engine#GetLoclist(buffer))
|
||||
|
||||
call filter(problems, 'v:val.bufnr is buffer && v:val.type is# problem_type')
|
||||
|
||||
if empty(problems)
|
||||
return ''
|
||||
endif
|
||||
|
||||
let open_lnum_symbol = get(g:, 'airline#extensions#ale#open_lnum_symbol', '(L')
|
||||
let close_lnum_symbol = get(g:, 'airline#extensions#ale#close_lnum_symbol', ')')
|
||||
|
||||
return open_lnum_symbol . problems[0].lnum . close_lnum_symbol
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ale#get(type)
|
||||
if !exists(':ALELint')
|
||||
return ''
|
||||
endif
|
||||
|
||||
let error_symbol = get(g:, 'airline#extensions#ale#error_symbol', 'E:')
|
||||
let warning_symbol = get(g:, 'airline#extensions#ale#warning_symbol', 'W:')
|
||||
let checking_symbol = get(g:, 'airline#extensions#ale#checking_symbol', '...')
|
||||
let show_line_numbers = get(g:, 'airline#extensions#ale#show_line_numbers', 1)
|
||||
|
||||
let is_err = a:type ==# 'error'
|
||||
|
||||
if ale#engine#IsCheckingBuffer(bufnr('')) == 1
|
||||
return is_err ? '' : checking_symbol
|
||||
endif
|
||||
|
||||
let symbol = is_err ? error_symbol : warning_symbol
|
||||
|
||||
let counts = ale#statusline#Count(bufnr(''))
|
||||
if type(counts) == type({}) && has_key(counts, 'error')
|
||||
" Use the current Dictionary format.
|
||||
let errors = counts.error + counts.style_error
|
||||
let num = is_err ? errors : counts.total - errors
|
||||
else
|
||||
" Use the old List format.
|
||||
let num = is_err ? counts[0] : counts[1]
|
||||
endif
|
||||
|
||||
if show_line_numbers == 1
|
||||
return s:airline_ale_count(num, symbol) . <sid>airline_ale_get_line_number(num, a:type)
|
||||
else
|
||||
return s:airline_ale_count(num, symbol)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ale#get_warning()
|
||||
return airline#extensions#ale#get('warning')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ale#get_error()
|
||||
return airline#extensions#ale#get('error')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ale#init(ext)
|
||||
call airline#parts#define_function('ale_error_count', 'airline#extensions#ale#get_error')
|
||||
call airline#parts#define_function('ale_warning_count', 'airline#extensions#ale#get_warning')
|
||||
augroup airline_ale
|
||||
autocmd!
|
||||
autocmd CursorHold,BufWritePost * call <sid>ale_refresh()
|
||||
autocmd User ALEJobStarted,ALELintPost call <sid>ale_refresh()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! s:ale_refresh()
|
||||
if get(g:, 'airline_skip_empty_sections', 0)
|
||||
exe ':AirlineRefresh'
|
||||
endif
|
||||
endfunction
|
||||
@@ -1,123 +1,312 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:has_fugitive = exists('*fugitive#head')
|
||||
let s:has_lawrencium = exists('*lawrencium#statusline')
|
||||
let s:has_vcscommand = get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')
|
||||
scriptencoding utf-8
|
||||
|
||||
if !s:has_fugitive && !s:has_lawrencium && !s:has_vcscommand
|
||||
finish
|
||||
" s:vcs_config contains static configuration of VCSes and their status relative
|
||||
" to the active file.
|
||||
" 'branch' - The name of currently active branch. This field is empty iff it
|
||||
" has not been initialized yet or the current file is not in
|
||||
" an active branch.
|
||||
" 'untracked' - Cache of untracked files represented as a dictionary with files
|
||||
" as keys. A file has a not exists symbol set as its value if it
|
||||
" is untracked. A file is present in this dictionary iff its
|
||||
" status is considered up to date.
|
||||
" 'untracked_mark' - used as regexp to test against the output of 'cmd'
|
||||
let s:vcs_config = {
|
||||
\ 'git': {
|
||||
\ 'exe': 'git',
|
||||
\ 'cmd': 'git status --porcelain -- ',
|
||||
\ 'untracked_mark': '??',
|
||||
\ 'exclude': '\.git',
|
||||
\ 'update_branch': 's:update_git_branch',
|
||||
\ 'display_branch': 's:display_git_branch',
|
||||
\ 'branch': '',
|
||||
\ 'untracked': {},
|
||||
\ },
|
||||
\ 'mercurial': {
|
||||
\ 'exe': 'hg',
|
||||
\ 'cmd': 'hg status -u -- ',
|
||||
\ 'untracked_mark': '?',
|
||||
\ 'exclude': '\.hg',
|
||||
\ 'update_branch': 's:update_hg_branch',
|
||||
\ 'display_branch': 's:display_hg_branch',
|
||||
\ 'branch': '',
|
||||
\ 'untracked': {},
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Initializes b:buffer_vcs_config. b:buffer_vcs_config caches the branch and
|
||||
" untracked status of the file in the buffer. Caching those fields is necessary,
|
||||
" because s:vcs_config may be updated asynchronously and s:vcs_config fields may
|
||||
" be invalid during those updates. b:buffer_vcs_config fields are updated
|
||||
" whenever corresponding fields in s:vcs_config are updated or an inconsistency
|
||||
" is detected during update_* operation.
|
||||
"
|
||||
" b:airline_head caches the head string it is empty iff it needs to be
|
||||
" recalculated. b:airline_head is recalculated based on b:buffer_vcs_config.
|
||||
function! s:init_buffer()
|
||||
let b:buffer_vcs_config = {}
|
||||
for vcs in keys(s:vcs_config)
|
||||
let b:buffer_vcs_config[vcs] = {
|
||||
\ 'branch': '',
|
||||
\ 'untracked': '',
|
||||
\ }
|
||||
endfor
|
||||
unlet! b:airline_head
|
||||
endfunction
|
||||
|
||||
let s:head_format = get(g:, 'airline#extensions#branch#format', 0)
|
||||
if s:head_format == 1
|
||||
function! s:format_name(name)
|
||||
return fnamemodify(a:name, ':t')
|
||||
endfunction
|
||||
elseif s:head_format == 2
|
||||
function! s:format_name(name)
|
||||
return pathshorten(a:name)
|
||||
endfunction
|
||||
elseif type(s:head_format) == type('')
|
||||
function! s:format_name(name)
|
||||
return call(s:head_format, [a:name])
|
||||
endfunction
|
||||
else
|
||||
function! s:format_name(name)
|
||||
return a:name
|
||||
endfunction
|
||||
endif
|
||||
|
||||
let s:git_dirs = {}
|
||||
function! s:get_git_branch(path)
|
||||
if has_key(s:git_dirs, a:path)
|
||||
return s:git_dirs[a:path]
|
||||
|
||||
" Fugitive special revisions. call '0' "staging" ?
|
||||
let s:names = {'0': 'index', '1': 'orig', '2':'fetch', '3':'merge'}
|
||||
let s:sha1size = get(g:, 'airline#extensions#branch#sha1_len', 7)
|
||||
|
||||
function! s:update_git_branch()
|
||||
if !airline#util#has_fugitive()
|
||||
let s:vcs_config['git'].branch = ''
|
||||
return
|
||||
endif
|
||||
|
||||
let dir = fugitive#extract_git_dir(a:path)
|
||||
if empty(dir)
|
||||
let name = ''
|
||||
else
|
||||
try
|
||||
let line = join(readfile(dir . '/HEAD'))
|
||||
if strpart(line, 0, 16) == 'ref: refs/heads/'
|
||||
let name = strpart(line, 16)
|
||||
let s:vcs_config['git'].branch = exists("*FugitiveHead") ?
|
||||
\ FugitiveHead(s:sha1size) : fugitive#head(s:sha1size)
|
||||
if s:vcs_config['git'].branch is# 'master' && winwidth(0) < 81
|
||||
" Shorten default a bit
|
||||
let s:vcs_config['git'].branch='mas'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:display_git_branch()
|
||||
let name = b:buffer_vcs_config['git'].branch
|
||||
try
|
||||
let commit = fugitive#buffer().commit()
|
||||
|
||||
if has_key(s:names, commit)
|
||||
let name = get(s:names, commit)."(".name.")"
|
||||
elseif !empty(commit)
|
||||
let ref = fugitive#repo().git_chomp('describe', '--all', '--exact-match', commit)
|
||||
if ref !~ "^fatal: no tag exactly matches"
|
||||
let name = s:format_name(substitute(ref, '\v\C^%(heads/|remotes/|tags/)=','',''))."(".name.")"
|
||||
else
|
||||
" raw commit hash
|
||||
let name = strpart(line, 0, 7)
|
||||
let name = matchstr(commit, '.\{'.s:sha1size.'}')."(".name.")"
|
||||
endif
|
||||
catch
|
||||
let name = ''
|
||||
endtry
|
||||
endif
|
||||
endif
|
||||
catch
|
||||
endtry
|
||||
|
||||
let s:git_dirs[a:path] = name
|
||||
return name
|
||||
endfunction
|
||||
|
||||
function! s:update_hg_branch()
|
||||
if airline#util#has_lawrencium()
|
||||
let cmd='LC_ALL=C hg qtop'
|
||||
let stl=lawrencium#statusline()
|
||||
let file=expand('%:p')
|
||||
if !empty(stl) && get(b:, 'airline_do_mq_check', 1)
|
||||
if g:airline#init#vim_async
|
||||
noa call airline#async#get_mq_async(cmd, file)
|
||||
elseif has("nvim")
|
||||
noa call airline#async#nvim_get_mq_async(cmd, file)
|
||||
else
|
||||
" remove \n at the end of the command
|
||||
let output=system(cmd)[0:-2]
|
||||
noa call airline#async#mq_output(output, file)
|
||||
endif
|
||||
endif
|
||||
" do not do mq check anymore
|
||||
let b:airline_do_mq_check = 0
|
||||
if exists("b:mq") && !empty(b:mq)
|
||||
if stl is# 'default'
|
||||
" Shorten default a bit
|
||||
let stl='def'
|
||||
endif
|
||||
let stl.=' ['.b:mq.']'
|
||||
endif
|
||||
let s:vcs_config['mercurial'].branch = stl
|
||||
else
|
||||
let s:vcs_config['mercurial'].branch = ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:display_hg_branch()
|
||||
return b:buffer_vcs_config['mercurial'].branch
|
||||
endfunction
|
||||
|
||||
function! s:update_branch()
|
||||
for vcs in keys(s:vcs_config)
|
||||
call {s:vcs_config[vcs].update_branch}()
|
||||
if b:buffer_vcs_config[vcs].branch != s:vcs_config[vcs].branch
|
||||
let b:buffer_vcs_config[vcs].branch = s:vcs_config[vcs].branch
|
||||
unlet! b:airline_head
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#update_untracked_config(file, vcs)
|
||||
if !has_key(s:vcs_config[a:vcs].untracked, a:file)
|
||||
return
|
||||
elseif s:vcs_config[a:vcs].untracked[a:file] != b:buffer_vcs_config[a:vcs].untracked
|
||||
let b:buffer_vcs_config[a:vcs].untracked = s:vcs_config[a:vcs].untracked[a:file]
|
||||
unlet! b:airline_head
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:update_untracked()
|
||||
let file = expand("%:p")
|
||||
if empty(file) || isdirectory(file)
|
||||
return
|
||||
endif
|
||||
|
||||
let needs_update = 1
|
||||
for vcs in keys(s:vcs_config)
|
||||
if file =~ s:vcs_config[vcs].exclude
|
||||
" Skip check for files that live in the exclude directory
|
||||
let needs_update = 0
|
||||
endif
|
||||
if has_key(s:vcs_config[vcs].untracked, file)
|
||||
let needs_update = 0
|
||||
call airline#extensions#branch#update_untracked_config(file, vcs)
|
||||
endif
|
||||
endfor
|
||||
|
||||
if !needs_update
|
||||
return
|
||||
endif
|
||||
|
||||
for vcs in keys(s:vcs_config)
|
||||
let config = s:vcs_config[vcs]
|
||||
if g:airline#init#vim_async
|
||||
" Note that asynchronous update updates s:vcs_config only, and only
|
||||
" s:update_untracked updates b:buffer_vcs_config. If s:vcs_config is
|
||||
" invalidated again before s:update_untracked is called, then we lose the
|
||||
" result of the previous call, i.e. the head string is not updated. It
|
||||
" doesn't happen often in practice, so we let it be.
|
||||
noa call airline#async#vim_vcs_untracked(config, file)
|
||||
else
|
||||
" nvim async or vim without job-feature
|
||||
noa call airline#async#nvim_vcs_untracked(config, file, vcs)
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#head()
|
||||
if !exists('b:buffer_vcs_config')
|
||||
call s:init_buffer()
|
||||
endif
|
||||
|
||||
call s:update_branch()
|
||||
call s:update_untracked()
|
||||
|
||||
if exists('b:airline_head') && !empty(b:airline_head)
|
||||
return b:airline_head
|
||||
endif
|
||||
|
||||
let b:airline_head = ''
|
||||
let found_fugitive_head = 0
|
||||
let vcs_priority = get(g:, "airline#extensions#branch#vcs_priority", ["git", "mercurial"])
|
||||
|
||||
if s:has_fugitive && !exists('b:mercurial_dir')
|
||||
let b:airline_head = fugitive#head(7)
|
||||
let found_fugitive_head = 1
|
||||
|
||||
if empty(b:airline_head) && !exists('b:git_dir')
|
||||
let b:airline_head = s:get_git_branch(expand("%:p:h"))
|
||||
let heads = []
|
||||
for vcs in vcs_priority
|
||||
if !empty(b:buffer_vcs_config[vcs].branch)
|
||||
let heads += [vcs]
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
if empty(b:airline_head)
|
||||
if s:has_lawrencium
|
||||
let b:airline_head = lawrencium#statusline()
|
||||
for vcs in heads
|
||||
if !empty(b:airline_head)
|
||||
let b:airline_head .= ' | '
|
||||
endif
|
||||
endif
|
||||
if len(heads) > 1
|
||||
let b:airline_head .= s:vcs_config[vcs].exe .':'
|
||||
endif
|
||||
let b:airline_head .= s:format_name({s:vcs_config[vcs].display_branch}())
|
||||
let b:airline_head .= b:buffer_vcs_config[vcs].untracked
|
||||
endfor
|
||||
|
||||
if empty(b:airline_head)
|
||||
if s:has_vcscommand
|
||||
call VCSCommandEnableBufferSetup()
|
||||
if empty(heads)
|
||||
if airline#util#has_vcscommand()
|
||||
noa call VCSCommandEnableBufferSetup()
|
||||
if exists('b:VCSCommandBufferInfo')
|
||||
let b:airline_head = get(b:VCSCommandBufferInfo, 0, '')
|
||||
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, ''))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||
let b:airline_head = ''
|
||||
if empty(heads)
|
||||
if airline#util#has_custom_scm()
|
||||
try
|
||||
let Fn = function(g:airline#extensions#branch#custom_head)
|
||||
let b:airline_head = Fn()
|
||||
endtry
|
||||
endif
|
||||
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].'…'
|
||||
let b:airline_head = b:airline_head[0:(w:displayed_head_limit - 1)].(&encoding ==? 'utf-8' ? '…' : '.')
|
||||
endif
|
||||
endif
|
||||
|
||||
let minwidth = empty(get(b:, 'airline_hunks', '')) ? 14 : 7
|
||||
let b:airline_head = airline#util#shorten(b:airline_head, 120, minwidth)
|
||||
return b:airline_head
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#get_head()
|
||||
let head = airline#extensions#branch#head()
|
||||
let empty_message = get(g:, 'airline#extensions#branch#empty_message',
|
||||
\ get(g:, 'airline_branch_empty_message', ''))
|
||||
let empty_message = get(g:, 'airline#extensions#branch#empty_message', '')
|
||||
let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
|
||||
return empty(head)
|
||||
\ ? empty_message
|
||||
\ : printf('%s%s', empty(symbol) ? '' : symbol.(g:airline_symbols.space), head)
|
||||
endfunction
|
||||
|
||||
function! s:check_in_path()
|
||||
if !exists('b:airline_branch_path')
|
||||
let root = get(b:, 'git_dir', get(b:, 'mercurial_dir', ''))
|
||||
let bufferpath = resolve(fnamemodify(expand('%'), ':p'))
|
||||
|
||||
if !filereadable(root) "not a file
|
||||
" if .git is a directory, it's the old submodule format
|
||||
if match(root, '\.git$') >= 0
|
||||
let root = expand(fnamemodify(root, ':h'))
|
||||
else
|
||||
" else it's the newer format, and we need to guesstimate
|
||||
let pattern = '\.git\(\\\|\/\)modules\(\\\|\/\)'
|
||||
if match(root, pattern) >= 0
|
||||
let root = substitute(root, pattern, '', '')
|
||||
endif
|
||||
function! s:reset_untracked_cache(shellcmdpost)
|
||||
" shellcmdpost - whether function was called as a result of ShellCmdPost hook
|
||||
if !g:airline#init#vim_async && !has('nvim')
|
||||
if a:shellcmdpost
|
||||
" Clear cache only if there was no error or the script uses an
|
||||
" asynchronous interface. Otherwise, cache clearing would overwrite
|
||||
" v:shell_error with a system() call inside get_*_untracked.
|
||||
if v:shell_error
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
let b:airline_file_in_root = stridx(bufferpath, root) > -1
|
||||
endif
|
||||
return b:airline_file_in_root
|
||||
|
||||
let file = expand("%:p")
|
||||
for vcs in keys(s:vcs_config)
|
||||
" Dump the value of the cache for the current file. Partially mitigates the
|
||||
" issue of cache invalidation happening before a call to
|
||||
" s:update_untracked()
|
||||
call airline#extensions#branch#update_untracked_config(file, vcs)
|
||||
let s:vcs_config[vcs].untracked = {}
|
||||
endfor
|
||||
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 ShellCmdPost,CmdwinLeave * unlet! b:airline_head b:airline_do_mq_check
|
||||
autocmd User AirlineBeforeRefresh unlet! b:airline_head b:airline_do_mq_check
|
||||
autocmd BufWritePost * call s:reset_untracked_cache(0)
|
||||
autocmd ShellCmdPost * call s:reset_untracked_cache(1)
|
||||
endfunction
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('*bufferline#get_status_string')
|
||||
finish
|
||||
endif
|
||||
@@ -18,6 +20,10 @@ function! airline#extensions#bufferline#init(ext)
|
||||
let g:bufferline_separator = g:airline_symbols.space
|
||||
endif
|
||||
|
||||
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
|
||||
if exists("+autochdir") && &autochdir == 1
|
||||
" if 'acd' is set, vim-airline uses the path section, so we need ot redefine this here as well
|
||||
call airline#parts#define_raw('path', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
|
||||
else
|
||||
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
" MIT License. Copyright (c) 2014 Mathias Andersson.
|
||||
" MIT License. Copyright (c) 2014-2018 Mathias Andersson et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('*CapsLockStatusline')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#capslock#status()
|
||||
return CapsLockStatusline() == '[caps]' ? 'CAPS' : ''
|
||||
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,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'command_t_loaded', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_csv', 0) && !exists(':Table')
|
||||
finish
|
||||
endif
|
||||
@@ -28,4 +30,3 @@ endfunction
|
||||
function! airline#extensions#csv#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#csv#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
@@ -77,4 +79,3 @@ function! airline#extensions#ctrlp#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#ctrlp#apply')
|
||||
call a:ext.add_theme_func('airline#extensions#ctrlp#load_theme')
|
||||
endfunction
|
||||
|
||||
|
||||
20
autoload/airline/extensions/ctrlspace.vim
Normal file
20
autoload/airline/extensions/ctrlspace.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
let s:padding = s:spc . s:spc . s:spc
|
||||
let s:cs = ctrlspace#context#Configuration().Symbols.CS
|
||||
|
||||
function! airline#extensions#ctrlspace#statusline(...)
|
||||
let b = airline#builder#new({ 'active': 1 })
|
||||
call b.add_section('airline_b', s:cs . 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
|
||||
132
autoload/airline/extensions/cursormode.vim
Normal file
132
autoload/airline/extensions/cursormode.vim
Normal file
@@ -0,0 +1,132 @@
|
||||
" Copyright (C) 2014 Andrea Cedraro <a.cedraro@gmail.com>
|
||||
" Copyright (C) 2017 Eduardo Suarez-Santana <e.suarezsantana@gmail.com>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining
|
||||
" a copy of this software and associated documentation files (the "Software"),
|
||||
" to deal in the Software without restriction, including without limitation
|
||||
" the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
" and/or sell copies of the Software, and to permit persons to whom the
|
||||
" Software is furnished to do so, subject to the following conditions:
|
||||
"
|
||||
" The above copyright notice and this permission notice shall be included
|
||||
" in all copies or substantial portions of the Software.
|
||||
"
|
||||
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||
" OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:is_win = has('win32') || has('win64')
|
||||
let s:is_iTerm = exists('$TERM_PROGRAM') && $TERM_PROGRAM =~# 'iTerm.app'
|
||||
let s:is_AppleTerminal = exists('$TERM_PROGRAM') && $TERM_PROGRAM =~# 'Apple_Terminal'
|
||||
|
||||
let s:is_good = !has('gui_running') && !s:is_win && !s:is_AppleTerminal
|
||||
|
||||
let s:last_mode = ''
|
||||
|
||||
if !exists('g:cursormode_exit_mode')
|
||||
let g:cursormode_exit_mode='n'
|
||||
endif
|
||||
|
||||
function! airline#extensions#cursormode#tmux_escape(escape)
|
||||
return '\033Ptmux;'.substitute(a:escape, '\\033', '\\033\\033', 'g').'\033\\'
|
||||
endfunction
|
||||
|
||||
let s:iTerm_escape_template = '\033]Pl%s\033\\'
|
||||
let s:xterm_escape_template = '\033]12;%s\007'
|
||||
|
||||
function! s:get_mode()
|
||||
return call(get(g:, 'cursormode_mode_func', 'mode'), [])
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#cursormode#set(...)
|
||||
let mode = s:get_mode()
|
||||
if mode !=# s:last_mode
|
||||
let s:last_mode = mode
|
||||
call s:set_cursor_color_for(mode)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:set_cursor_color_for(mode)
|
||||
let mode = a:mode
|
||||
for mode in [a:mode, a:mode.&background]
|
||||
if has_key(s:color_map, mode)
|
||||
try
|
||||
let save_eventignore = &eventignore
|
||||
set eventignore=all
|
||||
let save_shelltemp = &shelltemp
|
||||
set noshelltemp
|
||||
|
||||
silent call system(s:build_command(s:color_map[mode]))
|
||||
return
|
||||
finally
|
||||
let &shelltemp = save_shelltemp
|
||||
let &eventignore = save_eventignore
|
||||
endtry
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:build_command(color)
|
||||
if s:is_iTerm
|
||||
let color = substitute(a:color, '^#', '', '')
|
||||
let escape_template = s:iTerm_escape_template
|
||||
else
|
||||
let color = a:color
|
||||
let escape_template = s:xterm_escape_template
|
||||
endif
|
||||
|
||||
let escape = printf(escape_template, color)
|
||||
if exists('$TMUX')
|
||||
let escape = airline#extensions#cursormode#tmux_escape(escape)
|
||||
endif
|
||||
return "printf '".escape."' > /dev/tty"
|
||||
endfunction
|
||||
|
||||
function! s:get_color_map()
|
||||
if exists('g:cursormode_color_map')
|
||||
return g:cursormode_color_map
|
||||
endif
|
||||
|
||||
try
|
||||
let map = g:cursormode#{g:colors_name}#color_map
|
||||
return map
|
||||
catch
|
||||
return {
|
||||
\ "nlight": "#000000",
|
||||
\ "ndark": "#BBBBBB",
|
||||
\ "i": "#0000BB",
|
||||
\ "v": "#FF5555",
|
||||
\ "V": "#BBBB00",
|
||||
\ "\<C-V>": "#BB00BB",
|
||||
\ }
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
augroup airline#extensions#cursormode
|
||||
autocmd!
|
||||
autocmd VimLeave * call s:set_cursor_color_for(g:cursormode_exit_mode)
|
||||
" autocmd VimEnter * call airline#extensions#cursormode#activate()
|
||||
autocmd Colorscheme * call airline#extensions#cursormode#activate()
|
||||
augroup END
|
||||
|
||||
function! airline#extensions#cursormode#activate()
|
||||
let s:color_map = s:get_color_map()
|
||||
call airline#extensions#cursormode#set()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#cursormode#apply(...)
|
||||
let w:airline_section_a = get(w:, 'airline_section_a', g:airline_section_a)
|
||||
let w:airline_section_a .= '%{airline#extensions#cursormode#set()}'
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#cursormode#init(ext)
|
||||
let s:color_map = s:get_color_map()
|
||||
call a:ext.add_statusline_func('airline#extensions#cursormode#apply')
|
||||
endfunction
|
||||
@@ -1,15 +1,20 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:section_use_groups = get(g:, 'airline#extensions#default#section_use_groupitems', 1)
|
||||
let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', {
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ 'warning': 80,
|
||||
\ 'error': 80,
|
||||
\ })
|
||||
let s:layout = get(g:, 'airline#extensions#default#layout', [
|
||||
\ [ 'a', 'b', 'c' ],
|
||||
\ [ 'x', 'y', 'z', 'warning' ]
|
||||
\ [ 'x', 'y', 'z', 'warning', 'error' ]
|
||||
\ ])
|
||||
|
||||
function! s:get_section(winnr, key, ...)
|
||||
@@ -19,6 +24,9 @@ function! s:get_section(winnr, key, ...)
|
||||
endif
|
||||
endif
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists('g:airline_section_{a:key}')
|
||||
return ''
|
||||
endif
|
||||
let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
|
||||
let [prefix, suffix] = [get(a:000, 0, '%('.spc), get(a:000, 1, spc.'%)')]
|
||||
return empty(text) ? '' : prefix.text.suffix
|
||||
@@ -26,30 +34,42 @@ endfunction
|
||||
|
||||
function! s:build_sections(builder, context, keys)
|
||||
for key in a:keys
|
||||
if key == 'warning' && !a:context.active
|
||||
if (key == 'warning' || key == 'error') && !a:context.active
|
||||
continue
|
||||
endif
|
||||
call s:add_section(a:builder, a:context, key)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
if v:version >= 704 || (v:version >= 703 && has('patch81'))
|
||||
function s:add_section(builder, context, key)
|
||||
" There still is a highlighting bug when using groups %(%) in the statusline,
|
||||
" deactivate it, unless it is fixed (7.4.1511)
|
||||
if s:section_use_groups && (v:version >= 704 || (v:version >= 703 && has('patch81')))
|
||||
function! s:add_section(builder, context, key)
|
||||
let condition = (a:key is# "warning" || a:key is# "error") &&
|
||||
\ (v:version == 704 && !has("patch1511"))
|
||||
" i have no idea why the warning section needs special treatment, but it's
|
||||
" needed to prevent separators from showing up
|
||||
if a:key == 'warning'
|
||||
if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
|
||||
return
|
||||
endif
|
||||
if condition
|
||||
call a:builder.add_raw('%(')
|
||||
endif
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
if a:key == 'warning'
|
||||
if condition
|
||||
call a:builder.add_raw('%)')
|
||||
endif
|
||||
endfunction
|
||||
else
|
||||
" older version don't like the use of %(%)
|
||||
function s:add_section(builder, context, key)
|
||||
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
|
||||
@@ -78,4 +98,3 @@ function! airline#extensions#default#apply(builder, context)
|
||||
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
|
||||
41
autoload/airline/extensions/denite.vim
Normal file
41
autoload/airline/extensions/denite.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
" MIT License. Copyright (c) 2017-2018 Thomas Dy et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_denite', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
" Denite does not use vim's built-in modal editing but has a custom prompt
|
||||
" that implements its own insert/normal mode so we have to handle changing the
|
||||
" highlight
|
||||
function! airline#extensions#denite#check_denite_mode(bufnr)
|
||||
if &filetype != 'denite'
|
||||
return ''
|
||||
endif
|
||||
let mode = split(denite#get_status_mode(), ' ')
|
||||
let mode = tolower(mode[1])
|
||||
if !exists('b:denite_mode_cache') || mode != b:denite_mode_cache
|
||||
call airline#highlighter#highlight([mode], a:bufnr)
|
||||
let b:denite_mode_cache = mode
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#denite#apply(...)
|
||||
if &ft == 'denite'
|
||||
let w:airline_skip_empty_sections = 0
|
||||
call a:1.add_section('airline_a', ' Denite %{airline#extensions#denite#check_denite_mode('.a:2['bufnr'].')}')
|
||||
call a:1.add_section('airline_c', ' %{denite#get_status_sources()}')
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_y', ' %{denite#get_status_path()} ')
|
||||
call a:1.add_section('airline_z', ' %{denite#get_status_linenr()} ')
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#denite#init(ext)
|
||||
call denite#custom#option('_', 'statusline', 0)
|
||||
call a:ext.add_statusline_func('airline#extensions#denite#apply')
|
||||
endfunction
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':ProjectCreate')
|
||||
finish
|
||||
endif
|
||||
@@ -16,7 +18,13 @@ function! airline#extensions#eclim#creat_line(...)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#eclim#get_warnings()
|
||||
" Cache vavlues, so that it isn't called too often
|
||||
if exists("s:eclim_errors") &&
|
||||
\ get(b:, 'airline_changenr', 0) == changenr()
|
||||
return s:eclim_errors
|
||||
endif
|
||||
let eclimList = eclim#display#signs#GetExisting()
|
||||
let s:eclim_errors = ''
|
||||
|
||||
if !empty(eclimList)
|
||||
" Remove any non-eclim signs (see eclim#display#signs#Update)
|
||||
@@ -39,15 +47,15 @@ function! airline#extensions#eclim#get_warnings()
|
||||
let errorsNumber = len(eclimList)
|
||||
let errors = "[Eclim:" . type . " line:".string(errorsLine)." (".string(errorsNumber).")]"
|
||||
if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == ''
|
||||
return errors.(g:airline_symbols.space)
|
||||
let s:eclim_errors = errors.(g:airline_symbols.space)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
let b:airline_changenr = changenr()
|
||||
return s:eclim_errors
|
||||
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,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" we don't actually want this loaded :P
|
||||
finish
|
||||
|
||||
@@ -51,4 +53,3 @@ function! airline#extensions#example#get_cats()
|
||||
endfor
|
||||
return cats
|
||||
endfunction
|
||||
|
||||
|
||||
49
autoload/airline/extensions/fugitiveline.vim
Normal file
49
autoload/airline/extensions/fugitiveline.vim
Normal file
@@ -0,0 +1,49 @@
|
||||
" MIT License. Copyright (c) 2017-2018 Cimbali et al
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !airline#util#has_fugitive()
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
if exists("+autochdir") && &autochdir == 1
|
||||
let s:fmod = ':p'
|
||||
else
|
||||
let s:fmod = ':.'
|
||||
endif
|
||||
|
||||
function! airline#extensions#fugitiveline#bufname()
|
||||
if !exists('b:fugitive_name')
|
||||
let b:fugitive_name = ''
|
||||
try
|
||||
if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal')
|
||||
let b:fugitive_name = FugitiveReal(bufname('%'))
|
||||
elseif exists('b:git_dir')
|
||||
let buffer = fugitive#buffer()
|
||||
if buffer.type('blob')
|
||||
let b:fugitive_name = buffer.repo().translate(buffer.path('/'))
|
||||
endif
|
||||
endif
|
||||
catch
|
||||
endtry
|
||||
endif
|
||||
|
||||
if empty(b:fugitive_name)
|
||||
return fnamemodify(bufname('%'), s:fmod)
|
||||
else
|
||||
return fnamemodify(b:fugitive_name, s:fmod)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#fugitiveline#init(ext)
|
||||
if exists("+autochdir") && &autochdir == 1
|
||||
" if 'acd' is set, vim-airline uses the path section, so we need to redefine this here as well
|
||||
call airline#parts#define_raw('path', '%<%{airline#extensions#fugitiveline#bufname()}%m')
|
||||
else
|
||||
call airline#parts#define_raw('file', '%<%{airline#extensions#fugitiveline#bufname()}%m')
|
||||
endif
|
||||
autocmd ShellCmdPost,CmdwinLeave * unlet! b:fugitive_name
|
||||
autocmd User AirlineBeforeRefresh unlet! b:fugitive_name
|
||||
endfunction
|
||||
19
autoload/airline/extensions/grepper.vim
Normal file
19
autoload/airline/extensions/grepper.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
" MIT License. Copyright (c) 2014-2018 Mathias Andersson et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" Heavily derived from the Gutentags extension
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_grepper', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#grepper#status()
|
||||
let msg = grepper#statusline()
|
||||
return empty(msg) ? '' : 'grepper'
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#grepper#init(ext)
|
||||
call airline#parts#define_function('grepper', 'airline#extensions#grepper#status')
|
||||
endfunction
|
||||
17
autoload/airline/extensions/gutentags.vim
Normal file
17
autoload/airline/extensions/gutentags.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" MIT License. Copyright (c) 2014-2018 Mathias Andersson et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_gutentags', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#gutentags#status()
|
||||
let msg = gutentags#statusline()
|
||||
return empty(msg) ? '' : 'Gen. ' . msg
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#gutentags#init(ext)
|
||||
call airline#parts#define_function('gutentags', 'airline#extensions#gutentags#status')
|
||||
endfunction
|
||||
@@ -1,7 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0) && !get(g:, 'loaded_changes', 0)
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0) && !get(g:, 'loaded_changes', 0) && !get(g:, 'loaded_quickfixsigns', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -17,7 +19,8 @@ function! s:get_hunks_signify()
|
||||
endfunction
|
||||
|
||||
function! s:is_branch_empty()
|
||||
return exists('*airline#extensions#branch#head') && empty(airline#extensions#branch#head())
|
||||
return exists('*airline#extensions#branch#head') &&
|
||||
\ empty(get(b:, 'airline_head', ''))
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks_gitgutter()
|
||||
@@ -32,51 +35,59 @@ function! s:get_hunks_changes()
|
||||
return []
|
||||
endif
|
||||
let hunks = changes#GetStats()
|
||||
for i in hunks
|
||||
if i > 0
|
||||
return hunks
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
return hunks == [0, 0, 0] ? [] : hunks
|
||||
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') || get(b:, 'source_func', '') is# 's:get_hunks_empty'
|
||||
if get(g:, 'loaded_signify') && sy#buffer_is_active()
|
||||
let b:source_func = 's:get_hunks_signify'
|
||||
elseif exists('*GitGutterGetHunkSummary')
|
||||
let s:source_func = 's:get_hunks_gitgutter'
|
||||
let b:source_func = 's:get_hunks_gitgutter'
|
||||
elseif exists('*changes#GetStats')
|
||||
let s:source_func = 's:get_hunks_changes'
|
||||
let b:source_func = 's:get_hunks_changes'
|
||||
elseif exists('*quickfixsigns#vcsdiff#GetHunkSummary')
|
||||
let 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()
|
||||
if !get(w:, 'airline_active', 0)
|
||||
return ''
|
||||
endif
|
||||
" Cache values, so that it isn't called too often
|
||||
if exists("b:airline_hunks") &&
|
||||
\ get(b:, 'airline_changenr', 0) == b:changedtick &&
|
||||
\ winwidth(0) == get(s:, 'airline_winwidth', 0) &&
|
||||
\ get(b:, 'source_func', '') isnot# 's:get_hunks_signify' &&
|
||||
\ get(b:, 'source_func', '') isnot# 's:get_hunks_gitgutter' &&
|
||||
\ get(b:, 'source_func', '') isnot# 's:get_hunks_empty' &&
|
||||
\ get(b:, 'source_func', '') isnot# 's:get_hunks_changes'
|
||||
return b:airline_hunks
|
||||
endif
|
||||
let hunks = s:get_hunks()
|
||||
let string = ''
|
||||
if !empty(hunks)
|
||||
for i in [0, 1, 2]
|
||||
if s:non_zero_only == 0 || hunks[i] > 0
|
||||
if (s:non_zero_only == 0 && winwidth(0) > 100) || hunks[i] > 0
|
||||
let string .= printf('%s%s ', s:hunk_symbols[i], hunks[i])
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
let b:airline_hunks = string
|
||||
let b:airline_changenr = b:changedtick
|
||||
let s:airline_winwidth = winwidth(0)
|
||||
return string
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#init(ext)
|
||||
call airline#parts#define_function('hunks', 'airline#extensions#hunks#get_hunks')
|
||||
endfunction
|
||||
|
||||
|
||||
20
autoload/airline/extensions/keymap.vim
Normal file
20
autoload/airline/extensions/keymap.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Doron Behar, C.Brabandt et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !has('keymap')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#keymap#status()
|
||||
if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap'))
|
||||
return printf('%s', (!empty(&keymap) ? (g:airline_symbols.keymap . ' '. &keymap) : ''))
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#keymap#init(ext)
|
||||
call airline#parts#define_function('keymap', 'airline#extensions#keymap#status')
|
||||
endfunction
|
||||
101
autoload/airline/extensions/languageclient.vim
Normal file
101
autoload/airline/extensions/languageclient.vim
Normal file
@@ -0,0 +1,101 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bjorn Neergaard, w0rp, hallettj et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:error_symbol = get(g:, 'airline#extensions#languageclient#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#languageclient#warning_symbol', 'W:')
|
||||
let s:show_line_numbers = get(g:, 'airline#extensions#languageclient#show_line_numbers', 1)
|
||||
|
||||
" Severity codes from the LSP spec
|
||||
let s:severity_error = 1
|
||||
let s:severity_warning = 2
|
||||
let s:severity_info = 3
|
||||
let s:severity_hint = 4
|
||||
|
||||
" After each LanguageClient state change `s:diagnostics` will be populated with
|
||||
" a map from file names to lists of errors, warnings, informational messages,
|
||||
" and hints.
|
||||
let s:diagnostics = {}
|
||||
|
||||
function! s:languageclient_refresh()
|
||||
if get(g:, 'airline_skip_empty_sections', 0)
|
||||
exe ':AirlineRefresh'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:record_diagnostics(state)
|
||||
let result = json_decode(a:state.result)
|
||||
let s:diagnostics = result.diagnostics
|
||||
call s:languageclient_refresh()
|
||||
endfunction
|
||||
|
||||
function! s:get_diagnostics()
|
||||
call LanguageClient#getState(function("s:record_diagnostics"))
|
||||
endfunction
|
||||
|
||||
function! s:diagnostics_for_buffer()
|
||||
return get(s:diagnostics, expand('%:p'), [])
|
||||
endfunction
|
||||
|
||||
function! s:airline_languageclient_count(cnt, symbol)
|
||||
return a:cnt ? a:symbol. a:cnt : ''
|
||||
endfunction
|
||||
|
||||
function! s:airline_languageclient_get_line_number(type) abort
|
||||
let linenumber_of_first_problem = 0
|
||||
for d in s:diagnostics_for_buffer()
|
||||
if has_key(d, 'severity') && d.severity == a:type
|
||||
let linenumber_of_first_problem = d.range.start.line
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
if linenumber_of_first_problem == 0
|
||||
return ''
|
||||
endif
|
||||
|
||||
let open_lnum_symbol = get(g:, 'airline#extensions#languageclient#open_lnum_symbol', '(L')
|
||||
let close_lnum_symbol = get(g:, 'airline#extensions#languageclient#close_lnum_symbol', ')')
|
||||
|
||||
return open_lnum_symbol . linenumber_of_first_problem . close_lnum_symbol
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#languageclient#get(type)
|
||||
let is_err = a:type == s:severity_error
|
||||
let symbol = is_err ? s:error_symbol : s:warning_symbol
|
||||
|
||||
let cnt = 0
|
||||
for d in s:diagnostics_for_buffer()
|
||||
if has_key(d, 'severity') && d.severity == a:type
|
||||
let cnt += 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
if cnt == 0
|
||||
return ''
|
||||
endif
|
||||
|
||||
if s:show_line_numbers == 1
|
||||
return s:airline_languageclient_count(cnt, symbol) . <sid>airline_languageclient_get_line_number(a:type)
|
||||
else
|
||||
return s:airline_languageclient_count(cnt, symbol)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#languageclient#get_warning()
|
||||
return airline#extensions#languageclient#get(s:severity_warning)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#languageclient#get_error()
|
||||
return airline#extensions#languageclient#get(s:severity_error)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#languageclient#init(ext)
|
||||
call airline#parts#define_function('languageclient_error_count', 'airline#extensions#languageclient#get_error')
|
||||
call airline#parts#define_function('languageclient_warning_count', 'airline#extensions#languageclient#get_warning')
|
||||
augroup airline_languageclient
|
||||
autocmd!
|
||||
autocmd User LanguageClientDiagnosticsChanged call <sid>get_diagnostics()
|
||||
augroup END
|
||||
endfunction
|
||||
35
autoload/airline/extensions/localsearch.vim
Normal file
35
autoload/airline/extensions/localsearch.vim
Normal file
@@ -0,0 +1,35 @@
|
||||
" MIT License. Copyright (c) 2018 mox et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:enabled = get(g:, 'airline#extensions#localsearch#enabled', 1)
|
||||
if !get(g:, 'loaded_localsearch', 0) || !s:enabled || get(g:, 'airline#extensions#localsearch#loaded', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#extensions#localsearch#loaded = 001
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! airline#extensions#localsearch#load_theme(palette)
|
||||
call airline#highlighter#exec('localsearch_dark', [ '#ffffff' , '#000000' , 15 , 1 , ''])
|
||||
endfunction
|
||||
|
||||
|
||||
function! airline#extensions#localsearch#init(ext)
|
||||
call a:ext.add_theme_func('airline#extensions#localsearch#load_theme')
|
||||
call a:ext.add_statusline_func('airline#extensions#localsearch#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
function! airline#extensions#localsearch#apply(...)
|
||||
" first variable is the statusline builder
|
||||
let builder = a:1
|
||||
|
||||
""""" WARNING: the API for the builder is not finalized and may change
|
||||
if exists('#localsearch#WinEnter') " If localsearch mode is enabled
|
||||
call builder.add_section('localsearch_dark', s:spc.airline#section#create('LS').s:spc)
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
36
autoload/airline/extensions/neomake.vim
Normal file
36
autoload/airline/extensions/neomake.vim
Normal file
@@ -0,0 +1,36 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':Neomake')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:error_symbol = get(g:, 'airline#extensions#neomake#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#neomake#warning_symbol', 'W:')
|
||||
|
||||
function! s:get_counts()
|
||||
let l:counts = neomake#statusline#LoclistCounts()
|
||||
|
||||
if empty(l:counts)
|
||||
return neomake#statusline#QflistCounts()
|
||||
else
|
||||
return l:counts
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#neomake#get_warnings()
|
||||
let counts = s:get_counts()
|
||||
let warnings = get(counts, 'W', 0)
|
||||
return warnings ? s:warning_symbol.warnings : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#neomake#get_errors()
|
||||
let counts = s:get_counts()
|
||||
let errors = get(counts, 'E', 0)
|
||||
return errors ? s:error_symbol.errors : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#neomake#init(ext)
|
||||
call airline#parts#define_function('neomake_warning_count', 'airline#extensions#neomake#get_warnings')
|
||||
call airline#parts#define_function('neomake_error_count', 'airline#extensions#neomake#get_errors')
|
||||
endfunction
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':NetrwSettings')
|
||||
finish
|
||||
endif
|
||||
@@ -27,6 +29,6 @@ endfunction
|
||||
|
||||
|
||||
function! airline#extensions#netrw#sortstring()
|
||||
let order = (g:netrw_sort_direction =~ 'n') ? '+' : '-'
|
||||
let order = (get(g:, 'netrw_sort_direction', 'n') =~ 'n') ? '+' : '-'
|
||||
return g:netrw_sort_by . (g:airline_symbols.space) . '[' . order . ']'
|
||||
endfunction
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_nrrw_rgn', 0)
|
||||
finish
|
||||
endif
|
||||
@@ -39,7 +41,8 @@ function! airline#extensions#nrrwrgn#apply(...)
|
||||
endif
|
||||
endif
|
||||
let range=(dict.multi ? '' : printf("[%d-%d]", dict.start[1], dict.end[1]))
|
||||
call a:1.add_section('airline_c', printf("%s %s %s", name, range, dict.enabled ? "\u2713" : '!'))
|
||||
call a:1.add_section('airline_c', printf("%s %s %s", name, range,
|
||||
\ dict.enabled ? (&encoding ==? 'utf-8' ? "\u2713" : '') : '!'))
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_x', get(g:, 'airline_section_x').spc)
|
||||
call a:1.add_section('airline_y', spc.get(g:, 'airline_section_y').spc)
|
||||
|
||||
22
autoload/airline/extensions/obsession.vim
Normal file
22
autoload/airline/extensions/obsession.vim
Normal file
@@ -0,0 +1,22 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('*ObsessionStatus')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
if !exists('g:airline#extensions#obsession#indicator_text')
|
||||
let g:airline#extensions#obsession#indicator_text = '$'
|
||||
endif
|
||||
|
||||
function! airline#extensions#obsession#init(ext)
|
||||
call airline#parts#define_function('obsession', 'airline#extensions#obsession#get_status')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#obsession#get_status()
|
||||
return ObsessionStatus((g:airline#extensions#obsession#indicator_text . s:spc), '')
|
||||
endfunction
|
||||
81
autoload/airline/extensions/po.vim
Normal file
81
autoload/airline/extensions/po.vim
Normal file
@@ -0,0 +1,81 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#extensions#po#shorten()
|
||||
" Format and shorte the output of msgfmt
|
||||
let b:airline_po_stats = substitute(get(b:, 'airline_po_stats', ''), ' \(message\|translation\)s*\.*', '', 'g')
|
||||
let b:airline_po_stats = substitute(b:airline_po_stats, ', ', '/', 'g')
|
||||
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 - 2)].(&encoding==?'utf-8' ? '…' : '.'). ']'
|
||||
endif
|
||||
endif
|
||||
if strlen(get(b:, 'airline_po_stats', '')) >= 30 && winwidth(0) < 150
|
||||
let fuzzy = ''
|
||||
let untranslated = ''
|
||||
let messages = ''
|
||||
" Shorten [120 translated, 50 fuzzy, 4 untranslated] to [120T/50F/4U]
|
||||
if b:airline_po_stats =~ 'fuzzy'
|
||||
let fuzzy = substitute(b:airline_po_stats, '.*\(\d\+\) fuzzy.*', '\1F', '')
|
||||
endif
|
||||
if b:airline_po_stats =~ 'untranslated'
|
||||
let untranslated = substitute(b:airline_po_stats, '.*\(\d\+\) untranslated.*', '\1U', '')
|
||||
endif
|
||||
let messages = substitute(b:airline_po_stats, '\(\d\+\) translated.*', '\1T', '')
|
||||
let b:airline_po_stats = printf('%s%s%s', fuzzy, (empty(fuzzy) || empty(untranslated) ? '' : '/'), untranslated)
|
||||
if strlen(b:airline_po_stats) < 8
|
||||
let b:airline_po_stats = messages. (!empty(b:airline_po_stats) ? '/':''). b:airline_po_stats
|
||||
endif
|
||||
endif
|
||||
let b:airline_po_stats = '['.b:airline_po_stats. ']'
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#po#on_winenter()
|
||||
" only reset cache, if the window size changed
|
||||
if get(b:, 'airline_winwidth', 0) != winwidth(0)
|
||||
let b:airline_winwidth = winwidth(0)
|
||||
" needs re-formatting
|
||||
unlet! b:airline_po_stats
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#po#apply(...)
|
||||
if &ft ==# 'po'
|
||||
call airline#extensions#prepend_to_section('z', '%{airline#extensions#po#stats()}')
|
||||
" Also reset the cache variable, if a window has been split, e.g. the winwidth changed
|
||||
autocmd airline BufWritePost * unlet! b:airline_po_stats
|
||||
autocmd airline WinEnter * call airline#extensions#po#on_winenter()
|
||||
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 cmd = 'msgfmt --statistics -o /dev/null -- '
|
||||
if g:airline#init#vim_async
|
||||
call airline#async#get_msgfmt_stat(cmd, expand('%:p'))
|
||||
elseif has("nvim")
|
||||
call airline#async#nvim_get_msgfmt_stat(cmd, expand('%:p'))
|
||||
else
|
||||
let airline_po_stats = system(cmd. shellescape(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
|
||||
call airline#extensions#po#shorten()
|
||||
endif
|
||||
return get(b:, 'airline_po_stats', '')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#po#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#po#apply')
|
||||
endfunction
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':PromptlineSnapshot')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix'
|
||||
let g:airline#extensions#quickfix#location_text = 'Location'
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('g:airline#extensions#quickfix#quickfix_text')
|
||||
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix'
|
||||
endif
|
||||
|
||||
if !exists('g:airline#extensions#quickfix#location_text')
|
||||
let g:airline#extensions#quickfix#location_text = 'Location'
|
||||
endif
|
||||
|
||||
function! airline#extensions#quickfix#apply(...)
|
||||
if &buftype == 'quickfix'
|
||||
let w:airline_section_a = s:get_text()
|
||||
let w:airline_section_a = airline#extensions#quickfix#get_type()
|
||||
let w:airline_section_b = '%{get(w:, "quickfix_title", "")}'
|
||||
let w:airline_section_c = ''
|
||||
let w:airline_section_x = ''
|
||||
@@ -15,9 +22,24 @@ endfunction
|
||||
|
||||
function! airline#extensions#quickfix#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#quickfix#apply')
|
||||
call a:ext.add_inactive_statusline_func('airline#extensions#quickfix#inactive_qf_window')
|
||||
endfunction
|
||||
|
||||
function! s:get_text()
|
||||
function! airline#extensions#quickfix#inactive_qf_window(...)
|
||||
if getbufvar(a:2.bufnr, '&filetype') is# 'qf' && !empty(airline#util#getwinvar(a:2.winnr, 'quickfix_title', ''))
|
||||
call setwinvar(a:2.winnr, 'airline_section_c', '[%{get(w:, "quickfix_title", "")}] %f %m')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#quickfix#get_type()
|
||||
if exists("*win_getid") && exists("*getwininfo")
|
||||
let dict = getwininfo(win_getid())
|
||||
if len(dict) > 0 && get(dict[0], 'quickfix', 0) && !get(dict[0], 'loclist', 0)
|
||||
return g:airline#extensions#quickfix#quickfix_text
|
||||
elseif len(dict) > 0 && get(dict[0], 'quickfix', 0) && get(dict[0], 'loclist', 0)
|
||||
return g:airline#extensions#quickfix#location_text
|
||||
endif
|
||||
endif
|
||||
redir => buffers
|
||||
silent ls
|
||||
redir END
|
||||
@@ -34,4 +56,3 @@ function! s:get_text()
|
||||
endfor
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,19 +1,43 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':SyntasticCheck')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#syntastic#get_warnings()
|
||||
let errors = SyntasticStatuslineFlag()
|
||||
if strlen(errors) > 0
|
||||
return errors.(g:airline_symbols.space)
|
||||
let s:error_symbol = get(g:, 'airline#extensions#syntastic#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#syntastic#warning_symbol', 'W:')
|
||||
|
||||
function! airline#extensions#syntastic#get_warning()
|
||||
return airline#extensions#syntastic#get('warning')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#get_error()
|
||||
return airline#extensions#syntastic#get('error')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#get(type)
|
||||
let _backup = get(g:, 'syntastic_stl_format', '')
|
||||
let is_err = (a:type is# 'error')
|
||||
if is_err
|
||||
let g:syntastic_stl_format = get(g:, 'airline#extensions#syntastic#stl_format_err', '%E{[%e(#%fe)]}')
|
||||
else
|
||||
let g:syntastic_stl_format = get(g:, 'airline#extensions#syntastic#stl_format_warn', '%W{[%w(#%fw)]}')
|
||||
endif
|
||||
let cnt = SyntasticStatuslineFlag()
|
||||
if !empty(_backup)
|
||||
let g:syntastic_stl_format = _backup
|
||||
endif
|
||||
if empty(cnt)
|
||||
return ''
|
||||
else
|
||||
return (is_err ? s:error_symbol : s:warning_symbol).cnt
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#init(ext)
|
||||
call airline#parts#define_function('syntastic', 'airline#extensions#syntastic#get_warnings')
|
||||
call airline#parts#define_function('syntastic-warn', 'airline#extensions#syntastic#get_warning')
|
||||
call airline#parts#define_function('syntastic-err', 'airline#extensions#syntastic#get_error')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
scriptencoding utf-8
|
||||
|
||||
|
||||
let s:taboo = get(g:, 'airline#extensions#taboo#enabled', 1) && get(g:, 'loaded_taboo', 0)
|
||||
if s:taboo
|
||||
let g:taboo_tabline = 0
|
||||
endif
|
||||
|
||||
let s:ctrlspace = get(g:, 'CtrlSpaceLoaded', 0)
|
||||
|
||||
function! airline#extensions#tabline#init(ext)
|
||||
if has('gui_running')
|
||||
@@ -21,50 +27,108 @@ function! s:toggle_off()
|
||||
call airline#extensions#tabline#autoshow#off()
|
||||
call airline#extensions#tabline#tabs#off()
|
||||
call airline#extensions#tabline#buffers#off()
|
||||
if s:ctrlspace
|
||||
call airline#extensions#tabline#ctrlspace#off()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:toggle_on()
|
||||
call airline#extensions#tabline#autoshow#on()
|
||||
call airline#extensions#tabline#tabs#on()
|
||||
call airline#extensions#tabline#buffers#on()
|
||||
if s:ctrlspace
|
||||
call airline#extensions#tabline#ctrlspace#on()
|
||||
endif
|
||||
|
||||
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) || airline#util#ignore_buf(match)
|
||||
\ || isdirectory(expand("<afile>"))
|
||||
return
|
||||
endif
|
||||
call airline#util#doautocmd('BufMRUChange')
|
||||
" sometimes, the tabline is not correctly updated see #1580
|
||||
" so force redraw here
|
||||
let &tabline = &tabline
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#load_theme(palette)
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
let colors = get(a:palette, 'tabline', {})
|
||||
let l:tab = get(colors, 'airline_tab', a:palette.normal.airline_b)
|
||||
let l:tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
|
||||
let l:tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
|
||||
let l:tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
|
||||
let l:tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
|
||||
let tablabel = get(colors, 'airline_tablabel', a:palette.normal.airline_b)
|
||||
" Theme for tabs on the left
|
||||
let tab = get(colors, 'airline_tab', a:palette.normal.airline_b)
|
||||
let tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
|
||||
let tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
|
||||
let tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
|
||||
let tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
|
||||
let 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)
|
||||
let 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)
|
||||
let tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
|
||||
endif
|
||||
call airline#highlighter#exec('airline_tablabel', tablabel)
|
||||
call airline#highlighter#exec('airline_tab', tab)
|
||||
call airline#highlighter#exec('airline_tabsel', tabsel)
|
||||
call airline#highlighter#exec('airline_tabtype', tabtype)
|
||||
call airline#highlighter#exec('airline_tabfill', tabfill)
|
||||
call airline#highlighter#exec('airline_tabmod', tabmod)
|
||||
call airline#highlighter#exec('airline_tabmod_unsel', tabmodu)
|
||||
call airline#highlighter#exec('airline_tabhid', tabhid)
|
||||
|
||||
let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
|
||||
call airline#highlighter#exec('airline_tab', l:tab)
|
||||
call airline#highlighter#exec('airline_tabsel', l:tabsel)
|
||||
call airline#highlighter#exec('airline_tabtype', l:tabtype)
|
||||
call airline#highlighter#exec('airline_tabfill', l:tabfill)
|
||||
call airline#highlighter#exec('airline_tabmod', l:tabmod)
|
||||
call airline#highlighter#exec('airline_tabmod_unsel', l:tabmodu)
|
||||
call airline#highlighter#exec('airline_tabhid', l:tabhid)
|
||||
" Theme for tabs on the right
|
||||
let tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a)
|
||||
let tab_right = get(colors, 'airline_tab_right', a:palette.inactive.airline_c)
|
||||
let tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a)
|
||||
let 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 tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal_modified.airline_c)
|
||||
else
|
||||
"Fall back to normal airline_c if modified airline_c isn't present
|
||||
let tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c)
|
||||
endif
|
||||
call airline#highlighter#exec('airline_tab_right', tab_right)
|
||||
call airline#highlighter#exec('airline_tabsel_right', tabsel_right)
|
||||
call airline#highlighter#exec('airline_tabmod_right', tabmod_right)
|
||||
call airline#highlighter#exec('airline_tabhid_right', tabhid_right)
|
||||
call airline#highlighter#exec('airline_tabmod_unsel_right', tabmodu_right)
|
||||
endfunction
|
||||
|
||||
let s:current_tabcnt = -1
|
||||
|
||||
function! airline#extensions#tabline#get()
|
||||
let show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
|
||||
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 s:show_buffers && curtabcnt == 1 || !s:show_tabs
|
||||
if !exists('#airline#BufAdd#*')
|
||||
autocmd airline BufAdd * call <sid>update_tabline()
|
||||
endif
|
||||
if s:ctrlspace
|
||||
return airline#extensions#tabline#ctrlspace#get()
|
||||
elseif show_buffers && curtabcnt == 1 || !show_tabs
|
||||
return airline#extensions#tabline#buffers#get()
|
||||
else
|
||||
return airline#extensions#tabline#tabs#get()
|
||||
@@ -72,18 +136,37 @@ function! airline#extensions#tabline#get()
|
||||
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) && exists('*gettabvar')
|
||||
let title = gettabvar(a:n, 'title')
|
||||
endif
|
||||
|
||||
if empty(title)
|
||||
let buflist = tabpagebuflist(a:n)
|
||||
let winnr = tabpagewinnr(a:n)
|
||||
let all_buffers = airline#extensions#tabline#buflist#list()
|
||||
return airline#extensions#tabline#get_buffer_name(
|
||||
\ buflist[winnr - 1],
|
||||
\ filter(buflist, 'index(all_buffers, v:val) != -1'))
|
||||
endif
|
||||
|
||||
return title
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#get_buffer_name(nr)
|
||||
return airline#extensions#tabline#formatters#{s:formatter}#format(a:nr, airline#extensions#tabline#buflist#list())
|
||||
function! airline#extensions#tabline#get_buffer_name(nr, ...)
|
||||
let buffers = a:0 ? a:1 : airline#extensions#tabline#buflist#list()
|
||||
let formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
|
||||
return airline#extensions#tabline#formatters#{formatter}#format(a:nr, buffers)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#new_builder()
|
||||
let builder_context = {
|
||||
\ 'active' : 1,
|
||||
\ 'tabline' : 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),
|
||||
\ }
|
||||
@@ -95,5 +178,32 @@ function! airline#extensions#tabline#new_builder()
|
||||
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|')
|
||||
endif
|
||||
|
||||
return airline#builder#new(builder_context)
|
||||
return airline#extensions#tabline#builder#new(builder_context)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr)
|
||||
let cur = bufnr('%')
|
||||
if cur == a:bufnr
|
||||
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
else
|
||||
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
|
||||
let group = 'airline_tabmod_unsel'
|
||||
elseif index(a:tab_bufs, a:bufnr) > -1
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
endif
|
||||
return group
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#add_label(dict, type)
|
||||
if get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
call a:dict.add_section_spaced('airline_tablabel',
|
||||
\ get(g:, 'airline#extensions#tabline#'.a:type.'_label', a:type))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
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)
|
||||
@@ -22,7 +24,9 @@ function! airline#extensions#tabline#autoshow#on()
|
||||
augroup airline_tabline_autoshow
|
||||
autocmd!
|
||||
if s:buf_min_count <= 0 && s:tab_min_count <= 1
|
||||
set showtabline=2
|
||||
if &lines > 3
|
||||
set showtabline=2
|
||||
endif
|
||||
else
|
||||
if s:show_buffers == 1
|
||||
autocmd BufEnter * call <sid>show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()))
|
||||
@@ -34,13 +38,13 @@ function! airline#extensions#tabline#autoshow#on()
|
||||
|
||||
" Invalidate cache. This has to come after the BufUnload for
|
||||
" s:show_buffers, to invalidate the cache for BufEnter.
|
||||
autocmd BufAdd,BufUnload * call airline#extensions#tabline#buflist#invalidate()
|
||||
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
|
||||
if &showtabline != 2 && &lines > 3
|
||||
set showtabline=2
|
||||
endif
|
||||
else
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" 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:spc = g:airline_symbols.space
|
||||
|
||||
let s:current_bufnr = -1
|
||||
@@ -11,8 +10,7 @@ let s:current_modified = 0
|
||||
let s:current_tabline = ''
|
||||
let s:current_visible_buffers = []
|
||||
|
||||
let s:number_map = &encoding == 'utf-8'
|
||||
\ ? {
|
||||
let s:number_map = {
|
||||
\ '0': '⁰',
|
||||
\ '1': '¹',
|
||||
\ '2': '²',
|
||||
@@ -24,6 +22,8 @@ let s:number_map = &encoding == 'utf-8'
|
||||
\ '8': '⁸',
|
||||
\ '9': '⁹'
|
||||
\ }
|
||||
let s:number_map = &encoding == 'utf-8'
|
||||
\ ? get(g:, 'airline#extensions#tabline#buffer_idx_format', s:number_map)
|
||||
\ : {}
|
||||
|
||||
function! airline#extensions#tabline#buffers#off()
|
||||
@@ -35,12 +35,9 @@ endfunction
|
||||
function! airline#extensions#tabline#buffers#on()
|
||||
augroup airline_tabline_buffers
|
||||
autocmd!
|
||||
autocmd BufDelete * call airline#extensions#tabline#buffers#invalidate()
|
||||
autocmd BufDelete * call airline#extensions#tabline#buflist#clean()
|
||||
autocmd User BufMRUChange call airline#extensions#tabline#buflist#clean()
|
||||
augroup END
|
||||
|
||||
if s:buffer_idx_mode
|
||||
call s:define_buffer_idx_mode_mappings()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buffers#invalidate()
|
||||
@@ -48,117 +45,118 @@ function! airline#extensions#tabline#buffers#invalidate()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buffers#get()
|
||||
try
|
||||
call <sid>map_keys()
|
||||
catch
|
||||
" no-op
|
||||
endtry
|
||||
let cur = bufnr('%')
|
||||
if cur == s:current_bufnr
|
||||
if cur == s:current_bufnr && &columns == s:column_width
|
||||
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 show_buf_label_first = 0
|
||||
|
||||
if cur == nr
|
||||
if g:airline_detect_modified && getbufvar(nr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
if get(g:, 'airline#extensions#tabline#buf_label_first', 0)
|
||||
let show_buf_label_first = 1
|
||||
endif
|
||||
if show_buf_label_first
|
||||
call airline#extensions#tabline#add_label(b, 'buffers')
|
||||
endif
|
||||
|
||||
let b.tab_bufs = tabpagebuflist(tabpagenr())
|
||||
|
||||
let b.overflow_group = 'airline_tabhid'
|
||||
let b.buffers = airline#extensions#tabline#buflist#list()
|
||||
if get(g:, 'airline#extensions#tabline#current_first', 0)
|
||||
if index(b.buffers, cur) > -1
|
||||
call remove(b.buffers, index(b.buffers, cur))
|
||||
endif
|
||||
let b.buffers = [cur] + b.buffers
|
||||
endif
|
||||
|
||||
function! b.get_group(i) dict
|
||||
let bufnum = get(self.buffers, a:i, -1)
|
||||
if bufnum == -1
|
||||
return ''
|
||||
endif
|
||||
let group = airline#extensions#tabline#group_of_bufnr(self.tab_bufs, bufnum)
|
||||
if bufnum == bufnr('%')
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
endif
|
||||
return group
|
||||
endfunction
|
||||
|
||||
if has("tablineat")
|
||||
function! b.get_pretitle(i) dict
|
||||
let bufnum = get(self.buffers, a:i, -1)
|
||||
return '%'.bufnum.'@airline#extensions#tabline#buffers#clickbuf@'
|
||||
endfunction
|
||||
|
||||
function! b.get_posttitle(i) dict
|
||||
return '%X'
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function! b.get_title(i) dict
|
||||
let bufnum = get(self.buffers, a:i, -1)
|
||||
let group = self.get_group(a:i)
|
||||
let pgroup = self.get_group(a:i - 1)
|
||||
" always add a space when powerline_fonts are used
|
||||
" or for the very first item
|
||||
if get(g:, 'airline_powerline_fonts', 0) || a:i == 0
|
||||
let space = s:spc
|
||||
else
|
||||
if g:airline_detect_modified && getbufvar(nr, '&modified')
|
||||
let group = 'airline_tabmod_unsel'
|
||||
elseif index(tab_bufs, nr) > -1
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
let space= (pgroup == group ? s:spc : '')
|
||||
endif
|
||||
|
||||
if s:buffer_idx_mode
|
||||
if get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0)
|
||||
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)
|
||||
return space. get(s:number_map, a:i+1, '') . '%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)' . s:spc
|
||||
else
|
||||
call b.add_section(group, '['.l:index.s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.']')
|
||||
return '['.(a:i+1).s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.']'
|
||||
endif
|
||||
let l:index = l:index + 1
|
||||
else
|
||||
call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
|
||||
return space.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.s:spc
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
let current_buffer = max([index(b.buffers, cur), 0])
|
||||
let last_buffer = len(b.buffers) - 1
|
||||
call b.insert_titles(current_buffer, 0, last_buffer)
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.add_section('airline_tabtype', ' buffers ')
|
||||
if !show_buf_label_first
|
||||
call airline#extensions#tabline#add_label(b, 'buffers')
|
||||
endif
|
||||
|
||||
if tabpagenr('$') > 1
|
||||
call b.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
|
||||
endif
|
||||
|
||||
let s:current_bufnr = cur
|
||||
let s:column_width = &columns
|
||||
let s:current_tabline = b.build()
|
||||
let s:current_visible_buffers = copy(b.buffers)
|
||||
if b._right_title <= last_buffer
|
||||
call remove(s:current_visible_buffers, b._right_title, last_buffer)
|
||||
endif
|
||||
if b._left_title > 0
|
||||
call remove(s:current_visible_buffers, 0, b._left_title)
|
||||
endif
|
||||
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
|
||||
" no-op when called in 'keymap_ignored_filetypes'
|
||||
if count(get(g:, 'airline#extensions#tabline#keymap_ignored_filetypes',
|
||||
\ ['vimfiler', 'nerdtree']), &ft)
|
||||
return
|
||||
endif
|
||||
|
||||
@@ -173,14 +171,76 @@ function! s:select_tab(buf_index)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:define_buffer_idx_mode_mappings()
|
||||
noremap! <unique> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
|
||||
function! s:jump_to_tab(offset)
|
||||
let l = airline#extensions#tabline#buflist#list()
|
||||
let i = index(l, bufnr('%'))
|
||||
if i > -1
|
||||
exec 'b!' . l[(i + a:offset) % len(l)]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:map_keys()
|
||||
if get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1)
|
||||
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#clickbuf(minwid, clicks, button, modifiers) abort
|
||||
" Clickable buffers
|
||||
" works only in recent NeoVim with has('tablineat')
|
||||
|
||||
" single mouse button click without modifiers pressed
|
||||
if a:clicks == 1 && a:modifiers !~# '[^ ]'
|
||||
if a:button is# 'l'
|
||||
" left button - switch to buffer
|
||||
silent execute 'buffer' a:minwid
|
||||
elseif a:button is# 'm'
|
||||
" middle button - delete buffer
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#middle_click_preserves_windows', 0) == 0
|
||||
" just simply delete the clicked buffer. This will cause windows
|
||||
" associated with the clicked buffer to be closed.
|
||||
silent execute 'bdelete' a:minwid
|
||||
else
|
||||
" find windows displaying the clicked buffer and open an new
|
||||
" buffer in them.
|
||||
let current_window = bufwinnr("%")
|
||||
let window_number = bufwinnr(a:minwid)
|
||||
let last_window_visited = -1
|
||||
|
||||
" Set to 1 if the clicked buffer was open in any windows.
|
||||
let buffer_in_window = 0
|
||||
|
||||
" Find the next window with the clicked buffer open. If bufwinnr()
|
||||
" returns the same window number, this is because we clicked a new
|
||||
" buffer, and then tried editing a new buffer. Vim won't create a
|
||||
" new empty buffer for the same window, so we get the same window
|
||||
" number from bufwinnr(). In this case we just give up and don't
|
||||
" delete the buffer.
|
||||
" This could be made cleaner if we could check if the clicked buffer
|
||||
" is a new buffer, but I don't know if there is a way to do that.
|
||||
while window_number != -1 && window_number != last_window_visited
|
||||
let buffer_in_window = 1
|
||||
silent execute window_number . 'wincmd w'
|
||||
silent execute 'enew'
|
||||
let last_window_visited = window_number
|
||||
let window_number = bufwinnr(a:minwid)
|
||||
endwhile
|
||||
silent execute current_window . 'wincmd w'
|
||||
if window_number != last_window_visited || buffer_in_window == 0
|
||||
silent execute 'bdelete' a:minwid
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,38 +1,77 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:excludes = get(g:, 'airline#extensions#tabline#excludes', [])
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#extensions#tabline#buflist#invalidate()
|
||||
unlet! s:current_buffer_list
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buflist#clean()
|
||||
call airline#extensions#tabline#buflist#invalidate()
|
||||
call airline#extensions#tabline#buffers#invalidate()
|
||||
endfunction
|
||||
|
||||
" paths in excludes list
|
||||
function! s:ExcludePaths(nr, exclude_paths)
|
||||
let bpath = fnamemodify(bufname(a:nr), ":p")
|
||||
for f in a:exclude_paths
|
||||
if bpath =~# f | return 1 | endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" other types to exclude
|
||||
function! s:ExcludeOther(nr, exclude_preview)
|
||||
if (getbufvar(a:nr, 'current_syntax') == 'qf') ||
|
||||
\ (a:exclude_preview && getbufvar(a:nr, '&bufhidden') == 'wipe'
|
||||
\ && getbufvar(a:nr, '&buftype') == 'nofile')
|
||||
return 1 | endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buflist#list()
|
||||
if exists('s:current_buffer_list')
|
||||
return s:current_buffer_list
|
||||
endif
|
||||
|
||||
let exclude_buffers = get(g:, 'airline#extensions#tabline#exclude_buffers', [])
|
||||
let exclude_paths = get(g:, 'airline#extensions#tabline#excludes', [])
|
||||
let exclude_preview = get(g:, 'airline#extensions#tabline#exclude_preview', 1)
|
||||
|
||||
let list = (exists('g:did_bufmru') && g:did_bufmru) ? BufMRUList() : range(1, bufnr("$"))
|
||||
|
||||
let buffers = []
|
||||
let cur = bufnr('%')
|
||||
for nr in range(1, bufnr('$'))
|
||||
if buflisted(nr) && bufexists(nr)
|
||||
let toadd = 1
|
||||
for ex in s:excludes
|
||||
if match(bufname(nr), ex) >= 0
|
||||
let toadd = 0
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if getbufvar(nr, 'current_syntax') == 'qf'
|
||||
let toadd = 0
|
||||
endif
|
||||
if toadd
|
||||
call add(buffers, nr)
|
||||
" If this is too slow, we can switch to a different algorithm.
|
||||
" Basically branch 535 already does it, but since it relies on
|
||||
" BufAdd autocommand, I'd like to avoid this if possible.
|
||||
for nr in list
|
||||
if buflisted(nr)
|
||||
" Do not add to the bufferlist, if either
|
||||
" 1) bufnr is exclude_buffers list
|
||||
" 2) buffername matches one of exclude_paths patterns
|
||||
" 3) buffer is a quickfix buffer
|
||||
" 4) when excluding preview windows:
|
||||
" 'bufhidden' == wipe
|
||||
" 'buftype' == nofile
|
||||
" 5) ignore buffers matching airline#extensions#tabline#ignore_bufadd_pat
|
||||
|
||||
" check buffer numbers first
|
||||
if index(exclude_buffers, nr) >= 0
|
||||
continue
|
||||
" check paths second
|
||||
elseif !empty(exclude_paths) && s:ExcludePaths(nr, exclude_paths)
|
||||
continue
|
||||
" ignore buffers matching airline#extensions#tabline#ignore_bufadd_pat
|
||||
elseif airline#util#ignore_buf(bufname(nr))
|
||||
continue
|
||||
" check other types last
|
||||
elseif s:ExcludeOther(nr, exclude_preview)
|
||||
continue
|
||||
endif
|
||||
|
||||
call add(buffers, nr)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let s:current_buffer_list = buffers
|
||||
return buffers
|
||||
endfunction
|
||||
|
||||
|
||||
232
autoload/airline/extensions/tabline/builder.vim
Normal file
232
autoload/airline/extensions/tabline/builder.vim
Normal file
@@ -0,0 +1,232 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:prototype = {}
|
||||
|
||||
" Set the point in the tabline where the builder should insert the titles.
|
||||
"
|
||||
" Subsequent calls will overwrite the previous ones, so only the last call
|
||||
" determines to location to insert titles.
|
||||
"
|
||||
" NOTE: The titles are not inserted until |build| is called, so that the
|
||||
" remaining contents of the tabline can be taken into account.
|
||||
"
|
||||
" Callers should define at least |get_title| and |get_group| on the host
|
||||
" object before calling |build|.
|
||||
function! s:prototype.insert_titles(current, first, last) dict
|
||||
let self._first_title = a:first " lowest index
|
||||
let self._last_title = a:last " highest index
|
||||
let self._left_title = a:current " next index to add on the left
|
||||
let self._right_title = a:current + 1 " next index to add on the right
|
||||
let self._left_position = self.get_position() " left end of titles
|
||||
let self._right_position = self._left_position " right end of the titles
|
||||
endfunction
|
||||
|
||||
" Insert a title for entry number |index|, of group |group| at position |pos|,
|
||||
" if there is space for it. Returns 1 if it is inserted, 0 otherwise
|
||||
"
|
||||
" |force| inserts the title even if there isn't enough space left for it.
|
||||
" |sep_size| adjusts the size change that the title is considered to take up,
|
||||
" to account for changes to the separators
|
||||
"
|
||||
" The title is defined by |get_title| on the hosting object, called with
|
||||
" |index| as its only argument.
|
||||
" |get_pretitle| and |get_posttitle| may be defined on the host object to
|
||||
" insert some formatting before or after the title. These should be 0-width.
|
||||
"
|
||||
" This method updates |_right_position| and |_remaining_space| on the host
|
||||
" object, if the title is inserted.
|
||||
function! s:prototype.try_insert_title(index, group, pos, sep_size, force) dict
|
||||
let title = self.get_title(a:index)
|
||||
let title_size = s:tabline_evaluated_length(title) + a:sep_size
|
||||
if a:force || self._remaining_space >= title_size
|
||||
let pos = a:pos
|
||||
if has_key(self, "get_pretitle")
|
||||
call self.insert_raw(self.get_pretitle(a:index), pos)
|
||||
let self._right_position += 1
|
||||
let pos += 1
|
||||
endif
|
||||
|
||||
call self.insert_section(a:group, title, pos)
|
||||
let self._right_position += 1
|
||||
let pos += 1
|
||||
|
||||
if has_key(self, "get_posttitle")
|
||||
call self.insert_raw(self.get_posttitle(a:index), pos)
|
||||
let self._right_position += 1
|
||||
let pos += 1
|
||||
endif
|
||||
|
||||
let self._remaining_space -= title_size
|
||||
return 1
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:get_separator_change(new_group, old_group, end_group, sep_size, alt_sep_size)
|
||||
return s:get_separator_change_with_end(a:new_group, a:old_group, a:end_group, a:end_group, a:sep_size, a:alt_sep_size)
|
||||
endfunction
|
||||
|
||||
" Compute the change in size of the tabline caused by separators
|
||||
"
|
||||
" This should be kept up-to-date with |s:get_transitioned_seperator| and
|
||||
" |s:get_separator| in autoload/airline/builder.vim
|
||||
function! s:get_separator_change_with_end(new_group, old_group, new_end_group, old_end_group, sep_size, alt_sep_size)
|
||||
let sep_change = 0
|
||||
if !empty(a:new_end_group) " Separator between title and the end
|
||||
let sep_change += airline#builder#should_change_group(a:new_group, a:new_end_group) ? a:sep_size : a:alt_sep_size
|
||||
endif
|
||||
if !empty(a:old_group) " Separator between the title and the one adjacent
|
||||
let sep_change += airline#builder#should_change_group(a:new_group, a:old_group) ? a:sep_size : a:alt_sep_size
|
||||
if !empty(a:old_end_group) " Remove mis-predicted separator
|
||||
let sep_change -= airline#builder#should_change_group(a:old_group, a:old_end_group) ? a:sep_size : a:alt_sep_size
|
||||
endif
|
||||
endif
|
||||
return sep_change
|
||||
endfunction
|
||||
|
||||
" This replaces the build function of the |airline#builder#new| object, to
|
||||
" insert titles as specified by the last call to |insert_titles| before
|
||||
" passing to the original build function.
|
||||
"
|
||||
" Callers should define at least |get_title| and |get_group| on the host
|
||||
" object if |insert_titles| has been called on it.
|
||||
function! s:prototype.build() dict
|
||||
if has_key(self, '_left_position') && self._first_title <= self._last_title
|
||||
let self._remaining_space = &columns - s:tabline_evaluated_length(self._build())
|
||||
|
||||
let center_active = get(g:, 'airline#extensions#tabline#center_active', 0)
|
||||
|
||||
let sep_size = s:tabline_evaluated_length(self._context.left_sep)
|
||||
let alt_sep_size = s:tabline_evaluated_length(self._context.left_alt_sep)
|
||||
|
||||
let outer_left_group = airline#builder#get_prev_group(self._sections, self._left_position)
|
||||
let outer_right_group = airline#builder#get_next_group(self._sections, self._right_position)
|
||||
|
||||
let overflow_marker = get(g:, 'airline#extensions#tabline#overflow_marker', g:airline_symbols.ellipsis)
|
||||
let overflow_marker_size = s:tabline_evaluated_length(overflow_marker)
|
||||
" Allow space for the markers before we begin filling in titles.
|
||||
if self._left_title > self._first_title
|
||||
let self._remaining_space -= overflow_marker_size +
|
||||
\ s:get_separator_change(self.overflow_group, "", outer_left_group, sep_size, alt_sep_size)
|
||||
endif
|
||||
if self._left_title < self._last_title
|
||||
let self._remaining_space -= overflow_marker_size +
|
||||
\ s:get_separator_change(self.overflow_group, "", outer_right_group, sep_size, alt_sep_size)
|
||||
endif
|
||||
|
||||
" Add the current title
|
||||
let group = self.get_group(self._left_title)
|
||||
if self._left_title == self._first_title
|
||||
let sep_change = s:get_separator_change(group, "", outer_left_group, sep_size, alt_sep_size)
|
||||
else
|
||||
let sep_change = s:get_separator_change(group, "", self.overflow_group, sep_size, alt_sep_size)
|
||||
endif
|
||||
if self._left_title == self._last_title
|
||||
let sep_change += s:get_separator_change(group, "", outer_right_group, sep_size, alt_sep_size)
|
||||
else
|
||||
let sep_change += s:get_separator_change(group, "", self.overflow_group, sep_size, alt_sep_size)
|
||||
endif
|
||||
let left_group = group
|
||||
let right_group = group
|
||||
let self._left_title -=
|
||||
\ self.try_insert_title(self._left_title, group, self._left_position, sep_change, 1)
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#current_first', 0)
|
||||
" always have current title first
|
||||
let self._left_position += 1
|
||||
endif
|
||||
|
||||
if !center_active && self._right_title <= self._last_title
|
||||
" Add the title to the right
|
||||
let group = self.get_group(self._right_title)
|
||||
if self._right_title == self._last_title
|
||||
let sep_change = s:get_separator_change_with_end(group, right_group, outer_right_group, self.overflow_group, sep_size, alt_sep_size) - overflow_marker_size
|
||||
else
|
||||
let sep_change = s:get_separator_change(group, right_group, self.overflow_group, sep_size, alt_sep_size)
|
||||
endif
|
||||
let right_group = group
|
||||
let self._right_title +=
|
||||
\ self.try_insert_title(self._right_title, group, self._right_position, sep_change, 1)
|
||||
endif
|
||||
|
||||
while self._remaining_space > 0
|
||||
let done = 0
|
||||
if self._left_title >= self._first_title
|
||||
" Insert next title to the left
|
||||
let group = self.get_group(self._left_title)
|
||||
if self._left_title == self._first_title
|
||||
let sep_change = s:get_separator_change_with_end(group, left_group, outer_left_group, self.overflow_group, sep_size, alt_sep_size) - overflow_marker_size
|
||||
else
|
||||
let sep_change = s:get_separator_change(group, left_group, self.overflow_group, sep_size, alt_sep_size)
|
||||
endif
|
||||
let left_group = group
|
||||
let done = self.try_insert_title(self._left_title, group, self._left_position, sep_change, 0)
|
||||
let self._left_title -= done
|
||||
endif
|
||||
" If center_active is set, this |if| operates as an independent |if|,
|
||||
" otherwise as an |elif|.
|
||||
if self._right_title <= self._last_title && (center_active || !done)
|
||||
" Insert next title to the right
|
||||
let group = self.get_group(self._right_title)
|
||||
if self._right_title == self._last_title
|
||||
let sep_change = s:get_separator_change_with_end(group, right_group, outer_right_group, self.overflow_group, sep_size, alt_sep_size) - overflow_marker_size
|
||||
else
|
||||
let sep_change = s:get_separator_change(group, right_group, self.overflow_group, sep_size, alt_sep_size)
|
||||
endif
|
||||
let right_group = group
|
||||
let done = self.try_insert_title(self._right_title, group, self._right_position, sep_change, 0)
|
||||
let self._right_title += done
|
||||
endif
|
||||
if !done
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
if self._left_title >= self._first_title
|
||||
if get(g:, 'airline#extensions#tabline#current_first', 0)
|
||||
let self._left_position -= 1
|
||||
endif
|
||||
call self.insert_section(self.overflow_group, overflow_marker, self._left_position)
|
||||
let self._right_position += 1
|
||||
endif
|
||||
|
||||
if self._right_title <= self._last_title
|
||||
call self.insert_section(self.overflow_group, overflow_marker, self._right_position)
|
||||
endif
|
||||
endif
|
||||
|
||||
return self._build()
|
||||
endfunction
|
||||
|
||||
let s:prototype.overflow_group = 'airline_tab'
|
||||
|
||||
" Extract the text content a tabline will render. (Incomplete).
|
||||
"
|
||||
" See :help 'statusline' for the list of fields.
|
||||
function! s:evaluate_tabline(tabline)
|
||||
let tabline = a:tabline
|
||||
let tabline = substitute(tabline, '%{\([^}]\+\)}', '\=eval(submatch(1))', 'g')
|
||||
let tabline = substitute(tabline, '%#[^#]\+#', '', 'g')
|
||||
let tabline = substitute(tabline, '%(\([^)]\+\)%)', '\1', 'g')
|
||||
let tabline = substitute(tabline, '%\d\+[TX]', '', 'g')
|
||||
let tabline = substitute(tabline, '%=', '', 'g')
|
||||
let tabline = substitute(tabline, '%\d*\*', '', 'g')
|
||||
if has('tablineat')
|
||||
let tabline = substitute(tabline, '%@[^@]\+@', '', 'g')
|
||||
endif
|
||||
return tabline
|
||||
endfunction
|
||||
|
||||
function! s:tabline_evaluated_length(tabline)
|
||||
return airline#util#strchars(s:evaluate_tabline(a:tabline))
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#builder#new(context)
|
||||
let builder = airline#builder#new(a:context)
|
||||
let builder._build = builder.build
|
||||
call extend(builder, s:prototype, 'force')
|
||||
return builder
|
||||
endfunction
|
||||
157
autoload/airline/extensions/tabline/ctrlspace.vim
Normal file
157
autoload/airline/extensions/tabline/ctrlspace.vim
Normal file
@@ -0,0 +1,157 @@
|
||||
" MIT License. Copyright (c) 2016-2018 Kevin Sapper et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:current_bufnr = -1
|
||||
let s:current_modified = 0
|
||||
let s:current_tabnr = -1
|
||||
let s:current_tabline = ''
|
||||
let s:highlight_groups = ['hid', 0, '', 'sel', 'mod_unsel', 0, 'mod_unsel', 'mod']
|
||||
|
||||
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, pull_right)
|
||||
let pos_extension = (a:pull_right ? '_right' : '')
|
||||
let buffer_list = ctrlspace#api#BufferList(a:cur_tab)
|
||||
|
||||
" add by tenfy(tenfyzhong@qq.com)
|
||||
" if the current buffer no in the buffer list
|
||||
" return false and no redraw tabline.
|
||||
" Fixes #1515. if there a BufEnter autocmd execute redraw. The tabline may no update.
|
||||
let bufnr_list = map(copy(buffer_list), 'v:val["index"]')
|
||||
if index(bufnr_list, a:cur_buf) == -1 && a:cur_tab == s:current_tabnr
|
||||
return 0
|
||||
endif
|
||||
|
||||
let s:current_modified = getbufvar(a:cur_buf, '&modified')
|
||||
|
||||
for buffer in buffer_list
|
||||
let group = 'airline_tab'
|
||||
\ .s:highlight_groups[(4 * buffer.modified) + (2 * buffer.visible) + (a:cur_buf == buffer.index)]
|
||||
\ .pos_extension
|
||||
|
||||
let buf_name = '%(%{airline#extensions#tabline#get_buffer_name('.buffer.index.')}%)'
|
||||
|
||||
if has("tablineat")
|
||||
let buf_name = '%'.buffer.index.'@airline#extensions#tabline#buffers#clickbuf@'.buf_name.'%X'
|
||||
endif
|
||||
|
||||
call a:builder.add_section_spaced(group, buf_name)
|
||||
endfor
|
||||
|
||||
" add by tenfy(tenfyzhong@qq.com)
|
||||
" if the selected buffer was updated
|
||||
" return true
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#add_tab_section(builder, pull_right)
|
||||
let pos_extension = (a:pull_right ? '_right' : '')
|
||||
let tab_list = ctrlspace#api#TabList()
|
||||
|
||||
for tab in tab_list
|
||||
let group = 'airline_tab'
|
||||
\ .s:highlight_groups[(4 * tab.modified) + (3 * tab.current)]
|
||||
\ .pos_extension
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#ctrlspace_show_tab_nr', 0) == 0
|
||||
call a:builder.add_section_spaced(group, '%'.tab.index.'T'.tab.title.ctrlspace#api#TabBuffersNumber(tab.index).'%T')
|
||||
else
|
||||
call a:builder.add_section_spaced(group, '%'.(tab.index).'T'.(tab.index).(g:airline_symbols.space).(tab.title).ctrlspace#api#TabBuffersNumber(tab.index).'%T')
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#get()
|
||||
let cur_buf = bufnr('%')
|
||||
let buffer_label = get(g:, 'airline#extensions#tabline#buffers_label', 'buffers')
|
||||
let tab_label = get(g:, 'airline#extensions#tabline#tabs_label', 'tabs')
|
||||
let switch_buffers_and_tabs = get(g:, 'airline#extensions#tabline#switch_buffers_and_tabs', 0)
|
||||
|
||||
try
|
||||
call airline#extensions#tabline#tabs#map_keys()
|
||||
endtry
|
||||
|
||||
let cur_tab = tabpagenr()
|
||||
|
||||
if cur_buf == s:current_bufnr && cur_tab == s:current_tabnr
|
||||
if !g:airline_detect_modified || getbufvar(cur_buf, '&modified') == s:current_modified
|
||||
return s:current_tabline
|
||||
endif
|
||||
endif
|
||||
|
||||
let builder = airline#extensions#tabline#new_builder()
|
||||
|
||||
let show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
|
||||
let AppendBuffers = function('airline#extensions#tabline#ctrlspace#add_buffer_section', [builder, cur_tab, cur_buf])
|
||||
let AppendTabs = function('airline#extensions#tabline#ctrlspace#add_tab_section', [builder])
|
||||
let AppendLabel = function(builder.add_section_spaced, ['airline_tabtype'], builder)
|
||||
|
||||
" <= 1: |{Tabs} <tab|
|
||||
" == 2: |{Buffers} <buffers|
|
||||
" == 3: |buffers> {Buffers} {Tabs} <tabs|
|
||||
let showing_mode = (2 * show_buffers) + (show_tabs)
|
||||
let ignore_update = 0
|
||||
|
||||
" Add left tabline content
|
||||
if showing_mode <= 1 " Tabs only mode
|
||||
call AppendTabs(0)
|
||||
elseif showing_mode == 2 " Buffers only mode
|
||||
let ignore_update = !AppendBuffers(0)
|
||||
else
|
||||
if !switch_buffers_and_tabs
|
||||
call AppendLabel(buffer_label)
|
||||
let ignore_update = !AppendBuffers(0)
|
||||
else
|
||||
call AppendLabel(tab_label)
|
||||
call AppendTabs(0)
|
||||
endif
|
||||
endif
|
||||
|
||||
if ignore_update | return s:current_tabline | endif
|
||||
|
||||
call builder.add_section('airline_tabfill', '')
|
||||
call builder.split()
|
||||
call builder.add_section('airline_tabfill', '')
|
||||
|
||||
" Add right tabline content
|
||||
if showing_mode <= 1 " Tabs only mode
|
||||
call AppendLabel(tab_label)
|
||||
elseif showing_mode == 2 " Buffers only mode
|
||||
call AppendLabel(buffer_label)
|
||||
else
|
||||
if !switch_buffers_and_tabs
|
||||
call AppendTabs(1)
|
||||
call AppendLabel(tab_label)
|
||||
else
|
||||
let ignore_update = AppendBuffers(1)
|
||||
call AppendLabel(buffer_label)
|
||||
endif
|
||||
endif
|
||||
|
||||
if ignore_update | return s:current_tabline | 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,13 +1,16 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
|
||||
let s:fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
|
||||
let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ')
|
||||
let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
|
||||
let s:buf_modified_symbol = g:airline_symbols.modified
|
||||
|
||||
function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
|
||||
let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
|
||||
let _ = ''
|
||||
|
||||
let name = bufname(a:bufnr)
|
||||
@@ -15,9 +18,14 @@ function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
|
||||
let _ .= '[No Name]'
|
||||
else
|
||||
if s:fnamecollapse
|
||||
let _ .= substitute(fnamemodify(name, s:fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
|
||||
" Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c'
|
||||
"let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
|
||||
let _ .= pathshorten(fnamemodify(name, fmod))
|
||||
else
|
||||
let _ .= fnamemodify(name, s:fmod)
|
||||
let _ .= fnamemodify(name, fmod)
|
||||
endif
|
||||
if a:bufnr != bufnr('%') && s:fnametruncate && strlen(_) > s:fnametruncate
|
||||
let _ = strpart(_, 0, s:fnametruncate)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#extensions#tabline#formatters#jsformatter#format(bufnr, buffers)
|
||||
let buf = bufname(a:bufnr)
|
||||
let filename = fnamemodify(buf, ':t')
|
||||
|
||||
if filename == 'index.js' || filename == 'index.jsx' || filename == 'index.ts' || filename == 'index.tsx'
|
||||
return fnamemodify(buf, ':p:h:t') . '/i'
|
||||
else
|
||||
return airline#extensions#tabline#formatters#unique_tail_improved#format(a:bufnr, a:buffers)
|
||||
endif
|
||||
endfunction
|
||||
14
autoload/airline/extensions/tabline/formatters/tabnr.vim
Normal file
14
autoload/airline/extensions/tabline/formatters/tabnr.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" MIT License. Copyright (c) 2017-2018 C.Brabandt et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#extensions#tabline#formatters#tabnr#format(tab_nr_type, nr)
|
||||
if a:tab_nr_type == 0 " nr of splits
|
||||
return (g:airline_symbols.space).'%{len(tabpagebuflist('.a:nr.'))}'
|
||||
elseif a:tab_nr_type == 1 " tab number
|
||||
return (g:airline_symbols.space).a:nr
|
||||
else "== 2 splits and tab number
|
||||
return (g:airline_symbols.space).a:nr.'.%{len(tabpagebuflist('.a:nr.'))}'
|
||||
endif
|
||||
endfunction
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffers)
|
||||
let duplicates = {}
|
||||
let tails = {}
|
||||
@@ -10,7 +12,7 @@ function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffer
|
||||
if empty(name)
|
||||
let map[nr] = '[No Name]'
|
||||
else
|
||||
let tail = fnamemodify(name, ':t')
|
||||
let tail = fnamemodify(name, ':s?/\+$??:t')
|
||||
if has_key(tails, tail)
|
||||
let duplicates[nr] = nr
|
||||
endif
|
||||
@@ -19,9 +21,21 @@ function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffer
|
||||
endif
|
||||
endfor
|
||||
|
||||
let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':p:.')
|
||||
for nr in values(duplicates)
|
||||
let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, fnamemodify(bufname(nr), ':p:.'))
|
||||
let name = bufname(nr)
|
||||
let fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
|
||||
if fnamecollapse
|
||||
let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g'))
|
||||
else
|
||||
let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, fnamemodify(name, fmod))
|
||||
endif
|
||||
endfor
|
||||
|
||||
return map[a:bufnr]
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
|
||||
let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
|
||||
let s:show_close_button = get(g:, 'airline#extensions#tabline#show_close_button', 1)
|
||||
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
let s:close_symbol = get(g:, 'airline#extensions#tabline#close_symbol', 'X')
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
let s:current_modified = 0
|
||||
@@ -31,50 +28,97 @@ endfunction
|
||||
function! airline#extensions#tabline#tabs#get()
|
||||
let curbuf = bufnr('%')
|
||||
let curtab = tabpagenr()
|
||||
if curbuf == s:current_bufnr && curtab == s:current_tabnr
|
||||
try
|
||||
call airline#extensions#tabline#tabs#map_keys()
|
||||
catch
|
||||
" no-op
|
||||
endtry
|
||||
if curbuf == s:current_bufnr && curtab == s:current_tabnr && &columns == s:column_width
|
||||
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
|
||||
|
||||
call airline#extensions#tabline#add_label(b, 'tabs')
|
||||
|
||||
function! b.get_group(i) dict
|
||||
let curtab = tabpagenr()
|
||||
let group = 'airline_tab'
|
||||
if a:i == curtab
|
||||
let group = 'airline_tabsel'
|
||||
if g:airline_detect_modified
|
||||
for bi in tabpagebuflist(i)
|
||||
for bi in tabpagebuflist(curtab)
|
||||
if getbufvar(bi, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
else
|
||||
let group = 'airline_tab'
|
||||
endif
|
||||
let val = '%('
|
||||
if s:show_tab_nr
|
||||
if s:tab_nr_type == 0
|
||||
let val .= ' %{len(tabpagebuflist('.i.'))}'
|
||||
else
|
||||
let val .= (g:airline_symbols.space).i
|
||||
endif
|
||||
endif
|
||||
call b.add_section(group, val.'%'.i.'T %{airline#extensions#tabline#title('.i.')} %)')
|
||||
endfor
|
||||
return group
|
||||
endfunction
|
||||
|
||||
function! b.get_title(i) dict
|
||||
let val = '%('
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
|
||||
let tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
|
||||
let val .= airline#extensions#tabline#tabs#tabnr_formatter(tab_nr_type, a:i)
|
||||
endif
|
||||
|
||||
return val.'%'.a:i.'T %{airline#extensions#tabline#title('.a:i.')} %)'
|
||||
endfunction
|
||||
|
||||
call b.insert_titles(curtab, 1, tabpagenr('$'))
|
||||
|
||||
call b.add_raw('%T')
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
if s:show_close_button
|
||||
call b.add_section('airline_tab', ' %999X'.s:close_symbol.' ')
|
||||
call b.add_section('airline_tabfill', '')
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#show_close_button', 1)
|
||||
call b.add_section('airline_tab_right', ' %999X'.
|
||||
\ get(g:, 'airline#extensions#tabline#close_symbol', 'X').' ')
|
||||
endif
|
||||
if s:show_tab_type
|
||||
call b.add_section('airline_tabtype', ' tabs ')
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#show_splits', 1) == 1
|
||||
let buffers = tabpagebuflist(curtab)
|
||||
for nr in buffers
|
||||
let group = airline#extensions#tabline#group_of_bufnr(buffers, nr) . "_right"
|
||||
call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)')
|
||||
endfor
|
||||
if get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
call airline#extensions#tabline#add_label(b, 'buffers')
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:current_bufnr = curbuf
|
||||
let s:current_tabnr = curtab
|
||||
let s:column_width = &columns
|
||||
let s:current_tabline = b.build()
|
||||
return s:current_tabline
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#tabs#map_keys()
|
||||
if maparg('<Plug>AirlineSelectTab1', 'n') is# ':1tabn<CR>'
|
||||
return
|
||||
endif
|
||||
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
|
||||
|
||||
function! airline#extensions#tabline#tabs#tabnr_formatter(nr, i)
|
||||
let formatter = get(g:, 'airline#extensions#tabline#tabnr_formatter', 'tabnr')
|
||||
return airline#extensions#tabline#formatters#{formatter}#format(a:nr, a:i)
|
||||
endfunction
|
||||
|
||||
397
autoload/airline/extensions/tabline/xtabline.vim
Normal file
397
autoload/airline/extensions/tabline/xtabline.vim
Normal file
@@ -0,0 +1,397 @@
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" xTabline - Reduced version for vim-airline
|
||||
" Copyright (C) 2018 Gianmaria Bajo <mg1979.git@gmail.com>
|
||||
" License: MIT License
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
|
||||
function! airline#extensions#tabline#xtabline#init()
|
||||
|
||||
let s:state = 0
|
||||
|
||||
" initialize mappings
|
||||
call airline#extensions#tabline#xtabline#maps()
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Variables
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
let g:loaded_xtabline = 1
|
||||
let s:most_recent = -1
|
||||
let s:xtabline_filtering = 1
|
||||
|
||||
let t:xtl_excluded = get(g:, 'airline#extensions#tabline#exclude_buffers', [])
|
||||
let t:xtl_accepted = []
|
||||
|
||||
let g:xtabline_include_previews = get(g:, 'xtabline_include_previews', 1)
|
||||
|
||||
let g:xtabline_alt_action = get(g:, 'xtabline_alt_action', "buffer #")
|
||||
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Autocommands
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
augroup plugin-xtabline
|
||||
autocmd!
|
||||
|
||||
autocmd TabNew * call s:Do('new')
|
||||
autocmd TabEnter * call s:Do('enter')
|
||||
autocmd TabLeave * call s:Do('leave')
|
||||
autocmd TabClosed * call s:Do('close')
|
||||
|
||||
autocmd BufEnter * let g:xtabline_changing_buffer = 0
|
||||
autocmd BufAdd,BufDelete,BufWrite * call airline#extensions#tabline#xtabline#filter_buffers()
|
||||
augroup END
|
||||
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Commands
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
com! XTabReopen call airline#extensions#tabline#xtabline#reopen_last_tab()
|
||||
|
||||
endfunction
|
||||
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Mappings
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! airline#extensions#tabline#xtabline#maps()
|
||||
|
||||
if !exists('g:xtabline_disable_keybindings')
|
||||
|
||||
fun! s:mapkeys(keys, plug)
|
||||
if empty(mapcheck(a:keys)) && !hasmapto(a:plug)
|
||||
silent! execute 'nmap <unique> '.a:keys.' '.a:plug
|
||||
endif
|
||||
endfun
|
||||
|
||||
call s:mapkeys('<F5>','<Plug>XTablineToggleTabs')
|
||||
call s:mapkeys('<leader><F5>','<Plug>XTablineToggleFiltering')
|
||||
call s:mapkeys('<BS>','<Plug>XTablineSelectBuffer')
|
||||
call s:mapkeys(']l','<Plug>XTablineNextBuffer')
|
||||
call s:mapkeys('[l','<Plug>XTablinePrevBuffer')
|
||||
call s:mapkeys('<leader>tr','<Plug>XTablineReopen')
|
||||
endif
|
||||
|
||||
nnoremap <unique> <script> <Plug>XTablineToggleTabs <SID>ToggleTabs
|
||||
nnoremap <silent> <SID>ToggleTabs :call airline#extensions#tabline#xtabline#toggle_tabs()<cr>
|
||||
|
||||
nnoremap <unique> <script> <Plug>XTablineToggleFiltering <SID>ToggleFiltering
|
||||
nnoremap <silent> <SID>ToggleFiltering :call airline#extensions#tabline#xtabline#toggle_buffers()<cr>
|
||||
|
||||
nnoremap <unique> <script> <Plug>XTablineSelectBuffer <SID>SelectBuffer
|
||||
nnoremap <silent> <expr> <SID>SelectBuffer g:xtabline_changing_buffer ? "\<C-c>" : ":<C-u>call airline#extensions#tabline#xtabline#select_buffer(v:count)\<cr>"
|
||||
|
||||
nnoremap <unique> <script> <Plug>XTablineNextBuffer <SID>NextBuffer
|
||||
nnoremap <silent> <expr> <SID>NextBuffer airline#extensions#tabline#xtabline#next_buffer(v:count1)
|
||||
|
||||
nnoremap <unique> <script> <Plug>XTablinePrevBuffer <SID>PrevBuffer
|
||||
nnoremap <silent> <expr> <SID>PrevBuffer airline#extensions#tabline#xtabline#prev_buffer(v:count1)
|
||||
|
||||
nnoremap <unique> <script> <Plug>XTablineReopen <SID>ReopenLastTab
|
||||
nnoremap <silent> <SID>ReopenLastTab :XTabReopen<cr>
|
||||
|
||||
if get(g:, 'xtabline_cd_commands', 0)
|
||||
map <unique> <leader>cdc <Plug>XTablineCdCurrent
|
||||
map <unique> <leader>cdd <Plug>XTablineCdDown1
|
||||
map <unique> <leader>cd2 <Plug>XTablineCdDown2
|
||||
map <unique> <leader>cd3 <Plug>XTablineCdDown3
|
||||
map <unique> <leader>cdh <Plug>XTablineCdHome
|
||||
nnoremap <unique> <script> <Plug>XTablineCdCurrent :cd %:p:h<cr>:call airline#util#doautocmd('BufAdd')<cr>:pwd<cr>
|
||||
nnoremap <unique> <script> <Plug>XTablineCdDown1 :cd %:p:h:h<cr>:call airline#util#doautocmd('BufAdd')<cr>:pwd<cr>
|
||||
nnoremap <unique> <script> <Plug>XTablineCdDown2 :cd %:p:h:h:h<cr>:call airline#util#doautocmd('BufAdd')<cr>:pwd<cr>
|
||||
nnoremap <unique> <script> <Plug>XTablineCdDown3 :cd %:p:h:h:h:h<cr>:call airline#util#doautocmd('BufAdd')<cr>:pwd<cr>
|
||||
nnoremap <unique> <script> <Plug>XTablineCdHome :cd ~<cr>:call airline#util#doautocmd('BufAdd')<cr>:pwd<cr>
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Commands functions
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! airline#extensions#tabline#xtabline#toggle_tabs()
|
||||
"""Toggle between tabs/buffers tabline."""
|
||||
|
||||
if tabpagenr("$") == 1 | call airline#util#warning("There is only one tab.") | return | endif
|
||||
|
||||
if g:airline#extensions#tabline#show_tabs
|
||||
let g:airline#extensions#tabline#show_tabs = 0
|
||||
call airline#util#warning("Showing buffers")
|
||||
else
|
||||
let g:airline#extensions#tabline#show_tabs = 1
|
||||
call airline#util#warning("Showing tabs")
|
||||
endif
|
||||
|
||||
doautocmd BufAdd
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! airline#extensions#tabline#xtabline#toggle_buffers()
|
||||
"""Toggle buffer filtering in the tabline."""
|
||||
|
||||
if s:xtabline_filtering
|
||||
let s:xtabline_filtering = 0
|
||||
let g:airline#extensions#tabline#exclude_buffers = []
|
||||
call airline#util#warning("Buffer filtering turned off")
|
||||
doautocmd BufAdd
|
||||
else
|
||||
let s:xtabline_filtering = 1
|
||||
call airline#extensions#tabline#xtabline#filter_buffers()
|
||||
call airline#util#warning("Buffer filtering turned on")
|
||||
doautocmd BufAdd
|
||||
endif
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! airline#extensions#tabline#xtabline#reopen_last_tab()
|
||||
"""Reopen the last closed tab."""
|
||||
|
||||
if !exists('s:most_recently_closed_tab')
|
||||
call airline#util#warning("No recent tabs.")
|
||||
return
|
||||
endif
|
||||
|
||||
let tab = s:most_recently_closed_tab
|
||||
tabnew
|
||||
let empty = bufnr("%")
|
||||
let t:cwd = tab['cwd']
|
||||
cd `=t:cwd`
|
||||
let t:name = tab['name']
|
||||
for buf in tab['buffers'] | execute "badd ".buf | endfor
|
||||
execute "edit ".tab['buffers'][0]
|
||||
execute "bdelete ".empty
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! airline#extensions#tabline#xtabline#filter_buffers()
|
||||
"""Filter buffers so that only the ones within the tab's cwd will show up.
|
||||
|
||||
" 'accepted' is a list of buffer numbers, for quick access.
|
||||
" 'excluded' is a list of buffer numbers, it will be used by Airline to hide buffers.
|
||||
|
||||
if !s:xtabline_filtering | return | endif
|
||||
|
||||
let g:airline#extensions#tabline#exclude_buffers = []
|
||||
let t:xtl_excluded = g:airline#extensions#tabline#exclude_buffers
|
||||
let t:xtl_accepted = [] | let accepted = t:xtl_accepted
|
||||
let previews = g:xtabline_include_previews
|
||||
|
||||
" bufnr(0) is the alternate buffer
|
||||
for buf in range(1, bufnr("$"))
|
||||
|
||||
if !buflisted(buf) | continue | endif
|
||||
|
||||
" get the path
|
||||
let path = expand("#".buf.":p")
|
||||
|
||||
" confront with the cwd
|
||||
if !previews && path =~ "^".getcwd()
|
||||
call add(accepted, buf)
|
||||
elseif previews && path =~ getcwd()
|
||||
call add(accepted, buf)
|
||||
else
|
||||
call add(t:xtl_excluded, buf)
|
||||
endif
|
||||
endfor
|
||||
|
||||
call s:RefreshTabline()
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! airline#extensions#tabline#xtabline#next_buffer(nr)
|
||||
"""Switch to next visible buffer."""
|
||||
|
||||
if ( s:NotEnoughBuffers() || !s:xtabline_filtering ) | return | endif
|
||||
let accepted = t:xtl_accepted
|
||||
|
||||
let ix = index(accepted, bufnr("%"))
|
||||
let target = ix + a:nr
|
||||
let total = len(accepted)
|
||||
|
||||
if ix == -1
|
||||
" not in index, go back to most recent or back to first
|
||||
if s:most_recent == -1 || s:most_recent >= total
|
||||
let s:most_recent = 0
|
||||
endif
|
||||
|
||||
elseif target >= total
|
||||
" over last buffer
|
||||
while target >= total | let target -= total | endwhile
|
||||
let s:most_recent = target
|
||||
|
||||
else
|
||||
let s:most_recent = target
|
||||
endif
|
||||
|
||||
return ":buffer " . accepted[s:most_recent] . "\<cr>"
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! airline#extensions#tabline#xtabline#prev_buffer(nr)
|
||||
"""Switch to previous visible buffer."""
|
||||
|
||||
if ( s:NotEnoughBuffers() || !s:xtabline_filtering ) | return | endif
|
||||
let accepted = t:xtl_accepted
|
||||
|
||||
let ix = index(accepted, bufnr("%"))
|
||||
let target = ix - a:nr
|
||||
let total = len(accepted)
|
||||
|
||||
if ix == -1
|
||||
" not in index, go back to most recent or back to first
|
||||
if s:most_recent == -1 || s:most_recent >= total
|
||||
let s:most_recent = 0
|
||||
endif
|
||||
|
||||
elseif target < 0
|
||||
" before first buffer
|
||||
while target < 0 | let target += total | endwhile
|
||||
let s:most_recent = target
|
||||
|
||||
else
|
||||
let s:most_recent = target
|
||||
endif
|
||||
|
||||
return ":buffer " . accepted[s:most_recent] . "\<cr>"
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! airline#extensions#tabline#xtabline#select_buffer(nr)
|
||||
"""Switch to visible buffer in the tabline with [count]."""
|
||||
|
||||
if ( a:nr == 0 || !s:xtabline_filtering ) | execute g:xtabline_alt_action | return | endif
|
||||
let accepted = t:xtl_accepted
|
||||
|
||||
if (a:nr > len(accepted)) || s:NotEnoughBuffers() || accepted[a:nr - 1] == bufnr("%")
|
||||
return
|
||||
else
|
||||
let g:xtabline_changing_buffer = 1
|
||||
execute "buffer ".accepted[a:nr - 1]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! s:TabBuffers()
|
||||
"""Return a list of buffers names for this tab."""
|
||||
|
||||
return map(copy(t:xtl_accepted), 'bufname(v:val)')
|
||||
endfunction
|
||||
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Helper functions
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! s:NotEnoughBuffers()
|
||||
"""Just return if there aren't enough buffers."""
|
||||
|
||||
if len(t:xtl_accepted) < 2
|
||||
if index(t:xtl_accepted, bufnr("%")) == -1
|
||||
return
|
||||
elseif !len(t:xtl_accepted)
|
||||
call airline#util#warning("No available buffers for this tab.")
|
||||
else
|
||||
call airline#util#warning("No other available buffers for this tab.")
|
||||
endif
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:RefreshTabline()
|
||||
call airline#extensions#tabline#buflist#invalidate()
|
||||
endfunction
|
||||
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" TabPageCd
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" tabpagecd - Turn :cd into :tabpagecd, to use one tab page per project
|
||||
" expanded version by mg979
|
||||
" Copyright (C) 2012-2013 Kana Natsuno <http://whileimautomaton.net/>
|
||||
" Copyright (C) 2018 Gianmaria Bajo <mg1979.git@gmail.com>
|
||||
" License: MIT License
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! s:InitCwds()
|
||||
if !exists('g:xtab_cwds') | let g:xtab_cwds = [] | endif
|
||||
|
||||
while len(g:xtab_cwds) < tabpagenr("$")
|
||||
call add(g:xtab_cwds, getcwd())
|
||||
endwhile
|
||||
let s:state = 1
|
||||
let t:cwd = getcwd()
|
||||
let s:last_tab = 0
|
||||
call airline#extensions#tabline#xtabline#filter_buffers()
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! airline#extensions#tabline#xtabline#update_obsession()
|
||||
let string = 'let g:xtab_cwds = '.string(g:xtab_cwds).' | call airline#extensions#tabline#xtabline#update_obsession()'
|
||||
if !exists('g:obsession_append')
|
||||
let g:obsession_append = [string]
|
||||
else
|
||||
call filter(g:obsession_append, 'v:val !~# "^let g:xtab_cwds"')
|
||||
call add(g:obsession_append, string)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
function! s:Do(action)
|
||||
let arg = a:action
|
||||
if !s:state | call s:InitCwds() | return | endif
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
if arg == 'new'
|
||||
|
||||
call insert(g:xtab_cwds, getcwd(), tabpagenr()-1)
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
elseif arg == 'enter'
|
||||
|
||||
let t:cwd =g:xtab_cwds[tabpagenr()-1]
|
||||
|
||||
cd `=t:cwd`
|
||||
call airline#extensions#tabline#xtabline#filter_buffers()
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
elseif arg == 'leave'
|
||||
|
||||
let t:cwd = getcwd()
|
||||
let g:xtab_cwds[tabpagenr()-1] = t:cwd
|
||||
let s:last_tab = tabpagenr() - 1
|
||||
|
||||
if !exists('t:name') | let t:name = t:cwd | endif
|
||||
let s:most_recent_tab = {'cwd': t:cwd, 'name': t:name, 'buffers': s:TabBuffers()}
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
elseif arg == 'close'
|
||||
|
||||
let s:most_recently_closed_tab = copy(s:most_recent_tab)
|
||||
call remove(g:xtab_cwds, s:last_tab)
|
||||
endif
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
call airline#extensions#tabline#xtabline#update_obsession()
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
@@ -1,12 +1,15 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':TagbarToggle')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:flags = get(g:, 'airline#extensions#tagbar#flags', '')
|
||||
let s:spc = g:airline_symbols.space
|
||||
let s:init=0
|
||||
|
||||
" Arguments: current, sort, fname
|
||||
function! airline#extensions#tagbar#get_status(...)
|
||||
@@ -27,7 +30,18 @@ let s:airline_tagbar_last_lookup_time = 0
|
||||
let s:airline_tagbar_last_lookup_val = ''
|
||||
function! airline#extensions#tagbar#currenttag()
|
||||
if get(w:, 'airline_active', 0)
|
||||
if s:airline_tagbar_last_lookup_time != localtime()
|
||||
if !s:init
|
||||
try
|
||||
" try to load the plugin, if filetypes are disabled,
|
||||
" this will cause an error, so try only once
|
||||
let a=tagbar#currenttag('%', '', '')
|
||||
catch
|
||||
endtry
|
||||
unlet! a
|
||||
let s:init=1
|
||||
endif
|
||||
" function tagbar#currenttag does not exist, if filetype is not enabled
|
||||
if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag")
|
||||
let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags)
|
||||
let s:airline_tagbar_last_lookup_time = localtime()
|
||||
endif
|
||||
@@ -42,4 +56,3 @@ function! airline#extensions#tagbar#init(ext)
|
||||
|
||||
call airline#parts#define_function('tagbar', 'airline#extensions#tagbar#currenttag')
|
||||
endfunction
|
||||
|
||||
|
||||
43
autoload/airline/extensions/term.vim
Normal file
43
autoload/airline/extensions/term.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#extensions#term#apply(...)
|
||||
if &buftype == 'terminal'
|
||||
let spc = g:airline_symbols.space
|
||||
|
||||
let name=get(g:airline_mode_map, 't', 't')
|
||||
call a:1.add_section('airline_a', spc.name.spc)
|
||||
call a:1.add_section('airline_b', '')
|
||||
call a:1.add_section('airline_term', spc.s:termname())
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_y', '')
|
||||
call a:1.add_section('airline_z', spc.airline#section#create_right(['linenr', 'maxlinenr']))
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#term#inactive_apply(...)
|
||||
if getbufvar(a:2.bufnr, '&buftype') == 'terminal'
|
||||
let spc = g:airline_symbols.space
|
||||
call a:1.add_section('airline_a', spc.'TERMINAL'.spc)
|
||||
call a:1.add_section('airline_b', spc.'%f')
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:termname()
|
||||
let bufname = bufname('%')
|
||||
if has('nvim')
|
||||
return matchstr(bufname, 'term.*:\zs.*')
|
||||
else
|
||||
" get rid of leading '!'
|
||||
return bufname[1:]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#term#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#term#apply')
|
||||
call a:ext.add_inactive_statusline_func('airline#extensions#term#inactive_apply')
|
||||
endfunction
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':Tmuxline')
|
||||
finish
|
||||
endif
|
||||
@@ -23,4 +25,3 @@ function! airline#extensions#tmuxline#set_tmux_colors(palette)
|
||||
call tmuxline#api#snapshot(s:tmuxline_snapshot_file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':UndotreeToggle')
|
||||
finish
|
||||
endif
|
||||
@@ -24,4 +26,3 @@ endfunction
|
||||
function! airline#extensions#undotree#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#undotree#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
24
autoload/airline/extensions/unicode.vim
Normal file
24
autoload/airline/extensions/unicode.vim
Normal file
@@ -0,0 +1,24 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
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,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_unite', 0)
|
||||
finish
|
||||
endif
|
||||
@@ -20,4 +22,3 @@ function! airline#extensions#unite#init(ext)
|
||||
let g:unite_force_overwrite_statusline = 0
|
||||
call a:ext.add_statusline_func('airline#extensions#unite#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
34
autoload/airline/extensions/vimagit.vim
Normal file
34
autoload/airline/extensions/vimagit.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
" MIT License. Copyright (c) 2016-2018 Jerome Reybert et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" This plugin replace the whole section_a when in vimagit buffer
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_magit', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#vimagit#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#vimagit#apply')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimagit#get_mode()
|
||||
if ( exists("*magit#get_current_mode") )
|
||||
return magit#get_current_mode()
|
||||
else
|
||||
if ( b:magit_current_commit_mode == '' )
|
||||
return "STAGING"
|
||||
elseif ( b:magit_current_commit_mode == 'CC' )
|
||||
return "COMMIT"
|
||||
elseif ( b:magit_current_commit_mode == 'CA' )
|
||||
return "AMEND"
|
||||
else
|
||||
return "???"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimagit#apply(...)
|
||||
if ( &filetype == 'magit' )
|
||||
let w:airline_section_a = '%{airline#extensions#vimagit#get_mode()}'
|
||||
endif
|
||||
endfunction
|
||||
84
autoload/airline/extensions/vimtex.vim
Normal file
84
autoload/airline/extensions/vimtex.vim
Normal file
@@ -0,0 +1,84 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" This plugin replace the whole section_a when in vimagit buffer
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! s:SetDefault(var, val)
|
||||
if !exists(a:var)
|
||||
execute 'let ' . a:var . '=' . string(a:val)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Left and right delimiters (added only when status string is not empty)
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#left', "{")
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#right', "}")
|
||||
|
||||
" The current tex file is the main project file
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#main', "" )
|
||||
"
|
||||
" The current tex file is a subfile of the project
|
||||
" and the compilation is set for the main file
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#sub_main', "m")
|
||||
"
|
||||
" The current tex file is a subfile of the project
|
||||
" and the compilation is set for this subfile
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#sub_local', "l")
|
||||
"
|
||||
" Compilation is running and continuous compilation is off
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#compiled', "c₁")
|
||||
|
||||
" Compilation is running and continuous compilation is on
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#continuous', "c")
|
||||
|
||||
" Viewer is opened
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#viewer', "v")
|
||||
|
||||
function! airline#extensions#vimtex#init(ext)
|
||||
call airline#parts#define_raw('vimtex', '%{airline#extensions#vimtex#get_scope()}')
|
||||
call a:ext.add_statusline_func('airline#extensions#vimtex#apply')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimtex#apply(...)
|
||||
if exists("b:vimtex")
|
||||
let w:airline_section_x = get(w:, 'airline_section_x', g:airline_section_x)
|
||||
let w:airline_section_x.=s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#vimtex#get_scope()}'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimtex#get_scope()
|
||||
let l:status = ''
|
||||
|
||||
let vt_local = get(b:, 'vimtex_local', {})
|
||||
if empty(vt_local)
|
||||
let l:status .= g:airline#extensions#vimtex#main
|
||||
else
|
||||
if get(vt_local, 'active')
|
||||
let l:status .= g:airline#extensions#vimtex#sub_local
|
||||
else
|
||||
let l:status .= g:airline#extensions#vimtex#sub_main
|
||||
endif
|
||||
endif
|
||||
|
||||
if get(get(get(b:, 'vimtex', {}), 'viewer', {}), 'xwin_id')
|
||||
let l:status .= g:airline#extensions#vimtex#viewer
|
||||
endif
|
||||
|
||||
let l:compiler = get(get(b:, 'vimtex', {}), 'compiler', {})
|
||||
if !empty(l:compiler)
|
||||
if has_key(l:compiler, 'is_running') && b:vimtex.compiler.is_running()
|
||||
if get(l:compiler, 'continuous')
|
||||
let l:status .= g:airline#extensions#vimtex#continuous
|
||||
else
|
||||
let l:status .= g:airline#extensions#vimtex#compiled
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if !empty(l:status)
|
||||
let l:status = g:airline#extensions#vimtex#left . l:status . g:airline#extensions#vimtex#right
|
||||
endif
|
||||
return l:status
|
||||
endfunction
|
||||
@@ -1,9 +1,7 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !isdirectory($VIRTUAL_ENV)
|
||||
finish
|
||||
endif
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
@@ -12,14 +10,22 @@ function! airline#extensions#virtualenv#init(ext)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#virtualenv#apply(...)
|
||||
if &filetype =~ "python"
|
||||
if &filetype =~# "python"
|
||||
if get(g:, 'virtualenv_loaded', 0)
|
||||
let statusline = virtualenv#statusline()
|
||||
else
|
||||
let statusline = fnamemodify($VIRTUAL_ENV, ':t')
|
||||
endif
|
||||
call airline#extensions#append_to_section('x',
|
||||
\ s:spc.g:airline_right_alt_sep.s:spc.statusline)
|
||||
if !empty(statusline)
|
||||
call airline#extensions#append_to_section('x',
|
||||
\ s:spc.g:airline_right_alt_sep.s:spc.statusline)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#virtualenv#update()
|
||||
if &filetype =~# "python"
|
||||
call airline#extensions#virtualenv#apply()
|
||||
call airline#update_statusline()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,72 +1,124 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" 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
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
|
||||
let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)
|
||||
let s:default_checks = ['indent', 'trailing']
|
||||
|
||||
let s: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:indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
|
||||
|
||||
let s:max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
|
||||
let s:default_checks = ['indent', 'trailing', 'mixed-indent-file']
|
||||
|
||||
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
|
||||
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file']}
|
||||
|
||||
function! s:check_mixed_indent()
|
||||
if s:indent_algo == 1
|
||||
let indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
|
||||
if 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 then tabstop value
|
||||
" 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 indent_algo == 2
|
||||
return search('\v(^\t* +\t\s*\S)', 'nw')
|
||||
else
|
||||
return search('\v(^\t+ +)|(^ +\t+)', 'nw')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#check()
|
||||
if &readonly || !&modifiable || !s:enabled || line('$') > s:max_lines
|
||||
function! s:check_mixed_indent_file()
|
||||
let c_like_langs = get(g:, 'airline#extensions#c_like_langs',
|
||||
\ [ 'arduino', 'c', 'cpp', 'cuda', 'go', 'javascript', 'ld', 'php' ])
|
||||
if index(c_like_langs, &ft) > -1
|
||||
" for C-like languages: 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()
|
||||
let max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
|
||||
if &readonly || !&modifiable || !s:enabled || line('$') > max_lines
|
||||
\ || get(b:, 'airline_whitespace_disabled', 0)
|
||||
return ''
|
||||
endif
|
||||
let skip_check_ft = extend(s:skip_check_ft,
|
||||
\ get(g:, 'airline#extensions#whitespace#skip_indent_check_ft', {}), 'force')
|
||||
|
||||
if !exists('b:airline_whitespace_check')
|
||||
let b:airline_whitespace_check = ''
|
||||
let checks = get(g:, 'airline#extensions#whitespace#checks', s:default_checks)
|
||||
let checks = get(b:, 'airline_whitespace_checks', get(g:, 'airline#extensions#whitespace#checks', s:default_checks))
|
||||
|
||||
let trailing = 0
|
||||
if index(checks, 'trailing') > -1
|
||||
let trailing = search('\s$', 'nw')
|
||||
let check = 'trailing'
|
||||
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
|
||||
try
|
||||
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
|
||||
let trailing = search(regexp, 'nw')
|
||||
catch
|
||||
call airline#util#warning(printf('Whitespace: error occurred evaluating "%s"', regexp))
|
||||
echomsg v:exception
|
||||
return ''
|
||||
endtry
|
||||
endif
|
||||
|
||||
let mixed = 0
|
||||
if index(checks, 'indent') > -1
|
||||
let check = 'indent'
|
||||
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
|
||||
let mixed = s:check_mixed_indent()
|
||||
endif
|
||||
|
||||
if trailing != 0 || mixed != 0
|
||||
let mixed_file = ''
|
||||
let check = 'mixed-indent-file'
|
||||
if index(checks, check) > -1 && index(get(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 strlen(s:symbol) > 0
|
||||
let space = (g:airline_symbols.space)
|
||||
else
|
||||
let space = ''
|
||||
endif
|
||||
|
||||
if s:show_message
|
||||
if trailing != 0
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:trailing_format, trailing)
|
||||
let trailing_fmt = get(g:, 'airline#extensions#whitespace#trailing_format', '[%s]trailing')
|
||||
let b:airline_whitespace_check .= space.printf(trailing_fmt, trailing)
|
||||
endif
|
||||
if mixed != 0
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_format, mixed)
|
||||
let mixed_indent_fmt = get(g:, 'airline#extensions#whitespace#mixed_indent_format', '[%s]mixed-indent')
|
||||
let b:airline_whitespace_check .= space.printf(mixed_indent_fmt, mixed)
|
||||
endif
|
||||
if long != 0
|
||||
let long_fmt = get(g:, 'airline#extensions#whitespace#long_format', '[%s]long')
|
||||
let b:airline_whitespace_check .= space.printf(long_fmt, long)
|
||||
endif
|
||||
if !empty(mixed_file)
|
||||
let mixed_indent_file_fmt = get(g:, 'airline#extensions#whitespace#mixed_indent_file_format', '[%s]mix-indent-file')
|
||||
let b:airline_whitespace_check .= space.printf(mixed_indent_file_fmt, mixed_file)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return b:airline_whitespace_check
|
||||
return airline#util#shorten(b:airline_whitespace_check, 120, 9)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#toggle()
|
||||
@@ -88,7 +140,13 @@ function! airline#extensions#whitespace#toggle()
|
||||
call airline#update_statusline()
|
||||
endif
|
||||
endif
|
||||
echo 'Whitespace checking: '.(s:enabled ? 'Enabled' : 'Disabled')
|
||||
call airline#util#warning(printf('Whitespace checking: %s',(s:enabled ? 'Enabled' : 'Disabled')))
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#disable()
|
||||
if s:enabled
|
||||
call airline#extensions#whitespace#toggle()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#init(...)
|
||||
@@ -97,7 +155,17 @@ function! airline#extensions#whitespace#init(...)
|
||||
unlet! b:airline_whitespace_check
|
||||
augroup airline_whitespace
|
||||
autocmd!
|
||||
autocmd CursorHold,BufWritePost * unlet! b:airline_whitespace_check
|
||||
autocmd CursorHold,BufWritePost * call <sid>ws_refresh()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! s:ws_refresh()
|
||||
if get(b:, 'airline_ws_changedtick', 0) == b:changedtick
|
||||
return
|
||||
endif
|
||||
unlet! b:airline_whitespace_check
|
||||
if get(g:, 'airline_skip_empty_sections', 0)
|
||||
exe ':AirlineRefresh'
|
||||
endif
|
||||
let b:airline_ws_changedtick = b:changedtick
|
||||
endfunction
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('g:loaded_windowswap')
|
||||
finish
|
||||
endif
|
||||
@@ -15,9 +18,12 @@ function! airline#extensions#windowswap#init(ext)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#windowswap#get_status()
|
||||
if WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr()
|
||||
" use new tab-aware api if WS is up to date
|
||||
let s:mark = exists('*WindowSwap#IsCurrentWindowMarked') ?
|
||||
\WindowSwap#IsCurrentWindowMarked() :
|
||||
\(WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr())
|
||||
if s:mark
|
||||
return g:airline#extensions#windowswap#indicator_text.s:spc
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
||||
117
autoload/airline/extensions/wordcount.vim
Normal file
117
autoload/airline/extensions/wordcount.vim
Normal file
@@ -0,0 +1,117 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2 fdm=marker
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" get wordcount {{{1
|
||||
if exists('*wordcount')
|
||||
function! s:get_wordcount(visual_mode_active)
|
||||
let query = a:visual_mode_active ? 'visual_words' : 'words'
|
||||
return get(wordcount(), query, 0)
|
||||
endfunction
|
||||
else " Pull wordcount from the g_ctrl-g stats
|
||||
function! s:get_wordcount(visual_mode_active)
|
||||
let pattern = a:visual_mode_active
|
||||
\ ? '^.\D*\d\+\D\+\d\+\D\+\zs\d\+'
|
||||
\ : '^.\D*\%(\d\+\D\+\)\{5}\zs\d\+'
|
||||
|
||||
let save_status = v:statusmsg
|
||||
if !a:visual_mode_active && col('.') == col('$')
|
||||
let save_pos = getpos('.')
|
||||
execute "silent normal! g\<c-g>"
|
||||
call setpos('.', save_pos)
|
||||
else
|
||||
execute "silent normal! g\<c-g>"
|
||||
endif
|
||||
let stats = v:statusmsg
|
||||
let v:statusmsg = save_status
|
||||
|
||||
return str2nr(matchstr(stats, pattern))
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" format {{{1
|
||||
let s:formatter = get(g:, 'airline#extensions#wordcount#formatter', 'default')
|
||||
|
||||
" wrapper function for compatibility; redefined below for old-style formatters
|
||||
function! s:format_wordcount(wordcount)
|
||||
return airline#extensions#wordcount#formatters#{s:formatter}#to_string(a:wordcount)
|
||||
endfunction
|
||||
|
||||
" check user-defined formatter exists with appropriate functions, otherwise
|
||||
" fall back to default
|
||||
if s:formatter !=# 'default'
|
||||
execute 'runtime! autoload/airline/extensions/wordcount/formatters/'.s:formatter
|
||||
if !exists('*airline#extensions#wordcount#formatters#{s:formatter}#to_string')
|
||||
if !exists('*airline#extensions#wordcount#formatters#{s:formatter}#format')
|
||||
let s:formatter = 'default'
|
||||
else
|
||||
" redefine for backwords compatibility
|
||||
function! s:format_wordcount(_)
|
||||
if mode() ==? 'v'
|
||||
return b:airline_wordcount
|
||||
else
|
||||
return airline#extensions#wordcount#formatters#{s:formatter}#format()
|
||||
endif
|
||||
endfunction
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" update {{{1
|
||||
let s:wordcount_cache = 0 " cache wordcount for performance when force_update=0
|
||||
function! s:update_wordcount(force_update)
|
||||
let wordcount = s:get_wordcount(0)
|
||||
if wordcount != s:wordcount_cache || a:force_update
|
||||
let s:wordcount_cache = wordcount
|
||||
let b:airline_wordcount = s:format_wordcount(wordcount)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:visual_active = 0 " Boolean: for when to get visual wordcount
|
||||
function airline#extensions#wordcount#get()
|
||||
if s:visual_active
|
||||
return s:format_wordcount(s:get_wordcount(1))
|
||||
else
|
||||
if get(b:, 'airline_changedtick', 0) != b:changedtick
|
||||
call s:update_wordcount(0)
|
||||
let b:airline_changedtick = b:changedtick
|
||||
endif
|
||||
return get(b:, 'airline_wordcount', '')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" airline functions {{{1
|
||||
" default filetypes:
|
||||
let s:filetypes = ['help', 'markdown', 'rst', 'org', 'text', 'asciidoc', 'tex', 'mail']
|
||||
function! airline#extensions#wordcount#apply(...)
|
||||
let filetypes = get(g:, 'airline#extensions#wordcount#filetypes', s:filetypes)
|
||||
|
||||
" Check if filetype needs testing
|
||||
if did_filetype() || filetypes isnot s:filetypes
|
||||
let s:filetypes = filetypes
|
||||
|
||||
" Select test based on type of "filetypes": new=list, old=string
|
||||
if type(filetypes) == get(v:, 't_list', type([]))
|
||||
\ ? index(filetypes, &filetype) > -1 || index(filetypes, 'all') > -1
|
||||
\ : match(&filetype, filetypes) > -1
|
||||
let b:airline_changedtick = -1
|
||||
call s:update_wordcount(1) " force update: ensures initial worcount exists
|
||||
elseif exists('b:airline_wordcount') " cleanup when filetype is removed
|
||||
unlet b:airline_wordcount
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists('b:airline_wordcount')
|
||||
call airline#extensions#prepend_to_section(
|
||||
\ 'z', '%{airline#extensions#wordcount#get()}')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#wordcount#init(ext)
|
||||
augroup airline_wordcount
|
||||
autocmd! User AirlineModeChanged nested
|
||||
\ let s:visual_active = (mode() ==? 'v' || mode() ==? 's')
|
||||
augroup END
|
||||
call a:ext.add_statusline_func('airline#extensions#wordcount#apply')
|
||||
endfunction
|
||||
39
autoload/airline/extensions/wordcount/formatters/default.vim
Normal file
39
autoload/airline/extensions/wordcount/formatters/default.vim
Normal file
@@ -0,0 +1,39 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#extensions#wordcount#formatters#default#update_fmt(...)
|
||||
let s:fmt = get(g:, 'airline#extensions#wordcount#formatter#default#fmt', '%s words')
|
||||
let s:fmt_short = get(g:, 'airline#extensions#wordcount#formatter#default#fmt_short', s:fmt == '%s words' ? '%sW' : s:fmt)
|
||||
endfunction
|
||||
|
||||
" Reload format when statusline is rebuilt
|
||||
call airline#extensions#wordcount#formatters#default#update_fmt()
|
||||
if index(g:airline_statusline_funcrefs, function('airline#extensions#wordcount#formatters#default#update_fmt')) == -1
|
||||
" only add it, if not already done
|
||||
call airline#add_statusline_funcref(function('airline#extensions#wordcount#formatters#default#update_fmt'))
|
||||
endif
|
||||
|
||||
if match(get(v:, 'lang', ''), '\v\cC|en') > -1
|
||||
let s:decimal_group = ','
|
||||
elseif match(get(v:, 'lang', ''), '\v\cde|dk|fr|pt') > -1
|
||||
let s:decimal_group = '.'
|
||||
else
|
||||
let s:decimal_group = ''
|
||||
endif
|
||||
|
||||
function! airline#extensions#wordcount#formatters#default#to_string(wordcount)
|
||||
if winwidth(0) >= 80
|
||||
if a:wordcount > 999
|
||||
" Format number according to locale, e.g. German: 1.245 or English: 1,245
|
||||
let wordcount = substitute(a:wordcount, '\d\@<=\(\(\d\{3\}\)\+\)$', s:decimal_group.'&', 'g')
|
||||
else
|
||||
let wordcount = a:wordcount
|
||||
endif
|
||||
let str = printf(s:fmt, wordcount)
|
||||
else
|
||||
let str = printf(s:fmt_short, a:wordcount)
|
||||
endif
|
||||
return str . g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
|
||||
endfunction
|
||||
24
autoload/airline/extensions/xkblayout.vim
Normal file
24
autoload/airline/extensions/xkblayout.vim
Normal file
@@ -0,0 +1,24 @@
|
||||
" MIT License. Copyright (c) 2017-2018 YoungHoon Rhiu et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('g:XkbSwitchLib')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#xkblayout#status()
|
||||
let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '')
|
||||
let keyboard_layout = split(keyboard_layout, '\.')[-1]
|
||||
let short_codes = get(g:, 'airline#extensions#xkblayout#short_codes', {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'})
|
||||
|
||||
if has_key(short_codes, keyboard_layout)
|
||||
let keyboard_layout = short_codes[keyboard_layout]
|
||||
endif
|
||||
|
||||
return keyboard_layout
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#xkblayout#init(ext)
|
||||
call airline#parts#define_function('xkblayout', 'airline#extensions#xkblayout#status')
|
||||
endfunction
|
||||
37
autoload/airline/extensions/ycm.vim
Normal file
37
autoload/airline/extensions/ycm.vim
Normal file
@@ -0,0 +1,37 @@
|
||||
" MIT License. Copyright (c) 2015-2018 Evgeny Firsov et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
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') && exists("*youcompleteme#GetErrorCount")
|
||||
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') && exists("*youcompleteme#GetWarningCount")
|
||||
let cnt = youcompleteme#GetWarningCount()
|
||||
|
||||
if cnt != 0
|
||||
return s:warning_symbol.cnt.s:spc
|
||||
endif
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
@@ -1,52 +1,89 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:is_win32term = (has('win32') || has('win64')) &&
|
||||
\ !has('gui_running') &&
|
||||
\ (empty($CONEMUBUILD) || &term !=? 'xterm') &&
|
||||
\ !(exists("+termguicolors") && &termguicolors)
|
||||
|
||||
let s:separators = {}
|
||||
let s:accents = {}
|
||||
let s:hl_groups = {}
|
||||
|
||||
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:group_not_done(list, name)
|
||||
if index(a:list, a:name) == -1
|
||||
call add(a:list, a:name)
|
||||
return 1
|
||||
else
|
||||
if &vbs
|
||||
echomsg printf("airline: group: %s already done, skipping", a:name)
|
||||
endif
|
||||
return 0
|
||||
endif
|
||||
endfu
|
||||
|
||||
function! s:get_syn(group, what)
|
||||
" need to pass in mode, known to break on 7.3.547
|
||||
let mode = has('gui_running') || (has("termtruecolor") && &guicolors == 1) ? 'gui' : 'cterm'
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode)
|
||||
if empty(color) || color == -1
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode)
|
||||
if !exists("g:airline_gui_mode")
|
||||
let g:airline_gui_mode = airline#init#gui_mode()
|
||||
endif
|
||||
let color = ''
|
||||
if hlexists(a:group)
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode)
|
||||
endif
|
||||
if empty(color) || color == -1
|
||||
if has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
|
||||
else
|
||||
let color = a:what ==# 'fg' ? 0 : 1
|
||||
" should always exists
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode)
|
||||
" however, just in case
|
||||
if empty(color) || color == -1
|
||||
let color = 'NONE'
|
||||
endif
|
||||
endif
|
||||
return color
|
||||
endfunction
|
||||
|
||||
function! s:get_array(fg, bg, opts)
|
||||
let fg = a:fg
|
||||
let bg = a:bg
|
||||
return has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
\ ? [ fg, bg, '', '', join(a:opts, ',') ]
|
||||
\ : [ '', '', fg, bg, join(a:opts, ',') ]
|
||||
let opts=empty(a:opts) ? '' : join(a:opts, ',')
|
||||
return g:airline_gui_mode ==# 'gui'
|
||||
\ ? [ a:fg, a:bg, '', '', opts ]
|
||||
\ : [ '', '', a:fg, a:bg, opts ]
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#reset_hlcache()
|
||||
let s:hl_groups = {}
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#get_highlight(group, ...)
|
||||
let fg = s:get_syn(a:group, 'fg')
|
||||
let bg = s:get_syn(a:group, 'bg')
|
||||
let reverse = has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
\ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui')
|
||||
\ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')
|
||||
\|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
|
||||
return reverse ? s:get_array(bg, fg, a:000) : s:get_array(fg, bg, a:000)
|
||||
let reverse = get(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')
|
||||
if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group)
|
||||
let res = s:hl_groups[a:group]
|
||||
return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res
|
||||
else
|
||||
let fg = s:get_syn(a:group, 'fg')
|
||||
let bg = s:get_syn(a:group, 'bg')
|
||||
let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold')
|
||||
let opts = a:000
|
||||
if bold
|
||||
let opts = ['bold']
|
||||
endif
|
||||
let res = reverse ? s:get_array(bg, fg, opts) : s:get_array(fg, bg, opts)
|
||||
endif
|
||||
let s:hl_groups[a:group] = res
|
||||
return res
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#get_highlight2(fg, bg, ...)
|
||||
@@ -55,27 +92,107 @@ function! airline#highlighter#get_highlight2(fg, bg, ...)
|
||||
return s:get_array(fg, bg, a:000)
|
||||
endfunction
|
||||
|
||||
function! s:hl_group_exists(group)
|
||||
if !hlexists(a:group)
|
||||
return 0
|
||||
elseif empty(synIDattr(hlID(a:group), 'fg'))
|
||||
return 0
|
||||
endif
|
||||
return 1
|
||||
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 old_hi = airline#highlighter#get_highlight(a:group)
|
||||
if len(colors) == 4
|
||||
call add(colors, '')
|
||||
endif
|
||||
if g:airline_gui_mode ==# 'gui'
|
||||
let new_hi = [colors[0], colors[1], '', '', colors[4]]
|
||||
else
|
||||
let new_hi = ['', '', printf("%s", colors[2]), printf("%s", colors[3]), colors[4]]
|
||||
endif
|
||||
let colors = s:CheckDefined(colors)
|
||||
if old_hi != new_hi || !s:hl_group_exists(a:group)
|
||||
let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors))
|
||||
exe cmd
|
||||
if has_key(s:hl_groups, a:group)
|
||||
let s:hl_groups[a:group] = colors
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:CheckDefined(colors)
|
||||
" Checks, whether the definition of the colors is valid and is not empty or NONE
|
||||
" e.g. if the colors would expand to this:
|
||||
" hi airline_c ctermfg=NONE ctermbg=NONE
|
||||
" that means to clear that highlighting group, therefore, fallback to Normal
|
||||
" highlighting group for the cterm values
|
||||
|
||||
" This only works, if the Normal highlighting group is actually defined, so
|
||||
" return early, if it has been cleared
|
||||
if !exists("g:airline#highlighter#normal_fg_hi")
|
||||
let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm')
|
||||
endif
|
||||
if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0
|
||||
return a:colors
|
||||
endif
|
||||
|
||||
for val in a:colors
|
||||
if !empty(val) && val !=# 'NONE'
|
||||
return a:colors
|
||||
endif
|
||||
endfor
|
||||
" this adds the bold attribute to the term argument of the :hi command,
|
||||
" but at least this makes sure, the group will be defined
|
||||
let fg = g:airline#highlighter#normal_fg_hi
|
||||
let bg = synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm')
|
||||
if bg < 0
|
||||
" in case there is no background color defined for Normal
|
||||
let bg = a:colors[3]
|
||||
endif
|
||||
return a:colors[0:1] + [fg, bg] + [a:colors[4]]
|
||||
endfunction
|
||||
|
||||
function! s:GetHiCmd(list)
|
||||
" a:list needs to have 5 items!
|
||||
let res = ''
|
||||
let i = -1
|
||||
while i < 4
|
||||
let i += 1
|
||||
let item = get(a:list, i, '')
|
||||
if item is ''
|
||||
continue
|
||||
endif
|
||||
if i == 0
|
||||
let res .= ' guifg='.item
|
||||
elseif i == 1
|
||||
let res .= ' guibg='.item
|
||||
elseif i == 2
|
||||
let res .= ' ctermfg='.item
|
||||
elseif i == 3
|
||||
let res .= ' ctermbg='.item
|
||||
elseif i == 4
|
||||
let res .= printf(' gui=%s cterm=%s term=%s', item, item, item)
|
||||
endif
|
||||
endwhile
|
||||
return res
|
||||
endfunction
|
||||
|
||||
function! s:exec_separator(dict, from, to, inverse, suffix)
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
let group = a:from.'_to_'.a:to.a:suffix
|
||||
let l:from = airline#themes#get_highlight(a:from.a:suffix)
|
||||
let l:to = airline#themes#get_highlight(a:to.a:suffix)
|
||||
let group = a:from.'_to_'.a:to.a:suffix
|
||||
if a:inverse
|
||||
let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
|
||||
else
|
||||
@@ -86,11 +203,18 @@ 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
|
||||
call airline#highlighter#highlight(['inactive'])
|
||||
call airline#highlighter#highlight(['normal'])
|
||||
if getbufvar( bufnr('%'), '&modified' )
|
||||
call airline#highlighter#highlight(['normal', 'modified'])
|
||||
else
|
||||
call airline#highlighter#highlight(['normal'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#add_separator(from, to, inverse)
|
||||
@@ -116,18 +240,46 @@ function! airline#highlighter#highlight_modified_inactive(bufnr)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#highlight(modes)
|
||||
function! airline#highlighter#highlight(modes, ...)
|
||||
let bufnr = a:0 ? a:1 : ''
|
||||
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' : ''
|
||||
for mode in mapped
|
||||
let airline_grouplist = []
|
||||
let buffers_in_tabpage = sort(tabpagebuflist())
|
||||
if exists("*uniq")
|
||||
let buffers_in_tabpage = uniq(buffers_in_tabpage)
|
||||
endif
|
||||
" mapped might be something like ['normal', 'normal_modified']
|
||||
" if a group is in both modes available, only define the second
|
||||
" that is how this was done previously overwrite the previous definition
|
||||
for mode in reverse(mapped)
|
||||
if exists('g:airline#themes#{g:airline_theme}#palette[mode]')
|
||||
let dict = g:airline#themes#{g:airline_theme}#palette[mode]
|
||||
for kvp in items(dict)
|
||||
let mode_colors = kvp[1]
|
||||
call airline#highlighter#exec(kvp[0].suffix, mode_colors)
|
||||
let name = kvp[0]
|
||||
if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive'
|
||||
let name = 'airline_c'.bufnr
|
||||
endif
|
||||
" do not re-create highlighting for buffers that are no longer visible
|
||||
" in the current tabpage
|
||||
if name =~# 'airline_c\d\+'
|
||||
let bnr = matchstr(name, 'airline_c\zs\d\+') + 0
|
||||
if bnr > 0 && index(buffers_in_tabpage, bnr) == -1
|
||||
continue
|
||||
endif
|
||||
elseif (name =~# '_to_') || (name[0:10] is# 'airline_tab' && !empty(suffix))
|
||||
" group will be redefined below at exec_separator
|
||||
" or is not needed for tabline with '_inactive' suffix
|
||||
" since active flag is 1 for builder)
|
||||
continue
|
||||
endif
|
||||
if s:group_not_done(airline_grouplist, name.suffix)
|
||||
call airline#highlighter#exec(name.suffix, mode_colors)
|
||||
endif
|
||||
|
||||
for accent in keys(s:accents)
|
||||
if !has_key(p.accents, accent)
|
||||
@@ -145,15 +297,23 @@ function! airline#highlighter#highlight(modes)
|
||||
else
|
||||
call add(colors, get(p.accents[accent], 4, ''))
|
||||
endif
|
||||
call airline#highlighter#exec(kvp[0].suffix.'_'.accent, colors)
|
||||
if s:group_not_done(airline_grouplist, name.suffix.'_'.accent)
|
||||
call airline#highlighter#exec(name.suffix.'_'.accent, colors)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
if empty(s:separators)
|
||||
" nothing to be done
|
||||
continue
|
||||
endif
|
||||
" TODO: optimize this
|
||||
for sep in items(s:separators)
|
||||
" we cannot check, that the group already exists, else the separators
|
||||
" might not be correctly defined. But perhaps we can skip above groups
|
||||
" that match the '_to_' name, because they would be redefined here...
|
||||
call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
|
||||
endfor
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! s:check_defined(variable, default)
|
||||
if !exists(a:variable)
|
||||
let {a:variable} = a:default
|
||||
@@ -16,53 +18,116 @@ function! airline#init#bootstrap()
|
||||
|
||||
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":"<")
|
||||
let g:airline#init#vim_async = (v:version >= 800 && has('job'))
|
||||
let g:airline#init#is_windows = has('win32') || has('win64')
|
||||
|
||||
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_spell', 1)
|
||||
call s:check_defined('g:airline_detect_spelllang', 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, {
|
||||
\ '__' : '------',
|
||||
\ 'n' : 'NORMAL',
|
||||
\ 'i' : 'INSERT',
|
||||
\ 'R' : 'REPLACE',
|
||||
\ 'v' : 'VISUAL',
|
||||
\ 'V' : 'V-LINE',
|
||||
\ 'c' : 'COMMAND',
|
||||
\ '' : 'V-BLOCK',
|
||||
\ 'i' : 'INSERT',
|
||||
\ 'ic' : 'INSERT COMPL',
|
||||
\ 'ix' : 'INSERT COMPL',
|
||||
\ 'n' : 'NORMAL',
|
||||
\ 'ni' : '(INSERT)',
|
||||
\ 'no' : 'OP PENDING',
|
||||
\ 'R' : 'REPLACE',
|
||||
\ 'Rv' : 'V REPLACE',
|
||||
\ 's' : 'SELECT',
|
||||
\ 'S' : 'S-LINE',
|
||||
\ '' : 'S-BLOCK',
|
||||
\ 't' : 'TERMINAL',
|
||||
\ 'v' : 'VISUAL',
|
||||
\ 'V' : 'V-LINE',
|
||||
\ '' : 'V-BLOCK',
|
||||
\ }, 'keep')
|
||||
|
||||
call s:check_defined('g:airline_theme_map', {})
|
||||
call extend(g:airline_theme_map, {
|
||||
\ 'Tomorrow.*': 'tomorrow',
|
||||
\ 'base16.*': 'base16',
|
||||
\ 'default': 'dark',
|
||||
\ '\CTomorrow': 'tomorrow',
|
||||
\ 'base16': 'base16',
|
||||
\ 'mo[l|n]okai': 'molokai',
|
||||
\ 'wombat.*': 'wombat',
|
||||
\ '.*zenburn.*': 'zenburn',
|
||||
\ '.*solarized.*': 'solarized',
|
||||
\ 'wombat': 'wombat',
|
||||
\ 'zenburn': 'zenburn',
|
||||
\ 'solarized': 'solarized',
|
||||
\ 'flattened': 'solarized',
|
||||
\ '\CNeoSolarized': 'solarized',
|
||||
\ }, 'keep')
|
||||
|
||||
call s:check_defined('g:airline_symbols', {})
|
||||
" First define the symbols,
|
||||
" that are common in Powerline/Unicode/ASCII mode,
|
||||
" then add specific symbols for either mode
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'paste': get(g:, 'airline_paste_symbol', 'PASTE'),
|
||||
\ 'readonly': get(g:, 'airline_readonly_symbol', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a2" : 'RO'),
|
||||
\ 'whitespace': get(g:, 'airline_powerline_fonts', 0) ? "\u2739" : '!',
|
||||
\ 'linenr': get(g:, 'airline_linecolumn_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a1" : ':' ),
|
||||
\ 'branch': get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a0" : ''),
|
||||
\ 'modified': '+',
|
||||
\ 'space': ' ',
|
||||
\ }, 'keep')
|
||||
\ 'paste': 'PASTE',
|
||||
\ 'spell': 'SPELL',
|
||||
\ 'modified': '+',
|
||||
\ 'space': ' ',
|
||||
\ 'keymap': 'Keymap:',
|
||||
\ 'ellipsis': '...'
|
||||
\ }, 'keep')
|
||||
|
||||
if get(g:, 'airline_powerline_fonts', 0)
|
||||
" Symbols for Powerline terminals
|
||||
call s:check_defined('g:airline_left_sep', "\ue0b0") "
|
||||
call s:check_defined('g:airline_left_alt_sep', "\ue0b1") "
|
||||
call s:check_defined('g:airline_right_sep', "\ue0b2") "
|
||||
call s:check_defined('g:airline_right_alt_sep', "\ue0b3") "
|
||||
" ro=, ws=☲, lnr=☰, mlnr=, br=, nx=Ɇ, crypt=🔒
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'readonly': "\ue0a2",
|
||||
\ 'whitespace': "\u2632",
|
||||
\ 'linenr': "\u2630 ",
|
||||
\ 'maxlinenr': " \ue0a1",
|
||||
\ 'branch': "\ue0a0",
|
||||
\ 'notexists': "\u0246",
|
||||
\ 'crypt': nr2char(0x1F512),
|
||||
\ }, 'keep')
|
||||
elseif &encoding==?'utf-8' && !get(g:, "airline_symbols_ascii", 0)
|
||||
" Symbols for Unicode terminals
|
||||
call s:check_defined('g:airline_left_sep', "")
|
||||
call s:check_defined('g:airline_left_alt_sep', "")
|
||||
call s:check_defined('g:airline_right_sep', "")
|
||||
call s:check_defined('g:airline_right_alt_sep', "")
|
||||
" ro=⊝, ws=☲, lnr=☰, mlnr=㏑, br=ᚠ, nx=Ɇ, crypt=🔒
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'readonly': "\u229D",
|
||||
\ 'whitespace': "\u2632",
|
||||
\ 'linenr': "\u2630 ",
|
||||
\ 'maxlinenr': " \u33D1",
|
||||
\ 'branch': "\u16A0",
|
||||
\ 'notexists': "\u0246",
|
||||
\ 'crypt': nr2char(0x1F512),
|
||||
\ }, 'keep')
|
||||
else
|
||||
" Symbols for ASCII terminals
|
||||
call s:check_defined('g:airline_left_sep', "")
|
||||
call s:check_defined('g:airline_left_alt_sep', "")
|
||||
call s:check_defined('g:airline_right_sep', "")
|
||||
call s:check_defined('g:airline_right_alt_sep', "")
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'readonly': 'RO',
|
||||
\ 'whitespace': '!',
|
||||
\ 'linenr': 'ln ',
|
||||
\ 'maxlinenr': ' :',
|
||||
\ 'branch': '',
|
||||
\ 'notexists': '?',
|
||||
\ 'crypt': 'cr',
|
||||
\ }, 'keep')
|
||||
endif
|
||||
|
||||
call airline#parts#define('mode', {
|
||||
\ 'function': 'airline#parts#mode',
|
||||
@@ -70,45 +135,75 @@ function! airline#init#bootstrap()
|
||||
\ })
|
||||
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('spell', 'airline#parts#spell')
|
||||
call airline#parts#define_function('filetype', 'airline#parts#filetype')
|
||||
call airline#parts#define('readonly', {
|
||||
\ 'function': 'airline#parts#readonly',
|
||||
\ 'accent': 'red',
|
||||
\ })
|
||||
call airline#parts#define_raw('file', '%f%m')
|
||||
call airline#parts#define_raw('linenr', '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#')
|
||||
call airline#parts#define_raw('path', '%F%m')
|
||||
call airline#parts#define('linenr', {
|
||||
\ 'raw': '%{g:airline_symbols.linenr}%4l',
|
||||
\ 'accent': 'bold'})
|
||||
call airline#parts#define('maxlinenr', {
|
||||
\ 'raw': '/%L%{g:airline_symbols.maxlinenr}',
|
||||
\ 'accent': 'bold'})
|
||||
call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
|
||||
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace','windowswap'])
|
||||
call airline#parts#define_empty(['hunks', 'branch', 'obsession', 'tagbar',
|
||||
\ 'syntastic-warn', 'syntastic-err', 'eclim', 'whitespace','windowswap',
|
||||
\ 'ycm_error_count', 'ycm_warning_count', 'neomake_error_count',
|
||||
\ 'neomake_warning_count', 'ale_error_count', 'ale_warning_count',
|
||||
\ 'languageclient_error_count', 'languageclient_warning_count'])
|
||||
call airline#parts#define_text('capslock', '')
|
||||
call airline#parts#define_text('gutentags', '')
|
||||
call airline#parts#define_text('grepper', '')
|
||||
call airline#parts#define_text('xkblayout', '')
|
||||
call airline#parts#define_text('keymap', '')
|
||||
|
||||
unlet g:airline#init#bootstrapping
|
||||
endfunction
|
||||
|
||||
function! airline#init#gui_mode()
|
||||
return has('gui_running') || (has("termguicolors") && &termguicolors == 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', 'capslock', 'iminsert'])
|
||||
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'keymap', 'spell', 'capslock', 'xkblayout', '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', spc, 'readonly'])
|
||||
if exists("+autochdir") && &autochdir == 1
|
||||
let g:airline_section_c = airline#section#create(['%<', 'path', spc, 'readonly'])
|
||||
else
|
||||
let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly'])
|
||||
endif
|
||||
endif
|
||||
if !exists('g:airline_section_gutter')
|
||||
let g:airline_section_gutter = airline#section#create(['%='])
|
||||
endif
|
||||
if !exists('g:airline_section_x')
|
||||
let g:airline_section_x = airline#section#create_right(['tagbar', 'filetype'])
|
||||
let g:airline_section_x = airline#section#create_right(['tagbar', 'gutentags', 'grepper', 'filetype'])
|
||||
endif
|
||||
if !exists('g:airline_section_y')
|
||||
let g:airline_section_y = airline#section#create_right(['ffenc'])
|
||||
endif
|
||||
if !exists('g:airline_section_z')
|
||||
let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', ':%3v '])
|
||||
if winwidth(0) > 80
|
||||
let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%3p%%'.spc, 'linenr', 'maxlinenr', spc.':%3v'])
|
||||
else
|
||||
let g:airline_section_z = airline#section#create(['%3p%%'.spc, 'linenr', ':%3v'])
|
||||
endif
|
||||
endif
|
||||
if !exists('g:airline_section_error')
|
||||
let g:airline_section_error = airline#section#create(['ycm_error_count', 'syntastic-err', 'eclim', 'neomake_error_count', 'ale_error_count', 'languageclient_error_count'])
|
||||
endif
|
||||
if !exists('g:airline_section_warning')
|
||||
let g:airline_section_warning = airline#section#create(['syntastic', 'eclim', 'whitespace'])
|
||||
let g:airline_section_warning = airline#section#create(['ycm_warning_count', 'syntastic-warn', 'neomake_warning_count', 'ale_warning_count', 'languageclient_warning_count', 'whitespace'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
59
autoload/airline/msdos.vim
Normal file
59
autoload/airline/msdos.vim
Normal file
@@ -0,0 +1,59 @@
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" 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,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:parts = {}
|
||||
|
||||
" PUBLIC API {{{
|
||||
@@ -51,13 +53,31 @@ endfunction
|
||||
" }}}
|
||||
|
||||
function! airline#parts#mode()
|
||||
return get(w:, 'airline_current_mode', '')
|
||||
return airline#util#shorten(get(w:, 'airline_current_mode', ''), 79, 1)
|
||||
endfunction
|
||||
|
||||
function! airline#parts#crypt()
|
||||
return g:airline_detect_crypt && exists("+key") && !empty(&key) ? g:airline_symbols.crypt : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#paste()
|
||||
return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#spell()
|
||||
let spelllang = g:airline_detect_spelllang ? printf(" [%s]", toupper(substitute(&spelllang, ',', '/', 'g'))) : ''
|
||||
if g:airline_detect_spell && &spell
|
||||
if winwidth(0) >= 90
|
||||
return g:airline_symbols.spell . spelllang
|
||||
elseif winwidth(0) >= 70
|
||||
return g:airline_symbols.spell
|
||||
else
|
||||
return split(g:airline_symbols.spell, '\zs')[0]
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#iminsert()
|
||||
if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
|
||||
return toupper(b:keymap_name)
|
||||
@@ -66,14 +86,29 @@ function! airline#parts#iminsert()
|
||||
endfunction
|
||||
|
||||
function! airline#parts#readonly()
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
" only consider regular buffers (e.g. ones that represent actual files,
|
||||
" but not special ones like e.g. NERDTree)
|
||||
if !empty(&buftype) || airline#util#ignore_buf(bufname('%'))
|
||||
return ''
|
||||
endif
|
||||
if &readonly && !filereadable(bufname('%'))
|
||||
return '[noperm]'
|
||||
else
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#parts#filetype()
|
||||
return &filetype
|
||||
return winwidth(0) < 90 && strlen(&filetype) > 3 ? matchstr(&filetype, '...'). (&encoding is? 'utf-8' ? '…' : '>') : &filetype
|
||||
endfunction
|
||||
|
||||
function! airline#parts#ffenc()
|
||||
return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '')
|
||||
let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '')
|
||||
let bomb = &l:bomb ? '[BOM]' : ''
|
||||
let ff = strlen(&ff) ? '['.&ff.']' : ''
|
||||
if expected is# &fenc.bomb.ff
|
||||
return ''
|
||||
else
|
||||
return &fenc.bomb.ff
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
call airline#init#bootstrap()
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
@@ -17,6 +19,7 @@ function! s:create(parts, append)
|
||||
for idx in range(len(a:parts))
|
||||
let part = airline#parts#get(a:parts[idx])
|
||||
let val = ''
|
||||
let add_sep = get(l:, 'add_sep', 0)
|
||||
|
||||
if exists('part.function')
|
||||
let func = (part.function).'()'
|
||||
@@ -27,7 +30,11 @@ function! s:create(parts, append)
|
||||
let val .= s:spc.g:airline_left_alt_sep.s:spc
|
||||
endif
|
||||
if a:append < 0 && idx != 0
|
||||
let val = s:spc.g:airline_right_alt_sep.s:spc.val
|
||||
let t = ''
|
||||
if !add_sep
|
||||
let t = s:spc.g:airline_right_alt_sep.s:spc
|
||||
endif
|
||||
let val = t.val
|
||||
endif
|
||||
if exists('part.raw')
|
||||
let _ .= s:wrap_accent(part, val.(part.raw))
|
||||
@@ -42,10 +49,15 @@ function! s:create(parts, append)
|
||||
|
||||
if a:append > 0 && idx != 0
|
||||
let partval = printf('%%{airline#util#append(%s,%s)}', func, minwidth)
|
||||
" will add an extra separator, if minwidth is zero
|
||||
let add_sep = (minwidth == 0)
|
||||
elseif a:append < 0 && idx != len(a:parts) - 1
|
||||
let partval = printf('%%{airline#util#prepend(%s,%s)}', func, minwidth)
|
||||
" will add an extra separator, if minwidth is zero
|
||||
let add_sep = (minwidth == 0)
|
||||
else
|
||||
let partval = printf('%%{airline#util#wrap(%s,%s)}', func, minwidth)
|
||||
let add_sep = 0
|
||||
endif
|
||||
|
||||
if exists('part.condition')
|
||||
@@ -70,4 +82,3 @@ endfunction
|
||||
function! airline#section#create_right(parts)
|
||||
return s:create(a:parts, -1)
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" generates a dictionary which defines the colors for each highlight group
|
||||
function! airline#themes#generate_color_map(sect1, sect2, sect3, ...)
|
||||
let palette = {
|
||||
@@ -36,12 +38,22 @@ endfunction
|
||||
|
||||
function! airline#themes#patch(palette)
|
||||
for mode in keys(a:palette)
|
||||
if mode == 'accents'
|
||||
continue
|
||||
endif
|
||||
if !has_key(a:palette[mode], 'airline_warning')
|
||||
let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ]
|
||||
endif
|
||||
if !has_key(a:palette[mode], 'airline_error')
|
||||
let a:palette[mode]['airline_error'] = [ '#000000', '#990000', 232, 160 ]
|
||||
endif
|
||||
if !has_key(a:palette[mode], 'airline_term')
|
||||
let a:palette[mode]['airline_term'] = [ '#9cffd3', '#202020', 85, 232]
|
||||
endif
|
||||
endfor
|
||||
|
||||
let a:palette.accents = get(a:palette, 'accents', {})
|
||||
let a:palette.accents.none = [ '', '', '', '', '' ]
|
||||
let a:palette.accents.bold = [ '', '', '', '', 'bold' ]
|
||||
let a:palette.accents.italic = [ '', '', '', '', 'italic' ]
|
||||
|
||||
@@ -64,4 +76,3 @@ function! airline#themes#patch(palette)
|
||||
let a:palette.accents.purple = [ '#af00df' , '' , 128 , '' ]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
let s:N1 = [ '#141413' , '#aeee00' , 232 , 154 ] " blackestgravel & lime
|
||||
let s:N2 = [ '#f4cf86' , '#45413b' , 222 , 238 ] " dirtyblonde & deepgravel
|
||||
let s:N3 = [ '#8cffba' , '#242321' , 121 , 235 ] " saltwatertaffy & darkgravel
|
||||
let s:N4 = [ '#666462' , 241 ] " mediumgravel
|
||||
|
||||
let s:I1 = [ '#141413' , '#0a9dff' , 232 , 39 ] " blackestgravel & tardis
|
||||
let s:I2 = [ '#f4cf86' , '#005fff' , 222 , 27 ] " dirtyblonde & facebook
|
||||
let s:I3 = [ '#0a9dff' , '#242321' , 39 , 235 ] " tardis & darkgravel
|
||||
|
||||
let s:V1 = [ '#141413' , '#ffa724' , 232 , 214 ] " blackestgravel & orange
|
||||
let s:V2 = [ '#000000' , '#fade3e' , 16 , 221 ] " coal & dalespale
|
||||
let s:V3 = [ '#000000' , '#b88853' , 16 , 137 ] " coal & toffee
|
||||
let s:V4 = [ '#c7915b' , 173 ] " coffee
|
||||
|
||||
let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde
|
||||
let s:RE = [ '#ff9eb8' , 211 ] " dress
|
||||
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
|
||||
|
||||
let g:airline#themes#badwolf#palette = {}
|
||||
|
||||
let g:airline#themes#badwolf#palette.accents = {
|
||||
\ 'red': [ '#ff2c4b' , '' , 196 , '' , '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#badwolf#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#badwolf#palette.normal_modified = {
|
||||
\ 'airline_b': [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#badwolf#palette.insert_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#badwolf#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.replace = copy(airline#themes#badwolf#palette.insert)
|
||||
let g:airline#themes#badwolf#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#badwolf#palette.replace_modified = g:airline#themes#badwolf#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#badwolf#palette.visual_modified = {
|
||||
\ 'airline_c': [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#badwolf#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
if get(g:, 'airline#themes#base16#constant', 0)
|
||||
let g:airline#themes#base16#palette = {}
|
||||
|
||||
" Color palette
|
||||
let s:gui_dark_gray = '#202020'
|
||||
let s:cterm_dark_gray = 234
|
||||
let s:gui_med_gray_hi = '#303030'
|
||||
let s:cterm_med_gray_hi = 236
|
||||
let s:gui_med_gray_lo = '#3a3a3a'
|
||||
let s:cterm_med_gray_lo = 237
|
||||
let s:gui_light_gray = '#505050'
|
||||
let s:cterm_light_gray = 239
|
||||
let s:gui_green = '#99cc99'
|
||||
let s:cterm_green = 151
|
||||
let s:gui_blue = '#6a9fb5'
|
||||
let s:cterm_blue = 67
|
||||
let s:gui_purple = '#aa759f'
|
||||
let s:cterm_purple = 139
|
||||
let s:gui_orange = '#d28445'
|
||||
let s:cterm_orange = 173
|
||||
let s:gui_red = '#ac4142'
|
||||
let s:cterm_red = 131
|
||||
let s:gui_pink = '#d7afd7'
|
||||
let s:cterm_pink = 182
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
|
||||
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
|
||||
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
|
||||
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
|
||||
let g:airline#themes#base16#palette.insert_modified = copy(g:airline#themes#base16#palette.normal_modified)
|
||||
let g:airline#themes#base16#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
\ }
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#base16#palette.replace = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
|
||||
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
let g:airline#themes#base16#palette.replace_modified = copy(g:airline#themes#base16#palette.insert_modified)
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
|
||||
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
|
||||
let g:airline#themes#base16#palette.visual_modified = copy(g:airline#themes#base16#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#base16#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
else
|
||||
function! airline#themes#base16#refresh()
|
||||
let g:airline#themes#base16#palette = {}
|
||||
|
||||
let g:airline#themes#base16#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffText', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight2(['Visual', 'fg'], ['Visual', 'bg'])
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let group = airline#themes#get_highlight('vimCommand')
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'statusline': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffAdded', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['DiffAdded', 'fg'], ['Normal', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#base16#palette.insert_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['WarningMsg', 'fg'], 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#base16#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#base16#palette.replace_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['Constant', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#base16#palette.visual_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg'])
|
||||
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#base16#palette.inactive_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
endfunction
|
||||
call airline#themes#base16#refresh()
|
||||
endif
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
" Color palette
|
||||
let s:gui_dark_gray = '#303030'
|
||||
let s:cterm_dark_gray = 236
|
||||
let s:gui_med_gray_hi = '#444444'
|
||||
let s:cterm_med_gray_hi = 238
|
||||
let s:gui_med_gray_lo = '#3a3a3a'
|
||||
let s:cterm_med_gray_lo = 237
|
||||
let s:gui_light_gray = '#b2b2b2'
|
||||
let s:cterm_light_gray = 249
|
||||
let s:gui_green = '#afd787'
|
||||
let s:cterm_green = 150
|
||||
let s:gui_blue = '#87afd7'
|
||||
let s:cterm_blue = 110
|
||||
let s:gui_purple = '#afafd7'
|
||||
let s:cterm_purple = 146
|
||||
let s:gui_orange = '#d7af5f'
|
||||
let s:cterm_orange = 179
|
||||
let s:gui_red = '#d78787'
|
||||
let s:cterm_red = 174
|
||||
let s:gui_pink = '#d7afd7'
|
||||
let s:cterm_pink = 182
|
||||
|
||||
let g:airline#themes#bubblegum#palette = {}
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
|
||||
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
|
||||
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#bubblegum#palette.normal_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
|
||||
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
|
||||
let g:airline#themes#bubblegum#palette.insert_modified = copy(g:airline#themes#bubblegum#palette.normal_modified)
|
||||
let g:airline#themes#bubblegum#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
\ }
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#bubblegum#palette.replace = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
|
||||
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
let g:airline#themes#bubblegum#palette.replace_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
|
||||
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
|
||||
let g:airline#themes#bubblegum#palette.visual_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_light_gray, s:gui_med_gray_hi, s:cterm_light_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#bubblegum#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#bubblegum#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
|
||||
" CtrlP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#bubblegum#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, '' ] ,
|
||||
\ [ s:gui_orange, s:gui_med_gray_lo, s:cterm_orange, s:cterm_med_gray_lo, '' ] ,
|
||||
\ [ s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green, 'bold' ] )
|
||||
@@ -1,37 +1,92 @@
|
||||
" Each theme is contained in its own file and declares variables scoped to the
|
||||
" file. These variables represent the possible "modes" that airline can
|
||||
" detect. The mode is the return value of mode(), which gets converted to a
|
||||
" readable string. The following is a list currently supported modes: normal,
|
||||
" insert, replace, visual, and inactive.
|
||||
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
|
||||
" vim: et ts=2 sts=2 sw=2 tw=80
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" Airline themes are generated based on the following concepts:
|
||||
" * The section of the status line, valid Airline statusline sections are:
|
||||
" * airline_a (left most section)
|
||||
" * airline_b (section just to the right of airline_a)
|
||||
" * airline_c (section just to the right of airline_b)
|
||||
" * airline_x (first section of the right most sections)
|
||||
" * airline_y (section just to the right of airline_x)
|
||||
" * airline_z (right most section)
|
||||
" * The mode of the buffer, as reported by the :mode() function. Airline
|
||||
" converts the values reported by mode() to the following:
|
||||
" * normal
|
||||
" * insert
|
||||
" * replace
|
||||
" * visual
|
||||
" * inactive
|
||||
" The last one is actually no real mode as returned by mode(), but used by
|
||||
" airline to style inactive statuslines (e.g. windows, where the cursor
|
||||
" currently does not reside in).
|
||||
" * In addition to each section and mode specified above, airline themes
|
||||
" can also specify overrides. Overrides can be provided for the following
|
||||
" scenarios:
|
||||
" * 'modified'
|
||||
" * 'paste'
|
||||
"
|
||||
" Each mode can also have overrides. These are small changes to the mode that
|
||||
" don't require a completely different look. "modified" and "paste" are two
|
||||
" such supported overrides. These are simply suffixed to the major mode,
|
||||
" separated by an underscore. For example, "normal_modified" would be normal
|
||||
" mode where the current buffer is modified.
|
||||
" Airline themes are specified as a global viml dictionary using the above
|
||||
" sections, modes and overrides as keys to the dictionary. The name of the
|
||||
" dictionary is significant and should be specified as:
|
||||
" * g:airline#themes#<theme_name>#palette
|
||||
" where <theme_name> is substituted for the name of the theme.vim file where the
|
||||
" theme definition resides. Airline themes should reside somewhere on the
|
||||
" 'runtimepath' where it will be loaded at vim startup, for example:
|
||||
" * autoload/airline/themes/theme_name.vim
|
||||
"
|
||||
" The theming algorithm is a 2-pass system where the mode will draw over all
|
||||
" parts of the statusline, and then the override is applied after. This means
|
||||
" it is possible to specify a subset of the theme in overrides, as it will
|
||||
" simply overwrite the previous colors. If you want simultaneous overrides,
|
||||
" then they will need to change different parts of the statusline so they do
|
||||
" not conflict with each other.
|
||||
"
|
||||
" First, let's define 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.
|
||||
" For this, the dark.vim, theme, this is defined as
|
||||
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 ]
|
||||
let g:airline#themes#dark#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
" Keys in the dictionary are composed of the mode, and if specified the
|
||||
" override. For example:
|
||||
" * g:airline#themes#dark#palette.normal
|
||||
" * the colors for a statusline while in normal mode
|
||||
" * g:airline#themes#dark#palette.normal_modified
|
||||
" * the colors for a statusline while in normal mode when the buffer has
|
||||
" been modified
|
||||
" * g:airline#themes#dark#palette.visual
|
||||
" * the colors for a statusline while in visual mode
|
||||
"
|
||||
" Values for each dictionary key is an array of color values that should be
|
||||
" familiar for colorscheme designers:
|
||||
" * [guifg, guibg, ctermfg, ctermbg, opts]
|
||||
" See "help attr-list" for valid values for the "opt" value.
|
||||
"
|
||||
" Each theme must provide an array of such values for each airline section of
|
||||
" the statusline (airline_a through airline_z). A convenience function,
|
||||
" airline#themes#generate_color_map() exists to mirror airline_a/b/c to
|
||||
" airline_x/y/z, respectively.
|
||||
|
||||
" The dark.vim theme:
|
||||
let s:airline_a_normal = [ '#00005f' , '#dfff00' , 17 , 190 ]
|
||||
let s:airline_b_normal = [ '#ffffff' , '#444444' , 255 , 238 ]
|
||||
let s:airline_c_normal = [ '#9cffd3' , '#202020' , 85 , 234 ]
|
||||
let g:airline#themes#dark#palette.normal = airline#themes#generate_color_map(s:airline_a_normal, s:airline_b_normal, s:airline_c_normal)
|
||||
|
||||
" It should be noted the above is equivalent to:
|
||||
" let g:airline#themes#dark#palette.normal = airline#themes#generate_color_map(
|
||||
" \ [ '#00005f' , '#dfff00' , 17 , 190 ], " section airline_a
|
||||
" \ [ '#ffffff' , '#444444' , 255 , 238 ], " section airline_b
|
||||
" \ [ '#9cffd3' , '#202020' , 85 , 234 ] " section airline_c
|
||||
" \)
|
||||
"
|
||||
" In turn, that is equivalent to:
|
||||
" let g:airline#themes#dark#palette.normal = {
|
||||
" \ 'airline_a': [ '#00005f' , '#dfff00' , 17 , 190 ], "section airline_a
|
||||
" \ 'airline_b': [ '#ffffff' , '#444444' , 255 , 238 ], "section airline_b
|
||||
" \ 'airline_c': [ '#9cffd3' , '#202020' , 85 , 234 ], "section airline_c
|
||||
" \ 'airline_x': [ '#9cffd3' , '#202020' , 85 , 234 ], "section airline_x
|
||||
" \ 'airline_y': [ '#ffffff' , '#444444' , 255 , 238 ], "section airline_y
|
||||
" \ 'airline_z': [ '#00005f' , '#dfff00' , 17 , 190 ] "section airline_z
|
||||
" \}
|
||||
"
|
||||
" airline#themes#generate_color_map() also uses the values provided as
|
||||
" parameters to create intermediary groups such as:
|
||||
" airline_a_to_airline_b
|
||||
" airline_b_to_airline_c
|
||||
" etc...
|
||||
|
||||
" 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
|
||||
@@ -41,40 +96,46 @@ 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)
|
||||
let s:airline_a_insert = [ '#00005f' , '#00dfff' , 17 , 45 ]
|
||||
let s:airline_b_insert = [ '#ffffff' , '#005fff' , 255 , 27 ]
|
||||
let s:airline_c_insert = [ '#ffffff' , '#000080' , 15 , 17 ]
|
||||
let g:airline#themes#dark#palette.insert = airline#themes#generate_color_map(s:airline_a_insert, s:airline_b_insert, s:airline_c_insert)
|
||||
let g:airline#themes#dark#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#dark#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ 'airline_a': [ s:airline_a_insert[0] , '#d78700' , s:airline_a_insert[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#dark#palette.replace = copy(g:airline#themes#dark#palette.insert)
|
||||
let g:airline#themes#dark#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
|
||||
let g:airline#themes#dark#palette.replace.airline_a = [ s:airline_b_insert[0] , '#af0000' , s:airline_b_insert[2] , 124 , '' ]
|
||||
let g:airline#themes#dark#palette.replace_modified = g:airline#themes#dark#palette.insert_modified
|
||||
|
||||
|
||||
let s:V1 = [ '#000000' , '#ffaf00' , 232 , 214 ]
|
||||
let s:V2 = [ '#000000' , '#ff5f00' , 232 , 202 ]
|
||||
let s:V3 = [ '#ffffff' , '#5f0000' , 15 , 52 ]
|
||||
let g:airline#themes#dark#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let s:airline_a_visual = [ '#000000' , '#ffaf00' , 232 , 214 ]
|
||||
let s:airline_b_visual = [ '#000000' , '#ff5f00' , 232 , 202 ]
|
||||
let s:airline_c_visual = [ '#ffffff' , '#5f0000' , 15 , 52 ]
|
||||
let g:airline#themes#dark#palette.visual = airline#themes#generate_color_map(s:airline_a_visual, s:airline_b_visual, s:airline_c_visual)
|
||||
let g:airline#themes#dark#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
|
||||
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
|
||||
let g:airline#themes#dark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let s:airline_a_inactive = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
|
||||
let s:airline_b_inactive = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
|
||||
let s:airline_c_inactive = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
|
||||
let g:airline#themes#dark#palette.inactive = airline#themes#generate_color_map(s:airline_a_inactive, s:airline_b_inactive, s:airline_c_inactive)
|
||||
let g:airline#themes#dark#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
" For commandline mode, we use the colors from normal mode, except the mode
|
||||
" indicator should be colored differently, e.g. blue on light green
|
||||
let s:airline_a_commandline = [ '#0000ff' , '#0cff00' , 63 , 40 ]
|
||||
let s:airline_b_commandline = [ '#ffffff' , '#444444' , 255 , 238 ]
|
||||
let s:airline_c_commandline = [ '#9cffd3' , '#202020' , 85 , 234 ]
|
||||
let g:airline#themes#dark#palette.commandline = airline#themes#generate_color_map(s:airline_a_commandline, s:airline_b_commandline, s:airline_c_commandline)
|
||||
|
||||
" 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'
|
||||
@@ -92,11 +153,9 @@ let g:airline#themes#dark#palette.accents = {
|
||||
" variable so that related functionality is loaded iff the user is using
|
||||
" ctrlp. Note that this is optional, and if you do not define ctrlp colors
|
||||
" they will be chosen automatically from the existing palette.
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
if get(g:, 'loaded_ctrlp', 0)
|
||||
let g:airline#themes#dark#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
|
||||
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
|
||||
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
|
||||
endif
|
||||
let g:airline#themes#dark#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
|
||||
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
|
||||
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ]
|
||||
let s:N2 = [ '#93a1a1' , '#586e75' , 245 , 240 ]
|
||||
let s:N3 = [ '#93a1a1' , '#073642' , 240 , 233 ]
|
||||
let g:airline#themes#durant#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
|
||||
let g:airline#themes#durant#normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#9e9e9e' , '#303030' , 247 , 236 ]
|
||||
let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ]
|
||||
let g:airline#themes#durant#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#durant#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#durant#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#durant#palette.replace = copy(g:airline#themes#durant#palette.insert)
|
||||
let g:airline#themes#durant#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
|
||||
|
||||
let g:airline#themes#durant#palette.replace_modified = g:airline#themes#durant#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ]
|
||||
let s:V2 = [ '#ffffff' , '#44403a' , 255, 238 ]
|
||||
let s:V3 = [ '#90a680' , '#2e2d2a' , 64, 235 ]
|
||||
let g:airline#themes#durant#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#durant#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
|
||||
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
|
||||
let g:airline#themes#durant#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#durant#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#durant#palette.accents = {
|
||||
\ 'red': [ '#ff0000' , '' , 160 , '' ]
|
||||
\ }
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#durant#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
|
||||
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
|
||||
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
" vim-airline companion theme of Hybrid
|
||||
" (https://github.com/w0ng/vim-hybrid)
|
||||
|
||||
let g:airline#themes#hybrid#palette = {}
|
||||
|
||||
function! airline#themes#hybrid#refresh()
|
||||
let s:N1 = airline#themes#get_highlight('DiffAdd')
|
||||
let s:N2 = airline#themes#get_highlight('CursorLine')
|
||||
let s:N3 = airline#themes#get_highlight('PMenu')
|
||||
let g:airline#themes#hybrid#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let modified_group = airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.normal_modified = {
|
||||
\ 'airline_c': airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
\ }
|
||||
|
||||
let warning_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.normal.airline_warning = warning_group
|
||||
let g:airline#themes#hybrid#palette.normal_modified.airline_warning = warning_group
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffText', 'bg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellLocal', 'bg'], 'bold')
|
||||
let s:I3 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellCap', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#hybrid#palette.insert_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.insert.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.insert_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('DiffChange')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#hybrid#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let replace_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.replace_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.replace.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.replace_modified.airline_warning = g:airline#themes#hybrid#palette.replace_modified.airline_warning
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Text', 'fg'], ['Folded', 'bg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V3 = airline#themes#get_highlight2(['Text', 'fg'], ['Error', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#hybrid#palette.visual_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.visual.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.visual_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#hybrid#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#hybrid#palette.inactive_modified = {
|
||||
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#hybrid#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#hybrid#refresh()
|
||||
@@ -1,52 +0,0 @@
|
||||
let g:airline#themes#jellybeans#palette = {}
|
||||
|
||||
" The name of the function must be 'refresh'.
|
||||
function! airline#themes#jellybeans#refresh()
|
||||
" This theme is an example of how to use helper functions to extract highlight
|
||||
" values from the corresponding colorscheme. It was written in a hurry, so it
|
||||
" is very minimalistic. If you are a jellybeans user and want to make updates,
|
||||
" please send pull requests.
|
||||
|
||||
" Here are examples where the entire highlight group is copied and an airline
|
||||
" compatible color array is generated.
|
||||
let s:N1 = airline#themes#get_highlight('DbgCurrent', 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('NonText')
|
||||
|
||||
let g:airline#themes#jellybeans#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let g:airline#themes#jellybeans#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#jellybeans#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffb964', '', 215, '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight('DiffAdd', 'bold')
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#jellybeans#palette.insert_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('WildMenu', 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#jellybeans#palette.replace_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" Sometimes you want to mix and match colors from different groups, you can do
|
||||
" that with this method.
|
||||
let s:V1 = airline#themes#get_highlight2(['TabLineSel', 'bg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#jellybeans#palette.visual_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" And of course, you can always do it manually as well.
|
||||
let s:IA = [ '#444444', '#1c1c1c', 237, 234 ]
|
||||
let g:airline#themes#jellybeans#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#jellybeans#palette.inactive_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
endfunction
|
||||
|
||||
call airline#themes#jellybeans#refresh()
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
"
|
||||
" Colorscheme: Kalisi for airline. Inspired by powerline.
|
||||
" Arthur Jaron
|
||||
" hifreeo@gmail.com
|
||||
" 24.10.2014
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#0087ff' , '#ffffff','33','231']
|
||||
let s:V2 = [ '#005faf' , '#5fafff','25','75']
|
||||
let s:V3 = [ '#87d7ff' , '#005faf','117','25']
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [ '#d75fff' , '#ffffff','171','231']
|
||||
let s:R2 = [ '#5f005f' , '#d75fff','53','171']
|
||||
let s:R3 = [ '#ff87ff' , '#8700af','213','91']
|
||||
|
||||
let g:airline#themes#kalisi#palette = {}
|
||||
|
||||
|
||||
function! airline#themes#kalisi#refresh()
|
||||
|
||||
let s:StatusLine = airline#themes#get_highlight('StatusLine')
|
||||
let s:StatusLineNC = airline#themes#get_highlight('StatusLineNC')
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#ffffff' , '#e80000','231','160']
|
||||
let s:I2 = [ '#ff0000' , '#5f0000','196','52']
|
||||
let s:I3 = s:StatusLine
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#005f00' , '#afd700','22','148']
|
||||
let s:N2 = [ '#afd700' , '#005f00','148','22']
|
||||
let s:N3 = s:StatusLine
|
||||
|
||||
" Tabline Plugin
|
||||
let g:airline#themes#kalisi#palette.tabline = {
|
||||
\ 'airline_tab': ['#bcbcbc', '#005f00','250','22'],
|
||||
\ 'airline_tabsel': ['#404042', '#A6DB29','238','148'],
|
||||
\ 'airline_tabtype':['#afd700', '#204d20','148','22'],
|
||||
\ 'airline_tabfill': s:StatusLine,
|
||||
\ 'airline_tabhid': ['#c5c5c5', '#404042','251','238'],
|
||||
\ 'airline_tabmod': ['#d7ff00', '#afd700','190','148'],
|
||||
\ 'airline_tabmod_unsel': ['#d7ff00', '#005f00','190','22']
|
||||
\ }
|
||||
|
||||
let g:airline#themes#kalisi#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#kalisi#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#kalisi#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#kalisi#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
|
||||
" Inactive Mode
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#kalisi#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#kalisi#palette.inactive_modified = {
|
||||
\ 'airline_c': ['#d7ff00', s:IA[1],'190',s:IA[3]],
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#kalisi#refresh()
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#kalisi#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ s:StatusLine,
|
||||
\ ['#afd700', '#005f00','148','22'],
|
||||
\ [ '#005f00' , '#afd700' , '22','148']
|
||||
\)
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
let g:airline#themes#kolor#palette = {}
|
||||
|
||||
let s:N1 = [ '#e2e2e2' , '#4f3598' , 254 , 56 ]
|
||||
let s:N2 = [ '#ff5fd7' , '#242322' , 206 , 234 ]
|
||||
let s:N3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
|
||||
let g:airline#themes#kolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let g:airline#themes#kolor#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e2e2e2' , '#4f3598' , 254 , 56 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#242322' , '#7eaefd' , 234 , 111 ]
|
||||
let s:I2 = [ '#75d7d8' , '#242322' , 80 , 234 ]
|
||||
let s:I3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
let g:airline#themes#kolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#kolor#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#242322' , '#7eaefd' , 234 , 111 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#kolor#palette.replace = copy(g:airline#themes#kolor#palette.insert)
|
||||
let g:airline#themes#kolor#palette.replace.airline_a = [ s:I2[0] , '#005154' , s:I2[2] , 23 , '' ]
|
||||
let g:airline#themes#kolor#palette.replace_modified = {
|
||||
\ 'airline_c': [ '#e2e2e2' , '#005154' , 254 , 23 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:V1 = [ '#242322' , '#e6987a' , 234 , 180 ]
|
||||
let s:V2 = [ '#dbc570' , '#242322' , 186 , 234 ]
|
||||
let s:V3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
let g:airline#themes#kolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#kolor#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#242322' , '#e6987a' , 234 , 180 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
|
||||
let s:IA2 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 ]
|
||||
let s:IA3 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
|
||||
let g:airline#themes#kolor#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#kolor#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#kolor#palette.accents = {
|
||||
\ 'red': [ '#d96e8a' , '' , 168 , '' ]
|
||||
\ }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#kolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#e2e2e2' , '#4a4a4a' , 254 , 238 , '' ],
|
||||
\ [ '#e2e2e2' , '#242322' , 254 , 234 , '' ],
|
||||
\ [ '#e2e2e2' , '#4f3598' , 254 , 56 , 'bold' ])
|
||||
@@ -1,62 +0,0 @@
|
||||
" vim-airline companion theme of Laederon
|
||||
" (https://github.com/Donearm/Laederon)
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ] " blackestgravel & snow
|
||||
let s:N2 = [ '#ffffff' , '#44403a' , 255, 238 ] " snow & deepgravel
|
||||
let s:N3 = [ '#90a680' , '#2e2d2a' , 64, 235 ] " dilutedpaint & darkgravel
|
||||
let s:N4 = [ '#777470' , 240 ] " gravel
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#1a1a18' , '#1693a5' , 232 , 62 ] " blackestgravel & crystallake
|
||||
let s:I2 = [ '#515744' , '#44403a' , 101 , 238 ] " lichen & deepgravel
|
||||
let s:I3 = [ '#1693a5' , '#2e2d2a' , 39 , 235 ] " crystallake & darkgravel
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#1a1a18' , '#ab3e5d' , 232 , 161 ] " blackestgravel & raspberry
|
||||
let s:V2 = [ '#000000' , '#908571' , 16 , 252 ] " coal & winterterrain
|
||||
let s:V3 = [ '#ab3e5d' , '#8c7f77' , 161 , 245 ] " raspberry & wetcoldterrain
|
||||
let s:V4 = [ '#515744' , 101 ] " lichen
|
||||
|
||||
" Replace mode
|
||||
let s:RE = [ '#233e09' , 22 ] " oakleaf
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#ab3e5d' , 161 ] " raspberry
|
||||
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ]
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette = {}
|
||||
|
||||
let g:airline#themes#laederon#palette.accents = {
|
||||
\ 'red': [ '#ef393d' , '' , 196 , '' , '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#laederon#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#laederon#palette.normal_modified = {
|
||||
\ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#laederon#palette.insert_modified = {
|
||||
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#laederon#palette.insert_paste = {
|
||||
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.replace = copy(airline#themes#laederon#palette.insert)
|
||||
let g:airline#themes#laederon#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#laederon#palette.replace_modified = g:airline#themes#laederon#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#laederon#palette.visual_modified = {
|
||||
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#laederon#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
let g:airline#themes#light#palette = {}
|
||||
|
||||
let s:N1 = [ '#ffffff' , '#005fff' , 255 , 27 ]
|
||||
let s:N2 = [ '#000087' , '#00dfff' , 18 , 45 ]
|
||||
let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ]
|
||||
let g:airline#themes#light#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#light#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#005f00' , '#00df87' , 22 , 42 ]
|
||||
let s:I3 = [ '#005f5f' , '#afff87' , 23 , 156 ]
|
||||
let g:airline#themes#light#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#light#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#light#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#light#palette.replace = copy(g:airline#themes#light#palette.insert)
|
||||
let g:airline#themes#light#palette.replace.airline_a = [ s:I2[0] , '#ff0000' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#light#palette.replace_modified = g:airline#themes#light#palette.insert_modified
|
||||
|
||||
|
||||
let s:V1 = [ '#ffffff' , '#ff5f00' , 255 , 202 ]
|
||||
let s:V2 = [ '#5f0000' , '#ffaf00' , 52 , 214 ]
|
||||
let s:V3 = [ '#df5f00' , '#ffff87' , 166 , 228 ]
|
||||
let g:airline#themes#light#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#light#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#666666' , '#b2b2b2' , 242 , 249 , '' ]
|
||||
let s:IA2 = [ '#8a8a8a' , '#d0d0d0' , 245 , 252 , '' ]
|
||||
let s:IA3 = [ '#a8a8a8' , '#ffffff' , 248 , 255 , '' ]
|
||||
let g:airline#themes#light#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#light#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '' , 160 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
let g:airline#themes#lucius#palette = {}
|
||||
|
||||
function! airline#themes#lucius#refresh()
|
||||
|
||||
let s:N1 = airline#themes#get_highlight('StatusLine')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#lucius#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let modified_group = airline#themes#get_highlight('Statement')
|
||||
let g:airline#themes#lucius#palette.normal_modified = {
|
||||
\ 'airline_c': [modified_group[0], '', modified_group[2], '', '']
|
||||
\ }
|
||||
|
||||
let warning_group = airline#themes#get_highlight('DiffDelete')
|
||||
let g:airline#themes#lucius#palette.normal.airline_warning = warning_group
|
||||
let g:airline#themes#lucius#palette.normal_modified.airline_warning = warning_group
|
||||
|
||||
let s:I1 = airline#themes#get_highlight('DiffAdd')
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#lucius#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#lucius#palette.insert_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.insert.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.insert_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('DiffChange')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#lucius#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#lucius#palette.replace_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.replace.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.replace_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:V1 = airline#themes#get_highlight('Cursor')
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#lucius#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#lucius#palette.visual_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.visual.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.visual_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#lucius#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#lucius#palette.inactive_modified = {
|
||||
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#lucius#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#lucius#refresh()
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
" vim-airline companion theme of Luna
|
||||
" (https://github.com/Pychimp/vim-luna)
|
||||
|
||||
let g:airline#themes#luna#palette = {}
|
||||
|
||||
let g:airline#themes#luna#palette.accents = {
|
||||
\ 'red': [ '#ffffff' , '' , 231 , '' , '' ],
|
||||
\ }
|
||||
|
||||
|
||||
let s:N1 = [ '#ffffff' , '#005252' , 231 , 36 ]
|
||||
let s:N2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:N3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#luna#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#789f00' , 231 , 106 ]
|
||||
let s:I2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:I3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#luna#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#005e5e' , 255 , 52 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#luna#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#luna#palette.replace = copy(g:airline#themes#luna#palette.insert)
|
||||
let g:airline#themes#luna#palette.replace.airline_a = [ s:I2[0] , '#920000' , s:I2[2] , 88 , '' ]
|
||||
let g:airline#themes#luna#palette.replace_modified = g:airline#themes#luna#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#ffff9a' , '#ff8036' , 222 , 208 ]
|
||||
let s:V2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:V3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#luna#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#4e4e4e' , '#002b2b' , 59 , 23 , '' ]
|
||||
let g:airline#themes#luna#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#luna#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e20000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#luna#palette.tabline = {
|
||||
\ 'airline_tab': ['#2aa198', '#003f3f', 231, 29, ''],
|
||||
\ 'airline_tabsel': ['#ffffff', '#2e8b57', 231, 36, ''],
|
||||
\ 'airline_tabtype': ['#ffffff', '#005252', 231, 36, ''],
|
||||
\ 'airline_tabfill': ['#ffffff', '#002b2b', 231, 23, ''],
|
||||
\ 'airline_tabmod': ['#ffffff', '#780000', 231, 88, ''],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ffffff', '#5f0000', 231, 88 ]
|
||||
let g:airline#themes#luna#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#luna#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.insert.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.visual.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.replace.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#luna#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] ,
|
||||
\ [ '#ffffff' , '#005252' , 231 , 36 , '' ] ,
|
||||
\ [ '#ffffff' , '#973d45' , 231 , 95 , '' ] )
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
let g:airline#themes#molokai#palette = {}
|
||||
|
||||
let g:airline#themes#molokai#palette.accents = {
|
||||
\ 'red': [ '#66d9ef' , '' , 81 , '' , '' ],
|
||||
\ }
|
||||
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#080808' , '#e6db74' , 232 , 144 ] " mode
|
||||
let s:N2 = [ '#f8f8f0' , '#232526' , 253 , 16 ] " info
|
||||
let s:N3 = [ '#f8f8f0' , '#465457' , 253 , 67 ] " statusline
|
||||
|
||||
let g:airline#themes#molokai#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#molokai#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#e6db74' , 232 , 144 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#080808' , '#66d9ef' , 232 , 81 ]
|
||||
let s:I2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:I3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#molokai#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#66d9ef' , 232 , 81 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#molokai#palette.replace = copy(g:airline#themes#molokai#palette.insert)
|
||||
let g:airline#themes#molokai#palette.replace.airline_a = [ s:I1[0] , '#ef5939' , s:I1[2] , 166 , '' ]
|
||||
let g:airline#themes#molokai#palette.replace_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#ef5939' , 232 , 166 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#080808' , '#fd971f' , 232 , 208 ]
|
||||
let s:V2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:V3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#molokai#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#fd971f' , 232 , 208 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Inactive
|
||||
let s:IA = [ '#1b1d1e' , '#465457' , 233 , 67 , '' ]
|
||||
let g:airline#themes#molokai#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#molokai#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#f8f8f0' , '' , 253 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" CtrlP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#molokai#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#f8f8f0' , '#465457' , 253 , 67 , '' ] ,
|
||||
\ [ '#f8f8f0' , '#232526' , 253 , 16 , '' ] ,
|
||||
\ [ '#080808' , '#e6db74' , 232 , 144 , 'bold' ] )
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
let g:airline#themes#monochrome#palette = {}
|
||||
|
||||
function! airline#themes#monochrome#refresh()
|
||||
let s:SL = airline#themes#get_highlight('StatusLine')
|
||||
let g:airline#themes#monochrome#palette.normal = airline#themes#generate_color_map(s:SL, s:SL, s:SL)
|
||||
let g:airline#themes#monochrome#palette.insert = g:airline#themes#monochrome#palette.normal
|
||||
let g:airline#themes#monochrome#palette.replace = g:airline#themes#monochrome#palette.normal
|
||||
let g:airline#themes#monochrome#palette.visual = g:airline#themes#monochrome#palette.normal
|
||||
|
||||
let s:SLNC = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#monochrome#palette.inactive = airline#themes#generate_color_map(s:SLNC, s:SLNC, s:SLNC)
|
||||
endfunction
|
||||
|
||||
call airline#themes#monochrome#refresh()
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
let g:airline#themes#murmur#palette = {}
|
||||
|
||||
" Color palette
|
||||
let s:cterm_termbg = 237 " Background for branch and file format blocks
|
||||
let s:gui_termbg = '#5F5F5F'
|
||||
let s:cterm_termfg = 144 " Foreground for branch and file format blocks
|
||||
let s:gui_termfg = '#AFAF87'
|
||||
|
||||
let s:cterm_termbg2 = 234 " Background for middle block
|
||||
let s:gui_termbg2 = '#1C1C1C'
|
||||
let s:cterm_termfg2 = 39 " Foreground for middle block
|
||||
let s:gui_termfg2 = '#F5F5F5'
|
||||
|
||||
let s:cterm_normalbg = 27 " Background for normal mode and file position blocks
|
||||
let s:gui_normalbg = '#5F87FF'
|
||||
let s:cterm_normalfg = 15 " Foreground for normal mode and file position blocks
|
||||
let s:gui_normalfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_insertbg = 70 " Background for insert mode and file position blocks
|
||||
let s:gui_insertbg = '#87AF5F'
|
||||
let s:cterm_insertfg = 15 " Foreground for insert mode and file position blocks
|
||||
let s:gui_insertfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_visualbg = 166 " Background for visual mode and file position blocks
|
||||
let s:gui_visualbg = '#ff8c00'
|
||||
let s:cterm_visualfg = 15 " Foreground for visual mode and file position blocks
|
||||
let s:gui_visualfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_replacebg = 88 " Background for replace mode and file position blocks
|
||||
let s:gui_replacebg = '#870000'
|
||||
let s:cterm_replacefg = 15 " Foreground for replace mode and file position blocks
|
||||
let s:gui_replacefg = '#FFFFFF'
|
||||
|
||||
let s:cterm_alert = 88 " Modified file alert color
|
||||
let s:gui_alert = '#870000'
|
||||
|
||||
let s:cterm_inactivebg = 234 " Background for inactive mode
|
||||
let s:gui_inactivebg = '#1C1C1C'
|
||||
let s:cterm_inactivefg = 239 " Foreground for inactive mode
|
||||
let s:gui_inactivefg = '#4E4E4E'
|
||||
|
||||
" Branch and file format
|
||||
let s:BB = [s:gui_termfg, s:gui_termbg, s:cterm_termfg, s:cterm_termbg] " Branch and file format blocks
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_normalfg, s:gui_normalbg, s:cterm_normalfg, s:cterm_normalbg] " Outside blocks in normal mode
|
||||
let s:N2 = [s:gui_termfg2, s:gui_termbg2, s:cterm_normalbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.normal = airline#themes#generate_color_map(s:N1, s:BB, s:N2)
|
||||
let g:airline#themes#murmur#palette.normal_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_insertfg, s:gui_insertbg, s:cterm_insertfg, s:cterm_insertbg] " Outside blocks in insert mode
|
||||
let s:I2 = [s:gui_insertbg, s:gui_termbg2, s:cterm_insertbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.insert = airline#themes#generate_color_map(s:I1, s:BB, s:I2)
|
||||
let g:airline#themes#murmur#palette.insert_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [s:gui_replacefg, s:gui_replacebg, s:cterm_replacefg, s:cterm_replacebg] " Outside blocks in replace mode
|
||||
let s:R2 = [s:gui_termfg, s:gui_termbg2, s:cterm_termfg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.replace = airline#themes#generate_color_map(s:R1, s:BB, s:R2)
|
||||
let g:airline#themes#murmur#palette.replace_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_visualfg, s:gui_visualbg, s:cterm_visualfg, s:cterm_visualbg] " Outside blocks in visual mode
|
||||
let s:V2 = [s:gui_visualbg, s:gui_termbg2, s:cterm_visualbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.visual = airline#themes#generate_color_map(s:V1, s:BB, s:V2)
|
||||
let g:airline#themes#murmur#palette.visual_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Inactive mode
|
||||
let s:IA1 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let s:IA2 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let s:IA3 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let g:airline#themes#murmur#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
|
||||
" CtrlP plugin colors
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#murmur#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [s:gui_normalfg, s:gui_normalbg, s:cterm_normalfg, s:cterm_normalbg, ''],
|
||||
\ [s:gui_termfg, s:gui_termbg, s:cterm_termfg, s:cterm_termbg, ''],
|
||||
\ [s:gui_termfg2, s:gui_termbg2, s:cterm_termfg2, s:cterm_termbg2, 'bold'])
|
||||
@@ -1,46 +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 g:airline#themes#powerlineish#palette = {}
|
||||
|
||||
let g:airline#themes#powerlineish#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let g:airline#themes#powerlineish#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
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)
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
let g:airline#themes#raven#palette = {}
|
||||
|
||||
let g:airline#themes#raven#palette.accents = {
|
||||
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let s:N2 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let s:N3 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let g:airline#themes#raven#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#raven#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let s:I2 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let s:I3 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let g:airline#themes#raven#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#raven#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#raven#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#2e2e2e' , s:I1[2] , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#raven#palette.replace = copy(g:airline#themes#raven#palette.insert)
|
||||
let g:airline#themes#raven#palette.replace.airline_a = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
|
||||
let g:airline#themes#raven#palette.replace.airline_z = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
|
||||
let g:airline#themes#raven#palette.replace_modified = g:airline#themes#raven#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let s:V2 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let s:V3 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let g:airline#themes#raven#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#raven#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#5e5e5e' , '#222222' , 59 , 235 , '' ]
|
||||
let g:airline#themes#raven#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#raven#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#raven#palette.tabline = {
|
||||
\ 'airline_tab': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabsel': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
|
||||
\ 'airline_tabtype': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabfill': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabmod': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ff0000', '#2e2e2e', 196, 235 ]
|
||||
let g:airline#themes#raven#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#raven#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.insert.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.visual.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.replace.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#raven#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
|
||||
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
|
||||
\ [ '#2e2e2e' , '#a4c639' , 235 , 149 , '' ] )
|
||||
@@ -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:N1 = [ '#00dfff' , s:guibg , 45 , s:termbg ]
|
||||
let s:N2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:N3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
|
||||
let g:airline#themes#serene#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#serene#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#5fff00' , s:guibg , 82 , s:termbg ]
|
||||
let s:I2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:I3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
let g:airline#themes#serene#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#serene#palette.insert_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
let g:airline#themes#serene#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#serene#palette.replace = {
|
||||
\ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#serene#palette.replace_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
let s:V1 = [ '#dfdf00' , s:guibg , 184 , s:termbg ]
|
||||
let s:V2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:V3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
let g:airline#themes#serene#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#serene#palette.visual_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , s:guisep , 239 , s:termsep , '' ]
|
||||
let g:airline#themes#serene#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2)
|
||||
let g:airline#themes#serene#palette.inactive_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
let g:airline#themes#silver#palette = {}
|
||||
|
||||
let g:airline#themes#silver#palette.accents = {
|
||||
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let s:N2 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let s:N3 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let g:airline#themes#silver#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#silver#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let s:I2 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let s:I3 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let g:airline#themes#silver#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#silver#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#silver#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#e1e1e1' , s:I1[2] , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#silver#palette.replace = copy(g:airline#themes#silver#palette.insert)
|
||||
let g:airline#themes#silver#palette.replace.airline_a = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
|
||||
let g:airline#themes#silver#palette.replace.airline_z = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
|
||||
let g:airline#themes#silver#palette.replace_modified = g:airline#themes#silver#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let s:V2 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let s:V3 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let g:airline#themes#silver#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#silver#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#a1a1a1' , '#dddddd' , 145 , 188 , '' ]
|
||||
let g:airline#themes#silver#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#silver#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#silver#palette.tabline = {
|
||||
\ 'airline_tab': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabsel': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
|
||||
\ 'airline_tabtype': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabfill': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabmod': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ff0000', '#e1e1e1', 196, 188 ]
|
||||
let g:airline#themes#silver#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#silver#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.insert.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.visual.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.replace.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#silver#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
|
||||
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
|
||||
\ [ '#e1e1e1' , '#007599' , 188 , 30 , '' ] )
|
||||
@@ -1,46 +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: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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
let g:airline#themes#simple#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#df0000', '', 160, '', '' ] ,
|
||||
\ }
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
" vim-airline companion theme of Sol
|
||||
" (https://github.com/Pychimp/vim-sol)
|
||||
|
||||
let g:airline#themes#sol#palette = {}
|
||||
|
||||
let g:airline#themes#sol#palette.accents = {
|
||||
\ 'red': [ '#ffffff' , '' , 231 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#343434' , '#a0a0a0' , 237 , 248 ]
|
||||
let s:N2 = [ '#343434' , '#b3b3b3' , 237 , 250 ]
|
||||
let s:N3 = [ '#343434' , '#c7c7c7' , 237 , 252 ]
|
||||
let g:airline#themes#sol#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#sol#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#ff6868' , 237 , 209 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#eeeeee' , '#09643f' , 255 , 30 ]
|
||||
let s:I2 = [ '#343434' , '#a3a3a3' , 237 , 249 ]
|
||||
let s:I3 = [ '#343434' , '#b0b0b0' , 237 , 250 ]
|
||||
let g:airline#themes#sol#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#sol#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#343434' , '#ffdbc7' , 237 , 216 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#sol#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#09643f' , s:I1[2] , 30 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#sol#palette.replace = copy(g:airline#themes#sol#palette.insert)
|
||||
let g:airline#themes#sol#palette.replace.airline_a = [ s:I1[0] , '#ff2121' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#sol#palette.replace.airline_z = [ s:I1[0] , '#ff2121' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#sol#palette.replace_modified = g:airline#themes#sol#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#ffff9a' , '#ff6003' , 222 , 202 ]
|
||||
let s:V2 = [ '#343434' , '#a3a3a3' , 237 , 249 ]
|
||||
let s:V3 = [ '#343434' , '#b0b0b0' , 237 , 250 ]
|
||||
let g:airline#themes#sol#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#sol#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#343434' , '#ffdbc7' , 237 , 216 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#777777' , '#c7c7c7' , 244 , 251 , '' ]
|
||||
let g:airline#themes#sol#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#sol#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#ff3535' , '' , 203 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#sol#palette.tabline = {
|
||||
\ 'airline_tab': ['#343434', '#b3b3b3', 237, 250, ''],
|
||||
\ 'airline_tabsel': ['#ffffff', '#004b9a', 231, 31 , ''],
|
||||
\ 'airline_tabtype': ['#343434', '#a0a0a0', 237, 248, ''],
|
||||
\ 'airline_tabfill': ['#343434', '#c7c7c7', 237, 251, ''],
|
||||
\ 'airline_tabmod': ['#343434', '#ffdbc7', 237, 216, ''],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#eeeeee', '#e33900', 255, 166 ]
|
||||
let g:airline#themes#sol#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#sol#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.insert.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.visual.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.replace.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#sol#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#343434' , '#c7c7c7' , 237 , 251 , '' ] ,
|
||||
\ [ '#343434' , '#b3b3b3' , 237 , 250 , '' ] ,
|
||||
\ [ '#eeeeee' , '#007fff' , 255 , 27 , '' ] )
|
||||
@@ -1,176 +0,0 @@
|
||||
let g:airline#themes#solarized#palette = {}
|
||||
|
||||
function! airline#themes#solarized#refresh()
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Options
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
let s:background = get(g:, 'airline_solarized_bg', &background)
|
||||
let s:ansi_colors = get(g:, 'solarized_termcolors', 16) != 256 && &t_Co >= 16 ? 1 : 0
|
||||
let s:tty = &t_Co == 8
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Colors
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Base colors
|
||||
let s:base03 = {'t': s:ansi_colors ? 8 : (s:tty ? '0' : 234), 'g': '#002b36'}
|
||||
let s:base02 = {'t': s:ansi_colors ? '0' : (s:tty ? '0' : 235), 'g': '#073642'}
|
||||
let s:base01 = {'t': s:ansi_colors ? 10 : (s:tty ? '0' : 240), 'g': '#586e75'}
|
||||
let s:base00 = {'t': s:ansi_colors ? 11 : (s:tty ? '7' : 241), 'g': '#657b83'}
|
||||
let s:base0 = {'t': s:ansi_colors ? 12 : (s:tty ? '7' : 244), 'g': '#839496'}
|
||||
let s:base1 = {'t': s:ansi_colors ? 14 : (s:tty ? '7' : 245), 'g': '#93a1a1'}
|
||||
let s:base2 = {'t': s:ansi_colors ? 7 : (s:tty ? '7' : 254), 'g': '#eee8d5'}
|
||||
let s:base3 = {'t': s:ansi_colors ? 15 : (s:tty ? '7' : 230), 'g': '#fdf6e3'}
|
||||
let s:yellow = {'t': s:ansi_colors ? 3 : (s:tty ? '3' : 136), 'g': '#b58900'}
|
||||
let s:orange = {'t': s:ansi_colors ? 9 : (s:tty ? '1' : 166), 'g': '#cb4b16'}
|
||||
let s:red = {'t': s:ansi_colors ? 1 : (s:tty ? '1' : 160), 'g': '#dc322f'}
|
||||
let s:magenta = {'t': s:ansi_colors ? 5 : (s:tty ? '5' : 125), 'g': '#d33682'}
|
||||
let s:violet = {'t': s:ansi_colors ? 13 : (s:tty ? '5' : 61 ), 'g': '#6c71c4'}
|
||||
let s:blue = {'t': s:ansi_colors ? 4 : (s:tty ? '4' : 33 ), 'g': '#268bd2'}
|
||||
let s:cyan = {'t': s:ansi_colors ? 6 : (s:tty ? '6' : 37 ), 'g': '#2aa198'}
|
||||
let s:green = {'t': s:ansi_colors ? 2 : (s:tty ? '2' : 64 ), 'g': '#859900'}
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Simple mappings
|
||||
" NOTE: These are easily tweakable mappings. The actual mappings get
|
||||
" the specific gui and terminal colors from the base color dicts.
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Normal mode
|
||||
if s:background == 'dark'
|
||||
let s:N1 = [s:base3, s:base1, 'bold']
|
||||
let s:N2 = [s:base2, (s:tty ? s:base01 : s:base00), '']
|
||||
let s:N3 = [s:base01, s:base02, '']
|
||||
else
|
||||
let s:N1 = [s:base2, s:base00, 'bold']
|
||||
let s:N2 = [(s:tty ? s:base01 : s:base2), s:base1, '']
|
||||
let s:N3 = [s:base1, s:base2, '']
|
||||
endif
|
||||
let s:NF = [s:orange, s:N3[1], '']
|
||||
let s:NW = [s:base3, s:orange, '']
|
||||
if s:background == 'dark'
|
||||
let s:NM = [s:base1, s:N3[1], '']
|
||||
let s:NMi = [s:base2, s:N3[1], '']
|
||||
else
|
||||
let s:NM = [s:base01, s:N3[1], '']
|
||||
let s:NMi = [s:base02, s:N3[1], '']
|
||||
endif
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:N1[0], s:yellow, 'bold']
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let s:IF = s:NF
|
||||
let s:IM = s:NM
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:N1[0], s:magenta, 'bold']
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let s:VF = s:NF
|
||||
let s:VM = s:NM
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [s:N1[0], s:red, '']
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let s:RM = s:NM
|
||||
let s:RF = s:NF
|
||||
|
||||
" Inactive, according to VertSplit in solarized
|
||||
" (bg dark: base00; bg light: base0)
|
||||
if s:background == 'dark'
|
||||
let s:IA = [s:base02, s:base00, '']
|
||||
else
|
||||
let s:IA = [s:base2, s:base0, '']
|
||||
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 s:RFa = [s:RF[0].g, s:RF[1].g, s:RF[0].t, s:RF[1].t, s:RF[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.accents = {
|
||||
\ 'red': s:NFa,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#solarized#palette.inactive = airline#themes#generate_color_map(
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]])
|
||||
let g:airline#themes#solarized#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:NMi[0].g, '', s:NMi[0].t, '', s:NMi[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.normal = airline#themes#generate_color_map(
|
||||
\ [s:N1[0].g, s:N1[1].g, s:N1[0].t, s:N1[1].t, s:N1[2]],
|
||||
\ [s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]],
|
||||
\ [s:N3[0].g, s:N3[1].g, s:N3[0].t, s:N3[1].t, s:N3[2]])
|
||||
|
||||
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]])
|
||||
|
||||
let g:airline#themes#solarized#palette.insert.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.insert_modified = {
|
||||
\ 'airline_c': [s:IM[0].g, s:IM[1].g,
|
||||
\ s:IM[0].t, s:IM[1].t, s:IM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.visual = airline#themes#generate_color_map(
|
||||
\ [s:V1[0].g, s:V1[1].g, s:V1[0].t, s:V1[1].t, s:V1[2]],
|
||||
\ [s:V2[0].g, s:V2[1].g, s:V2[0].t, s:V2[1].t, s:V2[2]],
|
||||
\ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.visual.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.visual_modified = {
|
||||
\ 'airline_c': [s:VM[0].g, s:VM[1].g,
|
||||
\ s:VM[0].t, s:VM[1].t, s:VM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.replace = airline#themes#generate_color_map(
|
||||
\ [s:R1[0].g, s:R1[1].g, s:R1[0].t, s:R1[1].t, s:R1[2]],
|
||||
\ [s:R2[0].g, s:R2[1].g, s:R2[0].t, s:R2[1].t, s:R2[2]],
|
||||
\ [s:R3[0].g, s:R3[1].g, s:R3[0].t, s:R3[1].t, s:R3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.replace.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.replace_modified = {
|
||||
\ 'airline_c': [s:RM[0].g, s:RM[1].g,
|
||||
\ s:RM[0].t, s:RM[1].t, s:RM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline = {}
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline.airline_tab = [
|
||||
\ s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline.airline_tabtype = [
|
||||
\ s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]]
|
||||
endfunction
|
||||
|
||||
call airline#themes#solarized#refresh()
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
let g:airline#themes#tomorrow#palette = {}
|
||||
|
||||
function! airline#themes#tomorrow#refresh()
|
||||
let g:airline#themes#tomorrow#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Directory', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Pmenu')
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#tomorrow#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
let g:airline#themes#tomorrow#palette.inactive_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
call airline#themes#tomorrow#refresh()
|
||||
|
||||
@@ -1,64 +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:IA = [ s:N2[1], s:N3[1], s:N2[3], s:N3[3], '' ]
|
||||
|
||||
let g:airline#themes#ubaryd#palette = {}
|
||||
|
||||
let g:airline#themes#ubaryd#palette.accents = {
|
||||
\ 'red': [ '#ff7400' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let g:airline#themes#ubaryd#palette.inactive = {
|
||||
\ 'airline_a' : [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
let g:airline#themes#ubaryd#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user