Merge remote-tracking branch 'upstream/main'

This commit is contained in:
2024-02-09 14:24:59 -05:00
35 changed files with 1395 additions and 546 deletions

View File

@@ -143,6 +143,7 @@ function M.setup(opts)
colors.fg_float = colors.fg
colors.error = colors.red1
colors.todo = colors.blue
colors.warning = colors.yellow
colors.info = colors.blue2
colors.hint = colors.teal

View File

@@ -4,50 +4,51 @@ local M = {}
--- @param colors ColorScheme
function M.generate(colors)
local alacrittyColors = {}
for k, v in pairs(colors) do
if type(v) == "string" then
alacrittyColors[k] = v:gsub("^#", "0x")
end
end
local alacritty = util.template(
[[
[=[
# FarOut Alacritty Colors
colors:
# Default colors
primary:
background: '${bg}'
foreground: '${fg}'
# Default colors
[colors.primary]
background = '${bg}'
foreground = '${fg}'
# Normal colors
normal:
black: '${black}'
red: '${red}'
green: '${green}'
yellow: '${yellow}'
blue: '${blue}'
magenta: '${magenta}'
cyan: '${cyan}'
white: '${fg_dark}'
#[colors.cursor]
#cursor = '${fg}'
#text = '${bg}'
# Bright colors
bright:
black: '${terminal_black}'
red: '${red}'
green: '${green}'
yellow: '${yellow}'
blue: '${blue}'
magenta: '${magenta}'
cyan: '${cyan}'
white: '${fg}'
# Normal colors
[colors.normal]
black = '${black}'
red = '${red}'
green = '${green}'
yellow = '${yellow}'
blue = '${blue}'
magenta = '${magenta}'
cyan = '${cyan}'
white = '${fg_dark}'
indexed_colors:
- { index: 16, color: '${orange}' }
- { index: 17, color: '${red1}' }
]],
alacrittyColors
# Bright colors
[colors.bright]
black = '${terminal_black}'
red = '${red}'
green = '${green}'
yellow = '${yellow}'
blue = '${blue}'
magenta = '${magenta}'
cyan = '${cyan}'
white = '${fg}'
# Indexed Colors
[[colors.indexed_colors]]
index = 16
color = '${orange}'
[[colors.indexed_colors]]
index = 17
color = '${red1}'
]=],
colors
)
return alacritty

18
lua/farout/extra/fzf.lua Normal file
View File

@@ -0,0 +1,18 @@
local util = require("farout.util")
local M = {}
--- @param colors ColorScheme
function M.generate(colors)
return util.template(M.template, colors)
end
M.template = [[
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
--color=fg:${fg},bg:${bg},hl:${orange} \
--color=fg+:${fg},bg+:${bg_highlight},hl+:${orange} \
--color=info:${blue},prompt:${cyan},pointer:${cyan} \
--color=marker:${green},spinner:${green},header:${green}"
]]
return M

View File

@@ -37,7 +37,7 @@ function M.generate(colors)
},
string = {
"String",
regexp = "@string.regex",
regexp = "@string.regexp",
special = {
"@string.special",
path = nil,
@@ -57,10 +57,10 @@ function M.generate(colors)
variable = {
"@variable",
builtin = "@variable.builtin",
parameter = "@parameter",
parameter = "@variable.parameter",
other = {
nil,
member = "@field",
member = "@variable.member",
},
},
label = "@label",
@@ -137,7 +137,7 @@ function M.generate(colors)
quote = nil,
raw = {
"markdownCode",
inline = "@text.literal.markdown_inline",
inline = "@markup.raw.markdown_inline",
block = "markdownCodeBlock",
-- UI --
completion = nil,

View File

@@ -7,7 +7,7 @@ M.extras = {
kitty = {ext = "conf", url = "https://sw.kovidgoyal.net/kitty/conf.html", label = "Kitty"},
fish = {ext = "fish", url = "https://fishshell.com/docs/current/index.html", label = "Fish"},
fish_themes = {ext = "theme", url = "https://fishshell.com/docs/current/interactive.html#syntax-highlighting", label = "Fish Themes"},
alacritty = {ext = "yml", url = "https://github.com/alacritty/alacritty", label = "Alacritty"},
alacritty = {ext = "toml", url = "https://github.com/alacritty/alacritty", label = "Alacritty"},
wezterm = {ext = "toml", url = "https://wezfurlong.org/wezterm/config/files.html", label = "WezTerm"},
tmux = {ext = "tmux", url = "https://github.com/tmux/tmux/wiki", label = "Tmux"},
xresources = {ext = "Xresources", url = "https://wiki.archlinux.org/title/X_resources", label = "Xresources"},
@@ -25,6 +25,7 @@ M.extras = {
dunst = {ext = "dunstrc", url = "https://dunst-project.org/", label = "Dunst"},
gitui = {ext = "ron", url = "https://github.com/extrawurst/gitui", label = "GitUI"},
helix = { ext = "toml", url = "https://helix-editor.com/", label = "Helix"},
fzf = { ext = "zsh", url = "https://github.com/junegunn/fzf", label = "Fzf"},
}
local function write(str, fileName)

View File

@@ -16,6 +16,7 @@ selection_bg = "${bg_visual}"
selection_fg = "${fg}"
split = "${blue}"
compose_cursor = "${orange}"
scrollbar_thumb = "${bg_highlight}"
ansi = ["${black}", "${red}", "${green}", "${yellow}", "${blue}", "${magenta}", "${cyan}", "${fg_dark}"]
brights = ["${terminal_black}", "${red}", "${green}", "${yellow}", "${blue}", "${magenta}", "${cyan}", "${fg}"]

View File

@@ -91,6 +91,8 @@ function M.setup()
WarningMsg = { fg = c.warning }, -- warning messages
Whitespace = { fg = c.fg_gutter }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
WildMenu = { bg = c.bg_visual }, -- current match in 'wildmenu' completion
WinBar = { link = "StatusLine" }, -- window bar
WinBarNC = { link = "StatusLineNC" }, -- window bar in inactive windows
-- These groups are not listed as default vim groups,
-- but they are defacto standard group names for syntax highlighting.
@@ -130,7 +132,7 @@ function M.setup()
Special = { fg = c.blue1 }, -- (preferred) any special symbol
-- SpecialChar = { }, -- special character in a constant
-- Tag = { }, -- you can use CTRL-] on this
-- Delimiter = { }, -- character that needs attention
Delimiter = { link = "Special" }, -- character that needs attention
-- SpecialComment= { }, -- special things inside a comment
Debug = { fg = c.orange }, -- debugging statements
@@ -206,7 +208,62 @@ function M.setup()
DapStoppedLine = { bg = util.darken(c.warning, 0.1) }, -- Used for "Warning" diagnostic virtual text
-- These groups are for the Neovim tree-sitter highlights.
-- As of writing, tree-sitter support is a WIP, group names may change.
["@annotation"] = { link = "PreProc" },
["@attribute"] = { link = "PreProc" },
["@boolean"] = { link = "Boolean" },
["@character"] = { link = "Character" },
["@character.special"] = { link = "SpecialChar" },
["@comment"] = { link = "Comment" },
["@keyword.conditional"] = { link = "Conditional" },
["@constant"] = { link = "Constant" },
["@constant.builtin"] = { link = "Special" },
["@constant.macro"] = { link = "Define" },
["@keyword.debug"] = { link = "Debug" },
["@keyword.directive.define"] = { link = "Define" },
["@keyword.exception"] = { link = "Exception" },
["@number.float"] = { link = "Float" },
["@function"] = { link = "Function" },
["@function.builtin"] = { link = "Special" },
["@function.call"] = { link = "@function" },
["@function.macro"] = { link = "Macro" },
["@keyword.import"] = { link = "Include" },
["@keyword.coroutine"] = { link = "@keyword" },
["@keyword.operator"] = { link = "@operator" },
["@keyword.return"] = { link = "@keyword" },
["@function.method"] = { link = "Function" },
["@function.method.call"] = { link = "@function.method" },
["@namespace.builtin"] = { link = "@variable.builtin" },
["@none"] = {},
["@number"] = { link = "Number" },
["@keyword.directive"] = { link = "PreProc" },
["@keyword.repeat"] = { link = "Repeat" },
["@keyword.storage"] = { link = "StorageClass" },
["@string"] = { link = "String" },
["@markup.link.label"] = { link = "SpecialChar" },
["@markup.link.label.symbol"] = { link = "Identifier" },
["@tag"] = { link = "Label" },
["@tag.attribute"] = { link = "@property" },
["@tag.delimiter"] = { link = "Delimiter" },
["@markup"] = { link = "@none" },
["@markup.environment"] = { link = "Macro" },
["@markup.environment.name"] = { link = "Type" },
["@markup.raw"] = { link = "String" },
["@markup.math"] = { link = "Special" },
["@markup.strong"] = { bold = true },
["@markup.emphasis"] = { italic = true },
["@markup.strikethrough"] = { strikethrough = true },
["@markup.underline"] = { underline = true },
["@markup.heading"] = { link = "Title" },
["@comment.note"] = { fg = c.hint },
["@comment.error"] = { fg = c.error },
["@comment.hint"] = { fg = c.hint },
["@comment.info"] = { fg = c.info },
["@comment.warning"] = { fg = c.warning },
["@comment.todo"] = { fg = c.todo },
["@markup.link.url"] = { link = "Underlined" },
["@type"] = { link = "Type" },
["@type.definition"] = { link = "Typedef" },
["@type.qualifier"] = { link = "@keyword" },
--- Misc
-- TODO:
@@ -216,51 +273,49 @@ function M.setup()
--- Punctuation
["@punctuation.delimiter"] = { fg = c.blue5 }, -- For delimiters ie: `.`
["@punctuation.bracket"] = { fg = c.fg_dark }, -- For brackets and parens.
["@punctuation.special"] = { fg = c.blue5 }, -- For special punctutation that does not fall in the catagories before.
["@punctuation.special.markdown"] = { fg = c.orange, bold = true },
["@punctuation.special"] = { fg = c.blue5 }, -- For special symbols (e.g. `{}` in string interpolation)
["@markup.list"] = { fg = c.blue5 }, -- For special punctutation that does not fall in the catagories before.
["@markup.list.markdown"] = { fg = c.orange, bold = true },
--- Literals
["@string.documentation"] = { fg = c.yellow },
["@string.regex"] = { fg = c.blue6 }, -- For regexes.
["@string.regexp"] = { fg = c.blue6 }, -- For regexes.
["@string.escape"] = { fg = c.magenta }, -- For escape characters within a string.
--- Functions
["@constructor"] = { fg = c.magenta }, -- For constructor calls and definitions: `= { }` in Lua, and Java constructors.
["@parameter"] = { fg = c.yellow }, -- For parameters of a function.
["@parameter.builtin"] = { fg = util.lighten(c.yellow, 0.8) }, -- For builtin parameters of a function, e.g. "..." or Smali's p[1-99]
["@variable.parameter"] = { fg = c.yellow }, -- For parameters of a function.
["@variable.parameter.builtin"] = { fg = util.lighten(c.yellow, 0.8) }, -- For builtin parameters of a function, e.g. "..." or Smali's p[1-99]
--- Keywords
["@keyword"] = { fg = c.purple, style = options.styles.keywords }, -- For keywords that don't fall in previous categories.
-- TODO:
-- ["@keyword.coroutine"] = { }, -- For keywords related to coroutines.
["@keyword.function"] = { fg = c.magenta, style = options.styles.functions }, -- For keywords used to define a fuction.
["@label"] = { fg = c.blue }, -- For labels: `label:` in C and `:label:` in Lua.
--- Types
["@type.builtin"] = { fg = util.darken(c.blue1, 0.8) },
["@field"] = { fg = c.green1 }, -- For fields.
["@variable.member"] = { fg = c.green1 }, -- For fields.
["@property"] = { fg = c.green1 },
--- Identifiers
["@variable"] = { fg = c.fg, style = options.styles.variables }, -- Any variable name that does not have another highlight.
["@variable.builtin"] = { fg = c.red }, -- Variable names that are defined by the languages, like `this` or `self`.
["@namespace.builtin"] = { fg = c.red }, -- Variable names that are defined by the languages, like `this` or `self`.
["@module.builtin"] = { fg = c.red }, -- Variable names that are defined by the languages, like `this` or `self`.
--- Text
-- ["@text.literal.markdown"] = { fg = c.blue },
["@text.literal.markdown_inline"] = { bg = c.terminal_black, fg = c.blue },
["@text.reference"] = { fg = c.teal },
-- ["@markup.raw.markdown"] = { fg = c.blue },
["@markup.raw.markdown_inline"] = { bg = c.terminal_black, fg = c.blue },
["@markup.link"] = { fg = c.teal },
["@text.todo.unchecked"] = { fg = c.blue }, -- For brackets and parens.
["@text.todo.checked"] = { fg = c.green1 }, -- For brackets and parens.
["@text.warning"] = { fg = c.bg, bg = c.warning },
["@text.danger"] = { fg = c.bg, bg = c.error },
["@markup.list.unchecked"] = { fg = c.blue }, -- For brackets and parens.
["@markup.list.checked"] = { fg = c.green1 }, -- For brackets and parens.
["@text.diff.add"] = { link = "DiffAdd" },
["@text.diff.delete"] = { link = "DiffDelete" },
["@diff.plus"] = { link = "DiffAdd" },
["@diff.minus"] = { link = "DiffDelete" },
["@diff.delta"] = { link = "DiffChange" },
["@namespace"] = { link = "Include" },
["@module"] = { link = "Include" },
-- tsx
["@tag.tsx"] = { fg = c.red },
@@ -276,15 +331,15 @@ function M.setup()
["@lsp.type.enum"] = { link = "@type" },
["@lsp.type.enumMember"] = { link = "@constant" },
["@lsp.type.escapeSequence"] = { link = "@string.escape" },
["@lsp.type.formatSpecifier"] = { link = "@punctuation.special" },
["@lsp.type.formatSpecifier"] = { link = "@markup.list" },
["@lsp.type.generic"] = { link = "@variable" },
["@lsp.type.interface"] = { fg = util.lighten(c.blue1, 0.7) },
["@lsp.type.keyword"] = { link = "@keyword" },
["@lsp.type.lifetime"] = { link = "@storageclass" },
["@lsp.type.namespace"] = { link = "@namespace" },
["@lsp.type.lifetime"] = { link = "@keyword.storage" },
["@lsp.type.namespace"] = { link = "@module" },
["@lsp.type.number"] = { link = "@number" },
["@lsp.type.operator"] = { link = "@operator" },
["@lsp.type.parameter"] = { link = "@parameter" },
["@lsp.type.parameter"] = { link = "@variable.parameter" },
["@lsp.type.property"] = { link = "@property" },
["@lsp.type.selfKeyword"] = { link = "@variable.builtin" },
["@lsp.type.selfTypeKeyword"] = { link = "@variable.builtin" },
@@ -342,7 +397,7 @@ function M.setup()
-- LspTrouble
TroubleText = { fg = c.fg_dark },
TroubleCount = { fg = c.magenta, bg = c.fg_gutter },
TroubleNormal = { fg = c.fg_sidebar, bg = c.bg_sidebar },
TroubleNormal = { fg = c.fg, bg = c.bg_sidebar },
-- Illuminate
illuminatedWord = { bg = c.fg_gutter },
@@ -736,28 +791,28 @@ function M.setup()
Enum = "@lsp.type.enum",
EnumMember = "@lsp.type.enumMember",
Event = "Special",
Field = "@field",
Field = "@variable.member",
File = "Normal",
Folder = "Directory",
Function = "@function",
Interface = "@lsp.type.interface",
Key = "@field",
Key = "@variable.member",
Keyword = "@lsp.type.keyword",
Method = "@method",
Module = "@namespace",
Namespace = "@namespace",
Method = "@function.method",
Module = "@module",
Namespace = "@module",
Null = "@constant.builtin",
Number = "@number",
Object = "@constant",
Operator = "@operator",
Package = "@namespace",
Package = "@module",
Property = "@property",
Reference = "@text.reference",
Reference = "@markup.link",
Snippet = "Conceal",
String = "@string",
Struct = "@lsp.type.struct",
Unit = "@lsp.type.struct",
Text = "@text",
Text = "@markup",
TypeParameter = "@lsp.type.typeParameter",
Variable = "@variable",
Value = "@string",
@@ -775,7 +830,7 @@ function M.setup()
local markdown_rainbow = { c.blue, c.yellow, c.green, c.teal, c.magenta, c.purple }
for i, color in ipairs(markdown_rainbow) do
theme.highlights["@text.title." .. i .. ".markdown"] = { fg = color, bold = true }
theme.highlights["@markup.heading." .. i .. ".markdown"] = { fg = color, bold = true }
theme.highlights["Headline" .. i] = { bg = util.darken(color, 0.05) }
end
theme.highlights["Headline"] = { link = "Headline1" }

View File

@@ -1,5 +1,3 @@
local ts = require("farout.treesitter")
local M = {}
M.bg = "#000000"
@@ -51,10 +49,6 @@ end
---@param group string
function M.highlight(group, hl)
group = ts.get(group)
if not group then
return
end
if hl.style then
if type(hl.style) == "table" then
hl = vim.tbl_extend("force", hl, hl.style)
@@ -189,14 +183,6 @@ function M.load(theme)
vim.o.termguicolors = true
vim.g.colors_name = "farout"
if ts.new_style() then
for group, colors in pairs(ts.defaults) do
if not theme.highlights[group] then
M.highlight(group, colors)
end
end
end
M.syntax(theme.highlights)
-- vim.api.nvim_set_hl_ns(M.ns)