UNPKG

2.47 kBMarkdownView Raw
1# Airline themes
2
3## Creating styles
4
5Before creating the airline theme you need at least one color palette in `estilo/themes` folder. Then proceed to add the blank airline template from the command line:
6
7```sh
8estilo add-airline
9```
10
11This command will create a style file in `estilo/airline` directory of your project. Open it, it will look like this:
12
13```yml
14normal1: ''
15normal2: ''
16normal3: ''
17inactive1: ''
18inactive2: ''
19inactive3: ''
20insert1: ''
21insert2: ''
22insert3: ''
23replace1: ''
24replace2: ''
25replace3: ''
26visual1: ''
27visual2: ''
28visual3: ''
29```
30
31Every property in the template is composed by a name and a number, they represents how a part of the status line will look in a particular vim mode. That means the first line defines the style of the part 1 of the bar in normal mode, and so on.
32
33Part 1 represents the first and the last block of the status bar, part 2 the second and fourth, and the part 3 is for the center block (the third one).
34
35![airline blocks](https://cloud.githubusercontent.com/assets/829859/16402004/55f3682c-3ce9-11e6-8bd9-eaafbaaccb2e.png)
36
37Go to the first definition and fill its value inside the quotes (`''`), write the foreground and the background color names separated by a space (these ones should be in your color template). It should look something like this:
38
39```yml
40normal1: 'myblue mydark'
41```
42
43
44## Add theme to `estilo.yml`
45
46Open `estilo.yml` file and add an object for each theme with its parameters inside `airline` list. Every one has 3 parameters:
47
48- name: the name of the airline theme (should have not spaces)
49- palette: the name of the color palette. It's the same as the file inside `palettes` folder without the `.yml` extension
50- style: It's the same as the file inside `airline` folder without the `.yml` extension
51
52Example:
53
54```yml
55airline:
56 - name: 'awesome-night'
57 palette: 'awesome'
58 style: 'night'
59 - name: 'awesome-day'
60 palette: 'awesome'
61 style: 'day'
62```
63
64
65## Render
66
67With the command line in the project folder:
68
69```sh
70estilo render
71```
72
73Rendered files are in `plugins` folder of your project
74
75
76## Activating the theme
77
78Open your vim config file and add the next lines:
79
80```vim
81let g:PKG_NAME_airline = 1
82let g:airline_theme = 'MY_THEME_NAME'
83```
84
85Replace `PKG_NAME` with the name of your project (the name from `estilo.yml`), and `MY_THEME_NAME` with the name of the Airline theme you want to activate.
86
87Remember to add instructions to the `README` of your project before you publish it.