Skip to content

Commit

Permalink
feat: Added Airline themes
Browse files Browse the repository at this point in the history
Fixed #20
  • Loading branch information
ful1e5 committed May 23, 2023
1 parent 20a949d commit f6efb41
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### What's New?

- Included Airline themes Fixed #20
- CI: Get and update primer primitives automatically #253

### Changes

### Issues Fix
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ This command will attach an autocmd to the current buffer that executes on `Buff
- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
- [nvim-web-devicons](https://github.com/kyazdani42/nvim-web-devicons)
- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
- [vim-airline](https://github.com/vim-airline/vim-airline)
- [vim-gitgutter](https://github.com/airblade/vim-gitgutter)
- [which-key.nvim](https://github.com/folke/which-key.nvim)

Expand All @@ -594,6 +595,10 @@ vim.cmd('colorscheme github_dark')
require('lualine').setup({ ... })
```

### Airline

Set your airline colorscheme with `:AirlineThemes` vim command.

## Syntax highlight groups

This section will help you determine what highlight group is being applied to a piece of syntax. These sections will
Expand Down
2 changes: 2 additions & 0 deletions autoload/airline/themes/github_dark.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lua require('github-theme.util.airline')('github_dark')

1 change: 1 addition & 0 deletions autoload/airline/themes/github_dark_colorblind.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require('github-theme.util.airline')('github_dark_colorblind')
1 change: 1 addition & 0 deletions autoload/airline/themes/github_dark_default.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require('github-theme.util.airline')('github_dark_high_contrast')
1 change: 1 addition & 0 deletions autoload/airline/themes/github_dark_dimmed.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require('github-theme.util.airline')('github_dark_dimmed')
1 change: 1 addition & 0 deletions autoload/airline/themes/github_dark_high_contrast.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require('github-theme.util.airline')('github_dark_high_constrast')
1 change: 1 addition & 0 deletions autoload/airline/themes/github_dark_tritanopia.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require('github-theme.util.airline')('github_dark_tritanopia')
1 change: 1 addition & 0 deletions autoload/airline/themes/github_light.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require('github-theme.util.airline')('github_light')
1 change: 1 addition & 0 deletions autoload/airline/themes/github_light_colorblind.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require('github-theme.util.airline')('github_light_colorblind')
1 change: 1 addition & 0 deletions autoload/airline/themes/github_light_high_contrast.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require('github-theme.util.airline')('github_light_high_contrast')
1 change: 1 addition & 0 deletions autoload/airline/themes/github_light_tritanopia.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require('github-theme.util.airline')('github_light_tritanopia')
31 changes: 31 additions & 0 deletions lua/github-theme/util/airline.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
local C = require('github-theme.lib.color')

return function(style)
local config = require('github-theme.config').options
local s = require('github-theme.spec').load(style)
local p = s.palette
local tbg = config.transparent and 'NONE' or s.bg0

local function blend(color, a)
return C(s.bg1):blend(C(color), a):to_css()
end

local generate_color_map = function(color)
local t = {
{ tbg, color, 59, 74 }, -- guifg guibg ctermfg ctermbg
{ color, blend(color, 0.1), 74, 59 }, -- guifg guibg ctermfg ctermbg
{ s.fg2, blend(p.black.base, 0.2), 145, 16 }, -- guifg guibg ctermfg ctermbg
}
return vim.fn['airline#themes#generate_color_map'](t[1], t[2], t[3])
end

vim.g['airline#themes#' .. style .. '#palette'] = {
normal = generate_color_map(p.blue.base),
insert = generate_color_map(p.green.base),
visual = generate_color_map(p.yellow.base),
replace = generate_color_map(p.red.base),
commandline = generate_color_map(p.magenta.bright),
terminal = generate_color_map(p.orange),
inactive = generate_color_map(s.fg0),
}
end

0 comments on commit f6efb41

Please sign in to comment.