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

feat(platforms): add generation for platform files #161

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,12 @@ require('nordic').setup({

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).

I do not personally use all of the platforms and plugins in the list, so if something is not right, or you have a suggestion, please open a PR!
## Contributing a new Platform

All of the platform files are generated using a template system. Have a look at the files in [this directory](https://github.com/AlexvZyl/nordic.nvim/tree/main/lua/nordic/platforms) to see how it works.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a little cumbersome to read:

Suggested change
All of the platform files are generated using a template system. Have a look at the files in [this directory](https://github.com/AlexvZyl/nordic.nvim/tree/main/lua/nordic/platforms) to see how it works.
All of the platform files are generated using a template system. Have a look at [this directory](https://github.com/AlexvZyl/nordic.nvim/tree/main/lua/nordic/platforms) to see how it works.


> [!NOTE]
> I don't personally use all of the platforms and plugins in the list, so if something is not right, or you have a suggestion, please open a PR!

# 🎙️ Acknowledgements

Expand Down
41 changes: 41 additions & 0 deletions lua/nordic/platforms/fish_themes.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
local U = require('nordic.utils')

local M = {}

function M.generate(colors)
local fishColors = U.removeHash(colors)

return U.template(
[[
# Name: Nordic
# Auother: XXiaoA
# https://fishshell.com/docs/current/interactive.html#syntax-highlighting-variables

# Syntax Highlighting Colors
fish_color_normal ${blue1}
fish_color_command ${yellow.base}
fish_color_keyword ${magenta.base}
fish_color_quote ${green.base}
fish_color_redirection ${white1}
fish_color_end ${white0_normal}
fish_color_error ${error}
fish_color_param ${blue2}
fish_color_comment ${gray4}
fish_color_selection --background=${gray2}
fish_color_search_match --background=${black1}
fish_color_operator ${orange.base}
fish_color_escape ${blue1}
fish_color_autosuggestion ${gray5}

# Completion Pager Colors
fish_pager_color_progress ${blue1}
fish_pager_color_prefix ${yellow.base}
fish_pager_color_completion ${white1}
fish_pager_color_description ${blue1}
fish_pager_color_selected_background --background=${gray2}
]],
fishColors
)
end

return M
50 changes: 50 additions & 0 deletions lua/nordic/platforms/foot.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
local U = require('nordic.utils')

local M = {}

function M.generate(colors)
local footColors = U.removeHash(colors)

return U.template(
[[
[colors]
foreground=${fg}
background=${bg}

# black
regular0=${black0}
bright0=${gray2}

# red
regular1=${red.base}
bright1=${red.bright}

# green
regular2=${green.base}
bright2=${green.bright}

# yellow
regular3=${yellow.base}
bright3=${yellow.bright}

# blue
regular4=${blue0}
bright4=${blue2}

# magenta
regular5=${magenta.base}
bright5=${magenta.bright}

# cyan
regular6=${cyan.base}
bright6=${cyan.bright}

# white
regular7=${white0}
bright7=${white1}
]],
footColors
)
end

return M
51 changes: 51 additions & 0 deletions lua/nordic/platforms/ghostty.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
local U = require('nordic.utils')

local M = {}

function M.generate(colors)
return U.template(
[[
# Nordic Colorscheme for Ghostty.
# Based on https://github.com/AlexvZyl/nordic.nvim
# Author: @jorgebef

# To use this theme you have 2 options to install it:
#
# - Clone the theme file and set the theme option in your config to the absolute path of the theme file.
# Example:
#
# ```ini
# theme = "/home/jbef/.config/ghostty/nordic"
# ```
#
# - Copy the code directly inside your `ghostty` configuration file, usually located at `$HOME/.config/ghostty/config`

background = ${bg}
foreground = ${fg}
cursor-color = ${white0}
selection-background = ${gray1}
selection-foreground = ${white0}

palette = 0=${black0}
palette = 1=${red.base}
palette = 2=${green.base}
palette = 3=${yellow.base}
palette = 4=${blue0}
palette = 5=${blue2}
palette = 6=${magenta.base}
palette = 7=${white0}

palette = 8=${gray2}
palette = 9=${red.bright}
palette = 10=${green.bright}
palette = 11=${yellow.bright}
palette = 12=${blue2}
palette = 13=${magenta.bright}
palette = 14=${cyan.bright}
palette = 15=${white1}
]],
colors
)
end

return M
Loading
Loading