Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.1.0 #144

Merged
merged 23 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0453584
feat(transparency)!: add decoupled transparency options; (#127)
5-pebbles Apr 18, 2024
4ee062a
CI(bot): Generate docs and format
github-actions[bot] Apr 18, 2024
4945415
feat(colors): make on_palette stateless; (#125)
5-pebbles May 25, 2024
21a441e
CI(bot): Generate docs and format
github-actions[bot] May 25, 2024
1274e15
Feat: Improve pmenu & bg_visual colors for better visibility (#138)
5-pebbles May 27, 2024
80c65ab
CI(bot): Generate docs and format
github-actions[bot] May 27, 2024
adc8b8c
fix(build_palette): fix broken reload in stateless palette; (#137)
5-pebbles May 29, 2024
a567a10
CI(bot): Generate docs and format
github-actions[bot] May 29, 2024
b0a748e
Feat: Improve changing of highlights with `on_highlight` (#141)
5-pebbles Jun 2, 2024
11d8494
CI(bot): Generate docs and format
github-actions[bot] Jun 2, 2024
1333956
Add note on palette and change parentheses to "Always" (#142)
AlexvZyl Jun 2, 2024
c2c0eaf
CI(bot): Generate docs and format
github-actions[bot] Jun 2, 2024
96d0989
Feat: Add `after_palette` to override extended palette values (#143)
5-pebbles Jun 3, 2024
b166517
CI(bot): Generate docs and format
github-actions[bot] Jun 3, 2024
709f19c
Feat: Added support for rainbow-delimeters.nvim (#146)
avih7531 Jun 18, 2024
7a9c7ea
CI(bot): Generate docs and format
github-actions[bot] Jun 18, 2024
5fbd59d
Fix misspellings (#149)
5-pebbles Aug 17, 2024
b787b5e
CI(bot): Generate docs and format
github-actions[bot] Aug 17, 2024
9f3cff8
Fix: Weird neo-tree highlights; (#152)
5-pebbles Aug 17, 2024
45a5812
CI: Add testing for utils & delete extraneous code (#145)
5-pebbles Sep 1, 2024
08afa48
CI(bot): Generate docs and format
github-actions[bot] Sep 1, 2024
457cf92
Feat: Add tests for configuration options (#150)
5-pebbles Sep 24, 2024
02a196f
CI(bot): Generate docs and format
github-actions[bot] Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
shell: bash
run: |
nvim --version
OUTPUT=$(nvim --headless -c "lua require 'nordic.tests.options'" -c 'q' 2>&1);
OUTPUT=$(nvim --headless -c "lua require('nordic.tests').run_tests()" -c 'q' 2>&1);
if [[ -n "$OUTPUT" ]]
then
exit 1
echo "::error title='Checks failed'::$OUTPUT" && exit 1
fi
2 changes: 1 addition & 1 deletion .stylua.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ line_endings = "Unix"
indent_type = "Spaces"
indent_width = 4
quote_style = "AutoPreferSingle"
call_parentheses = "None"
call_parentheses = "Always"
collapse_simple_statement = "ConditionalOnly"
105 changes: 83 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ With [lazy.nvim](https://github.com/folke/lazy.nvim):
lazy = false,
priority = 1000,
config = function()
require 'nordic' .load()
require('nordic').load()
end
}
```
Expand All @@ -57,49 +57,58 @@ colorscheme nordic
Using lua:

```lua
vim.cmd.colorscheme 'nordic'
vim.cmd.colorscheme('nordic')
-- or
require 'nordic' .load()
require('nordic').load()
```

Using with lualine:

```lua
require 'lualine' .setup {
require('lualine').setup({
options = {
theme = 'nordic'
}
}
})
```

To get the palette in lua:
If you want to use the color palette somewhere else, you can access it with:

```lua
local palette = require 'nordic.colors'
local palette = require('nordic.colors')
```
> [!WARNING]
> Please make sure that `require('nordic.colors')` is called *after* setup, otherwise the colors might be wrong for your config.

# ⚙️ Configuration

Nordic will use the default values, unless `setup` is called. Below is the default configuration.

```lua
require 'nordic' .setup {
-- This callback can be used to override the colors used in the palette.
on_palette = function(palette) return palette end,
require('nordic').setup({
-- This callback can be used to override the colors used in the base palette.
on_palette = function(palette) end,
-- This callback can be used to override the colors used in the extended palette.
after_palette = function(palette) end,
-- This callback can be used to override highlights before they are applied.
on_highlight = function(highlights, palette) end,
-- Enable bold keywords.
bold_keywords = false,
-- Enable italic comments.
italic_comments = true,
-- Enable general editor background transparency.
transparent_bg = false,
-- Enable editor background transparency.
transparent = {
-- Enable transparent background.
bg = false,
-- Enable transparent background for floating windows.
float = false,
},
-- Enable brighter float border.
bright_border = false,
-- Reduce the overall amount of blue in the theme (diverges from base Nord).
reduced_blue = true,
-- Swap the dark background with the normal one.
swap_backgrounds = false,
-- Override the styling of any highlight group.
override = {},
-- Cursorline options. Also includes visual/selection.
cursorline = {
-- Bold font in cursorline.
Expand Down Expand Up @@ -127,27 +136,79 @@ require 'nordic' .setup {
-- Enables dark background for treesitter-context window
dark_background = true,
}
}
})
```

An example of overriding the `TelescopePromptTitle` colors:
**Examples:**

<details>
<summary><b><code>on_palette</code></b></summary>
&nbsp;

An example of overriding colors in the base palette:
```lua
require('nordic').setup({
on_palette = function(palette)
palette.black0 = "#BF616A"
palette.green.base = palette.cyan.base
end,
})
```

</details>


<details>
<summary><b><code>after_palette</code></b></summary>
&nbsp;

An example of setting the visual selection color (for more values see [this file](https://github.com/AlexvZyl/nordic.nvim/blob/main/lua/nordic/colors/init.lua)):
```lua
require('nordic').setup({
after_palette = function(palette)
local U = require("nordic.utils")
palette.bg_visual = U.blend(palette.orange.base, palette.bg, 0.15)
end,
})
```

</details>


<details>
<summary><b><code>on_highlight</code></b></summary>
&nbsp;

An example of overriding the `TelescopePromptTitle` colors:
```lua
local palette = require 'nordic.colors'
require 'nordic' .setup {
override = {
TelescopePromptTitle = {
require('nordic').setup({
on_highlight = function(highlights, palette)
highlights.TelescopePromptTitle = {
fg = palette.red.bright,
bg = palette.green.base,
italic = true,
underline = true,
sp = palette.yellow.dim,
undercurl = false
}
}
}
end,
})
```

And an example of disabling all italics:
```lua
require('nordic').setup({
on_highlight = function(highlights, _palette)
for _, highlight in pairs(highlights) do
highlight.italic = false
end
end
})
```

</details>


# 🗒️ Supported Plugins and Platforms

For the list of supported plugins, please take a look at [this file](https://github.com/AlexvZyl/nordic.nvim/blob/main/lua/nordic/groups/integrations.lua). For the list of supported platforms, please take a look at [this directory](https://github.com/AlexvZyl/nordic.nvim/tree/main/platforms).
Expand Down
102 changes: 80 additions & 22 deletions doc/nordic.nvim.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*nordic.nvim.txt* For NVIM v0.8.0 Last change: 2024 April 14
*nordic.nvim.txt* For NVIM v0.8.0 Last change: 2024 September 24

==============================================================================
Table of Contents *nordic.nvim-table-of-contents*
Expand Down Expand Up @@ -59,7 +59,7 @@ With lazy.nvim <https://github.com/folke/lazy.nvim>:
lazy = false,
priority = 1000,
config = function()
require 'nordic' .load()
require('nordic').load()
end
}
<
Expand All @@ -83,52 +83,62 @@ Using vim:
Using lua:

>lua
vim.cmd.colorscheme 'nordic'
vim.cmd.colorscheme('nordic')
-- or
require 'nordic' .load()
require('nordic').load()
<

Using with lualine:

>lua
require 'lualine' .setup {
require('lualine').setup({
options = {
theme = 'nordic'
}
}
})
<

To get the palette in lua:
If you want to use the color palette somewhere else, you can access it with:

>lua
local palette = require 'nordic.colors'
local palette = require('nordic.colors')
<


[!WARNING] Please make sure that `require('nordic.colors')` is called _after_
setup, otherwise the colors might be wrong for your config.

==============================================================================
6. ⚙️ Configuration *nordic.nvim-⚙️-configuration*

Nordic will use the default values, unless `setup` is called. Below is the
default configuration.

>lua
require 'nordic' .setup {
-- This callback can be used to override the colors used in the palette.
on_palette = function(palette) return palette end,
require('nordic').setup({
-- This callback can be used to override the colors used in the base palette.
on_palette = function(palette) end,
-- This callback can be used to override the colors used in the extended palette.
after_palette = function(palette) end,
-- This callback can be used to override highlights before they are applied.
on_highlight = function(highlights, palette) end,
-- Enable bold keywords.
bold_keywords = false,
-- Enable italic comments.
italic_comments = true,
-- Enable general editor background transparency.
transparent_bg = false,
-- Enable editor background transparency.
transparent = {
-- Enable transparent background.
bg = false,
-- Enable transparent background for floating windows.
float = false,
},
-- Enable brighter float border.
bright_border = false,
-- Reduce the overall amount of blue in the theme (diverges from base Nord).
reduced_blue = true,
-- Swap the dark background with the normal one.
swap_backgrounds = false,
-- Override the styling of any highlight group.
override = {},
-- Cursorline options. Also includes visual/selection.
cursorline = {
-- Bold font in cursorline.
Expand Down Expand Up @@ -156,25 +166,73 @@ default configuration.
-- Enables dark background for treesitter-context window
dark_background = true,
}
}
})
<

**Examples:**

on_palette ~



An example of overriding colors in the base palette:

>lua
require('nordic').setup({
on_palette = function(palette)
palette.black0 = "#BF616A"
palette.green.base = palette.cyan.base
end,
})
<

after_palette ~



An example of setting the visual selection color (for more values see this file
<https://github.com/AlexvZyl/nordic.nvim/blob/main/lua/nordic/colors/init.lua>):

>lua
require('nordic').setup({
after_palette = function(palette)
local U = require("nordic.utils")
palette.bg_visual = U.blend(palette.orange.base, palette.bg, 0.15)
end,
})
<

on_highlight ~



An example of overriding the `TelescopePromptTitle` colors:

>lua
local palette = require 'nordic.colors'
require 'nordic' .setup {
override = {
TelescopePromptTitle = {
require('nordic').setup({
on_highlight = function(highlights, palette)
highlights.TelescopePromptTitle = {
fg = palette.red.bright,
bg = palette.green.base,
italic = true,
underline = true,
sp = palette.yellow.dim,
undercurl = false
}
}
}
end,
})
<

And an example of disabling all italics:

>lua
require('nordic').setup({
on_highlight = function(highlights, _palette)
for _, highlight in pairs(highlights) do
highlight.italic = false
end
end
})
<


Expand Down
2 changes: 1 addition & 1 deletion lua/lualine/themes/nordic.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local C = require 'nordic.colors'
local C = require('nordic.colors')

local nordic = {}

Expand Down
Loading