Skip to content

Commit

Permalink
Release 0.1.0 (#144)
Browse files Browse the repository at this point in the history
Co-authored-by: Owen Friedman <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Avi Herman <[email protected]>
  • Loading branch information
4 people authored Sep 24, 2024
1 parent 03fcff3 commit 1ee4044
Show file tree
Hide file tree
Showing 18 changed files with 712 additions and 217 deletions.
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

0 comments on commit 1ee4044

Please sign in to comment.