Compare commits
No commits in common. "main" and "feat/about" have entirely different histories.
main
...
feat/about
22 changed files with 189 additions and 391 deletions
78
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
78
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
|
|
@ -1,78 +0,0 @@
|
||||||
name: Bug Report
|
|
||||||
description: Report a bug
|
|
||||||
title: 'bug: '
|
|
||||||
labels: [bug]
|
|
||||||
body:
|
|
||||||
- type: checkboxes
|
|
||||||
attributes:
|
|
||||||
label: Prerequisites
|
|
||||||
options:
|
|
||||||
- label:
|
|
||||||
I have searched [existing
|
|
||||||
issues](https://github.com/barrettruth/midnight.nvim/issues)
|
|
||||||
required: true
|
|
||||||
- label: I have updated to the latest version
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: 'Neovim version'
|
|
||||||
description: 'Output of `nvim --version`'
|
|
||||||
render: text
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: 'Operating system'
|
|
||||||
placeholder: 'e.g. Arch Linux, macOS 15, Ubuntu 24.04'
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Description
|
|
||||||
description: What happened? What did you expect?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Steps to reproduce
|
|
||||||
description: Minimal steps to trigger the bug
|
|
||||||
value: |
|
|
||||||
1.
|
|
||||||
2.
|
|
||||||
3.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: 'Health check'
|
|
||||||
description: 'Output of `:checkhealth midnight`'
|
|
||||||
render: text
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Minimal reproduction
|
|
||||||
description: |
|
|
||||||
Save the script below as `repro.lua`, edit if needed, and run:
|
|
||||||
```
|
|
||||||
nvim -u repro.lua
|
|
||||||
```
|
|
||||||
Confirm the bug reproduces with this config before submitting.
|
|
||||||
render: lua
|
|
||||||
value: |
|
|
||||||
vim.env.LAZY_STDPATH = '.repro'
|
|
||||||
load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()
|
|
||||||
require('lazy.nvim').setup({
|
|
||||||
spec = {
|
|
||||||
{
|
|
||||||
'barrett-ruth/midnight.nvim',
|
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
5
.github/ISSUE_TEMPLATE/config.yaml
vendored
5
.github/ISSUE_TEMPLATE/config.yaml
vendored
|
|
@ -1,5 +0,0 @@
|
||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: Questions
|
|
||||||
url: https://github.com/barrettruth/midnight.nvim/discussions
|
|
||||||
about: Ask questions and discuss ideas
|
|
||||||
30
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
30
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
|
|
@ -1,30 +0,0 @@
|
||||||
name: Feature Request
|
|
||||||
description: Suggest a feature
|
|
||||||
title: 'feat: '
|
|
||||||
labels: [enhancement]
|
|
||||||
body:
|
|
||||||
- type: checkboxes
|
|
||||||
attributes:
|
|
||||||
label: Prerequisites
|
|
||||||
options:
|
|
||||||
- label:
|
|
||||||
I have searched [existing
|
|
||||||
issues](https://github.com/barrettruth/midnight.nvim/issues)
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Problem
|
|
||||||
description: What problem does this solve?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Proposed solution
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Alternatives considered
|
|
||||||
76
.github/workflows/quality.yaml
vendored
76
.github/workflows/quality.yaml
vendored
|
|
@ -11,6 +11,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
lua: ${{ steps.changes.outputs.lua }}
|
lua: ${{ steps.changes.outputs.lua }}
|
||||||
|
python: ${{ steps.changes.outputs.python }}
|
||||||
markdown: ${{ steps.changes.outputs.markdown }}
|
markdown: ${{ steps.changes.outputs.markdown }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
@ -24,7 +25,10 @@ jobs:
|
||||||
- '*.lua'
|
- '*.lua'
|
||||||
- '.luarc.json'
|
- '.luarc.json'
|
||||||
- '*.toml'
|
- '*.toml'
|
||||||
- 'vim.yaml'
|
python:
|
||||||
|
- 'scripts/**/*.py'
|
||||||
|
- 'pyproject.toml'
|
||||||
|
- 'uv.lock'
|
||||||
markdown:
|
markdown:
|
||||||
- '*.md'
|
- '*.md'
|
||||||
|
|
||||||
|
|
@ -35,8 +39,11 @@ jobs:
|
||||||
if: ${{ needs.changes.outputs.lua == 'true' }}
|
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: JohnnyMorganz/stylua-action@v4
|
||||||
- run: nix develop --command stylua --check .
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
version: 2.1.0
|
||||||
|
args: --check .
|
||||||
|
|
||||||
lua-lint:
|
lua-lint:
|
||||||
name: Lua Lint Check
|
name: Lua Lint Check
|
||||||
|
|
@ -45,8 +52,11 @@ jobs:
|
||||||
if: ${{ needs.changes.outputs.lua == 'true' }}
|
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v31
|
- name: Lint with Selene
|
||||||
- run: nix develop --command selene --display-style quiet .
|
uses: NTBBloodbath/selene-action@v1.0.0
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
args: --display-style quiet .
|
||||||
|
|
||||||
lua-typecheck:
|
lua-typecheck:
|
||||||
name: Lua Type Check
|
name: Lua Type Check
|
||||||
|
|
@ -62,6 +72,48 @@ jobs:
|
||||||
directories: lua
|
directories: lua
|
||||||
configpath: .luarc.json
|
configpath: .luarc.json
|
||||||
|
|
||||||
|
python-format:
|
||||||
|
name: Python Format Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v4
|
||||||
|
- name: Install ruff
|
||||||
|
run: uv tool install ruff
|
||||||
|
- name: Check Python formatting with ruff
|
||||||
|
run: ruff format --check .
|
||||||
|
|
||||||
|
python-lint:
|
||||||
|
name: Python Lint Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v4
|
||||||
|
- name: Install ruff
|
||||||
|
run: uv tool install ruff
|
||||||
|
- name: Lint Python files with ruff
|
||||||
|
run: ruff check .
|
||||||
|
|
||||||
|
python-typecheck:
|
||||||
|
name: Python Type Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v4
|
||||||
|
- name: Install dependencies with mypy
|
||||||
|
run: uv sync --dev
|
||||||
|
- name: Type check Python files with mypy
|
||||||
|
run: uv run mypy .
|
||||||
|
|
||||||
markdown-format:
|
markdown-format:
|
||||||
name: Markdown Format Check
|
name: Markdown Format Check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -69,5 +121,15 @@ jobs:
|
||||||
if: ${{ needs.changes.outputs.markdown == 'true' }}
|
if: ${{ needs.changes.outputs.markdown == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v31
|
- name: Setup pnpm
|
||||||
- run: nix develop --command prettier --check .
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 8
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
- name: Install prettier
|
||||||
|
run: pnpm add -g prettier@3.1.0
|
||||||
|
- name: Check markdown formatting with prettier
|
||||||
|
run: prettier --check .
|
||||||
|
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -8,6 +8,3 @@ venv/
|
||||||
CLAUDE.md
|
CLAUDE.md
|
||||||
__pycache__
|
__pycache__
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
.direnv/
|
|
||||||
.envrc
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
{
|
{
|
||||||
"runtime.version": "LuaJIT",
|
"runtime.version": "Lua 5.1",
|
||||||
"runtime.path": ["lua/?.lua", "lua/?/init.lua"],
|
"runtime.path": ["lua/?.lua", "lua/?/init.lua"],
|
||||||
"diagnostics.globals": ["vim"],
|
"diagnostics.globals": ["vim"],
|
||||||
"workspace.library": ["$VIMRUNTIME/lua", "${3rd}/luv/library"],
|
"workspace.library": ["$VIMRUNTIME/lua", "${3rd}/luv/library"],
|
||||||
"workspace.checkThirdParty": false,
|
"workspace.checkThirdParty": false,
|
||||||
"workspace.ignoreDir": [".direnv"],
|
|
||||||
"completion.callSnippet": "Replace"
|
"completion.callSnippet": "Replace"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,26 @@ repos:
|
||||||
files: \.lua$
|
files: \.lua$
|
||||||
pass_filenames: true
|
pass_filenames: true
|
||||||
|
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
rev: v0.14.3
|
||||||
|
hooks:
|
||||||
|
- id: ruff-format
|
||||||
|
name: ruff (format)
|
||||||
|
files: \.py$
|
||||||
|
- id: ruff
|
||||||
|
name: ruff (lint imports)
|
||||||
|
args: ['--fix', '--select=I']
|
||||||
|
files: \.py$
|
||||||
|
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: mypy
|
||||||
|
name: mypy (type check)
|
||||||
|
entry: uv run mypy
|
||||||
|
language: system
|
||||||
|
args: ['.']
|
||||||
|
pass_filenames: false
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
rev: v4.0.0-alpha.8
|
rev: v4.0.0-alpha.8
|
||||||
hooks:
|
hooks:
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
.direnv/
|
|
||||||
23
README.md
23
README.md
|
|
@ -1,25 +1,24 @@
|
||||||
# midnight.nvim
|
# midnight.nvim
|
||||||
|
|
||||||
Neovim theme for code, not colors.
|
neovim theme for code, not colors.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Install using your package manager of choice or via
|
Install with any package manager of your choice. For example, with
|
||||||
[luarocks](https://luarocks.org/modules/barrettruth/midnight.nvim):
|
[lazy.nvim](https://github.com/folke/lazy.nvim):
|
||||||
|
|
||||||
```
|
|
||||||
luarocks install midnight.nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
Then set the colorscheme:
|
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
vim.cmd.colorscheme('midnight')
|
{
|
||||||
|
'barrett-ruth/midnight.nvim',
|
||||||
|
config = function()
|
||||||
|
vim.cmd.colorscheme('midnight')
|
||||||
|
end,
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Plugin Integrations
|
## Plugin Integration
|
||||||
|
|
||||||
- [treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
|
- [treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
|
||||||
- [fzf-lua](https://github.com/ibhagwan/fzf-lua)
|
- [fzf-lua](https://github.com/ibhagwan/fzf-lua)
|
||||||
|
|
@ -30,7 +29,7 @@ vim.cmd.colorscheme('midnight')
|
||||||
## Motivation
|
## Motivation
|
||||||
|
|
||||||
I find existing colorschemes to generally be excessively colorful and
|
I find existing colorschemes to generally be excessively colorful and
|
||||||
distracting rather than informative. I wrote midnight.nvim to focus on code
|
distracting, rather than informative. I wrote midnight.nvim to focus on code
|
||||||
structure, specifically for competitive programming and workplace software
|
structure, specifically for competitive programming and workplace software
|
||||||
development environments. I included highlighting of constants (e.g. strings,
|
development environments. I included highlighting of constants (e.g. strings,
|
||||||
numbers, booleans) and language keywords to emphasize the maximally important
|
numbers, booleans) and language keywords to emphasize the maximally important
|
||||||
|
|
|
||||||
|
|
@ -1 +1,2 @@
|
||||||
|
vim.o.background = 'light'
|
||||||
require('midnight').load()
|
require('midnight').load()
|
||||||
|
|
|
||||||
|
|
@ -1 +1,2 @@
|
||||||
|
vim.o.background = 'dark'
|
||||||
require('midnight').load()
|
require('midnight').load()
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ INSTALLATION *midnight-installation*
|
||||||
|
|
||||||
>lua
|
>lua
|
||||||
{
|
{
|
||||||
'barrettruth/midnight.nvim',
|
'barrett-ruth/midnight.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
vim.cmd.colorscheme('midnight')
|
vim.cmd.colorscheme('midnight')
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
43
flake.lock
generated
43
flake.lock
generated
|
|
@ -1,43 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1771423170,
|
|
||||||
"narHash": "sha256-K7Dg9TQ0mOcAtWTO/FX/FaprtWQ8BmEXTpLIaNRhEwU=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "bcc4a9d9533c033d806a46b37dc444f9b0da49dd",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"systems": "systems"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
||||||
33
flake.nix
33
flake.nix
|
|
@ -1,33 +0,0 @@
|
||||||
{
|
|
||||||
description = "midnight.nvim — a dark colorscheme for Neovim";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
||||||
systems.url = "github:nix-systems/default";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs =
|
|
||||||
{
|
|
||||||
nixpkgs,
|
|
||||||
systems,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
forEachSystem =
|
|
||||||
f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
formatter = forEachSystem (pkgs: pkgs.nixfmt-tree);
|
|
||||||
|
|
||||||
devShells = forEachSystem (pkgs: {
|
|
||||||
default = pkgs.mkShell {
|
|
||||||
packages = [
|
|
||||||
pkgs.prettier
|
|
||||||
pkgs.stylua
|
|
||||||
pkgs.selene
|
|
||||||
pkgs.lua-language-server
|
|
||||||
];
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local loading = false
|
---@class MidnightConfig
|
||||||
|
---@field [string] any
|
||||||
|
|
||||||
|
---@param opts? MidnightConfig
|
||||||
|
---@return nil
|
||||||
|
function M.setup(opts)
|
||||||
|
opts = opts or {}
|
||||||
|
end
|
||||||
|
|
||||||
---@return nil
|
---@return nil
|
||||||
function M.load()
|
function M.load()
|
||||||
if loading then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
loading = true
|
|
||||||
|
|
||||||
if vim.g.colors_name then
|
if vim.g.colors_name then
|
||||||
vim.cmd('hi clear')
|
vim.cmd('hi clear')
|
||||||
end
|
end
|
||||||
|
|
@ -22,21 +24,6 @@ function M.load()
|
||||||
|
|
||||||
local theme = require('midnight.theme')
|
local theme = require('midnight.theme')
|
||||||
theme.apply()
|
theme.apply()
|
||||||
|
|
||||||
loading = false
|
|
||||||
end
|
|
||||||
|
|
||||||
---@deprecated Use `vim.cmd('colorscheme midnight')` instead
|
|
||||||
function M.setup(_opts)
|
|
||||||
vim.deprecate(
|
|
||||||
'require("midnight").setup()',
|
|
||||||
'vim.cmd("colorscheme midnight")',
|
|
||||||
'v0.1.0',
|
|
||||||
'midnight.nvim',
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
M.load()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,7 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@param hex string
|
|
||||||
---@param bg_hex string
|
|
||||||
---@param alpha number
|
|
||||||
---@return string
|
|
||||||
function M.blend(hex, bg_hex, alpha)
|
|
||||||
local function parse(h)
|
|
||||||
h = h:gsub('#', '')
|
|
||||||
return tonumber(h:sub(1, 2), 16), tonumber(h:sub(3, 4), 16), tonumber(h:sub(5, 6), 16)
|
|
||||||
end
|
|
||||||
local r, g, b = parse(hex)
|
|
||||||
local bg_r, bg_g, bg_b = parse(bg_hex)
|
|
||||||
local blend_r = math.floor(r * alpha + bg_r * (1 - alpha))
|
|
||||||
local blend_g = math.floor(g * alpha + bg_g * (1 - alpha))
|
|
||||||
local blend_b = math.floor(b * alpha + bg_b * (1 - alpha))
|
|
||||||
return string.format('#%02x%02x%02x', blend_r, blend_g, blend_b)
|
|
||||||
end
|
|
||||||
|
|
||||||
---@class Palette
|
---@class Palette
|
||||||
---@field foreground string
|
---@field black string
|
||||||
---@field red string
|
---@field red string
|
||||||
---@field green string
|
---@field green string
|
||||||
---@field yellow string
|
---@field yellow string
|
||||||
|
|
@ -26,7 +9,7 @@ end
|
||||||
---@field magenta string
|
---@field magenta string
|
||||||
---@field cyan string
|
---@field cyan string
|
||||||
---@field orange? string
|
---@field orange? string
|
||||||
---@field background string
|
---@field white string
|
||||||
---@field bright_black string
|
---@field bright_black string
|
||||||
---@field bright_red string
|
---@field bright_red string
|
||||||
---@field bright_green string
|
---@field bright_green string
|
||||||
|
|
@ -48,13 +31,10 @@ end
|
||||||
---@field light_cyan? string
|
---@field light_cyan? string
|
||||||
---@field light_white? string
|
---@field light_white? string
|
||||||
---@field medium_emphasis? string
|
---@field medium_emphasis? string
|
||||||
---@field diff_add? string
|
|
||||||
---@field diff_delete? string
|
|
||||||
---@field diff_change? string
|
|
||||||
|
|
||||||
---@type Palette
|
---@type Palette
|
||||||
M.midnight = {
|
M.midnight = {
|
||||||
foreground = '#121212',
|
black = '#121212',
|
||||||
red = '#ff6b6b',
|
red = '#ff6b6b',
|
||||||
green = '#98c379',
|
green = '#98c379',
|
||||||
yellow = '#e5c07b',
|
yellow = '#e5c07b',
|
||||||
|
|
@ -62,7 +42,7 @@ M.midnight = {
|
||||||
magenta = '#c678dd',
|
magenta = '#c678dd',
|
||||||
cyan = '#56b6c2',
|
cyan = '#56b6c2',
|
||||||
orange = '#e5a56b',
|
orange = '#e5a56b',
|
||||||
background = '#e0e0e0',
|
white = '#e0e0e0',
|
||||||
|
|
||||||
bright_black = '#666666',
|
bright_black = '#666666',
|
||||||
bright_red = '#f48771',
|
bright_red = '#f48771',
|
||||||
|
|
@ -79,20 +59,11 @@ M.midnight = {
|
||||||
dark_grey = '#222222',
|
dark_grey = '#222222',
|
||||||
|
|
||||||
medium_emphasis = '#999999',
|
medium_emphasis = '#999999',
|
||||||
|
|
||||||
-- Diff backgrounds: base color blended at 40% with visual bg (#121212)
|
|
||||||
-- Generated via: M.blend(base_color, '#121212', 0.4)
|
|
||||||
-- diff_add = M.blend('#98c379', '#121212', 0.4) -- green
|
|
||||||
-- diff_delete = M.blend('#ff6b6b', '#121212', 0.4) -- red
|
|
||||||
-- diff_change = M.blend('#7aa2f7', '#121212', 0.4) -- blue
|
|
||||||
diff_add = '#0c2f1e',
|
|
||||||
diff_delete = '#291f27',
|
|
||||||
diff_change = '#3a4a6d',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
---@type Palette
|
---@type Palette
|
||||||
M.daylight = {
|
M.daylight = {
|
||||||
foreground = '#f5f5f5',
|
black = '#f5f5f5',
|
||||||
red = '#c7254e',
|
red = '#c7254e',
|
||||||
green = '#2d7f3e',
|
green = '#2d7f3e',
|
||||||
yellow = '#996800',
|
yellow = '#996800',
|
||||||
|
|
@ -100,7 +71,7 @@ M.daylight = {
|
||||||
magenta = '#ae3ec9',
|
magenta = '#ae3ec9',
|
||||||
cyan = '#1098ad',
|
cyan = '#1098ad',
|
||||||
orange = '#d9730d',
|
orange = '#d9730d',
|
||||||
background = '#1a1a1a',
|
white = '#1a1a1a',
|
||||||
|
|
||||||
bright_black = '#999999',
|
bright_black = '#999999',
|
||||||
bright_red = '#e03e52',
|
bright_red = '#e03e52',
|
||||||
|
|
@ -117,12 +88,6 @@ M.daylight = {
|
||||||
dark_grey = '#ebebeb',
|
dark_grey = '#ebebeb',
|
||||||
|
|
||||||
medium_emphasis = '#666666',
|
medium_emphasis = '#666666',
|
||||||
|
|
||||||
-- Diff backgrounds: base color blended at 40% with visual bg (#f5f5f5)
|
|
||||||
-- Generated via: M.blend(base_color, '#f5f5f5', 0.4)
|
|
||||||
diff_add = '#a5c5ab',
|
|
||||||
diff_delete = '#e2a1b2',
|
|
||||||
diff_change = '#a9b7e5',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
---@return Palette
|
---@return Palette
|
||||||
|
|
|
||||||
|
|
@ -59,22 +59,22 @@ function M.apply()
|
||||||
|
|
||||||
hi(
|
hi(
|
||||||
'Normal',
|
'Normal',
|
||||||
{ fg = cs.background, bg = cs.foreground },
|
{ fg = cs.white, bg = cs.black },
|
||||||
{ 'Identifier', 'Special', 'StatusLine', 'StatusLineNC', 'Winbar', 'WinbarNC' }
|
{ 'Identifier', 'Special', 'StatusLine', 'StatusLineNC', 'Winbar', 'WinbarNC' }
|
||||||
)
|
)
|
||||||
hi('NonText', { fg = cs.grey }, { 'SpecialKey' })
|
hi('NonText', { fg = cs.grey }, { 'SpecialKey' })
|
||||||
|
|
||||||
hi('LineNr', { fg = cs.light_black }, { 'SignColumn' })
|
hi('LineNr', { fg = cs.light_black }, { 'SignColumn' })
|
||||||
hi('CursorLine', { bg = cs.dark_grey, underline = false }, { 'ColorColumn', 'Folded', 'Visual' })
|
hi('CursorLine', { bg = cs.dark_grey }, { 'ColorColumn', 'Folded', 'Visual' })
|
||||||
hi('CursorLineNr', { fg = cs.medium_emphasis })
|
hi('CursorLineNr', { fg = cs.medium_emphasis })
|
||||||
|
|
||||||
hi('Conceal', { fg = cs.light_black, bg = cs.foreground })
|
hi('Conceal', { fg = cs.light_black, bg = cs.black })
|
||||||
hi('Directory', { fg = cs.blue })
|
hi('Directory', { fg = cs.blue })
|
||||||
hi('Error', { fg = cs.red })
|
hi('Error', { fg = cs.red })
|
||||||
hi('ErrorMsg', { bold = true, underline = true, fg = cs.red })
|
hi('ErrorMsg', { bold = true, underline = true, fg = cs.red })
|
||||||
hi('MoreMsg', { fg = cs.yellow }, { 'WarningMsg' })
|
hi('MoreMsg', { fg = cs.yellow }, { 'WarningMsg' })
|
||||||
hi('MatchParen', { bg = cs.med_grey })
|
hi('MatchParen', { bg = cs.med_grey })
|
||||||
hi('NormalFloat', { bg = cs.foreground }, {
|
hi('NormalFloat', { bg = cs.black }, {
|
||||||
'LspInfoBorder',
|
'LspInfoBorder',
|
||||||
'FloatBorder',
|
'FloatBorder',
|
||||||
'FloatShadow',
|
'FloatShadow',
|
||||||
|
|
@ -87,47 +87,43 @@ function M.apply()
|
||||||
tshi('Comment', { fg = cs.light_black })
|
tshi('Comment', { fg = cs.light_black })
|
||||||
tshi('Constant', { fg = cs.green })
|
tshi('Constant', { fg = cs.green })
|
||||||
tshi('Define', { fg = cs.blue })
|
tshi('Define', { fg = cs.blue })
|
||||||
tshi('Function', { fg = cs.background }, { '@function.builtin', '@function.macro' })
|
tshi('Function', { fg = cs.white }, { '@function.builtin', '@function.macro' })
|
||||||
tshi('Include', { fg = cs.blue })
|
tshi('Include', { fg = cs.blue })
|
||||||
tshi('Keyword', { fg = cs.blue }, { 'Statement' })
|
tshi('Keyword', { fg = cs.blue }, { 'Statement' })
|
||||||
tshi('Namespace', { fg = cs.background })
|
tshi('Namespace', { fg = cs.white })
|
||||||
tshi('Number', { fg = cs.green })
|
tshi('Number', { fg = cs.green })
|
||||||
tshi('Operator', { fg = cs.background }, { '@keyword.operator', '@conditional.ternary' })
|
tshi('Operator', { fg = cs.white }, { '@keyword.operator', '@conditional.ternary' })
|
||||||
hi('Delimiter', { none = true })
|
hi('Delimiter', { none = true })
|
||||||
hi('@punctuation.delimiter', { fg = cs.background })
|
hi('@punctuation.delimiter', { fg = cs.white })
|
||||||
tshi('PreProc', { fg = cs.blue })
|
tshi('PreProc', { fg = cs.blue })
|
||||||
tshi('String', { fg = cs.green }, { '@character' })
|
tshi('String', { fg = cs.green }, { '@character' })
|
||||||
hi('@string.escape', { fg = cs.green })
|
hi('@string.escape', { fg = cs.green })
|
||||||
tshi('Title', { bold = true, fg = cs.background })
|
tshi('Title', { bold = true, fg = cs.white })
|
||||||
|
|
||||||
hi('@tag', { fg = cs.background })
|
hi('@tag', { fg = cs.white })
|
||||||
hi('@tag.attribute', { fg = cs.background })
|
hi('@tag.attribute', { fg = cs.white })
|
||||||
hi('@tag.delimiter', { fg = cs.background })
|
hi('@tag.delimiter', { fg = cs.white })
|
||||||
|
|
||||||
tshi('Type', { fg = cs.background })
|
tshi('Type', { fg = cs.white })
|
||||||
hi('@type.qualifier', { fg = cs.background }, { '@storageclass' })
|
hi('@type.qualifier', { fg = cs.white }, { '@storageclass' })
|
||||||
hi('@lsp.type.enum', { fg = cs.background }, { '@lsp.type.class' })
|
hi('@lsp.type.enum', { fg = cs.white }, { '@lsp.type.class' })
|
||||||
hi('@lsp.type.comment', { none = true }, { '@lsp.type.macro' })
|
hi('@lsp.type.comment', { none = true }, { '@lsp.type.macro' })
|
||||||
|
|
||||||
hi('@text.emphasis', { italic = true })
|
hi('@text.emphasis', { italic = true })
|
||||||
hi('@text.strong', { bold = true })
|
hi('@text.strong', { bold = true })
|
||||||
hi('@text.underline', { underline = true })
|
hi('@text.underline', { underline = true })
|
||||||
hi('@text.uri', { fg = cs.background, underline = true }, { '@text.reference' })
|
hi('@text.uri', { fg = cs.white, underline = true }, { '@text.reference' })
|
||||||
|
|
||||||
hi('@comment.danger', { fg = cs.red, bold = true, italic = true })
|
hi('@text.danger', { fg = cs.red, bold = true, italic = true })
|
||||||
hi('@comment.note', { fg = cs.blue, bold = true, italic = true })
|
hi('@text.note', { fg = cs.green, bold = true, italic = true })
|
||||||
hi('@comment.todo', { fg = cs.yellow, bold = true, italic = true }, { 'Todo' })
|
hi('@text.todo', { fg = cs.yellow, bold = true, italic = true }, { 'Todo' })
|
||||||
hi('@comment.warning', { fg = cs.yellow, bold = true, italic = true })
|
hi('@text.warning', { fg = cs.yellow, bold = true, italic = true })
|
||||||
|
|
||||||
hi('@variable', { none = true })
|
hi('@variable', { none = true })
|
||||||
|
|
||||||
hi('Pmenu', { fg = cs.background, bg = cs.foreground }, { 'PmenuSbar' })
|
hi('Pmenu', { bg = cs.dark_grey }, { 'PmenuSbar' })
|
||||||
hi('PmenuSel', { bg = cs.med_grey })
|
hi('PmenuSel', { bg = cs.med_grey })
|
||||||
hi('PmenuThumb', { bg = cs.grey })
|
hi('PmenuThumb', { bg = cs.grey })
|
||||||
hi('BlinkCmpMenu', { fg = cs.background, bg = cs.foreground })
|
|
||||||
hi('BlinkCmpMenuBorder', { fg = cs.background, bg = cs.foreground })
|
|
||||||
hi('BlinkCmpDoc', { fg = cs.background, bg = cs.foreground })
|
|
||||||
hi('BlinkCmpDocBorder', { fg = cs.background, bg = cs.foreground })
|
|
||||||
|
|
||||||
hi('LspInlayHint', { fg = cs.light_black })
|
hi('LspInlayHint', { fg = cs.light_black })
|
||||||
hi('LspSignatureActiveParameter', { underline = true, italic = true })
|
hi('LspSignatureActiveParameter', { underline = true, italic = true })
|
||||||
|
|
@ -143,63 +139,32 @@ function M.apply()
|
||||||
hi('DiagnosticUnderlineInfo', { undercurl = true, special = cs.light_black })
|
hi('DiagnosticUnderlineInfo', { undercurl = true, special = cs.light_black })
|
||||||
|
|
||||||
hi('SpellBad', { underline = true, special = cs.red })
|
hi('SpellBad', { underline = true, special = cs.red })
|
||||||
hi('SpellRare', { underline = true, special = cs.background })
|
hi('SpellRare', { underline = true, special = cs.white })
|
||||||
hi('SpellCap', { underline = true, special = cs.background })
|
hi('SpellCap', { underline = true, special = cs.white })
|
||||||
hi('SpellLocal', { underline = true, special = cs.background })
|
hi('SpellLocal', { underline = true, special = cs.white })
|
||||||
|
|
||||||
hi('gitCommitSummary', { fg = cs.background })
|
hi('gitCommitSummary', { fg = cs.white })
|
||||||
|
|
||||||
hi('@attribute.diff', { fg = cs.blue })
|
hi('@attribute.diff', { fg = cs.white })
|
||||||
hi('@diff.minus', { fg = cs.red })
|
hi('DiffAdd', { fg = cs.green }, { '@text.diff.add', 'diffAdded' })
|
||||||
hi('@diff.plus', { fg = cs.green })
|
hi('DiffDelete', { fg = cs.red }, { '@text.diff.delete', 'diffRemoved' })
|
||||||
hi('@diff.delta', { fg = cs.blue })
|
hi('DiffChange', { fg = cs.yellow })
|
||||||
hi('@punctuation.special.diff', { fg = cs.blue })
|
|
||||||
|
|
||||||
link('Normal', { '@string.special.path', '@variable.parameter' })
|
hi('@constructor.lua', { fg = cs.white })
|
||||||
hi('DiffAdd', { bg = cs.diff_add, fg = cs.green }, { '@text.diff.add', 'diffAdded' })
|
|
||||||
hi('DiffDelete', { bg = cs.diff_delete, fg = cs.red }, { '@text.diff.delete', 'diffRemoved' })
|
|
||||||
hi('DiffChange', { bg = cs.diff_change, fg = cs.blue })
|
|
||||||
hi('DiffText', { bg = cs.blue, fg = cs.foreground })
|
|
||||||
|
|
||||||
hi('DiffsDiffAdd', { bg = cs.diff_add })
|
|
||||||
hi('DiffsDiffDelete', { bg = cs.diff_delete })
|
|
||||||
hi('DiffsDiffChange', { bg = cs.diff_change })
|
|
||||||
hi('DiffsDiffText', { bg = cs.blue })
|
|
||||||
|
|
||||||
hi('@constructor.lua', { fg = cs.background })
|
|
||||||
hi('@markup.heading.gitcommit', { none = true })
|
hi('@markup.heading.gitcommit', { none = true })
|
||||||
|
|
||||||
hi('@function.latex', { fg = cs.blue })
|
|
||||||
|
|
||||||
hi('GitSignsCurrentLineBlame', { italic = true, fg = cs.light_black })
|
hi('GitSignsCurrentLineBlame', { italic = true, fg = cs.light_black })
|
||||||
hi('GitSignsAdd', { fg = cs.green })
|
link('DiffAdd', 'GitSignsAdd')
|
||||||
hi('GitSignsChange', { fg = cs.blue })
|
link('DiffChange', 'GitSignsChange')
|
||||||
hi('GitSignsDelete', { fg = cs.red })
|
link('DiffDelete', 'GitSignsDelete')
|
||||||
|
|
||||||
link('Search', 'HighlightUndo')
|
link('Search', 'HighlightUndo')
|
||||||
|
|
||||||
link('Pmenu', 'CmpPmenu')
|
link('Pmenu', 'CmpPmenu')
|
||||||
link('PmenuSel', 'CmpPmenuSel')
|
link('PmenuSel', 'CmpPmenuSel')
|
||||||
hi('CmpItemAbbr', { fg = cs.background })
|
hi('CmpItemAbbr', { fg = cs.white })
|
||||||
hi('CmpItemAbbrMatch', { fg = cs.background, bold = true })
|
hi('CmpItemAbbrMatch', { fg = cs.white, bold = true })
|
||||||
hi('CmpItemAbbrMatchFuzzy', { fg = cs.background, bold = true })
|
hi('CmpItemAbbrMatchFuzzy', { fg = cs.white, bold = true })
|
||||||
hi('BlinkCmpLabelMatch', { fg = cs.green })
|
|
||||||
hi('BlinkCmpGhostText', { fg = cs.light_black })
|
|
||||||
hi('BlinkCmpGitKindMR', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitKindPR', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitKindIssue', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitKindCommit', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitKindMention', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitKindIconMR', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitKindIconPR', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitKindIconIssue', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitKindIconCommit', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitKindIconMention', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitLabelMRId', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitLabelPRId', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitLabelIssueId', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitLabelCommitId', { fg = cs.magenta })
|
|
||||||
hi('BlinkCmpGitLabelMentionId', { fg = cs.magenta })
|
|
||||||
hi('CmpItemAbbrDeprecated', { fg = cs.light_black, strikethrough = true })
|
hi('CmpItemAbbrDeprecated', { fg = cs.light_black, strikethrough = true })
|
||||||
hi('CmpItemMenu', { fg = cs.light_black })
|
hi('CmpItemMenu', { fg = cs.light_black })
|
||||||
|
|
||||||
|
|
@ -250,18 +215,18 @@ function M.apply()
|
||||||
link('Directory', 'OilDir')
|
link('Directory', 'OilDir')
|
||||||
|
|
||||||
link('NormalFloat', 'FzfLuaBorder')
|
link('NormalFloat', 'FzfLuaBorder')
|
||||||
hi('FzfLuaHeaderText', { fg = cs.background }, { 'FzfLuaBufFlagCur' })
|
hi('FzfLuaHeaderText', { fg = cs.white }, { 'FzfLuaBufFlagCur' })
|
||||||
hi('FzfLuaBufFlagAlt', { fg = cs.background })
|
hi('FzfLuaBufFlagAlt', { fg = cs.white })
|
||||||
link('Normal', 'FzfLuaLivePrompt')
|
link('Normal', 'FzfLuaLivePrompt')
|
||||||
|
|
||||||
vim.g.terminal_color_0 = cs.foreground
|
vim.g.terminal_color_0 = cs.black
|
||||||
vim.g.terminal_color_1 = cs.red
|
vim.g.terminal_color_1 = cs.red
|
||||||
vim.g.terminal_color_2 = cs.green
|
vim.g.terminal_color_2 = cs.green
|
||||||
vim.g.terminal_color_3 = cs.yellow
|
vim.g.terminal_color_3 = cs.yellow
|
||||||
vim.g.terminal_color_4 = cs.blue
|
vim.g.terminal_color_4 = cs.blue
|
||||||
vim.g.terminal_color_5 = cs.magenta
|
vim.g.terminal_color_5 = cs.magenta
|
||||||
vim.g.terminal_color_6 = cs.cyan
|
vim.g.terminal_color_6 = cs.cyan
|
||||||
vim.g.terminal_color_7 = cs.background
|
vim.g.terminal_color_7 = cs.white
|
||||||
vim.g.terminal_color_8 = cs.bright_black
|
vim.g.terminal_color_8 = cs.bright_black
|
||||||
vim.g.terminal_color_9 = cs.bright_red
|
vim.g.terminal_color_9 = cs.bright_red
|
||||||
vim.g.terminal_color_10 = cs.bright_green
|
vim.g.terminal_color_10 = cs.bright_green
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@ rockspec_format = '3.0'
|
||||||
package = 'midnight.nvim'
|
package = 'midnight.nvim'
|
||||||
version = 'scm-1'
|
version = 'scm-1'
|
||||||
|
|
||||||
source = { url = 'git://github.com/barrettruth/midnight.nvim' }
|
source = { url = 'git://github.com/barrett-ruth/midnight.nvim' }
|
||||||
build = { type = 'builtin' }
|
build = { type = 'builtin' }
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
nix develop --command stylua --check .
|
|
||||||
git ls-files '*.lua' | xargs nix develop --command selene --display-style quiet
|
|
||||||
nix develop --command prettier --check .
|
|
||||||
nix fmt
|
|
||||||
git diff --exit-code -- '*.nix'
|
|
||||||
nix develop --command lua-language-server --check . --checklevel=Warning
|
|
||||||
|
|
@ -1,4 +1 @@
|
||||||
std = 'vim'
|
std = 'vim'
|
||||||
|
|
||||||
[lints]
|
|
||||||
bad_string_escape = 'allow'
|
|
||||||
|
|
|
||||||
30
vim.toml
Normal file
30
vim.toml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
[selene]
|
||||||
|
base = "lua51"
|
||||||
|
name = "vim"
|
||||||
|
|
||||||
|
[vim]
|
||||||
|
any = true
|
||||||
|
|
||||||
|
[jit]
|
||||||
|
any = true
|
||||||
|
|
||||||
|
[assert]
|
||||||
|
any = true
|
||||||
|
|
||||||
|
[describe]
|
||||||
|
any = true
|
||||||
|
|
||||||
|
[it]
|
||||||
|
any = true
|
||||||
|
|
||||||
|
[before_each]
|
||||||
|
any = true
|
||||||
|
|
||||||
|
[after_each]
|
||||||
|
any = true
|
||||||
|
|
||||||
|
[spy]
|
||||||
|
any = true
|
||||||
|
|
||||||
|
[stub]
|
||||||
|
any = true
|
||||||
26
vim.yaml
26
vim.yaml
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
base: lua51
|
|
||||||
name: vim
|
|
||||||
lua_versions:
|
|
||||||
- luajit
|
|
||||||
globals:
|
|
||||||
vim:
|
|
||||||
any: true
|
|
||||||
jit:
|
|
||||||
any: true
|
|
||||||
assert:
|
|
||||||
any: true
|
|
||||||
describe:
|
|
||||||
any: true
|
|
||||||
it:
|
|
||||||
any: true
|
|
||||||
before_each:
|
|
||||||
any: true
|
|
||||||
after_each:
|
|
||||||
any: true
|
|
||||||
spy:
|
|
||||||
any: true
|
|
||||||
stub:
|
|
||||||
any: true
|
|
||||||
bit:
|
|
||||||
any: true
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue