2021-01-02 23:14:48 +00:00
|
|
|
# Contributing to lualine.nvim
|
|
|
|
|
|
|
|
### Adding a theme
|
|
|
|
|
|
|
|
* refer to example below to see how themes are defined
|
|
|
|
* take 4 screenshots showing a different vim modes (normal, insert, visual, replace)
|
|
|
|
* add your theme with screenshots attached to [THEMES.md](./THEMES.md) while maintaining alphabetical order
|
2021-04-07 15:25:02 +00:00
|
|
|
* If the colorscheme you're trying to add already support lightline. You can use
|
|
|
|
[lightline2lualine theme converter](https://gist.github.com/shadmansaleh/000871c9a608a012721c6acc6d7a19b9) to easily port the theme to lualine.
|
|
|
|
|
|
|
|
**Note to colorscheme authors** : If you want to support lualine. You can put your
|
|
|
|
lualine theme at lua/lualine/themes/{your_colorscheme}.lua in you repo.
|
2021-01-02 23:14:48 +00:00
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><b>theme example</b></summary>
|
|
|
|
|
|
|
|
To create a custom theme you need to define a colorscheme for each of vim's modes. Each mode has a `fg` and `bg` field for every lualine section.
|
2021-08-02 14:25:34 +00:00
|
|
|
To specify colors you can use #rrggbb/color_name(like: red)/cterm_color(0-255).
|
2021-01-08 01:35:09 +00:00
|
|
|
You can add special effects with `gui`.
|
|
|
|
|
2021-05-13 16:39:30 +00:00
|
|
|
Though the example shows a,b,c being set you can specify theme for x, y, z too.
|
|
|
|
But if unspecified then they default to c, b, a sections theme respectively .
|
|
|
|
Also all modes theme defaults to normal modes theme.
|
2021-01-02 23:14:48 +00:00
|
|
|
|
2021-05-13 16:39:30 +00:00
|
|
|
Adding theme is really easy in lua. Here is and example of a gruvbox theme.
|
2021-01-02 23:14:48 +00:00
|
|
|
```lua
|
|
|
|
local colors = {
|
2021-05-14 00:09:34 +00:00
|
|
|
black = '#282828',
|
2021-02-22 20:28:29 +00:00
|
|
|
white = '#ebdbb2',
|
|
|
|
red = '#fb4934',
|
|
|
|
green = '#b8bb26',
|
|
|
|
blue = '#83a598',
|
|
|
|
yellow = '#fe8019',
|
2021-01-08 01:35:09 +00:00
|
|
|
gray = '#a89984',
|
|
|
|
darkgray = '#3c3836',
|
|
|
|
lightgray = '#504945',
|
2021-01-02 23:14:48 +00:00
|
|
|
inactivegray = '#7c6f64',
|
|
|
|
}
|
2021-05-14 00:09:34 +00:00
|
|
|
return {
|
|
|
|
normal = {
|
|
|
|
a = {bg = colors.gray, fg = colors.black, gui = 'bold'},
|
|
|
|
b = {bg = colors.lightgray, fg = colors.white},
|
|
|
|
c = {bg = colors.darkgray, fg = colors.gray}
|
|
|
|
},
|
|
|
|
insert = {
|
|
|
|
a = {bg = colors.blue, fg = colors.black, gui = 'bold'},
|
|
|
|
b = {bg = colors.lightgray, fg = colors.white},
|
|
|
|
c = {bg = colors.lightgray, fg = colors.white}
|
|
|
|
},
|
|
|
|
visual = {
|
|
|
|
a = {bg = colors.yellow, fg = colors.black, gui = 'bold'},
|
|
|
|
b = {bg = colors.lightgray, fg = colors.white},
|
|
|
|
c = {bg = colors.inactivegray, fg = colors.black}
|
|
|
|
},
|
|
|
|
replace = {
|
|
|
|
a = {bg = colors.red, fg = colors.black, gui = 'bold'},
|
|
|
|
b = {bg = colors.lightgray, fg = colors.white},
|
|
|
|
c = {bg = colors.black, fg = colors.white}
|
|
|
|
},
|
|
|
|
command = {
|
|
|
|
a = {bg = colors.green, fg = colors.black, gui = 'bold'},
|
|
|
|
b = {bg = colors.lightgray, fg = colors.white},
|
|
|
|
c = {bg = colors.inactivegray, fg = colors.black}
|
|
|
|
},
|
|
|
|
inactive = {
|
|
|
|
a = {bg = colors.darkgray, fg = colors.gray, gui = 'bold'},
|
|
|
|
b = {bg = colors.darkgray, fg = colors.gray},
|
|
|
|
c = {bg = colors.darkgray, fg = colors.gray}
|
|
|
|
}
|
2021-01-02 23:14:48 +00:00
|
|
|
}
|
2021-03-17 00:37:34 +00:00
|
|
|
require('lualine').setup {options = {theme = gruvbox}}
|
2021-01-02 23:14:48 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
</details>
|