1 | # Airline themes
|
2 |
|
3 | ## Creating styles
|
4 |
|
5 | Before 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
|
8 | estilo add-airline
|
9 | ```
|
10 |
|
11 | This command will create a style file in `estilo/airline` directory of your project. Open it, it will look like this:
|
12 |
|
13 | ```yml
|
14 | normal1: ''
|
15 | normal2: ''
|
16 | normal3: ''
|
17 | inactive1: ''
|
18 | inactive2: ''
|
19 | inactive3: ''
|
20 | insert1: ''
|
21 | insert2: ''
|
22 | insert3: ''
|
23 | replace1: ''
|
24 | replace2: ''
|
25 | replace3: ''
|
26 | visual1: ''
|
27 | visual2: ''
|
28 | visual3: ''
|
29 | ```
|
30 |
|
31 | Every 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 |
|
33 | Part 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 |
|
37 | Go 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
|
40 | normal1: 'myblue mydark'
|
41 | ```
|
42 |
|
43 |
|
44 | ## Add theme to `estilo.yml`
|
45 |
|
46 | Open `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 |
|
52 | Example:
|
53 |
|
54 | ```yml
|
55 | airline:
|
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 |
|
67 | With the command line in the project folder:
|
68 |
|
69 | ```sh
|
70 | estilo render
|
71 | ```
|
72 |
|
73 | Rendered files are in `plugins` folder of your project
|
74 |
|
75 |
|
76 | ## Activating the theme
|
77 |
|
78 | Open your vim config file and add the next lines:
|
79 |
|
80 | ```vim
|
81 | let g:PKG_NAME_airline = 1
|
82 | let g:airline_theme = 'MY_THEME_NAME'
|
83 | ```
|
84 |
|
85 | Replace `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 |
|
87 | Remember to add instructions to the `README` of your project before you publish it.
|