Skip to content

Commit

Permalink
[ADD] Add README, docs, workflows
Browse files Browse the repository at this point in the history
Add README, docs, and workflows. Minor refactoring of plugins and
loading auto style.
  • Loading branch information
miikanissi committed Oct 29, 2023
1 parent 3beac98 commit 6ebda89
Show file tree
Hide file tree
Showing 14 changed files with 462 additions and 42 deletions.
74 changes: 74 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Bug report
description: Report a problem with Modus Themes
labels: [bug]
body:
- type: textarea
attributes:
label: "Description"
description: "A short description of the problem you are reporting."
validations:
required: true
- type: textarea
attributes:
label: "Neovim version"
description: "Output of `nvim --version` (Modus Themes requires neovim >= 0.8)"
render: markdown
placeholder: |
NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1692716794
validations:
required: true
- type: input
attributes:
label: "Terminal and multiplexer"
placeholder: "kitty 0.29.2 with tmux 3.3a"
- type: input
attributes:
label: "Modus themes version"
placeholder: "modus-themes.nvim v1.0.0"
validations:
required: true
- type: textarea
attributes:
label: "Steps to reproduce"
description: "Steps to reproduce using the minimal config provided below."
placeholder: |
1. `nvim -u repro.lua`
2. ...
validations:
required: true
- type: textarea
attributes:
label: Repro
description:
Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with
`nvim -u repro.lua`
value: |
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"miikanissi/modus-themes.nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("modus")
-- add anything else here
render: Lua
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Feature request
description: Suggest an idea for Modus Themes
labels: [enhancement]
body:
- type: textarea
attributes:
label: "Description"
description: "A short description of the feature idea you have."
render: markdown
validations:
required: true
- type: textarea
attributes:
label: "Additional context"
description: "Any other context or screenshots about the feature."
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI
on:
push:
pull_request:

jobs:
tests:
if: always()
strategy:
matrix:
# os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Neovim
shell: bash
run: |
mkdir -p /tmp/nvim
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage
cd /tmp/nvim
chmod a+x ./nvim.appimage
./nvim.appimage --appimage-extract
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
- name: Run Tests
run: |
nvim --version
[ ! -d tests ] && exit 0
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}"
docs:
runs-on: ubuntu-latest
needs: tests
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v3
- run: git pull
- name: panvimdoc
uses: kdheepak/panvimdoc@main
with:
vimdoc: modus-themes.nvim
version: "Neovim >= 0.8.0"
demojify: true
treesitter: true
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[UPD] auto-generate vimdoc"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author:
"github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
130 changes: 129 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,129 @@
# modus-themes.nvim
# Modus Themes

Highly accessible themes for [Neovim](https://github.com/neovim/neovim), conforming with
the highest standard for color contrast between background and foreground values
([WCAG AAA](https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced.html)). This
is a Neovim port of the original
[Modus Themes](https://protesilaos.com/emacs/modus-themes) built for
[GNU Emacs](https://www.gnu.org/software/emacs/).

![Modus Themes Preview](https://raw.githubusercontent.com/miikanissi/modus-themes.nvim/master/assets/modus-themes-preview.png)

## Features

- Extensive `TreeSitter` syntax highlighting and `LSP` integration
- Supports most popular plugins
- Switch between light and dark mode automatically based on `vim.o.background`
- Provides [extras](#-extras) to use with numerous other applications

## Requirements

- [Neovim](https://github.com/neovim/neovim) >=
[0.7.2](https://github.com/neovim/neovim/releases/tag/v0.7.2)

## Installation

Install the theme with your preferred package manager.

[lazy.nvim](https://github.com/folke/lazy.nvim)

```lua
{ "miikanissi/modus-themes.nvim", priority = 1000 }
```

[packer.nvim](https://github.com/wbthomason/packer.nvim)

```lua
use({ "miikanissi/modus-themes.nvim" })
```

[vim-plug](https://github.com/junegunn/vim-plug)

```vim
Plug 'miikanissi/modus-themes.nvim'
```

## Usage

### Lua

```lua
vim.cmd([[colorscheme modus]]) -- modus-operandi, modus-vivendi
```

### Vim Script

```vim
colorscheme modus " modus-operandi, modus-vivendi
```

## Configuration

> Ensure the configuration is set **BEFORE** loading the color scheme with
> `colorscheme modus`.
By default, the theme will choose between light (modus-operandi) and dark
(modus-vivendi) based on the background value set with `vim.o.background`.

If using the default options, there is no need to explicitly call `setup`.

```lua
-- Default options
require("modus-themes").setup({
-- Theme comes in two styles `modus_operandi` and `modus_vivendi`
-- `auto` will automatically set style based on background set with vim.o.background
style = "auto",
variant = "default", -- Theme comes in four variants `default`, `tinted`, `deuteranopia`, and `tritanopia`
styles = {
-- Style to be applied to different syntax groups
-- Value is any valid attr-list value for `:help nvim_set_hl`
comments = { italic = true },
keywords = { italic = true },
functions = {},
variables = {},
},

--- You can override specific color groups to use other groups or a hex color
--- function will be called with a ColorScheme table
---@param colors ColorScheme
on_colors = function(colors) end,

--- You can override specific highlights to use other groups or a hex color
--- function will be called with a Highlights and ColorScheme table
---@param highlights Highlights
---@param colors ColorScheme
on_highlights = function(highlights, colors) end,
})
```

### Example Settings and Color Overrides

```lua
require("modus-themes").setup({
style = "modus_operandi", -- Always use modus_operandi regardless of `vim.o.background`
variant = "tinted", -- Use tinted variant
styles = {
-- Enable italics for functions
functions = { italic = true },
},

on_colors = function(colors)
colors.error = colors.red_faint -- Change error color to the "faint" variant
end,
})
```

## Contributing

Contributions are welcome. Feel free to create a pull request to add support for any
missing plugins, or to report an issue.

Please ensure the WCAG AAA contrast requirements are met. You can use this
[contrast checker](https://webaim.org/resources/contrastchecker/) for reference.

## Acknowledgements

- [Modus Themes](https://protesilaos.com/emacs/modus-themes): Original Modus Themes for
GNU Emacs
- [Tokyo Night](https://github.com/folke/tokyonight.nvim): Neovim theme used for
inspiration
Binary file added assets/modus-themes-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion colors/modus-operandi.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require("modus-themes")._load("modus_operandi")
require("modus-themes").load({ style = "modus_operandi" })
2 changes: 1 addition & 1 deletion colors/modus-vivendi.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require("modus-themes")._load("modus_vivendi")
require("modus-themes").load({ style = "modus_vivendi" })
2 changes: 1 addition & 1 deletion colors/modus.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require("modus-themes")._load()
require("modus-themes").load()
Loading

0 comments on commit 6ebda89

Please sign in to comment.