Skip to content

Commit 006812a

Browse files
authored
Merge pull request #2 from uloco/develop
merge 1.0.0
2 parents f79807c + 44d0eac commit 006812a

File tree

8 files changed

+261
-54
lines changed

8 files changed

+261
-54
lines changed

README.md

Lines changed: 141 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,145 @@
1-
# bluloco.nvim
2-
bluloco theme port for neovim
1+
# Bluloco.nvim
32

4-
## THIS IS A WORK IN PROGRESS AND NOT READY YET!
3+
A fancy but yet sophisticated light and dark designer neovim theme built with [lush.nvim](https://github.com/rktjmp/lush.nvim).
4+
It features a much more comprehensive usage of syntax scopes and color
5+
consistency, with due regards to aesthetics, contrast and readability.
6+
Most popular plugins are also supported, see _plugins_ (link)
57

6-
If you want to get notified when the first version is available go ahead and
7-
please star this project.
8+
This theme also works very good when Apple's **Nightshift Mode** is activated.
89

9-
Seeing other people interested in this,
10-
makes me probably finish it faster, too. ;)
10+
This is a port of the popular Visual Studio Code Themes
11+
[Bluloco Light](https://github.com/uloco/theme-bluloco-light) and
12+
[Bluloco Dark](https://github.com/uloco/theme-bluloco-dark)
1113

14+
### Dark
15+
16+
![dark](./screenshots/dark.png)
17+
18+
### Light
19+
20+
![light](./screenshots/light.png)
21+
22+
## Features
23+
24+
- Auto switching light & dark style
25+
- Configureable _transparency_ and _italics_
26+
- Exhaustive plugin support
27+
- Written in lua
28+
29+
## Plugins
30+
31+
Currently supported plugins are:
32+
33+
- [treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
34+
- [hlargs](https://github.com/m-demare/hlargs.nvim)
35+
- [lsp](https://github.com/neovim/lsp-config)
36+
- [lspsaga](https://github.com/glepnir/lspsaga.nvim)
37+
- [telescope](https://github.com/nvim-telescope/telescope.nvim)
38+
- [telescope-file-browser](https://github.com/nvim-telescope/telescope-file-browser.nvim)
39+
- [nvim-tree](https://github.com/kyazdani42/nvim-tree.lua)
40+
- [trouble](https://github.com/folke/trouble.nvim)
41+
- [todo-comments](https://github.com/folke/todo-comments.nvim)
42+
- [which-key](https://github.com/liuchengxu/vim-which-key)
43+
- [cmp](https://github.com/hrsh7th/nvim-cmp)
44+
- [gitsigns](https://github.com/lewis6991/gitsigns.nvim)
45+
- [git-conflict](https://github.com/akinsho/git-conflict.nvim)
46+
- [diffview](https://github.com/sindrets/diffview.nvim)
47+
- [neogit](https://github.com/TimUntersberger/neogit)
48+
- [indent-blankline](https://github.com/lukas-reineke/indent-blankline.nvim)
49+
- [bufferline](https://github.com/akinsho/nvim-bufferline.lua)
50+
- [lualine](https://github.com/hoob3rt/lualine.nvim)
51+
- [scrollbar](https://github.com/petertriho/nvim-scrollbar)
52+
- [illuminated](https://github.com/RRethy/vim-illuminate)
53+
- [cursorword](https://github.com/xiyaowong/nvim-cursorword)
54+
- [mason](https://github.com/williamboman/mason.nvim)
55+
- [notify](https://github.com/rcarriga/nvim-notify)
56+
- [alpha](https://github.com/goolord/alpha-nvim)
57+
58+
<!--
59+
TODO:
60+
<details>
61+
<summary> Example config </summary>
62+
</details
63+
- Foldable with screenshots
64+
- Add needed config hereF -->
65+
66+
## Install
67+
68+
Install Bluloco with [packer](https://github.com/wbthomason/packer.nvim):
69+
70+
```lua
71+
use {
72+
'uloco/bluloco.nvim',
73+
requires = { 'rktjmp/lush.nvim' }
74+
}
75+
```
76+
77+
## Usage
78+
79+
Enable the colorscheme with defaults.
80+
81+
> ⚠️ The `setup()` function is optional but please call it
82+
> **before** you set the colorscheme if you want to adjust the config.
83+
84+
```lua
85+
require("bluloco").setup({
86+
style = "auto" -- "auto" | "dark" | "light"
87+
transparent = false,
88+
italics = false,
89+
})
90+
91+
vim.cmd('colorscheme bluloco')
92+
```
93+
94+
You can also apply the style variant directly.
95+
These are especially helpful when switching in an already running vim session.
96+
97+
```vim
98+
:colorscheme bluloco-dark
99+
:colorscheme bluloco-light
100+
```
101+
102+
#### Lualine
103+
104+
Make sure your lualine settings are set to auto:
105+
106+
```lua
107+
require('lualine').setup {
108+
options = {
109+
theme = 'auto'
110+
}
111+
}
112+
```
113+
114+
## Config
115+
116+
### Style
117+
118+
There are three styles you can configure here: `auto`, `dark` and `light`.
119+
The `auto` setting is the default and will adjust automatically to your
120+
`vim.o.background` value. If you change this value during runtime, it will also adjust accordingly.
121+
122+
> ℹ️ The style value only applies if you set the theme with `vim.cmd('colorscheme bluloco')`.
123+
> Setting the theme with a variant directly will override this setting.
124+
125+
### Transparency
126+
127+
This setting will disable the background and use the default background of your terminal.
128+
You need to enable this if you want the terminal to be transparent. You would still need to
129+
configure your terminal accordingly for light and dark backgrounds when switching often.
130+
131+
<!-- TODO: See: auto switching themes.
132+
See: bluloco theme for iTerm2 -->
133+
134+
### Italics
135+
136+
This setting will enable italics for _keywords_, _comments_ and _markup attributes_.
137+
138+
<!-- ## Recipes
139+
### Auto switching light & dark themes
140+
-->
141+
142+
## Contributing
143+
144+
I'd be more than happy for any bugs you find and add an [issue](https://github.com/uloco/bluloco.nvim/issues).
145+
Pull requests are warmly welcome especially for missing plugin support.

colors/bluloco-dark.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
local bluloco = require("bluloco")
2+
3+
bluloco.config.style = "dark"
4+
vim.o.background = "dark"
5+
6+
bluloco.load()

colors/bluloco-light.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
local bluloco = require("bluloco")
2+
3+
bluloco.config.style = "light"
4+
vim.o.background = "light"
5+
6+
bluloco.load()

colors/bluloco.lua

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
-- You probably always want to set this in your vim file
2-
-- vim.opt.background = 'dark'
3-
vim.g.colors_name = 'bluloco'
1+
---@diagnostic disable: undefined-global
2+
local bluloco = require("bluloco")
3+
local config = bluloco.config
4+
local load = bluloco.load
45

5-
-- By setting our module to nil, we clear lua's cache,
6-
-- which means the require ahead will *always* occur.
7-
--
8-
-- This isn't strictly required but it can be a useful trick if you are
9-
-- incrementally editing your config a lot and want to be sure your themes
10-
-- changes are being picked up without restarting neovim.
11-
--
12-
-- Note if you're working in on your theme and have :Lushify'd the buffer,
13-
-- your changes will be applied with our without the following line.
14-
--
15-
-- The performance impact of this call can be measured in the hundreds of
16-
-- *nanoseconds* and such could be considered "production safe".
17-
package.loaded['lush_theme.bluloco'] = nil
18-
19-
-- include our theme file and pass it to lush to apply
20-
require('lush')(require('lush_theme.bluloco'))
6+
if (config.style == "dark") then
7+
vim.o.background = "dark"
8+
elseif (config.style == "light") then
9+
vim.o.background = "light"
10+
end
2111

12+
load()

lua/bluloco/init.lua

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---@diagnostic disable: undefined-global
2+
local lush = require('lush')
3+
local M = {}
4+
5+
local defaultConfig = {
6+
style = "auto", -- auto | light | dark
7+
transparent = false,
8+
italics = false,
9+
}
10+
11+
M.config = defaultConfig
12+
13+
function M.setup(options)
14+
M.config = vim.tbl_deep_extend("force", {}, defaultConfig, options or {})
15+
end
16+
17+
function M.load()
18+
local theme = require('lush_theme.bluloco')
19+
vim.g.colors_name = 'bluloco'
20+
package.loaded['lush_theme.bluloco'] = nil
21+
22+
-- transparent
23+
if (M.config.transparent == true) then
24+
theme = lush.extends({ theme }).with(function()
25+
return {
26+
Normal { theme.Normal, bg = "NONE" }, -- normal text
27+
NormalSB { bg = "NONE" },
28+
BufferlineFill { bg = "NONE" },
29+
TroubleNormal { bg = "NONE" },
30+
NvimTreeNormal { bg = "NONE" },
31+
NvimTreeNormalNC { bg = "NONE" },
32+
}
33+
end)
34+
end
35+
36+
-- italics
37+
if (M.config.italics == true) then
38+
local sym = injected_functions.sym
39+
theme = lush.extends({ theme }).with(function()
40+
return {
41+
Statement { theme.Statement, gui = "italic" },
42+
Boolean { theme.Boolean, gui = "italic" },
43+
Comment { theme.Comment, gui = "italic" },
44+
sym("@tag.attribute") { theme["@tag.attribute"], gui = "italic" },
45+
sym("@annotation") { theme["@annotation"], gui = "italic" },
46+
}
47+
end)
48+
end
49+
50+
-- bufferline
51+
local bufferlineInstalled = pcall(require, 'bufferline')
52+
if (bufferlineInstalled) then
53+
theme = lush.extends({ theme }).with(function()
54+
return {
55+
TabLineSel { bg = theme.Statement.fg }, -- tab pages line, active tab page label
56+
}
57+
end)
58+
end
59+
60+
61+
lush(theme)
62+
end
63+
64+
return M

0 commit comments

Comments
 (0)