Skip to content
Open
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
41 changes: 41 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: nix flake check

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_dispatch:

jobs:
flake-check:
name: nix flake check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: nix flake check
run: nix flake check --no-build --show-trace

- name: Build default package (jsvim)
run: nix build .#jsvim --no-link --print-out-paths

build-language-packages:
name: build ${{ matrix.pkg }}
runs-on: ubuntu-latest
needs: flake-check
strategy:
fail-fast: false
matrix:
pkg: [jsvim, rustvim, zvim, jvim, sharpvim, rvim]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build .#${{ matrix.pkg }} --no-link --print-out-paths
80 changes: 80 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,86 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### BREAKING

- The default flake output is now `jsvim`, not `nvim`. Use
`nix run .#jsvim` (or `nix build .#jsvim`). The on-disk binary is still
named `nvim` (and `vim`) via package aliases, so day-to-day shell usage
is unchanged.
- The legacy package definition formerly named `nvim` has been removed.
The example `nixCats` and `regularCats` packages are still present.

### Added

- **JS/TS DX overhaul (`jsvim`)**:
- ESLint LSP (vscode-eslint-language-server) with `codeActionOnSave`.
- JSON / CSS / HTML / Tailwind / Emmet / YAML LSPs.
- SchemaStore.nvim integration for `package.json`, `tsconfig.json`,
GitHub Actions, etc.
- Working `vscode-js-debug` DAP setup with launch configs for
`node`, `tsx`, `npm` script picker, `jest`, `vitest` and the
pre-existing attach configs.
- `neotest` with `neotest-jest` and `neotest-vitest` adapters
(`<leader>tn` / `<leader>tf` / `<leader>ts` / `<leader>to` / `<leader>tw`).
- `package-info.nvim` for inline npm version info in `package.json`.
- `nvim-ts-autotag` (auto-close JSX tags) and
`nvim-ts-context-commentstring` (correct JSX comments).
- `nvim-autopairs` (general).
- **LSP**:
- Inlay hints auto-enabled on `LspAttach` for clients that support them,
with `<leader>th` toggle.
- `vim.diagnostic.config` configured (rounded float, severity sort,
bullet virtual_text prefix).
- Language-aware `root_markers` (no more `{ '.git' }`-only).
- ts_ls inlay hints + code lens settings.
- **Imports**: `<leader>oi`/`ia`/`ir`/`if` now use the typed code-action
kinds (`source.organizeImports.ts` etc.) instead of the raw
`_typescript.organizeImports` command.
- **`:checkhealth jsvim`** reports node/npm/tsc/LSP/formatter/linter
availability and the attached LSP clients on the current buffer.
- **CI**: `.github/workflows/check.yml` runs `nix flake check` and builds
every language package on push/PR.

### Changed

- `flake.nix` collapsed: every language package is now built from a
single `mkLanguagePackage` helper in `nix/lib.nix`, dedup'ing ~600 lines.
- Each `nix/languages/*.nix` is the single source of truth for its
language: it now declares `formatters`, `linters`, `lspName`,
runtime deps, and (for js) `js-debug-path`. The lua side reads the
merged tables via `nixCats.extra("languageConfig.formatters")` /
`...linters`, so adding a language no longer requires touching
`lua/myLuaConf/format/init.lua` or `lua/myLuaConf/lint/init.lua`.
- `prettierd` is now wired up for `json`, `jsonc`, `html`, `css`, `scss`,
`less`, `yaml`, `markdown`, `graphql`, `vue`, `svelte` (in addition to
the existing js/ts/jsx/tsx).
- `eslint_d` is now wired up as the JS/TS linter via `nvim-lint`.
- `mason-lspconfig` non-Nix path migrated to v2 API
(`automatic_enable = false` + per-server `vim.lsp.enable`).
- AI / Claude Code is now opt-in per package; only `jsvim`, `nixCats`
and `regularCats` enable it. The previous global `general -> ai`
link in `extraCats` has been removed.
- Claude Code toggle moved from `<C-,>` (not transmitted by most
terminals) to `<leader>ct`.
- `vim.o.clipboard` is no longer set globally; per-key `<leader>y`/`p`
bindings give explicit control without clobbering registers.

### Fixed

- `nvim-dap-js` no longer references the (non-existent in Nix) Mason
`node-debug2-adapter`. All `pwa-*` adapters share one server-mode
spawn of vscode-js-debug's `dapDebugServer.js`.
- ts_ls settings: removed the invalid `displayStringForProperties` /
`preferDisplayStringForProperties` keys; replaced with valid
`inlayHints` / `implementationsCodeLens` / `referencesCodeLens` /
`preferences` settings.
- Format-on-save no longer runs twice (removed the redundant
`BufWritePre *` autocmd that duplicated `format_on_save`).
- Replaced deprecated APIs: `vim.lsp.get_active_clients`,
`vim.api.nvim_buf_set_option`, `vim.api.nvim_win_set_option`,
`vim.api.nvim_buf_get_option`, `vim.lsp.buf.execute_command`,
`vim.diagnostic.goto_prev`/`goto_next`, `vim.highlight.on_yank`.

### Added

- **Documentation**: Comprehensive guides for installation, language packages, and adding new languages
Expand Down
95 changes: 56 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ nix develop # or nix flake show to see available packages

Each package provides a specialized Neovim configuration for a specific language ecosystem:

| Package | Language | LSP | Debugger | Formatter | Use Case |
|---------|----------|-----|----------|-----------|----------|
| **jsvim** | JavaScript/TypeScript | ts_ls | vscode-js-debug | prettier | Frontend/Node.js development |
| **jvim** | Java | jdtls | Built-in | - | Java application development |
| **sharpvim** | C# | OmniSharp | - | - | .NET development |
| Package | Language | LSPs | Debugger | Formatter / Linter | Use Case |
|---------|----------|------|----------|--------------------|----------|
| **jsvim** *(default)* | JavaScript / TypeScript | ts_ls, eslint, jsonls, cssls, html, tailwindcss, emmet, yamlls | vscode-js-debug | prettierd / eslint_d | Frontend / Node.js development |
| **rustvim** | Rust | rust-analyzer | CodeLLDB | rustfmt / clippy | Rust development |
| **zvim** | Zig | zls | LLDB | zig fmt | Zig systems programming |
| **rustvim** | Rust | rust-analyzer | CodeLLDB | rustfmt | Rust development with clippy linting |
| **rvim** | R | languageserver | - | styler | R statistical analysis & data science |
| **nvim** | General | TypeScript-focused | Multi-lang | prettier | Default multi-language setup |
| **jvim** | Java | jdtls | (JDWP attach) | google-java-format | JVM development |
| **sharpvim** | C# | omnisharp | netcoredbg | csharpier | .NET development |
| **rvim** | R | r_language_server | - | styler / lintr | R statistical analysis |

### Using Language-Specific Packages

Expand Down Expand Up @@ -95,16 +94,38 @@ nvim/

## Key Features by Package

### JavaScript/TypeScript (jsvim)

- **LSP**: TypeScript Language Server with full TypeScript/JavaScript support
- **Debugging**: vscode-js-debug with launch/attach configurations
- **Formatting**: Prettier/Prettierd for consistent code style
- **Features**:
- Node.js ESM and CommonJS debugging
- Chrome/Browser debugging
- Jest test debugging
- Process attachment capabilities
### JavaScript / TypeScript (`jsvim`) — default package

- **LSPs**:
- `ts_ls` (typescript-language-server) with inlay hints,
`implementations` and `references` code lenses
- `eslint` (vscode-eslint-language-server) with `codeActionOnSave`
- `jsonls` + `yamlls` driven by `SchemaStore.nvim`
- `cssls`, `html`, `tailwindcss`, `emmet_language_server`
- **Debugging**: vscode-js-debug, run as a server-mode adapter shared by
every `pwa-*` config:
- Launch current file with `node` or `tsx`
- Launch via `npm` script (interactive picker reads `package.json`)
- Debug Jest test (current file) via `node_modules/.bin/jest`
- Debug Vitest test (current file)
- Attach to Node by default port (9229), custom port, or PID picker
- Attach to / launch Chrome
- **Formatting**: `prettierd` (with `prettier` fallback) for js, ts, jsx,
tsx, json, jsonc, html, css, scss, less, yaml, markdown, graphql, vue,
svelte. Run on save via `conform.nvim`, manual via `<leader>FF`.
- **Linting**: `eslint_d` via `nvim-lint` on `BufWritePost` /
`BufReadPost` / `InsertLeave`.
- **Tests**: `neotest` with `neotest-jest` and `neotest-vitest`:
`<leader>tn` (nearest), `<leader>tf` (file), `<leader>ts` (summary),
`<leader>to` (output), `<leader>tw` (watch).
- **Imports** (`<leader>oi` / `ia` / `ir` / `if`): organize, add missing,
remove unused, fix all — uses typed code-action kinds.
- **package.json** UX (`<leader>n*`): inline npm version info, update,
delete, install via `package-info.nvim`.
- **JSX**: `nvim-ts-autotag` (auto-close tags) and
`nvim-ts-context-commentstring` (correct comment tokens inside JSX).
- **Health check**: `:checkhealth jsvim` reports tooling availability and
attached LSP clients.

### Rust (rustvim)

Expand Down Expand Up @@ -196,10 +217,10 @@ Press `<leader>FF` to manually format the current file.

### Linting

Code quality checks run on buffer write:
- JavaScript/TypeScript: ESLint (commented, can enable)
- Rust: Clippy (integrated with rust-analyzer)
- R: lintr
Code quality checks run on buffer write / read / insert-leave:
- JavaScript / TypeScript: `eslint_d` (via `nvim-lint`)
- Rust: clippy (integrated via rust-analyzer's `check.command`)
- R: `lintr`

## Customization

Expand All @@ -218,27 +239,23 @@ Edit `lua/myLuaConf/opts_and_keys.lua` to customize:

### Creating a Custom Package

Edit flake.nix and add a new package definition:
Every language package is built with the `mkLanguagePackage` helper in
`nix/lib.nix`. To add a new language `foo`:

1. Create `nix/languages/foo.nix` declaring `lspsAndRuntimeDeps`,
`formatters`, `linters`, `lspName`, `packageName`, `appName`, `logo`.
2. Add it to the `languageModules` set in `nix/lib.nix`.
3. Add a one-liner output in `flake.nix`:

```nix
customvim = { pkgs, ... }: {
settings = {
configDirName = "nvim";
wrapRc = true;
};
categories = {
markdown = true;
general = true;
rust = true; # Your desired language
# ... other categories
};
};
foovim = moxLib.mkLanguagePackage { language = "foo"; };
```

Then build it:
```bash
nix build .#customvim
```
4. Optionally extend `lua/myLuaConf/LSPs/init.lua` with an
`if nixCats('foo') then servers.foo_ls = { ... } end` block.

The lua side reads formatters/linters automatically from the merged
language tables passed via `nixCats.extra("languageConfig.*")`.

## Architecture

Expand Down
Loading
Loading