Merge pull request #3 from barrettruth/feat/init
feat: add project infrastructure and rewrite README
This commit is contained in:
commit
a6d82b16fb
12 changed files with 318 additions and 155 deletions
17
.github/DISCUSSION_TEMPLATE/q-a.yaml
vendored
Normal file
17
.github/DISCUSSION_TEMPLATE/q-a.yaml
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
title: 'Q&A'
|
||||
labels: []
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Use this space for questions, ideas, and general discussion about nonicons.nvim.
|
||||
For bug reports, please [open an issue](https://github.com/barrettruth/nonicons.nvim/issues/new/choose) instead.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Question or topic
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Context
|
||||
description: Any relevant details (Neovim version, config, screenshots)
|
||||
78
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
Normal file
78
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
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/nonicons.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 nonicons`'
|
||||
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 = {
|
||||
{
|
||||
'barrettruth/nonicons.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
},
|
||||
},
|
||||
})
|
||||
validations:
|
||||
required: true
|
||||
5
.github/ISSUE_TEMPLATE/config.yaml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yaml
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Questions
|
||||
url: https://github.com/barrettruth/nonicons.nvim/discussions
|
||||
about: Ask questions and discuss ideas
|
||||
30
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
Normal file
30
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
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/nonicons.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
|
||||
21
.github/workflows/luarocks.yaml
vendored
Normal file
21
.github/workflows/luarocks.yaml
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
name: luarocks
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
uses: ./.github/workflows/quality.yaml
|
||||
|
||||
publish:
|
||||
needs: quality
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: nvim-neorocks/luarocks-tag-release@v7
|
||||
env:
|
||||
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
|
||||
89
.github/workflows/quality.yaml
vendored
Normal file
89
.github/workflows/quality.yaml
vendored
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
name: quality
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
lua: ${{ steps.changes.outputs.lua }}
|
||||
markdown: ${{ steps.changes.outputs.markdown }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
with:
|
||||
filters: |
|
||||
lua:
|
||||
- 'lua/**'
|
||||
- 'plugin/**'
|
||||
- '*.lua'
|
||||
- '.luarc.json'
|
||||
- '*.toml'
|
||||
markdown:
|
||||
- '*.md'
|
||||
|
||||
lua-format:
|
||||
name: Lua Format Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: JohnnyMorganz/stylua-action@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: 2.1.0
|
||||
args: --check .
|
||||
|
||||
lua-lint:
|
||||
name: Lua Lint Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Lint with Selene
|
||||
uses: NTBBloodbath/selene-action@v1.0.0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --display-style quiet .
|
||||
|
||||
lua-typecheck:
|
||||
name: Lua Type Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run Lua LS Type Check
|
||||
uses: mrcjkb/lua-typecheck-action@v0
|
||||
with:
|
||||
checklevel: Warning
|
||||
directories: lua
|
||||
configpath: .luarc.json
|
||||
|
||||
markdown-format:
|
||||
name: Markdown Format Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.markdown == 'true' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup pnpm
|
||||
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 .
|
||||
17
.pre-commit-config.yaml
Normal file
17
.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
minimum_pre_commit_version: '3.5.0'
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/JohnnyMorganz/StyLua
|
||||
rev: v2.3.1
|
||||
hooks:
|
||||
- id: stylua-github
|
||||
name: stylua (Lua formatter)
|
||||
files: \.lua$
|
||||
pass_filenames: true
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: v4.0.0-alpha.8
|
||||
hooks:
|
||||
- id: prettier
|
||||
name: prettier
|
||||
files: \.(md|toml|yaml|yml|sh)$
|
||||
1
.prettierignore
Normal file
1
.prettierignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
node_modules/
|
||||
9
.prettierrc
Normal file
9
.prettierrc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"proseWrap": "always",
|
||||
"printWidth": 80,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"trailingComma": "none",
|
||||
"semi": false,
|
||||
"singleQuote": true
|
||||
}
|
||||
171
README.md
171
README.md
|
|
@ -1,44 +1,22 @@
|
|||
# nonicons.nvim
|
||||
|
||||
**Nonicons for Neovim**
|
||||
**[Nonicons](https://github.com/ya2s/nonicons) for Neovim**
|
||||
|
||||
Replace [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons)
|
||||
glyphs with icons from the [nonicons](https://github.com/yamatsum/nonicons)
|
||||
font. Any plugin that uses nvim-web-devicons automatically displays nonicons
|
||||
glyphs.
|
||||
<!-- screenshot here -->
|
||||
|
||||
## Features
|
||||
|
||||
- Replaces nvim-web-devicons glyphs with nonicons font icons
|
||||
- Any plugin using nvim-web-devicons works automatically
|
||||
- No `setup()` call needed
|
||||
|
||||
## Requirements
|
||||
|
||||
- [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons)
|
||||
- [nonicons font](https://github.com/yamatsum/nonicons/releases) installed in
|
||||
your terminal
|
||||
- [nonicons font](https://github.com/ya2s/nonicons/releases) installed
|
||||
|
||||
## Installation
|
||||
|
||||
Install the nonicons font and configure your terminal to use it as a fallback:
|
||||
|
||||
**ghostty**
|
||||
|
||||
```
|
||||
font-family = Nonicons
|
||||
font-family = YourMainFont
|
||||
```
|
||||
|
||||
**kitty**
|
||||
|
||||
```
|
||||
symbol_map U+F101-U+F219 Nonicons
|
||||
```
|
||||
|
||||
**wezterm**
|
||||
|
||||
```lua
|
||||
config.font = wezterm.font_with_fallback({
|
||||
'YourMainFont',
|
||||
'Nonicons',
|
||||
})
|
||||
```
|
||||
|
||||
Install with your package manager of choice or via
|
||||
[luarocks](https://luarocks.org/modules/barrettruth/nonicons.nvim):
|
||||
|
||||
|
|
@ -46,7 +24,15 @@ Install with your package manager of choice or via
|
|||
luarocks install nonicons.nvim
|
||||
```
|
||||
|
||||
**lazy.nvim**
|
||||
## Documentation
|
||||
|
||||
```vim
|
||||
:help nonicons.nvim
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
**How do I install with lazy.nvim?**
|
||||
|
||||
```lua
|
||||
{
|
||||
|
|
@ -55,126 +41,7 @@ luarocks install nonicons.nvim
|
|||
}
|
||||
```
|
||||
|
||||
The plugin applies overrides automatically. No `setup()` call is needed.
|
||||
|
||||
## Configuration
|
||||
|
||||
Configure via `vim.g.nonicons` before the plugin loads:
|
||||
|
||||
```lua
|
||||
vim.g.nonicons = {
|
||||
override = true, -- default; set false to disable devicons wrapping
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```lua
|
||||
local get = require('nonicons').get
|
||||
|
||||
get('lua') -- returns the nonicons lua character
|
||||
get('python') -- returns the nonicons python character
|
||||
get('git-branch') -- returns the nonicons git-branch character
|
||||
```
|
||||
|
||||
The raw mapping table is available for advanced use:
|
||||
|
||||
```lua
|
||||
local code = require('nonicons').mapping['lua']
|
||||
local icon = vim.fn.nr2char(code)
|
||||
```
|
||||
|
||||
## Recipes
|
||||
|
||||
**lualine** — mode icons:
|
||||
|
||||
```lua
|
||||
local get = require('nonicons').get
|
||||
|
||||
require('lualine').setup({
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{
|
||||
'mode',
|
||||
fmt = function(mode)
|
||||
local map = {
|
||||
NORMAL = get('vim-normal-mode'),
|
||||
INSERT = get('vim-insert-mode'),
|
||||
VISUAL = get('vim-visual-mode'),
|
||||
REPLACE = get('vim-replace-mode'),
|
||||
COMMAND = get('vim-command-mode'),
|
||||
}
|
||||
return map[mode] or mode
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
**nvim-notify**:
|
||||
|
||||
```lua
|
||||
require('notify').setup({
|
||||
icons = {
|
||||
ERROR = require('nonicons').get('x-circle'),
|
||||
WARN = require('nonicons').get('alert'),
|
||||
INFO = require('nonicons').get('info'),
|
||||
DEBUG = require('nonicons').get('bug'),
|
||||
TRACE = require('nonicons').get('play'),
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
**mason.nvim**:
|
||||
|
||||
```lua
|
||||
require('mason').setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = require('nonicons').get('check'),
|
||||
package_pending = require('nonicons').get('sync'),
|
||||
package_uninstalled = require('nonicons').get('x'),
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
**oil.nvim**, **fzf-lua**, **telescope.nvim** — no configuration needed. These
|
||||
plugins read from nvim-web-devicons which nonicons.nvim wraps automatically.
|
||||
|
||||
**nvim-tree**:
|
||||
|
||||
```lua
|
||||
local get = require('nonicons').get
|
||||
|
||||
require('nvim-tree').setup({
|
||||
renderer = {
|
||||
icons = {
|
||||
glyphs = {
|
||||
default = get('file'),
|
||||
symlink = get('file-symlink-file'),
|
||||
folder = {
|
||||
default = get('file-directory-fill'),
|
||||
open = get('file-directory-open-fill'),
|
||||
symlink = get('file-submodule'),
|
||||
empty = get('file-directory-outline'),
|
||||
arrow_open = get('chevron-down'),
|
||||
arrow_closed = get('chevron-right'),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
```vim
|
||||
:help nonicons.nvim
|
||||
```
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
- [yamatsum/nonicons](https://github.com/yamatsum/nonicons) — icon font
|
||||
- [ya2s/nonicons](https://github.com/ya2s/nonicons) — icon font
|
||||
- [ya2s/nvim-nonicons](https://github.com/ya2s/nvim-nonicons) — original plugin
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ License: MIT
|
|||
INTRODUCTION *nonicons.nvim*
|
||||
|
||||
nonicons.nvim replaces nvim-web-devicons glyphs with icons from the nonicons
|
||||
font (https://github.com/yamatsum/nonicons). It wraps devicons functions so
|
||||
font (https://github.com/ya2s/nonicons). It wraps devicons functions so
|
||||
that any plugin using nvim-web-devicons automatically displays nonicons glyphs.
|
||||
|
||||
==============================================================================
|
||||
|
|
@ -164,7 +164,7 @@ FONT SETUP *nonicons-font*
|
|||
|
||||
The nonicons font must be installed and configured in your terminal emulator.
|
||||
|
||||
Download the font from: https://github.com/yamatsum/nonicons/releases
|
||||
Download the font from: https://github.com/ya2s/nonicons/releases
|
||||
|
||||
ghostty ~
|
||||
>
|
||||
|
|
@ -200,7 +200,7 @@ Run `:checkhealth nonicons` to verify:
|
|||
==============================================================================
|
||||
ACKNOWLEDGEMENTS *nonicons-acknowledgements*
|
||||
|
||||
- yamatsum/nonicons (https://github.com/yamatsum/nonicons) — icon font
|
||||
- ya2s/nonicons (https://github.com/ya2s/nonicons) — icon font
|
||||
- ya2s/nvim-nonicons (https://github.com/ya2s/nvim-nonicons) — original plugin
|
||||
|
||||
==============================================================================
|
||||
|
|
|
|||
29
flake.nix
Normal file
29
flake.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
description = "nonicons.nvim — nonicons 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
|
||||
{
|
||||
devShells = forEachSystem (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
packages = [
|
||||
pkgs.prettier
|
||||
pkgs.stylua
|
||||
pkgs.selene
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue