2021-01-02 23:14:48 +00:00
|
|
|
# Contributing to lualine.nvim
|
|
|
|
|
|
|
|
|
|
|
|
### General
|
|
|
|
|
2021-03-17 00:35:49 +00:00
|
|
|
please use lua-format before creating a pr :smile:
|
2021-01-02 23:14:48 +00:00
|
|
|
|
2021-03-17 00:35:49 +00:00
|
|
|
### All contributions are very welcome but themes require a lot of work on my part if not done properly so here's a guide on how to do them.
|
2021-01-02 23:14:48 +00:00
|
|
|
|
|
|
|
### 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
|
|
|
|
|
|
|
|
<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-01-08 01:35:09 +00:00
|
|
|
You can add special effects with `gui`.
|
|
|
|
|
|
|
|
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 gruvbox = { }
|
|
|
|
|
|
|
|
local colors = {
|
2021-02-22 20:28:29 +00:00
|
|
|
black = "#282828",
|
|
|
|
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',
|
|
|
|
}
|
|
|
|
|
|
|
|
gruvbox.normal = {
|
2021-01-08 01:35:09 +00:00
|
|
|
-- gui parameter is optional and behaves the same way as in vim's highlight command
|
|
|
|
a = { bg = colors.gray, fg = colors.black, gui = "bold", },
|
|
|
|
b = { bg = colors.lightgray, fg = colors.white, },
|
|
|
|
c = { bg = colors.darkgray, fg = colors.gray }
|
2021-01-02 23:14:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gruvbox.insert = {
|
2021-01-08 01:35:09 +00:00
|
|
|
a = { bg = colors.blue, fg = colors.black, gui = "bold", },
|
|
|
|
b = { bg = colors.lightgray, fg = colors.white, },
|
|
|
|
c = { bg = colors.lightgray, fg = colors.white }
|
2021-01-02 23:14:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gruvbox.visual = {
|
2021-01-08 01:35:09 +00:00
|
|
|
a = { bg = colors.yellow, fg = colors.black, gui = "bold", },
|
|
|
|
b = { bg = colors.lightgray, fg = colors.white, },
|
|
|
|
c = { bg = colors.inactivegray, fg = colors.black },
|
2021-01-02 23:14:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gruvbox.replace = {
|
2021-01-08 01:35:09 +00:00
|
|
|
a = { bg = colors.red, fg = colors.black, gui = "bold", },
|
|
|
|
b = { bg = colors.lightgray, fg = colors.white, },
|
|
|
|
c = { bg = colors.black, fg = colors.white },
|
2021-01-02 23:14:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gruvbox.command = {
|
2021-01-08 01:35:09 +00:00
|
|
|
a = { bg = colors.green, fg = colors.black, gui = "bold", },
|
|
|
|
b = { bg = colors.lightgray, fg = colors.white, },
|
|
|
|
c = { bg = colors.inactivegray, fg = colors.black },
|
2021-01-02 23:14:48 +00:00
|
|
|
}
|
|
|
|
|
2021-01-08 01:35:09 +00:00
|
|
|
-- you can assign one colorscheme to another, if a colorscheme is
|
|
|
|
-- undefined it falls back to normal
|
2021-01-02 23:14:48 +00:00
|
|
|
gruvbox.terminal = gruvbox.normal
|
|
|
|
|
|
|
|
gruvbox.inactive = {
|
2021-01-08 01:35:09 +00:00
|
|
|
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-15 17:29:34 +00:00
|
|
|
lualine.options.theme = gruvbox
|
2021-01-02 23:14:48 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
</details>
|