mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-19 16:48:43 +00:00
Compare commits
171 commits
49b748072b
...
2442f5107b
| Author | SHA1 | Date | |
|---|---|---|---|
|
2442f5107b |
|||
|
cb4d8340a1 |
|||
|
|
300989f008 |
||
|
|
f58b8ded0b |
||
|
|
30ed6ceae4 |
||
|
|
ab1385ffb9 |
||
|
|
f5769ca156 |
||
|
|
f04ad1fff5 | ||
|
|
3f42d4e810 |
||
|
|
412d786325 | ||
|
|
144ab18dbd | ||
|
|
76558857a3 |
||
|
|
48d5fbfa32 |
||
|
|
7550be9b72 |
||
|
|
988f034236 |
||
|
|
7095c4d49f | ||
|
f4e0300886 |
|||
|
c4cf91d4b5 |
|||
|
e78ebe0680 |
|||
|
|
b1e2801ee3 | ||
|
|
e6d30cf9d9 |
||
|
74ba4d9559 |
|||
|
ec24c0ecaf |
|||
|
|
624547353c |
||
|
|
c7745775ce |
||
|
|
b45f0516a1 |
||
|
|
3da08708d7 |
||
|
|
195d39cef7 | ||
|
|
316aeeae4e | ||
|
|
f7b556ab24 |
||
|
|
9e50a89d7e | ||
|
|
a15ad3cd11 | ||
|
|
c4d040b0b0 |
||
|
|
139c18f296 |
||
|
|
5fe4106866 |
||
|
d3a0e7029a |
|||
|
232824a863 |
|||
|
7a4f8132e4 |
|||
|
6922565279 |
|||
|
e3316b98df |
|||
|
b89097f1c0 |
|||
|
|
37aac45396 |
||
|
|
23e50a8eb7 |
||
|
|
eecebde413 |
||
|
|
23e40da9a4 | ||
|
|
ab991a7e57 | ||
|
|
1643b5262b | ||
|
4399a05a46 |
|||
|
|
6d1b7ec094 | ||
|
|
a0905ee428 | ||
|
a595233c46 |
|||
|
|
2f33732bed |
||
|
|
62cd4154a2 | ||
|
|
32b9694840 | ||
|
|
35b888c00d |
||
|
74587e254a |
|||
|
|
d8ac181663 |
||
|
|
fde3dfbabd | ||
|
|
8f87f05b45 |
||
|
|
3dcd8c796e | ||
|
79993c71d8 |
|||
|
|
ae49dd7dd3 |
||
|
392f737401 |
|||
|
db2c5e6744 |
|||
|
|
3c79d4df64 |
||
|
|
55229043ba |
||
|
|
89f1c02f04 |
||
|
|
e72bf9398d |
||
|
|
c2434da6b4 |
||
|
|
8efdfd508e |
||
|
|
509c00c9de |
||
|
815ed49d36 |
|||
|
|
054e4a3b9c |
||
|
|
a099cdaf97 |
||
|
fee3bbe536 |
|||
|
4855b540b5 |
|||
|
|
b26e8b2db6 |
||
|
|
b6486a2aba |
||
|
65e1fdd97b |
|||
|
7365866e8d |
|||
|
86fb8d601f |
|||
|
5d229d48c7 |
|||
|
|
17d876b0b4 |
||
|
ce08bf8d2c |
|||
|
|
29f6940868 |
||
|
|
955f2046cf |
||
|
|
4f0cc5725a |
||
|
|
22f5704527 |
||
|
|
09f2e1d524 |
||
|
a1806457ca |
|||
|
|
edbfc120af | ||
|
99f1200c8d |
|||
|
d3c7f7125c |
|||
|
f07468e13a |
|||
|
d330db08e0 |
|||
|
|
9e94587102 | ||
|
|
61be6cf405 |
||
|
|
55e11e543b |
||
|
f1d72cf076 |
|||
|
10a06b3fa0 |
|||
|
37750d9bef |
|||
|
3c672f64fc |
|||
|
5221dc27dd |
|||
|
60ab3c90b4 |
|||
|
cf24e93c1b |
|||
|
7d191a350d |
|||
|
|
e9e57caa18 | ||
|
b11ca58113 |
|||
|
|
9feb71594d |
||
|
5f5aff2d46 |
|||
|
18e659dd7d |
|||
|
|
ee0a7e7048 |
||
|
|
e752f59994 |
||
|
8162653c29 |
|||
|
91deec0986 |
|||
|
4b17e14f84 |
|||
|
b44b76a1a7 |
|||
|
3d3b734e66 |
|||
|
f558b7bc00 |
|||
|
b618939716 |
|||
|
69e75a00ed |
|||
|
4678f73411 |
|||
|
1ed6fd9f58 |
|||
|
d147606a35 |
|||
|
|
c2380761d1 | ||
|
|
d783fa0b27 | ||
|
|
140cfea205 | ||
|
|
c5b72f124f |
||
|
|
e946799757 |
||
|
98d9f0e622 |
|||
|
|
26ff9dcc9e |
||
|
f7c35ab342 |
|||
|
5278dab32b |
|||
|
eae1f306b8 |
|||
|
c7e49f3703 |
|||
|
dda89a2d9c |
|||
|
|
028bd7b4cb |
||
|
|
cc2c412b88 | ||
|
|
1f7405aaf7 | ||
|
|
997d685c00 |
||
|
ef3928be60 |
|||
|
|
eb4b990b49 |
||
|
c45f28aefd |
|||
|
|
5dff9537d1 |
||
|
099907591a |
|||
|
|
1381a0eee1 |
||
|
|
878cf96f71 | ||
|
|
ea90d2baf3 | ||
|
efa859381f |
|||
| c30f07fcd6 | |||
| 9bd2a6dcb4 | |||
|
|
ea9075a07f | ||
| 52fb95ea6b | |||
| 35c432db3b | |||
| 159a033902 | |||
| 1768791402 | |||
|
a8291918a9 |
|||
|
|
20a4bbe01e | ||
|
|
64bee7e729 | ||
|
|
b99308bd70 |
||
|
|
f8779d1968 | ||
|
|
75fa8e22b6 | ||
|
|
f0fe0b0f62 | ||
|
|
c7b7a5d6d4 | ||
|
|
9f6413e891 |
||
|
|
79f3dc2c02 | ||
|
|
e21904d50d | ||
|
|
7092ff5b7b | ||
|
|
8cde1f7b93 | ||
|
|
72c5c7f634 | ||
|
|
6bdc52cd77 |
125 changed files with 2267 additions and 684 deletions
55
.github/labels.yml
vendored
Normal file
55
.github/labels.yml
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
# This file is used by .github/workflows/labels.yml
|
||||||
|
"topic: plugins":
|
||||||
|
- any:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- modules/plugins/**/*
|
||||||
|
|
||||||
|
"topic: modules":
|
||||||
|
- any:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- modules/**/*
|
||||||
|
|
||||||
|
"topic: dependencies":
|
||||||
|
- any:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- npins
|
||||||
|
- flake.lock
|
||||||
|
|
||||||
|
"topic: CI":
|
||||||
|
- any:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- .github/workflows/*.yml
|
||||||
|
- .github/typos.toml
|
||||||
|
- .github/dependabot.yml
|
||||||
|
|
||||||
|
"topic: meta":
|
||||||
|
- any:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- .github/CODEOWNERS
|
||||||
|
- LICENSE
|
||||||
|
- .github/README.md
|
||||||
|
- .github/funding.yml
|
||||||
|
- .github/assets
|
||||||
|
- .github/*_TEMPLATE
|
||||||
|
- .gitignore
|
||||||
|
- .editorconfig
|
||||||
|
- release.json
|
||||||
|
|
||||||
|
"topic: documentation":
|
||||||
|
- any:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- docs/**/*
|
||||||
|
- .github/CONTRIBUTING.md
|
||||||
|
- .github/README.md
|
||||||
|
"topic: packaging":
|
||||||
|
- any:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- flake.nix
|
||||||
|
- flake/packages.nix
|
||||||
33
.github/workflows/backport.yml
vendored
Normal file
33
.github/workflows/backport.yml
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
name: Backport PR on Label
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- labeled
|
||||||
|
|
||||||
|
# Permissions needed for the korthout/backport-action to create branches and PRs
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
backport:
|
||||||
|
name: Create Backport PR
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: |
|
||||||
|
github.event.pull_request.merged == true && startsWith(github.event.label.name, 'backport-')
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Backport Action
|
||||||
|
uses: korthout/backport-action@v3
|
||||||
|
with:
|
||||||
|
# Regex pattern for labels that should trigger a backport AND extracts the target branch
|
||||||
|
# from the name (e.g. v0.x or v0.x.y; we use zerover). This action will ONLY proceed if
|
||||||
|
# the label that triggered the workflow fully matches this pattern.
|
||||||
|
# Example matching labels: "backport-v0.1", "backport-v0.10.1"
|
||||||
|
# Example non-matching labels: "backport-foo", "backport-v1.0"
|
||||||
|
label_pattern: '^backport-(v0\.\d+(\.\d+)?)$'
|
||||||
21
.github/workflows/labeler.yml
vendored
Normal file
21
.github/workflows/labeler.yml
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
name: "Label PR"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [edited, opened, synchronize, reopened]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
labels:
|
||||||
|
name: "Label PR"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
||||||
|
steps:
|
||||||
|
- uses: actions/labeler@v5
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
configuration-path: .github/labels.yml
|
||||||
|
sync-labels: true
|
||||||
|
|
@ -18,12 +18,16 @@ isMaximal: {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
|
# This must be enabled for the language modules to hook into
|
||||||
|
# the LSP API.
|
||||||
|
enable = true;
|
||||||
|
|
||||||
formatOnSave = true;
|
formatOnSave = true;
|
||||||
lspkind.enable = false;
|
lspkind.enable = false;
|
||||||
lightbulb.enable = true;
|
lightbulb.enable = true;
|
||||||
lspsaga.enable = false;
|
lspsaga.enable = false;
|
||||||
trouble.enable = true;
|
trouble.enable = true;
|
||||||
lspSignature.enable = true;
|
lspSignature.enable = !isMaximal; # conflicts with blink in maximal
|
||||||
otter-nvim.enable = isMaximal;
|
otter-nvim.enable = isMaximal;
|
||||||
nvim-docs-view.enable = isMaximal;
|
nvim-docs-view.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
@ -38,8 +42,7 @@ isMaximal: {
|
||||||
# This section does not include a comprehensive list of available language modules.
|
# This section does not include a comprehensive list of available language modules.
|
||||||
# To list all available language module options, please visit the nvf manual.
|
# To list all available language module options, please visit the nvf manual.
|
||||||
languages = {
|
languages = {
|
||||||
enableLSP = true;
|
enableFormat = true; #
|
||||||
enableFormat = true;
|
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
enableExtraDiagnostics = true;
|
enableExtraDiagnostics = true;
|
||||||
|
|
||||||
|
|
@ -124,7 +127,15 @@ isMaximal: {
|
||||||
|
|
||||||
autopairs.nvim-autopairs.enable = true;
|
autopairs.nvim-autopairs.enable = true;
|
||||||
|
|
||||||
autocomplete.nvim-cmp.enable = true;
|
# nvf provides various autocomplete options. The tried and tested nvim-cmp
|
||||||
|
# is enabled in default package, because it does not trigger a build. We
|
||||||
|
# enable blink-cmp in maximal because it needs to build its rust fuzzy
|
||||||
|
# matcher library.
|
||||||
|
autocomplete = {
|
||||||
|
nvim-cmp.enable = !isMaximal;
|
||||||
|
blink-cmp.enable = isMaximal;
|
||||||
|
};
|
||||||
|
|
||||||
snippets.luasnip.enable = true;
|
snippets.luasnip.enable = true;
|
||||||
|
|
||||||
filetree = {
|
filetree = {
|
||||||
|
|
@ -142,6 +153,7 @@ isMaximal: {
|
||||||
binds = {
|
binds = {
|
||||||
whichKey.enable = true;
|
whichKey.enable = true;
|
||||||
cheatsheet.enable = true;
|
cheatsheet.enable = true;
|
||||||
|
hardtime-nvim.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
telescope.enable = true;
|
telescope.enable = true;
|
||||||
|
|
@ -187,6 +199,7 @@ isMaximal: {
|
||||||
};
|
};
|
||||||
images = {
|
images = {
|
||||||
image-nvim.enable = false;
|
image-nvim.enable = false;
|
||||||
|
img-clip.enable = isMaximal;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -235,6 +248,7 @@ isMaximal: {
|
||||||
cmp.enable = isMaximal;
|
cmp.enable = isMaximal;
|
||||||
};
|
};
|
||||||
codecompanion-nvim.enable = false;
|
codecompanion-nvim.enable = false;
|
||||||
|
avante-nvim.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
session = {
|
session = {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
inherit
|
inherit
|
||||||
(
|
(
|
||||||
(lib.evalModules {
|
(lib.evalModules {
|
||||||
|
specialArgs = {inherit inputs;};
|
||||||
modules =
|
modules =
|
||||||
import ../modules/modules.nix {
|
import ../modules/modules.nix {
|
||||||
inherit lib pkgs;
|
inherit lib pkgs;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,15 @@
|
||||||
# Configuring nvf {#ch-configuring}
|
# Configuring nvf {#ch-configuring}
|
||||||
|
|
||||||
|
[helpful tips section]: #ch-helpful-tips
|
||||||
|
|
||||||
|
nvf allows for _very_ extensive configuration in Neovim through the Nix module
|
||||||
|
interface. The below chapters describe several of the options exposed in nvf for
|
||||||
|
your convenience. You might also be interested in the [helpful tips section] for
|
||||||
|
more advanced or unusual configuration options supported by nvf.
|
||||||
|
|
||||||
|
Note that this section does not cover module _options_. For an overview of all
|
||||||
|
module options provided by nvf, please visit the [appendix](/options.html)
|
||||||
|
|
||||||
```{=include=} chapters
|
```{=include=} chapters
|
||||||
configuring/custom-package.md
|
configuring/custom-package.md
|
||||||
configuring/custom-plugins.md
|
configuring/custom-plugins.md
|
||||||
|
|
@ -7,4 +17,5 @@ configuring/overriding-plugins.md
|
||||||
configuring/languages.md
|
configuring/languages.md
|
||||||
configuring/dags.md
|
configuring/dags.md
|
||||||
configuring/dag-entries.md
|
configuring/dag-entries.md
|
||||||
|
configuring/autocmds.md
|
||||||
```
|
```
|
||||||
|
|
|
||||||
119
docs/manual/configuring/autocmds.md
Normal file
119
docs/manual/configuring/autocmds.md
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
# Autocommands and Autogroups {#ch-autocmds-augroups}
|
||||||
|
|
||||||
|
This module allows you to declaratively configure Neovim autocommands and
|
||||||
|
autogroups within your Nix configuration.
|
||||||
|
|
||||||
|
## Autogroups (`vim.augroups`) {#sec-vim-augroups}
|
||||||
|
|
||||||
|
Autogroups (`augroup`) organize related autocommands. This allows them to be
|
||||||
|
managed collectively, such as clearing them all at once to prevent duplicates.
|
||||||
|
Each entry in the list is a submodule with the following options:
|
||||||
|
|
||||||
|
| Option | Type | Default | Description | Example |
|
||||||
|
| :------- | :----- | :------ | :--------------------------------------------------------------------------------------------------- | :---------------- |
|
||||||
|
| `enable` | `bool` | `true` | Enables or disables this autogroup definition. | `true` |
|
||||||
|
| `name` | `str` | _None_ | **Required.** The unique name for the autogroup. | `"MyFormatGroup"` |
|
||||||
|
| `clear` | `bool` | `true` | Clears any existing autocommands within this group before adding new ones defined in `vim.autocmds`. | `true` |
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
vim.augroups = [
|
||||||
|
{
|
||||||
|
name = "MyCustomAuGroup";
|
||||||
|
clear = true; # Clear previous autocommands in this group on reload
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "Formatting";
|
||||||
|
# clear defaults to true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Autocommands (`vim.autocmds`) {#sec-vim-autocmds}
|
||||||
|
|
||||||
|
Autocommands (`autocmd`) trigger actions based on events happening within Neovim
|
||||||
|
(e.g., saving a file, entering a buffer). Each entry in the list is a submodule
|
||||||
|
with the following options:
|
||||||
|
|
||||||
|
| Option | Type | Default | Description | Example |
|
||||||
|
| :--------- | :-------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- |
|
||||||
|
| `enable` | `bool` | `true` | Enables or disables this autocommand definition. | `true` |
|
||||||
|
| `event` | `nullOr (listOf str)` | `null` | **Required.** List of Neovim events that trigger this autocommand (e.g., `BufWritePre`, `FileType`). | `[ "BufWritePre" ]` |
|
||||||
|
| `pattern` | `nullOr (listOf str)` | `null` | List of file patterns (globs) to match against (e.g., `*.py`, `*`). If `null`, matches all files for the given event. | `[ "*.lua", "*.nix" ]` |
|
||||||
|
| `callback` | `nullOr luaInline` | `null` | A Lua function to execute when the event triggers. Use `lib.nvim.types.luaInline` or `lib.options.literalExpression "mkLuaInline '''...'''"`. **Cannot be used with `command`.** | `lib.nvim.types.luaInline "function() print('File saved!') end"` |
|
||||||
|
| `command` | `nullOr str` | `null` | A Vimscript command to execute when the event triggers. **Cannot be used with `callback`.** | `"echo 'File saved!'"` |
|
||||||
|
| `group` | `nullOr str` | `null` | The name of an `augroup` (defined in `vim.augroups`) to associate this autocommand with. | `"MyCustomAuGroup"` |
|
||||||
|
| `desc` | `nullOr str` | `null` | A description for the autocommand (useful for introspection). | `"Format buffer on save"` |
|
||||||
|
| `once` | `bool` | `false` | If `true`, the autocommand runs only once and then automatically removes itself. | `false` |
|
||||||
|
| `nested` | `bool` | `false` | If `true`, allows this autocommand to trigger other autocommands. | `false` |
|
||||||
|
|
||||||
|
:::{.warning}
|
||||||
|
|
||||||
|
You cannot define both `callback` (for Lua functions) and `command` (for
|
||||||
|
Vimscript) for the same autocommand. Choose one.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
**Examples:**
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
vim.augroups = [ { name = "UserSetup"; } ];
|
||||||
|
|
||||||
|
vim.autocmds = [
|
||||||
|
# Example 1: Using a Lua callback
|
||||||
|
{
|
||||||
|
event = [ "BufWritePost" ];
|
||||||
|
pattern = [ "*.lua" ];
|
||||||
|
group = "UserSetup";
|
||||||
|
desc = "Notify after saving Lua file";
|
||||||
|
callback = lib.nvim.types.luaInline ''
|
||||||
|
function()
|
||||||
|
vim.notify("Lua file saved!", vim.log.levels.INFO)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
# Example 2: Using a Vim command
|
||||||
|
{
|
||||||
|
event = [ "FileType" ];
|
||||||
|
pattern = [ "markdown" ];
|
||||||
|
group = "UserSetup";
|
||||||
|
desc = "Set spellcheck for Markdown";
|
||||||
|
command = "setlocal spell";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Example 3: Autocommand without a specific group
|
||||||
|
{
|
||||||
|
event = [ "BufEnter" ];
|
||||||
|
pattern = [ "*.log" ];
|
||||||
|
desc = "Disable line numbers in log files";
|
||||||
|
command = "setlocal nonumber";
|
||||||
|
# No 'group' specified
|
||||||
|
}
|
||||||
|
|
||||||
|
# Example 4: Using Lua for callback
|
||||||
|
{
|
||||||
|
event = [ "BufWinEnter" ];
|
||||||
|
pattern = [ "*" ];
|
||||||
|
desc = "Simple greeting on entering a buffer window";
|
||||||
|
callback = lib.generators.mkLuaInline ''
|
||||||
|
function(args)
|
||||||
|
print("Entered buffer: " .. args.buf)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Run only once per session trigger
|
||||||
|
once = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
These definitions are automatically translated into the necessary Lua code to
|
||||||
|
configure `vim.api.nvim_create_augroup` and `vim.api.nvim_create_autocmd` when
|
||||||
|
Neovim starts.
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
# Custom Neovim Package {#ch-custom-package}
|
# Custom Neovim Package {#ch-custom-package}
|
||||||
|
|
||||||
As of v0.5, you may now specify the Neovim package that will be wrapped with
|
As of v0.5, you may now specify the Neovim package that will be wrapped with
|
||||||
your configuration. This is done with the `vim.package` option.
|
your configuration. This is done with the [](#opt-vim.package) option.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{inputs, pkgs, ...}: {
|
{inputs, pkgs, ...}: {
|
||||||
# using the neovim-nightly overlay
|
# using the neovim-nightly overlay
|
||||||
vim.package = inputs.neovim-overlay.packages.${pkgs.system}.neovim;
|
vim.package = inputs.neovim-overlay.packages.${pkgs.stdenv.system}.neovim;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,33 @@
|
||||||
# Custom Plugins {#ch-custom-plugins}
|
# Custom Plugins {#ch-custom-plugins}
|
||||||
|
|
||||||
**nvf**, by default, exposes a wide variety of plugins as module options for
|
**nvf** exposes a very wide variety of plugins by default, which are consumed by
|
||||||
your convenience and bundles necessary dependencies into **nvf**'s runtime. In
|
module options. This is done for your convenience, and to bundle all necessary
|
||||||
case a plugin is not available in **nvf**, you may consider making a pull
|
dependencies into **nvf**'s runtime with full control of versioning, testing and
|
||||||
request to **nvf** to include it as a module or you may add it to your
|
dependencies. In the case a plugin you need is _not_ available, you may consider
|
||||||
configuration locally.
|
making a pull request to add the package you're looking for, or you may add it
|
||||||
|
to your configuration locally. The below section describes how new plugins may
|
||||||
|
be added to the user's configuration.
|
||||||
|
|
||||||
## Adding Plugins {#ch-adding-plugins}
|
## Adding Plugins {#ch-adding-plugins}
|
||||||
|
|
||||||
There are multiple ways of adding custom plugins to your **nvf** configuration.
|
Per **nvf**'s design choices, there are several ways of adding custom plugins to
|
||||||
|
your configuration as you need them. As we aim for extensive configuration, it
|
||||||
|
is possible to add custom plugins (from nixpkgs, pinning tools, flake inputs,
|
||||||
|
etc.) to your Neovim configuration before they are even implemented in **nvf**
|
||||||
|
as a module.
|
||||||
|
|
||||||
You can use custom plugins, before they are implemented in the flake. To add a
|
:::{.info}
|
||||||
plugin to the runtime, you need to add it to the [](#opt-vim.startPlugins) list
|
|
||||||
in your configuration.
|
|
||||||
|
|
||||||
Adding a plugin to `startPlugins` will not allow you to configure the plugin
|
To add a plugin to your runtime, you will need to add it to
|
||||||
that you have added, but **nvf** provides multiple ways of configuring any custom
|
[](#opt-vim.startPlugins) list in your configuration. This is akin to cloning a
|
||||||
plugins that you might have added to your configuration.
|
plugin to `~/.config/nvim`, but they are only ever placed in the Nix store and
|
||||||
|
never exposed to the outside world for purity and full isolation.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
As you would configure a cloned plugin, you must configure the new plugins that
|
||||||
|
you've added to `startPlugins.` **nvf** provides multiple ways of configuring
|
||||||
|
any custom plugins that you might have added to your configuration.
|
||||||
|
|
||||||
```{=include=} sections
|
```{=include=} sections
|
||||||
custom-plugins/configuring.md
|
custom-plugins/configuring.md
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,20 @@
|
||||||
# Configuring {#sec-configuring-plugins}
|
# Configuring {#sec-configuring-plugins}
|
||||||
|
|
||||||
Just making the plugin to your Neovim configuration available might not always
|
Just making the plugin to your Neovim configuration available might not always
|
||||||
be enough. In that case, you can write custom lua config using either
|
be enough., for example, if the plugin requires a setup table. In that case, you
|
||||||
`config.vim.lazy.plugins.*.setupOpts` `config.vim.extraPlugins.*.setup` or
|
can write custom Lua configuration using one of
|
||||||
`config.vim.luaConfigRC`.
|
|
||||||
|
|
||||||
The first option uses an extended version of `lz.n`'s PluginSpec. `setupModule`
|
- `config.vim.lazy.plugins.*.setupOpts`
|
||||||
and `setupOpt` can be used if the plugin uses a `require('module').setup(...)`
|
- `config.vim.extraPlugins.*.setup`
|
||||||
pattern. Otherwise, the `before` and `after` hooks should do what you need.
|
- `config.vim.luaConfigRC`.
|
||||||
|
|
||||||
|
## Lazy Plugins {#ch-vim-lazy-plugins}
|
||||||
|
|
||||||
|
`config.vim.lazy.plugins.*.setupOpts` is useful for lazy-loading plugins, and
|
||||||
|
uses an extended version of `lz.n's` `PluginSpec` to expose a familiar
|
||||||
|
interface. `setupModule` and `setupOpt` can be used if the plugin uses a
|
||||||
|
`require('module').setup(...)` pattern. Otherwise, the `before` and `after`
|
||||||
|
hooks should do what you need.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
|
@ -25,50 +32,61 @@ pattern. Otherwise, the `before` and `after` hooks should do what you need.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The second option uses an attribute set, which maps DAG section names to a
|
## Standard API {#ch-vim-extra-plugins}
|
||||||
|
|
||||||
|
`vim.extraPlugins` uses an attribute set, which maps DAG section names to a
|
||||||
custom type, which has the fields `package`, `after`, `setup`. They allow you to
|
custom type, which has the fields `package`, `after`, `setup`. They allow you to
|
||||||
set the package of the plugin, the sections its setup code should be after (note
|
set the package of the plugin, the sections its setup code should be after (note
|
||||||
that the `extraPlugins` option has its own DAG scope), and the its setup code
|
that the `extraPlugins` option has its own DAG scope), and the its setup code
|
||||||
respectively. For example:
|
respectively. For example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
config.vim.extraPlugins = with pkgs.vimPlugins; {
|
{pkgs, ...}: {
|
||||||
aerial = {
|
config.vim.extraPlugins = {
|
||||||
package = aerial-nvim;
|
aerial = {
|
||||||
setup = "require('aerial').setup {}";
|
package = pkgs.vimPlugins.aerial-nvim;
|
||||||
};
|
setup = "require('aerial').setup {}";
|
||||||
|
};
|
||||||
|
|
||||||
harpoon = {
|
harpoon = {
|
||||||
package = harpoon;
|
package = pkgs.vimPlugins.harpoon;
|
||||||
setup = "require('harpoon').setup {}";
|
setup = "require('harpoon').setup {}";
|
||||||
after = ["aerial"]; # place harpoon configuration after aerial
|
after = ["aerial"]; # place harpoon configuration after aerial
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The third option also uses an attribute set, but this one is resolved as a DAG
|
### Setup using luaConfigRC {#setup-using-luaconfigrc}
|
||||||
|
|
||||||
|
`vim.luaConfigRC` also uses an attribute set, but this one is resolved as a DAG
|
||||||
directly. The attribute names denote the section names, and the values lua code.
|
directly. The attribute names denote the section names, and the values lua code.
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
# this will create an "aquarium" section in your init.lua with the contents of your custom config
|
# This will create a section called "aquarium" in the 'init.lua' with the
|
||||||
# which will be *appended* to the rest of your configuration, inside your init.vim
|
# contents of your custom configuration. By default 'entryAnywhere' is implied
|
||||||
|
# in DAGs, so this will be inserted to an arbitrary position. In the case you
|
||||||
|
# wish to control the position of this section with more precision, please
|
||||||
|
# look into the DAGs section of the manual.
|
||||||
config.vim.luaConfigRC.aquarium = "vim.cmd('colorscheme aquiarum')";
|
config.vim.luaConfigRC.aquarium = "vim.cmd('colorscheme aquiarum')";
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- deno-fmt-ignore-start -->
|
<!-- deno-fmt-ignore-start -->
|
||||||
|
[DAG system]: #ch-using-dags
|
||||||
|
[DAG section]: #ch-dag-entries
|
||||||
|
|
||||||
::: {.note}
|
::: {.note}
|
||||||
One of the greatest strengths of nvf is the ability to order
|
One of the **greatest strengths** of **nvf** is the ability to order
|
||||||
snippets of configuration via the DAG system. It will allow specifying positions
|
configuration snippets precisely using the [DAG system]. DAGs
|
||||||
of individual sections of configuration as needed. nvf provides helper functions
|
are a very powerful mechanism that allows specifying positions
|
||||||
|
of individual sections of configuration as needed. We provide helper functions
|
||||||
in the extended library, usually under `inputs.nvf.lib.nvim.dag` that you may
|
in the extended library, usually under `inputs.nvf.lib.nvim.dag` that you may
|
||||||
use.
|
use.
|
||||||
|
|
||||||
Please refer to the [DAG section](#ch-dag-entries) in the nvf manual
|
Please refer to the [DAG section] in the nvf manual
|
||||||
to find out more about the DAG system.
|
to find out more about the DAG system.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
<!-- deno-fmt-ignore-end -->
|
<!-- deno-fmt-ignore-end -->
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
# Lazy Method {#sec-lazy-method}
|
# Lazy Method {#sec-lazy-method}
|
||||||
|
|
||||||
As of version **0.7**, we exposed an API for configuring lazy-loaded plugins via
|
As of version **0.7**, an API is exposed to allow configuring lazy-loaded
|
||||||
`lz.n` and `lzn-auto-require`.
|
plugins via `lz.n` and `lzn-auto-require`. Below is a comprehensive example of
|
||||||
|
how it may be loaded to lazy-load an arbitrary plugin.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
|
@ -41,7 +42,8 @@ As of version **0.7**, we exposed an API for configuring lazy-loaded plugins via
|
||||||
|
|
||||||
## LazyFile event {#sec-lazyfile-event}
|
## LazyFile event {#sec-lazyfile-event}
|
||||||
|
|
||||||
You can use the `LazyFile` user event to load a plugin when a file is opened:
|
**nvf** re-implements `LazyFile` as a familiar user event to load a plugin when
|
||||||
|
a file is opened:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
|
@ -55,5 +57,6 @@ You can use the `LazyFile` user event to load a plugin when a file is opened:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
You can consider `LazyFile` as an alias to
|
You can consider the `LazyFile` event as an alias to the combination of
|
||||||
`["BufReadPost" "BufNewFile" "BufWritePre"]`
|
`"BufReadPost"`, `"BufNewFile"` and `"BufWritePre"`, i.e., a list containing all
|
||||||
|
three of those events: `["BufReadPost" "BufNewFile" "BufWritePre"]`
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,31 @@
|
||||||
# Legacy Method {#sec-legacy-method}
|
# Legacy Method {#sec-legacy-method}
|
||||||
|
|
||||||
Prior to version v0.5, the method of adding new plugins was adding the plugin
|
Prior to version **0.5**, the method of adding new plugins was adding the plugin
|
||||||
package to `vim.startPlugins` and add its configuration as a DAG under one of
|
package to [](#opt-vim.startPlugins) and adding its configuration as a DAG under
|
||||||
`vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or
|
one of `vim.configRC` or [](#opt-vim.luaConfigRC). While `configRC` has been
|
||||||
prefer a more hands-on approach may use the old method where the load order of
|
deprecated, users who have not yet updated to 0.5 or those who prefer a more
|
||||||
the plugins is determined by DAGs.
|
hands-on approach may choose to use the old method where the load order of the
|
||||||
|
plugins is explicitly determined by DAGs without internal abstractions.
|
||||||
|
|
||||||
## Adding plugins {#sec-adding-plugins}
|
## Adding New Plugins {#sec-adding-new-plugins}
|
||||||
|
|
||||||
To add a plugin not available in nvf as a module to your configuration, you may
|
To add a plugin not available in **nvf** as a module to your configuration using
|
||||||
add it to [](#opt-vim.startPlugins) in order to make it available to Neovim at
|
the legacy method, you must add it to [](#opt-vim.startPlugins) in order to make
|
||||||
runtime.
|
it available to Neovim at runtime.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
# Add a Neovim plugin from Nixpkgs to the runtime.
|
# Add a Neovim plugin from Nixpkgs to the runtime.
|
||||||
|
# This does not need to come explicitly from packages. 'vim.startPlugins'
|
||||||
|
# takes a list of *string* (to load internal plugins) or *package* to load
|
||||||
|
# a Neovim package from any source.
|
||||||
vim.startPlugins = [pkgs.vimPlugins.aerial-nvim];
|
vim.startPlugins = [pkgs.vimPlugins.aerial-nvim];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
And to configure the added plugin, you can use the `luaConfigRC` option to
|
Once the package is available in Neovim's runtime, you may use the `luaConfigRC`
|
||||||
provide configuration as a DAG using the **nvf** extended library.
|
option to provide configuration as a DAG using the **nvf** extended library in
|
||||||
|
order to configure the added plugin,
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{inputs, ...}: let
|
{inputs, ...}: let
|
||||||
|
|
@ -29,6 +34,8 @@ provide configuration as a DAG using the **nvf** extended library.
|
||||||
# to specialArgs, the 'inputs' prefix may be omitted.
|
# to specialArgs, the 'inputs' prefix may be omitted.
|
||||||
inherit (inputs.nvf.lib.nvim.dag) entryAnywhere;
|
inherit (inputs.nvf.lib.nvim.dag) entryAnywhere;
|
||||||
in {
|
in {
|
||||||
|
# luaConfigRC takes Lua configuration verbatim and inserts it at an arbitrary
|
||||||
|
# position by default or if 'entryAnywhere' is used.
|
||||||
vim.luaConfigRC.aerial-nvim= entryAnywhere ''
|
vim.luaConfigRC.aerial-nvim= entryAnywhere ''
|
||||||
require('aerial').setup {
|
require('aerial').setup {
|
||||||
-- your configuration here
|
-- your configuration here
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
# Non-lazy Method {#sec-non-lazy-method}
|
# Non-lazy Method {#sec-non-lazy-method}
|
||||||
|
|
||||||
As of version **0.5**, we have a more extensive API for configuring plugins,
|
As of version **0.5**, we have a more extensive API for configuring plugins that
|
||||||
under `vim.extraPlugins`. Instead of using DAGs exposed by the library, you may
|
should be preferred over the legacy method. This API is available as
|
||||||
use the extra plugin module as follows:
|
[](#opt-vim.extraPlugins). Instead of using DAGs exposed by the library
|
||||||
|
_directly_, you may use the extra plugin module as follows:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{pkgs, ...}: {
|
||||||
config.vim.extraPlugins = with pkgs.vimPlugins; {
|
config.vim.extraPlugins = {
|
||||||
aerial = {
|
aerial = {
|
||||||
package = aerial-nvim;
|
package = pkgs.vimPlugins.aerial-nvim;
|
||||||
setup = ''
|
setup = ''
|
||||||
require('aerial').setup {
|
require('aerial').setup {
|
||||||
-- some lua configuration here
|
-- some lua configuration here
|
||||||
|
|
@ -17,10 +18,12 @@ use the extra plugin module as follows:
|
||||||
};
|
};
|
||||||
|
|
||||||
harpoon = {
|
harpoon = {
|
||||||
package = harpoon;
|
package = pkgs.vimPlugins.harpoon;
|
||||||
setup = "require('harpoon').setup {}";
|
setup = "require('harpoon').setup {}";
|
||||||
after = ["aerial"];
|
after = ["aerial"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This provides a level of abstraction over the DAG system for faster iteration.
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,22 @@
|
||||||
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
|
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
|
||||||
|
|
||||||
In any of the `opt.languages.<language>.lsp.package` options you can provide
|
One of the strengths of **nvf** is convenient aliases to quickly configure LSP
|
||||||
your own LSP package, or provide the command to launch the language server, as a
|
servers through the Nix module system. By default the LSP packages for relevant
|
||||||
list of strings. You can use this to skip automatic installation of a language
|
language modules will be pulled into the closure. If this is not desirable, you
|
||||||
server, and instead use the one found in your `$PATH` during runtime, for
|
may provide **a custom LSP package** (e.g., a Bash script that calls a command)
|
||||||
example:
|
or **a list of strings** to be interpreted as the command to launch the language
|
||||||
|
server. By using a list of strings, you can use this to skip automatic
|
||||||
|
installation of a language server, and instead use the one found in your `$PATH`
|
||||||
|
during runtime, for example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
vim.languages.java = {
|
vim.languages.java = {
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# this expects jdt-language-server to be in your PATH
|
|
||||||
# or in `vim.extraPackages`
|
# This expects 'jdt-language-server' to be in your PATH or in
|
||||||
|
# 'vim.extraPackages.' There are no additional checks performed to see
|
||||||
|
# if the command provided is valid.
|
||||||
package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"];
|
package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
# Default Configs {#ch-default-configs}
|
|
||||||
|
|
||||||
While you can configure **nvf** yourself using the builder, you can also use the
|
|
||||||
pre-built configs that are available. Here are a few default configurations you
|
|
||||||
can use.
|
|
||||||
|
|
||||||
```{=include=} chapters
|
|
||||||
default-configs/maximal.md
|
|
||||||
default-configs/nix.md
|
|
||||||
```
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
# Maximal {#sec-default-maximal}
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ nix run github:notashelf/nvf#maximal -- test.nix
|
|
||||||
```
|
|
||||||
|
|
||||||
It is the same fully configured Neovim as with the [Nix](#sec-default-nix)
|
|
||||||
configuration, but with every supported language enabled.
|
|
||||||
|
|
||||||
::: {.note} Running the maximal config will download _a lot_ of packages as it
|
|
||||||
is downloading language servers, formatters, and more. :::
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
# Nix {#sec-default-nix}
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ nix run github:notashelf/nvf#nix test.nix
|
|
||||||
```
|
|
||||||
|
|
||||||
Enables all the of Neovim plugins, with language support for specifically Nix.
|
|
||||||
This lets you see what a fully configured neovim setup looks like without
|
|
||||||
downloading a whole bunch of language servers and associated tools.
|
|
||||||
|
|
@ -39,7 +39,7 @@ An example flake that exposes your custom Neovim configuration might look like
|
||||||
theme.enable = true;
|
theme.enable = true;
|
||||||
|
|
||||||
# Enable Treesitter
|
# Enable Treesitter
|
||||||
tree-sitter.enable = true;
|
treesitter.enable = true;
|
||||||
|
|
||||||
# Other options will go here. Refer to the config
|
# Other options will go here. Refer to the config
|
||||||
# reference in Appendix B of the nvf manual.
|
# reference in Appendix B of the nvf manual.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ try-it-out.md
|
||||||
```
|
```
|
||||||
|
|
||||||
```{=include=} parts
|
```{=include=} parts
|
||||||
default-configs.md
|
|
||||||
installation.md
|
installation.md
|
||||||
configuring.md
|
configuring.md
|
||||||
tips.md
|
tips.md
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,14 @@
|
||||||
# Helpful Tips {#ch-helpful-tips}
|
# Helpful Tips {#ch-helpful-tips}
|
||||||
|
|
||||||
|
This section provides helpful tips that may be considered "unorthodox" or "too
|
||||||
|
advanced" for some users. We will cover basic debugging steps, offline
|
||||||
|
documentation, configuring **nvf** with pure Lua and using custom plugin sources
|
||||||
|
in **nvf** in this section. For general configuration tips, please see previous
|
||||||
|
chapters.
|
||||||
|
|
||||||
```{=include=} chapters
|
```{=include=} chapters
|
||||||
tips/pure-lua-config.md
|
|
||||||
tips/debugging-nvf.md
|
tips/debugging-nvf.md
|
||||||
tips/offline-docs.md
|
tips/offline-docs.md
|
||||||
|
tips/pure-lua-config.md
|
||||||
|
tips/plugin-sources.md
|
||||||
```
|
```
|
||||||
|
|
|
||||||
131
docs/manual/tips/plugin-sources.md
Normal file
131
docs/manual/tips/plugin-sources.md
Normal file
|
|
@ -0,0 +1,131 @@
|
||||||
|
# Adding Plugins From Different Sources {#sec-plugin-sources}
|
||||||
|
|
||||||
|
**nvf** attempts to avoid depending on Nixpkgs for Neovim plugins. For the most
|
||||||
|
part, this is accomplished by defining each plugin's source and building them
|
||||||
|
from source.
|
||||||
|
|
||||||
|
[npins]: https://github.com/andir/npins
|
||||||
|
|
||||||
|
To define plugin sources, we use [npins] and pin each plugin source using
|
||||||
|
builtin fetchers. You are not bound by this restriction. In your own
|
||||||
|
configuration, any kind of fetcher or plugin source is fine.
|
||||||
|
|
||||||
|
## Nixpkgs & Friends {#ch-plugins-from-nixpkgs}
|
||||||
|
|
||||||
|
`vim.startPlugins` and `vim.optPlugins` options take either a **string**, in
|
||||||
|
which case a plugin from nvf's internal plugins registry will be used, or a
|
||||||
|
**package**. If your plugin does not require any setup, or ordering for it s
|
||||||
|
configuration, then it is possible to add it to `vim.startPlugins` to load it on
|
||||||
|
startup.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{pkgs, ...}: {
|
||||||
|
# Aerial does require some setup. In the case you pass a plugin that *does*
|
||||||
|
# require manual setup, then you must also call the setup function.
|
||||||
|
vim.startPlugins = [pkgs.vimPlugins.aerial-nvim];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
[`vim.extraPlugins`]: https://notashelf.github.io/nvf/options.html#opt-vim.extraPlugins
|
||||||
|
|
||||||
|
This will fetch aerial.nvim from nixpkgs, and add it to Neovim's runtime path to
|
||||||
|
be loaded manually. Although for plugins that require manual setup, you are
|
||||||
|
encouraged to use [`vim.extraPlugins`].
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
vim.extraPlugins = {
|
||||||
|
aerial = {
|
||||||
|
package = pkgs.vimPlugins.aerial-nvim;
|
||||||
|
setup = "require('aerial').setup {}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
[custom plugins section]: https://notashelf.github.io/nvf/index.xhtml#ch-custom-plugins
|
||||||
|
|
||||||
|
More details on the extraPlugins API is documented in the
|
||||||
|
[custom plugins section].
|
||||||
|
|
||||||
|
## Building Your Own Plugins {#ch-plugins-from-source}
|
||||||
|
|
||||||
|
In the case a plugin is not available in Nixpkgs, or the Nixpkgs package is
|
||||||
|
outdated (or, more likely, broken) it is possible to build the plugins from
|
||||||
|
source using a tool, such as [npins]. You may also use your _flake inputs_ as
|
||||||
|
sources.
|
||||||
|
|
||||||
|
Example using plugin inputs:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
# In your flake.nix
|
||||||
|
inputs = {
|
||||||
|
aerial-nvim = {
|
||||||
|
url = "github:stevearc/aerial.nvim"
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Make sure that 'inputs' is properly propagated into Nvf, for example, through
|
||||||
|
# specialArgs.
|
||||||
|
outputs = { ... };
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
In the case, you may use the input directly for the plugin's source attribute in
|
||||||
|
`buildVimPlugin`.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
# Make sure that 'inputs' is properly propagated! It will be missing otherwise
|
||||||
|
# and the resulting errors might be too obscure.
|
||||||
|
{inputs, ...}: let
|
||||||
|
aerial-from-source = pkgs.vimUtils.buildVimPlugin {
|
||||||
|
name = "aerial-nvim";
|
||||||
|
src = inputs.aerial-nvim;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
vim.extraPlugins = {
|
||||||
|
aerial = {
|
||||||
|
package = aerial-from-source;
|
||||||
|
setup = "require('aerial').setup {}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, if you do not want to keep track of the source using flake inputs
|
||||||
|
or npins, you may call `fetchFromGitHub` (or other fetchers) directly. An
|
||||||
|
example would look like this.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
regexplainer = buildVimPlugin {
|
||||||
|
name = "nvim-regexplainer";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "bennypowers";
|
||||||
|
repo = "nvim-regexplainer";
|
||||||
|
rev = "4250c8f3c1307876384e70eeedde5149249e154f";
|
||||||
|
hash = "sha256-15DLbKtOgUPq4DcF71jFYu31faDn52k3P1x47GL3+b0=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# The 'buildVimPlugin' imposes some "require checks" on all plugins build from
|
||||||
|
# source. Failing tests, if they are not relevant, can be disabled using the
|
||||||
|
# 'nvimSkipModule' argument to the 'buildVimPlugin' function.
|
||||||
|
nvimSkipModule = [
|
||||||
|
"regexplainer"
|
||||||
|
"regexplainer.buffers.init"
|
||||||
|
"regexplainer.buffers.popup"
|
||||||
|
"regexplainer.buffers.register"
|
||||||
|
"regexplainer.buffers.shared"
|
||||||
|
"regexplainer.buffers.split"
|
||||||
|
"regexplainer.component.descriptions"
|
||||||
|
"regexplainer.component.init"
|
||||||
|
"regexplainer.renderers.narrative.init"
|
||||||
|
"regexplainer.renderers.narrative.narrative"
|
||||||
|
"regexplainer.renderers.init"
|
||||||
|
"regexplainer.utils.defer"
|
||||||
|
"regexplainer.utils.init"
|
||||||
|
"regexplainer.utils.treesitter"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
@ -26,7 +26,12 @@ $ nix run github:notashelf/nvf#nix
|
||||||
$ nix run github:notashelf/nvf#maximal
|
$ nix run github:notashelf/nvf#maximal
|
||||||
```
|
```
|
||||||
|
|
||||||
### Available Configs {#sec-available-configs}
|
### Available Configurations {#sec-available-configs}
|
||||||
|
|
||||||
|
::: {.info}
|
||||||
|
|
||||||
|
The below configurations are provided for demonstration purposes, and are
|
||||||
|
**not** designed to be installed as is. You may
|
||||||
|
|
||||||
#### Nix {#sec-configs-nix}
|
#### Nix {#sec-configs-nix}
|
||||||
|
|
||||||
|
|
@ -34,15 +39,32 @@ $ nix run github:notashelf/nvf#maximal
|
||||||
a set of visual and functional plugins. By running `nix run .#`, which is the
|
a set of visual and functional plugins. By running `nix run .#`, which is the
|
||||||
default package, you will build Neovim with this config.
|
default package, you will build Neovim with this config.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ nix run github:notashelf/nvf#nix test.nix
|
||||||
|
```
|
||||||
|
|
||||||
|
This command will start Neovim with some opinionated plugin configurations, and
|
||||||
|
is designed specifically for Nix. the `nix` configuration lets you see how a
|
||||||
|
fully configured Neovim setup _might_ look like without downloading too many
|
||||||
|
packages or shell utilities.
|
||||||
|
|
||||||
#### Maximal {#sec-configs-maximal}
|
#### Maximal {#sec-configs-maximal}
|
||||||
|
|
||||||
`Maximal` is the ultimate configuration that will enable support for more
|
`Maximal` is the ultimate configuration that will enable support for more
|
||||||
commonly used language as well as additional complementary plugins. Keep in
|
commonly used language as well as additional complementary plugins. Keep in
|
||||||
mind, however, that this will pull a lot of dependencies.
|
mind, however, that this will pull a lot of dependencies.
|
||||||
|
|
||||||
::: {.tip}
|
```bash
|
||||||
|
$ nix run github:notashelf/nvf#maximal -- test.nix
|
||||||
|
```
|
||||||
|
|
||||||
You are _strongly_ recommended to use the binary cache if you would like to try
|
It uses the same configuration template with the [Nix](#sec-configs-nix)
|
||||||
the Maximal configuration.
|
configuration, but supports many more languages, and enables more utility,
|
||||||
|
companion or fun plugins.
|
||||||
|
|
||||||
|
::: {.warning}
|
||||||
|
|
||||||
|
Running the maximal config will download _a lot_ of packages as it is
|
||||||
|
downloading language servers, formatters, and more.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,8 @@ soon.
|
||||||
|
|
||||||
- A new section has been added for language support: `vim.languages.<language>`.
|
- A new section has been added for language support: `vim.languages.<language>`.
|
||||||
|
|
||||||
- The options [](#opt-vim.languages.enableLSP),
|
- The options `enableLSP` [](#opt-vim.languages.enableTreesitter), etc. will
|
||||||
[](#opt-vim.languages.enableTreesitter), etc. will enable the respective
|
enable the respective section for all languages that have been enabled.
|
||||||
section for all languages that have been enabled.
|
|
||||||
- All LSP languages have been moved here
|
- All LSP languages have been moved here
|
||||||
- `plantuml` and `markdown` have been moved here
|
- `plantuml` and `markdown` have been moved here
|
||||||
- A new section has been added for `html`. The old
|
- A new section has been added for `html`. The old
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ Release notes for release 0.5
|
||||||
- Updated indent-blankine.nvim to v3 - this comes with a few option changes,
|
- Updated indent-blankine.nvim to v3 - this comes with a few option changes,
|
||||||
which will be migrated with `renamedOptionModule`
|
which will be migrated with `renamedOptionModule`
|
||||||
|
|
||||||
[jacekpoz](https://jacekpoz.pl):
|
[poz](https://poz.pet):
|
||||||
|
|
||||||
- Fixed scrollOffset not being used
|
- Fixed scrollOffset not being used
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ vim.api.nvim_set_keymap('n', '<leader>a', ':lua camelToSnake()<CR>', { noremap =
|
||||||
|
|
||||||
- Added rose-pine theme.
|
- Added rose-pine theme.
|
||||||
|
|
||||||
[jacekpoz](https://jacekpoz.pl):
|
[poz](https://poz.pet):
|
||||||
|
|
||||||
- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete
|
- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete
|
||||||
window popup only when manually activated.
|
window popup only when manually activated.
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ The changes are, in no particular order:
|
||||||
- Add [lz.n] support and lazy-load some builtin plugins.
|
- Add [lz.n] support and lazy-load some builtin plugins.
|
||||||
- Add simpler helper functions for making keymaps
|
- Add simpler helper functions for making keymaps
|
||||||
|
|
||||||
[jacekpoz](https://jacekpoz.pl):
|
[poz](https://poz.pet):
|
||||||
|
|
||||||
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
||||||
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
|
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,11 @@
|
||||||
unavailable as they have been refactored out of the main none-ls repository
|
unavailable as they have been refactored out of the main none-ls repository
|
||||||
upstream.
|
upstream.
|
||||||
|
|
||||||
|
- `vim.useSystemClipboard` has been deprecated as a part of removing most
|
||||||
|
top-level convenience options, and should instead be configured in the new
|
||||||
|
module interface. You may set [](#opt-vim.clipboard.registers) appropriately
|
||||||
|
to configure Neovim to use the system clipboard.
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf):
|
[NotAShelf](https://github.com/notashelf):
|
||||||
|
|
||||||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
||||||
|
|
@ -91,6 +96,11 @@
|
||||||
options for `vim.diagnostic.config()` can now be customized through the
|
options for `vim.diagnostic.config()` can now be customized through the
|
||||||
[](#opt-vim.diagnostics.config) in nvf.
|
[](#opt-vim.diagnostics.config) in nvf.
|
||||||
|
|
||||||
|
- Add `vim.clipboard` module for easily managing Neovim clipboard providers and
|
||||||
|
relevant packages in a simple UI.
|
||||||
|
- This deprecates `vim.useSystemClipboard` as well, see breaking changes
|
||||||
|
section above for migration options.
|
||||||
|
|
||||||
[amadaluzia](https://github.com/amadaluzia):
|
[amadaluzia](https://github.com/amadaluzia):
|
||||||
|
|
||||||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
||||||
|
|
@ -109,6 +119,7 @@
|
||||||
- Add tsx support in conform and lint
|
- Add tsx support in conform and lint
|
||||||
- Moved code setting `additionalRuntimePaths` and `enableLuaLoader` out of
|
- Moved code setting `additionalRuntimePaths` and `enableLuaLoader` out of
|
||||||
`luaConfigPre`'s default to prevent being overridden
|
`luaConfigPre`'s default to prevent being overridden
|
||||||
|
- Use conform over custom autocmds for LSP format on save
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
|
|
@ -278,6 +289,7 @@
|
||||||
[BANanaD3V](https://github.com/BANanaD3V):
|
[BANanaD3V](https://github.com/BANanaD3V):
|
||||||
|
|
||||||
- `alpha` is now configured with nix.
|
- `alpha` is now configured with nix.
|
||||||
|
- Add `markview-nvim` markdown renderer.
|
||||||
|
|
||||||
[viicslen](https://github.com/viicslen):
|
[viicslen](https://github.com/viicslen):
|
||||||
|
|
||||||
|
|
@ -296,6 +308,7 @@
|
||||||
`vim.diagnostics.nvim-lint.linters.*.required_files`.
|
`vim.diagnostics.nvim-lint.linters.*.required_files`.
|
||||||
- Add global function `nvf_lint` under
|
- Add global function `nvf_lint` under
|
||||||
`vim.diagnostics.nvim-lint.lint_function`.
|
`vim.diagnostics.nvim-lint.lint_function`.
|
||||||
|
- Deprecate `vim.scrollOffset` in favor of `vim.options.scrolloff`.
|
||||||
|
|
||||||
[Sc3l3t0n](https://github.com/Sc3l3t0n):
|
[Sc3l3t0n](https://github.com/Sc3l3t0n):
|
||||||
|
|
||||||
|
|
@ -312,6 +325,8 @@
|
||||||
- Fix fzf-lua having a hard dependency on fzf.
|
- Fix fzf-lua having a hard dependency on fzf.
|
||||||
- Enable inlay hints support - `config.vim.lsp.inlayHints`.
|
- Enable inlay hints support - `config.vim.lsp.inlayHints`.
|
||||||
- Add `neo-tree`, `snacks.picker` extensions to `lualine`.
|
- Add `neo-tree`, `snacks.picker` extensions to `lualine`.
|
||||||
|
- Add support for `vim.lsp.formatOnSave` and
|
||||||
|
`vim.lsp.mappings.toggleFormatOnSave`
|
||||||
|
|
||||||
[tebuevd](https://github.com/tebuevd):
|
[tebuevd](https://github.com/tebuevd):
|
||||||
|
|
||||||
|
|
@ -325,11 +340,15 @@
|
||||||
|
|
||||||
[flash.nvim]: https://github.com/folke/flash.nvim
|
[flash.nvim]: https://github.com/folke/flash.nvim
|
||||||
[gitlinker.nvim]: https://github.com/linrongbin16/gitlinker.nvim
|
[gitlinker.nvim]: https://github.com/linrongbin16/gitlinker.nvim
|
||||||
|
[nvim-treesitter-textobjects]: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||||
|
|
||||||
- Fix oil config referencing snacks
|
- Fix oil config referencing snacks
|
||||||
- Add [flash.nvim] plugin to `vim.utility.motion.flash-nvim`
|
- Add [flash.nvim] plugin to `vim.utility.motion.flash-nvim`
|
||||||
- Fix default telescope ignore list entry for '.git/' to properly match
|
- Fix default telescope ignore list entry for '.git/' to properly match
|
||||||
- Add [gitlinker.nvim] plugin to `vim.git.gitlinker-nvim`
|
- Add [gitlinker.nvim] plugin to `vim.git.gitlinker-nvim`
|
||||||
|
- Add [nvim-treesitter-textobjects] plugin to `vim.treesitter.textobjects`
|
||||||
|
- Default to disabling Conform for Rust if rust-analyzer is used
|
||||||
|
- To force using Conform, set `languages.rust.format.enable = true`.
|
||||||
|
|
||||||
[rrvsh](https://github.com/rrvsh):
|
[rrvsh](https://github.com/rrvsh):
|
||||||
|
|
||||||
|
|
@ -351,4 +370,60 @@
|
||||||
|
|
||||||
[aionoid](https://github.com/aionoid):
|
[aionoid](https://github.com/aionoid):
|
||||||
|
|
||||||
|
[avante-nvim]: https://github.com/yetone/avante.nvim
|
||||||
|
|
||||||
- Fix [render-markdown.nvim] file_types option type to list, to accept merging.
|
- Fix [render-markdown.nvim] file_types option type to list, to accept merging.
|
||||||
|
- Add [avante.nvim] plugin under `vim.assistant.avante-nvim`.
|
||||||
|
|
||||||
|
[poz](https://poz.pet):
|
||||||
|
|
||||||
|
- Fix gitsigns null-ls issue.
|
||||||
|
|
||||||
|
[Haskex](https://github.com/haskex):
|
||||||
|
|
||||||
|
[Hardtime.nvim]: https://github.com/m4xshen/hardtime.nvim
|
||||||
|
|
||||||
|
- Add Plugin [Hardtime.nvim] under `vim.binds.hardtime-nvim` with `enable` and
|
||||||
|
`setupOpts` options
|
||||||
|
|
||||||
|
[taylrfnt](https://github.com/taylrfnt):
|
||||||
|
|
||||||
|
[nvim-tree](https://github.com/nvim-tree/nvim-tree.lua):
|
||||||
|
|
||||||
|
- Add missing `right_align` option for existing `renderer.icons` options.
|
||||||
|
- Add missing `render.icons` options (`hidden_placement`,
|
||||||
|
`diagnostics_placement`, and `bookmarks_placement`).
|
||||||
|
|
||||||
|
[cramt](https://github.com/cramt):
|
||||||
|
|
||||||
|
- Add `rubylsp` option in `vim.languages.ruby.lsp.server` to use shopify's
|
||||||
|
ruby-lsp language server
|
||||||
|
|
||||||
|
[Haskex](https://github.com/haskex):
|
||||||
|
|
||||||
|
[solarized-osaka.nvim]: https://github.com/craftzdog/solarized-osaka.nvim
|
||||||
|
|
||||||
|
- Add [solarized-osaka.nvim] theme
|
||||||
|
|
||||||
|
[img-clip.nvim]: https://github.com/hakonharnes/img-clip.nvim
|
||||||
|
|
||||||
|
- Add [img-clip.nvim] plugin in `vim.utility.images.img-clip` with `enable` and
|
||||||
|
`setupOpts`
|
||||||
|
- Add `vim.utility.images.img-clip.enable = isMaximal` in configuration.nix
|
||||||
|
|
||||||
|
[anil9](https://github.com/anil9):
|
||||||
|
|
||||||
|
[clojure-lsp]: https://github.com/clojure-lsp/clojure-lsp
|
||||||
|
[conjure]: https://github.com/Olical/conjure
|
||||||
|
|
||||||
|
- Add Clojure support under `vim.languages.clojure` using [clojure-lsp]
|
||||||
|
- Add code evaluation environment [conjure] under `vim.repl.conjure`
|
||||||
|
|
||||||
|
[CallumGilly](https://github.com/CallumGilly):
|
||||||
|
|
||||||
|
- Add missing `transparent` option for existing
|
||||||
|
[onedark.nvim](https://github.com/navarasu/onedark.nvim) theme.
|
||||||
|
|
||||||
|
[theutz](https://github.com/theutz):
|
||||||
|
|
||||||
|
- Added "auto" flavour for catppuccin theme
|
||||||
12
flake.lock
generated
12
flake.lock
generated
|
|
@ -38,11 +38,11 @@
|
||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1745705214,
|
"lastModified": 1748278309,
|
||||||
"narHash": "sha256-XGfaHbFI4vvDuaoVO3IFYZKezXIO8rhUaMCGcjY71Ac=",
|
"narHash": "sha256-JCeiMrUhFku44kfKsgiD9Ibzho4MblBD2WmOQYsQyTY=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "c1f4587db4c53dcefa432c46c7a899a116d8e924",
|
"rev": "486a17ba1279ab2357cae8ff66b309db622f8831",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -77,11 +77,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1745377448,
|
"lastModified": 1748217807,
|
||||||
"narHash": "sha256-jhZDfXVKdD7TSEGgzFJQvEEZ2K65UMiqW5YJ2aIqxMA=",
|
"narHash": "sha256-P3u2PXxMlo49PutQLnk2PhI/imC69hFl1yY4aT5Nax8=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "507b63021ada5fee621b6ca371c4fca9ca46f52c",
|
"rev": "3108eaa516ae22c2360928589731a4f1581526ef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,7 @@
|
||||||
systems = import inputs.systems;
|
systems = import inputs.systems;
|
||||||
imports = [
|
imports = [
|
||||||
./flake/templates
|
./flake/templates
|
||||||
|
|
||||||
./flake/apps.nix
|
./flake/apps.nix
|
||||||
./flake/legacyPackages.nix
|
|
||||||
./flake/overlays.nix
|
|
||||||
./flake/packages.nix
|
./flake/packages.nix
|
||||||
./flake/develop.nix
|
./flake/develop.nix
|
||||||
];
|
];
|
||||||
|
|
|
||||||
80
flake/avante-nvim/default.nix
Normal file
80
flake/avante-nvim/default.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
{
|
||||||
|
nix-update-script,
|
||||||
|
openssl,
|
||||||
|
pkg-config,
|
||||||
|
rustPlatform,
|
||||||
|
stdenv,
|
||||||
|
vimPlugins,
|
||||||
|
vimUtils,
|
||||||
|
makeWrapper,
|
||||||
|
pkgs,
|
||||||
|
version,
|
||||||
|
src,
|
||||||
|
pins,
|
||||||
|
}: let
|
||||||
|
inherit version src;
|
||||||
|
avante-nvim-lib = rustPlatform.buildRustPackage {
|
||||||
|
pname = "avante-nvim-lib";
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
useFetchCargoVendor = true;
|
||||||
|
cargoHash = "sha256-pmnMoNdaIR0i+4kwW3cf01vDQo39QakTCEG9AXA86ck=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkg-config
|
||||||
|
makeWrapper
|
||||||
|
pkgs.perl
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
openssl
|
||||||
|
];
|
||||||
|
|
||||||
|
buildFeatures = ["luajit"];
|
||||||
|
|
||||||
|
checkFlags = [
|
||||||
|
# Disabled because they access the network.
|
||||||
|
"--skip=test_hf"
|
||||||
|
"--skip=test_public_url"
|
||||||
|
"--skip=test_roundtrip"
|
||||||
|
"--skip=test_fetch_md"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
vimUtils.buildVimPlugin {
|
||||||
|
pname = "avante-nvim";
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
dependencies =
|
||||||
|
[vimPlugins.nvim-treesitter]
|
||||||
|
++ (builtins.map (name: let
|
||||||
|
pin = pins.${name};
|
||||||
|
in
|
||||||
|
pkgs.fetchFromGitHub {
|
||||||
|
inherit (pin.repository) owner repo;
|
||||||
|
rev = pin.revision;
|
||||||
|
sha256 = pin.hash;
|
||||||
|
}) [
|
||||||
|
"dressing-nvim"
|
||||||
|
"plenary-nvim"
|
||||||
|
"nui-nvim"
|
||||||
|
]);
|
||||||
|
|
||||||
|
postInstall = let
|
||||||
|
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
|
in ''
|
||||||
|
mkdir -p $out/build
|
||||||
|
ln -s ${avante-nvim-lib}/lib/libavante_repo_map${ext} $out/build/avante_repo_map${ext}
|
||||||
|
ln -s ${avante-nvim-lib}/lib/libavante_templates${ext} $out/build/avante_templates${ext}
|
||||||
|
ln -s ${avante-nvim-lib}/lib/libavante_tokenizers${ext} $out/build/avante_tokenizers${ext}
|
||||||
|
ln -s ${avante-nvim-lib}/lib/libavante_html2md${ext} $out/build/avante_html2md${ext}
|
||||||
|
'';
|
||||||
|
|
||||||
|
nvimSkipModules = [
|
||||||
|
# Requires setup with corresponding provider
|
||||||
|
"avante.providers.azure"
|
||||||
|
"avante.providers.copilot"
|
||||||
|
"avante.providers.vertex_claude"
|
||||||
|
"avante.providers.ollama"
|
||||||
|
];
|
||||||
|
}
|
||||||
38
flake/blink/default.nix
Normal file
38
flake/blink/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
rustPlatform,
|
||||||
|
fetchFromGitHub,
|
||||||
|
writeShellScriptBin,
|
||||||
|
}:
|
||||||
|
rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
|
pname = "blink-cmp";
|
||||||
|
version = "1.2.0";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "Saghen";
|
||||||
|
repo = "blink.cmp";
|
||||||
|
tag = "v${finalAttrs.version}";
|
||||||
|
hash = "sha256-bKe8SSg1HPWE7b4iRQJwiOVCrvvgttuHCOIa4U/38AY=";
|
||||||
|
};
|
||||||
|
|
||||||
|
forceShare = [
|
||||||
|
"man"
|
||||||
|
"info"
|
||||||
|
];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
cp -r {lua,plugin} "$out"
|
||||||
|
mkdir -p "$out/doc"
|
||||||
|
cp 'doc/'*'.txt' "$out/doc/"
|
||||||
|
mkdir -p "$out/target"
|
||||||
|
mv "$out/lib" "$out/target/release"
|
||||||
|
'';
|
||||||
|
|
||||||
|
cargoHash = "sha256-IDoDugtNWQovfSstbVMkKHLBXKa06lxRWmywu4zyS3M=";
|
||||||
|
useFetchCargoVendor = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
(writeShellScriptBin "git" "exit 1")
|
||||||
|
];
|
||||||
|
|
||||||
|
env.RUSTC_BOOTSTRAP = true;
|
||||||
|
})
|
||||||
|
|
@ -3,13 +3,14 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
self',
|
self',
|
||||||
|
inputs',
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
devShells = {
|
devShells = {
|
||||||
default = self'.devShells.lsp;
|
default = self'.devShells.lsp;
|
||||||
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
||||||
lsp = pkgs.mkShellNoCC {
|
lsp = pkgs.mkShellNoCC {
|
||||||
packages = with pkgs; [nil statix deadnix alejandra npins];
|
packages = with pkgs; [inputs'.nil.packages.default statix deadnix alejandra npins];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
perSystem = {
|
|
||||||
system,
|
|
||||||
inputs',
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
legacyPackages = import inputs.nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = [
|
|
||||||
inputs.self.overlays.default
|
|
||||||
|
|
||||||
(final: prev: {
|
|
||||||
# Build nil from source to get most recent
|
|
||||||
# features as they are added.
|
|
||||||
nil = inputs'.nil.packages.default;
|
|
||||||
blink-cmp = let
|
|
||||||
pin = self.pins.blink-cmp;
|
|
||||||
in
|
|
||||||
final.callPackage ./legacyPackages/blink-cmp.nix {
|
|
||||||
inherit (pin) version;
|
|
||||||
src = prev.fetchFromGitHub {
|
|
||||||
inherit (pin.repository) owner repo;
|
|
||||||
rev = pin.revision;
|
|
||||||
sha256 = pin.hash;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
stdenv,
|
|
||||||
rustPlatform,
|
|
||||||
vimUtils,
|
|
||||||
gitMinimal,
|
|
||||||
src,
|
|
||||||
version,
|
|
||||||
}: let
|
|
||||||
blink-fuzzy-lib = rustPlatform.buildRustPackage {
|
|
||||||
pname = "blink-fuzzy-lib";
|
|
||||||
inherit version src;
|
|
||||||
|
|
||||||
# TODO: remove this if plugin stops using nightly rust
|
|
||||||
env.RUSTC_BOOTSTRAP = true;
|
|
||||||
|
|
||||||
useFetchCargoVendor = true;
|
|
||||||
cargoHash = "sha256-MWElqh7ENJ6CbLOnvz0DsP5YYu+e+y12GSUOfW1IKGU=";
|
|
||||||
|
|
||||||
nativeBuildInputs = [gitMinimal];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
vimUtils.buildVimPlugin {
|
|
||||||
pname = "blink-cmp";
|
|
||||||
inherit version src;
|
|
||||||
|
|
||||||
# blink references a repro.lua which is placed outside the lua/ directory
|
|
||||||
doCheck = false;
|
|
||||||
preInstall = let
|
|
||||||
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
|
||||||
in ''
|
|
||||||
mkdir -p target/release
|
|
||||||
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy${ext} target/release/libblink_cmp_fuzzy${ext}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Module for reproducing issues
|
|
||||||
nvimSkipModules = ["repro"];
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
|
||||||
|
|
||||||
buildPkg = pkgs: modules: (neovimConfiguration {inherit pkgs modules;}).neovim;
|
|
||||||
|
|
||||||
nixConfig = import ../configuration.nix false;
|
|
||||||
maximalConfig = import ../configuration.nix true;
|
|
||||||
in {
|
|
||||||
flake.overlays.default = final: _prev: {
|
|
||||||
inherit neovimConfiguration;
|
|
||||||
neovim-nix = buildPkg final [nixConfig];
|
|
||||||
neovim-maximal = buildPkg final [maximalConfig];
|
|
||||||
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{inputs, ...}: {
|
{
|
||||||
|
inputs,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
} @ args: {
|
||||||
perSystem = {
|
perSystem = {
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
|
@ -6,8 +10,27 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
docs = import ../docs {inherit pkgs inputs lib;};
|
docs = import ../docs {inherit pkgs inputs lib;};
|
||||||
|
buildPkg = maximal:
|
||||||
|
(args.config.flake.lib.nvim.neovimConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [(import ../configuration.nix maximal)];
|
||||||
|
}).neovim;
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
|
blink-cmp = pkgs.callPackage ./blink {};
|
||||||
|
avante-nvim = let
|
||||||
|
pin = self.pins.avante-nvim;
|
||||||
|
in
|
||||||
|
pkgs.callPackage ./avante-nvim {
|
||||||
|
version = pin.branch;
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
inherit (pin.repository) owner repo;
|
||||||
|
rev = pin.revision;
|
||||||
|
sha256 = pin.hash;
|
||||||
|
};
|
||||||
|
pins = self.pins;
|
||||||
|
};
|
||||||
|
|
||||||
inherit (docs.manual) htmlOpenTool;
|
inherit (docs.manual) htmlOpenTool;
|
||||||
# Documentation
|
# Documentation
|
||||||
docs = docs.manual.html;
|
docs = docs.manual.html;
|
||||||
|
|
@ -61,9 +84,9 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Exposed neovim configurations
|
# Exposed neovim configurations
|
||||||
nix = config.legacyPackages.neovim-nix;
|
nix = buildPkg false;
|
||||||
maximal = config.legacyPackages.neovim-maximal;
|
maximal = buildPkg true;
|
||||||
default = config.legacyPackages.neovim-nix;
|
default = config.packages.nix;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,22 @@
|
||||||
config.vim = {
|
config.vim = {
|
||||||
theme.enable = true;
|
theme.enable = true;
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
# Enable LSP functionality globally. This is required for modules found
|
||||||
|
# in `vim.languages` to enable relevant LSPs.
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# You may define your own LSP configurations using `vim.lsp.servers` in
|
||||||
|
# nvf without ever needing lspconfig to do it. This will use the native
|
||||||
|
# API provided by Neovim > 0.11
|
||||||
|
servers = {};
|
||||||
|
};
|
||||||
|
|
||||||
# Language support and automatic configuration of companion plugins.
|
# Language support and automatic configuration of companion plugins.
|
||||||
# Note that enabling, e.g., languages.<lang>.diagnostics will automatically
|
# Note that enabling, e.g., languages.<lang>.diagnostics will automatically
|
||||||
# enable top-level options such as enableLSP or enableExtraDiagnostics as
|
# enable top-level options such as enableLSP or enableExtraDiagnostics as
|
||||||
# they are needed.
|
# they are needed.
|
||||||
languages = {
|
languages = {
|
||||||
enableLSP = true;
|
|
||||||
enableFormat = true;
|
enableFormat = true;
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
enableExtraDiagnostics = true;
|
enableExtraDiagnostics = true;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
types = import ./types {inherit lib;};
|
types = import ./types {inherit lib self;};
|
||||||
config = import ./config.nix {inherit lib;};
|
config = import ./config.nix {inherit lib;};
|
||||||
binds = import ./binds.nix {inherit lib;};
|
binds = import ./binds.nix {inherit lib;};
|
||||||
dag = import ./dag.nix {inherit lib;};
|
dag = import ./dag.nix {inherit lib;};
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/booleans.nix
|
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (builtins) isString getAttr;
|
inherit (builtins) isString getAttr;
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.types) bool;
|
inherit (lib.types) listOf bool str submodule attrsOf anything either nullOr;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
inherit (lib.nvim.types) luaInline;
|
||||||
in {
|
in {
|
||||||
|
# TODO: remove
|
||||||
diagnosticsToLua = {
|
diagnosticsToLua = {
|
||||||
lang,
|
lang,
|
||||||
config,
|
config,
|
||||||
|
|
@ -32,4 +33,48 @@ in {
|
||||||
type = bool;
|
type = bool;
|
||||||
description = "Turn on ${desc} for enabled languages by default";
|
description = "Turn on ${desc} for enabled languages by default";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lspOptions = submodule {
|
||||||
|
freeformType = attrsOf anything;
|
||||||
|
options = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to enable this LSP server.";
|
||||||
|
};
|
||||||
|
|
||||||
|
capabilities = mkOption {
|
||||||
|
type = nullOr (either luaInline (attrsOf anything));
|
||||||
|
default = null;
|
||||||
|
description = "LSP capabilitiess to pass to lspconfig";
|
||||||
|
};
|
||||||
|
|
||||||
|
on_attach = mkOption {
|
||||||
|
type = nullOr luaInline;
|
||||||
|
default = null;
|
||||||
|
description = "Function to execute when an LSP server attaches to a buffer";
|
||||||
|
};
|
||||||
|
|
||||||
|
filetypes = mkOption {
|
||||||
|
type = nullOr (listOf str);
|
||||||
|
default = null;
|
||||||
|
description = "Filetypes to auto-attach LSP in";
|
||||||
|
};
|
||||||
|
|
||||||
|
cmd = mkOption {
|
||||||
|
type = nullOr (listOf str);
|
||||||
|
default = null;
|
||||||
|
description = "Command used to start the LSP server";
|
||||||
|
};
|
||||||
|
|
||||||
|
root_markers = mkOption {
|
||||||
|
type = nullOr (listOf str);
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
"root markers" used to determine the root directory of the workspace, and
|
||||||
|
the filetypes associated with this LSP server.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
{lib}: let
|
{
|
||||||
|
lib,
|
||||||
|
self,
|
||||||
|
}: let
|
||||||
typesDag = import ./dag.nix {inherit lib;};
|
typesDag = import ./dag.nix {inherit lib;};
|
||||||
typesPlugin = import ./plugins.nix {inherit lib;};
|
typesPlugin = import ./plugins.nix {inherit lib self;};
|
||||||
typesLanguage = import ./languages.nix {inherit lib;};
|
typesLanguage = import ./languages.nix {inherit lib;};
|
||||||
customTypes = import ./custom.nix {inherit lib;};
|
customTypes = import ./custom.nix {inherit lib;};
|
||||||
in {
|
in {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
{lib}: let
|
{
|
||||||
|
lib,
|
||||||
|
self,
|
||||||
|
}: let
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
||||||
inherit (lib.strings) hasPrefix removePrefix;
|
inherit (lib.strings) hasPrefix removePrefix;
|
||||||
|
|
@ -12,7 +15,7 @@
|
||||||
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
||||||
|
|
||||||
# Get the names of all npins
|
# Get the names of all npins
|
||||||
pluginInputNames = attrNames (lib.importJSON ../../npins/sources.json).pins;
|
pluginInputNames = ["blink-cmp"] ++ attrNames self.pins;
|
||||||
|
|
||||||
# You can either use the name of the plugin or a package.
|
# You can either use the name of the plugin or a package.
|
||||||
pluginType = nullOr (
|
pluginType = nullOr (
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
showSignColumn = "signcolumn";
|
showSignColumn = "signcolumn";
|
||||||
|
|
||||||
# 2025-02-07
|
# 2025-02-07
|
||||||
scrollOff = "scrolloff";
|
scrollOffset = "scrolloff";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = concatLists [
|
imports = concatLists [
|
||||||
|
|
@ -111,6 +111,15 @@ in {
|
||||||
under the diagnostics module. Please consider using one of 'vim.diagnostics.config' or
|
under the diagnostics module. Please consider using one of 'vim.diagnostics.config' or
|
||||||
'vim.luaConfigRC' to configure LSP lines for Neovim through its own diagnostics API.
|
'vim.luaConfigRC' to configure LSP lines for Neovim through its own diagnostics API.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
|
# 2025-05-04
|
||||||
|
(mkRemovedOptionModule ["vim" "useSystemClipboard"] ''
|
||||||
|
Clipboard behaviour should now be controlled through the new, more fine-grained module
|
||||||
|
interface found in 'vim.clipboard'. To replicate previous behaviour, you may either
|
||||||
|
add 'vim.opt.clipboard:append("unnamedplus")' in luaConfigRC, or preferably set it
|
||||||
|
in 'vim.clipboard.registers'. Please see the documentation for the new module for more
|
||||||
|
details, or open an issue if you are confused.
|
||||||
|
'')
|
||||||
]
|
]
|
||||||
|
|
||||||
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
"minimap"
|
"minimap"
|
||||||
"notes"
|
"notes"
|
||||||
"projects"
|
"projects"
|
||||||
|
"repl"
|
||||||
"rich-presence"
|
"rich-presence"
|
||||||
"runner"
|
"runner"
|
||||||
"session"
|
"session"
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,10 @@
|
||||||
inherit (lib.options) mkOption mkEnableOption literalMD;
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.attrsets) optionalAttrs;
|
inherit (lib.attrsets) optionalAttrs;
|
||||||
inherit (lib.types) enum bool str int either;
|
inherit (lib.types) enum bool str either;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
inherit (lib.nvim.binds) pushDownDefault;
|
inherit (lib.nvim.binds) pushDownDefault;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
inherit (lib.nvim.types) luaInline;
|
inherit (lib.nvim.types) luaInline;
|
||||||
|
|
||||||
cfg = config.vim;
|
cfg = config.vim;
|
||||||
|
|
@ -22,24 +21,12 @@ in {
|
||||||
description = "Hide search highlight so it doesn't stay highlighted";
|
description = "Hide search highlight so it doesn't stay highlighted";
|
||||||
};
|
};
|
||||||
|
|
||||||
scrollOffset = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 8;
|
|
||||||
description = "Start scrolling this number of lines from the top or bottom of the page.";
|
|
||||||
};
|
|
||||||
|
|
||||||
syntaxHighlighting = mkOption {
|
syntaxHighlighting = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = !config.vim.treesitter.highlight.enable;
|
default = !config.vim.treesitter.highlight.enable;
|
||||||
description = "Enable syntax highlighting";
|
description = "Enable syntax highlighting";
|
||||||
};
|
};
|
||||||
|
|
||||||
useSystemClipboard = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = "Make use of the clipboard for default yank and paste operations. Don't use * and +";
|
|
||||||
};
|
|
||||||
|
|
||||||
lineNumberMode = mkOption {
|
lineNumberMode = mkOption {
|
||||||
type = enum ["relative" "number" "relNumber" "none"];
|
type = enum ["relative" "number" "relNumber" "none"];
|
||||||
default = "relNumber";
|
default = "relNumber";
|
||||||
|
|
@ -144,10 +131,6 @@ in {
|
||||||
# to pre-set Neovim options. Fear not, though as the Lua DAG is still as powerful as it
|
# to pre-set Neovim options. Fear not, though as the Lua DAG is still as powerful as it
|
||||||
# could be.
|
# could be.
|
||||||
luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
||||||
${optionalString cfg.useSystemClipboard ''
|
|
||||||
vim.opt.clipboard:append("unnamedplus")
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString cfg.syntaxHighlighting ''
|
${optionalString cfg.syntaxHighlighting ''
|
||||||
vim.cmd("syntax on")
|
vim.cmd("syntax on")
|
||||||
''}
|
''}
|
||||||
|
|
|
||||||
80
modules/neovim/init/clipboard.nix
Normal file
80
modules/neovim/init/clipboard.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption mkPackageOption;
|
||||||
|
inherit (lib.types) nullOr either str listOf submodule;
|
||||||
|
inherit (lib.attrsets) mapAttrs mapAttrsToList filterAttrs;
|
||||||
|
cfg = config.vim.clipboard;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
vim = {
|
||||||
|
clipboard = {
|
||||||
|
enable = mkEnableOption ''
|
||||||
|
clipboard management for Neovim. Users may still choose to manage their
|
||||||
|
clipboard through [](#opt-vim.options) should they wish to avoid using
|
||||||
|
this module.
|
||||||
|
'';
|
||||||
|
|
||||||
|
registers = mkOption {
|
||||||
|
type = either str (listOf str);
|
||||||
|
default = "";
|
||||||
|
example = "unnamedplus";
|
||||||
|
description = ''
|
||||||
|
The register to be used by the Neovim clipboard. Recognized types are:
|
||||||
|
|
||||||
|
* unnamed: Vim will use the clipboard register `"*"` for all yank, delete,
|
||||||
|
change and put operations which would normally go to the unnamed register.
|
||||||
|
|
||||||
|
* unnamedplus: A variant of the "unnamed" flag which uses the clipboard register
|
||||||
|
`"+"` ({command}`:h quoteplus`) instead of register `"*"` for all yank, delete,
|
||||||
|
change and put operations which would normally go to the unnamed register.
|
||||||
|
|
||||||
|
When `unnamed` and `unnamedplus` is included simultaneously yank and delete
|
||||||
|
operations (but not put) will additionally copy the text into register `"*"`.
|
||||||
|
|
||||||
|
Please see {command}`:h clipboard` for more details.
|
||||||
|
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
providers = mkOption {
|
||||||
|
type = submodule {
|
||||||
|
options = let
|
||||||
|
clipboards = {
|
||||||
|
# name = "package name";
|
||||||
|
wl-copy = "wl-clipboard";
|
||||||
|
xclip = "xclip";
|
||||||
|
xsel = "xsel";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mapAttrs (name: pname: {
|
||||||
|
enable = mkEnableOption name;
|
||||||
|
package = mkPackageOption pkgs pname {nullable = true;};
|
||||||
|
})
|
||||||
|
clipboards;
|
||||||
|
};
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Clipboard providers for which packages will be added to nvf's
|
||||||
|
{option}`extraPackages`. The `package` field may be set to `null`
|
||||||
|
if related packages are already found in system packages to
|
||||||
|
potentially reduce closure sizes.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
options.clipboard = cfg.registers;
|
||||||
|
extraPackages = mapAttrsToList (_: v: v.package) (
|
||||||
|
filterAttrs (_: v: v.enable && v.package != null) cfg.providers
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2,9 +2,11 @@
|
||||||
imports = [
|
imports = [
|
||||||
./autocmds.nix
|
./autocmds.nix
|
||||||
./basic.nix
|
./basic.nix
|
||||||
|
./clipboard.nix
|
||||||
./debug.nix
|
./debug.nix
|
||||||
./diagnostics.nix
|
./diagnostics.nix
|
||||||
./highlight.nix
|
./highlight.nix
|
||||||
|
./lsp.nix
|
||||||
./spellcheck.nix
|
./spellcheck.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
93
modules/neovim/init/lsp.nix
Normal file
93
modules/neovim/init/lsp.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) filter;
|
||||||
|
inherit (lib.modules) mkIf mkMerge mkDefault;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) attrsOf;
|
||||||
|
inherit (lib.strings) concatLines;
|
||||||
|
inherit (lib.attrsets) mapAttrsToList attrNames filterAttrs;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
inherit (lib.nvim.languages) lspOptions;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
cfg = config.vim.lsp;
|
||||||
|
|
||||||
|
lspConfigurations =
|
||||||
|
mapAttrsToList (
|
||||||
|
name: value: ''
|
||||||
|
vim.lsp.config["${name}"] = ${toLuaObject value}
|
||||||
|
''
|
||||||
|
)
|
||||||
|
cfg.servers;
|
||||||
|
|
||||||
|
enabledServers = filterAttrs (_: u: u.enable) cfg.servers;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
vim.lsp = {
|
||||||
|
enable = mkEnableOption ''
|
||||||
|
global LSP functionality for Neovim.
|
||||||
|
|
||||||
|
This option controls whether to enable LSP functionality within modules under
|
||||||
|
{option}`vim.languages`. You do not need to set this to `true` for language
|
||||||
|
servers defined in {option}`vim.lsp.servers` to take effect, since they are
|
||||||
|
enabled automatically.
|
||||||
|
'';
|
||||||
|
|
||||||
|
servers = mkOption {
|
||||||
|
type = attrsOf lspOptions;
|
||||||
|
default = {};
|
||||||
|
example = ''
|
||||||
|
{
|
||||||
|
"*" = {
|
||||||
|
root_markers = [".git"];
|
||||||
|
capabilities = {
|
||||||
|
textDocument = {
|
||||||
|
semanticTokens = {
|
||||||
|
multilineTokenSupport = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
"clangd" = {
|
||||||
|
filetypes = ["c"];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
LSP configurations that will be managed using `vim.lsp.config()` and related
|
||||||
|
utilities added in Neovim 0.11. LSPs defined here will be added to the
|
||||||
|
resulting {file}`init.lua` using `vim.lsp.config` and enabled through
|
||||||
|
`vim.lsp.enable()` API from Neovim below the configuration table.
|
||||||
|
|
||||||
|
You may review the generated configuration by running {command}`nvf-print-config`
|
||||||
|
in a shell. Please see {command}`:help lsp-config` for more details
|
||||||
|
on the underlying API.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
{
|
||||||
|
vim.lsp.servers."*" = {
|
||||||
|
capabilities = mkDefault (mkLuaInline "capabilities");
|
||||||
|
on_attach = mkDefault (mkLuaInline "default_on_attach");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf (cfg.servers != {}) {
|
||||||
|
vim.luaConfigRC.lsp-servers = entryAnywhere ''
|
||||||
|
-- Individual LSP configurations managed by nvf.
|
||||||
|
${concatLines lspConfigurations}
|
||||||
|
|
||||||
|
-- Enable configured LSPs explicitly
|
||||||
|
vim.lsp.enable(${toLuaObject (filter (name: name != "*") (attrNames enabledServers))})
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
325
modules/plugins/assistant/avante/avante-nvim.nix
Normal file
325
modules/plugins/assistant/avante/avante-nvim.nix
Normal file
|
|
@ -0,0 +1,325 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
|
inherit (lib.types) int str enum nullOr attrs bool;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
options.vim.assistant = {
|
||||||
|
avante-nvim = {
|
||||||
|
enable = mkEnableOption "complementary Neovim plugin for avante.nvim";
|
||||||
|
setupOpts = mkPluginSetupOption "avante-nvim" {
|
||||||
|
provider = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "The provider used in Aider mode or in the planning phase of Cursor Planning Mode.";
|
||||||
|
};
|
||||||
|
|
||||||
|
vendors = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define Your Custom providers.";
|
||||||
|
example = literalMD ''
|
||||||
|
```nix
|
||||||
|
ollama = {
|
||||||
|
__inherited_from = "openai";
|
||||||
|
api_key_name = "";
|
||||||
|
endpoint = "http://127.0.0.1:11434/v1";
|
||||||
|
model = "qwen2.5u-coder:7b";
|
||||||
|
max_tokens = 4096;
|
||||||
|
disable_tools = true;
|
||||||
|
};
|
||||||
|
ollama_ds = {
|
||||||
|
__inherited_from = "openai";
|
||||||
|
api_key_name = "";
|
||||||
|
endpoint = "http://127.0.0.1:11434/v1";
|
||||||
|
model = "deepseek-r1u:7b";
|
||||||
|
max_tokens = 4096;
|
||||||
|
disable_tools = true;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
auto_suggestions_provider = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "claude";
|
||||||
|
description = ''
|
||||||
|
Since auto-suggestions are a high-frequency operation and therefore expensive,
|
||||||
|
currently designating it as `copilot` provider is dangerous because:
|
||||||
|
https://github.com/yetone/avante.nvim/issues/1048
|
||||||
|
Of course, you can reduce the request frequency by increasing `suggestion.debounce`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
cursor_applying_provider = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
The provider used in the applying phase of Cursor Planning Mode, defaults to `nil`,
|
||||||
|
Config.provider will be used as the provider for the applying phase when `nil`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
dual_boost = {
|
||||||
|
enabled = mkEnableOption "dual_boost mode.";
|
||||||
|
|
||||||
|
first_provider = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "openai";
|
||||||
|
description = "The first provider to generate response.";
|
||||||
|
};
|
||||||
|
|
||||||
|
second_provider = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "claude";
|
||||||
|
description = "The second provider to generate response.";
|
||||||
|
};
|
||||||
|
|
||||||
|
prompt = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = ''
|
||||||
|
Based on the two reference outputs below, generate a response that incorporates
|
||||||
|
elements from both but reflects your own judgment and unique perspective.
|
||||||
|
Do not provide any explanation, just give the response directly. Reference Output 1:
|
||||||
|
[{{provider1_output}}], Reference Output 2: [{{provider2_output}}'';
|
||||||
|
description = "The prompt to generate response based on the two reference outputs.";
|
||||||
|
};
|
||||||
|
|
||||||
|
timeout = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 60000;
|
||||||
|
description = "Timeout in milliseconds.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
behaviour = {
|
||||||
|
auto_suggestions =
|
||||||
|
mkEnableOption "auto suggestions.";
|
||||||
|
|
||||||
|
auto_set_highlight_group =
|
||||||
|
mkEnableOption "automatically set the highlight group for the current line."
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
auto_set_keymaps =
|
||||||
|
mkEnableOption "automatically set the keymap for the current line."
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
auto_apply_diff_after_generation =
|
||||||
|
mkEnableOption "automatically apply diff after LLM response.";
|
||||||
|
|
||||||
|
support_paste_from_clipboard = mkEnableOption ''
|
||||||
|
pasting image from clipboard.
|
||||||
|
This will be determined automatically based whether img-clip is available or not.
|
||||||
|
'';
|
||||||
|
|
||||||
|
minimize_diff =
|
||||||
|
mkEnableOption "remove unchanged lines when applying a code block."
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
enable_token_counting =
|
||||||
|
mkEnableOption "token counting."
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
enable_cursor_planning_mode =
|
||||||
|
mkEnableOption "Cursor Planning Mode.";
|
||||||
|
|
||||||
|
enable_claude_text_editor_tool_mode =
|
||||||
|
mkEnableOption "Claude Text Editor Tool Mode.";
|
||||||
|
};
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
diff = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for diff.";
|
||||||
|
};
|
||||||
|
|
||||||
|
suggestion = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for suggestion actions.";
|
||||||
|
};
|
||||||
|
|
||||||
|
jump = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for jump actions.";
|
||||||
|
};
|
||||||
|
|
||||||
|
submit = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for submit actions.";
|
||||||
|
};
|
||||||
|
|
||||||
|
cancel = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for cancel actions.";
|
||||||
|
};
|
||||||
|
|
||||||
|
sidebar = mkOption {
|
||||||
|
type = nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
description = "Define or override the default keymaps for sidebar actions.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
hints.enabled =
|
||||||
|
mkEnableOption ""
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to enable hints.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
windows = {
|
||||||
|
position = mkOption {
|
||||||
|
type = enum ["right" "left" "top" "bottom"];
|
||||||
|
default = "right";
|
||||||
|
description = "The position of the sidebar.";
|
||||||
|
};
|
||||||
|
|
||||||
|
wrap =
|
||||||
|
mkEnableOption ""
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
similar to vim.o.wrap.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
width = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 30;
|
||||||
|
description = "Default % based on available width.";
|
||||||
|
};
|
||||||
|
|
||||||
|
sidebar_header = {
|
||||||
|
enabled = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "enable/disable the header.";
|
||||||
|
};
|
||||||
|
|
||||||
|
align = mkOption {
|
||||||
|
type = enum ["right" "center" "left"];
|
||||||
|
default = "center";
|
||||||
|
description = "Position of the title.";
|
||||||
|
};
|
||||||
|
|
||||||
|
rounded = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable rounded sidebar header";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
input = {
|
||||||
|
prefix = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "> ";
|
||||||
|
description = "The prefix used on the user input.";
|
||||||
|
};
|
||||||
|
|
||||||
|
height = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 8;
|
||||||
|
description = ''
|
||||||
|
Height of the input window in vertical layout.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
edit = {
|
||||||
|
border = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "rounded";
|
||||||
|
description = "The border type on the edit window.";
|
||||||
|
};
|
||||||
|
|
||||||
|
start_insert = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Start insert mode when opening the edit window.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
ask = {
|
||||||
|
floating = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Open the 'AvanteAsk' prompt in a floating window.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
start_insert = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Start insert mode when opening the ask window.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
border = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "rounded";
|
||||||
|
description = "The border type on the ask window.";
|
||||||
|
};
|
||||||
|
|
||||||
|
focus_on_apply = mkOption {
|
||||||
|
type = enum ["ours" "theirs"];
|
||||||
|
default = "ours";
|
||||||
|
description = "Which diff to focus after applying.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
diff = {
|
||||||
|
autojump =
|
||||||
|
mkEnableOption ""
|
||||||
|
// {
|
||||||
|
default = true;
|
||||||
|
description = "Automatically jumps to the next change.";
|
||||||
|
};
|
||||||
|
|
||||||
|
override_timeoutlen = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 500;
|
||||||
|
example = -1;
|
||||||
|
description = ''
|
||||||
|
Override the 'timeoutlen' setting while hovering over a diff (see {command}`:help timeoutlen`).
|
||||||
|
Helps to avoid entering operator-pending mode with diff mappings starting with `c`.
|
||||||
|
Disable by setting to -1.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
suggestion = {
|
||||||
|
debounce = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 600;
|
||||||
|
description = "Suggestion debounce in milliseconds.";
|
||||||
|
};
|
||||||
|
|
||||||
|
throttle = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 600;
|
||||||
|
description = "Suggestion throttle in milliseconds.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
41
modules/plugins/assistant/avante/config.nix
Normal file
41
modules/plugins/assistant/avante/config.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.lists) optionals;
|
||||||
|
|
||||||
|
cfg = config.vim.assistant.avante-nvim;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins =
|
||||||
|
[
|
||||||
|
"nvim-treesitter"
|
||||||
|
"plenary-nvim"
|
||||||
|
"dressing-nvim"
|
||||||
|
"nui-nvim"
|
||||||
|
]
|
||||||
|
++ (optionals config.vim.mini.pick.enable ["mini-pick"])
|
||||||
|
++ (optionals config.vim.telescope.enable ["telescope"])
|
||||||
|
++ (optionals config.vim.autocomplete.nvim-cmp.enable ["nvim-cmp"])
|
||||||
|
++ (optionals config.vim.fzf-lua.enable ["fzf-lua"])
|
||||||
|
++ (optionals config.vim.visuals.nvim-web-devicons.enable ["nvim-web-devicons"])
|
||||||
|
++ (optionals config.vim.utility.images.img-clip.enable ["img-clip"]);
|
||||||
|
|
||||||
|
lazy.plugins = {
|
||||||
|
avante-nvim = {
|
||||||
|
package = "avante-nvim";
|
||||||
|
setupModule = "avante";
|
||||||
|
inherit (cfg) setupOpts;
|
||||||
|
event = ["DeferredUIEnter"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
treesitter.enable = true;
|
||||||
|
|
||||||
|
languages.markdown.extensions.render-markdown-nvim.setupOpts.file_types = lib.mkAfter ["Avante"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/assistant/avante/default.nix
Normal file
6
modules/plugins/assistant/avante/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./avante-nvim.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -21,7 +21,17 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
treesitter.enable = true;
|
treesitter = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Codecompanion depends on the YAML grammar being added. Below is
|
||||||
|
# an easy way of adding an user-configurable grammar package exposed
|
||||||
|
# by the YAML language module *without* enabling the whole YAML language
|
||||||
|
# module. The package is defined even when the module is disabled.
|
||||||
|
grammars = [
|
||||||
|
config.vim.languages.yaml.treesitter.package
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
autocomplete.nvim-cmp = {
|
autocomplete.nvim-cmp = {
|
||||||
sources = {codecompanion-nvim = "[codecompanion]";};
|
sources = {codecompanion-nvim = "[codecompanion]";};
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,6 @@
|
||||||
./chatgpt
|
./chatgpt
|
||||||
./copilot
|
./copilot
|
||||||
./codecompanion
|
./codecompanion
|
||||||
|
./avante
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
freeformType = attrsOf (listOf (either str luaInline));
|
freeformType = attrsOf (listOf (either str luaInline));
|
||||||
options = {
|
options = {
|
||||||
preset = mkOption {
|
preset = mkOption {
|
||||||
type = enum ["default" "none" "super-tab" "enter"];
|
type = enum ["default" "none" "super-tab" "enter" "cmdline"];
|
||||||
default = "none";
|
default = "none";
|
||||||
description = "keymap presets";
|
description = "keymap presets";
|
||||||
};
|
};
|
||||||
|
|
@ -48,7 +48,7 @@ in {
|
||||||
cmdline = {
|
cmdline = {
|
||||||
sources = mkOption {
|
sources = mkOption {
|
||||||
type = nullOr (listOf str);
|
type = nullOr (listOf str);
|
||||||
default = [];
|
default = null;
|
||||||
description = "List of sources to enable for cmdline. Null means use default source list.";
|
description = "List of sources to enable for cmdline. Null means use default source list.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,21 @@ in {
|
||||||
"fallback"
|
"fallback"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# cmdline is not enabled by default, we're just providing keymaps in
|
||||||
|
# case the user enables them
|
||||||
|
cmdline.keymap = {
|
||||||
|
${mappings.complete} = ["show" "fallback"];
|
||||||
|
${mappings.close} = ["hide" "fallback"];
|
||||||
|
${mappings.scrollDocsUp} = ["scroll_documentation_up" "fallback"];
|
||||||
|
${mappings.scrollDocsDown} = ["scroll_documentation_down" "fallback"];
|
||||||
|
# NOTE: mappings.confirm is skipped because our default, <CR> would
|
||||||
|
# lead to accidental triggers of blink.accept instead of executing
|
||||||
|
# the cmd
|
||||||
|
|
||||||
|
${mappings.next} = ["select_next" "show" "fallback"];
|
||||||
|
${mappings.previous} = ["select_prev" "fallback"];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -683,15 +683,48 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
git_placement = mkOption {
|
git_placement = mkOption {
|
||||||
type = enum ["before" "after" "signcolumn"];
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
description = "Place where the git icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled.";
|
|
||||||
default = "before";
|
default = "before";
|
||||||
|
description = ''
|
||||||
|
Place where the git icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
modified_placement = mkOption {
|
modified_placement = mkOption {
|
||||||
type = enum ["before" "after" "signcolumn"];
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
description = "Place where the modified icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled.";
|
|
||||||
default = "after";
|
default = "after";
|
||||||
|
description = ''
|
||||||
|
Place where the modified icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
hidden_placement = mkOption {
|
||||||
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
|
default = "after";
|
||||||
|
description = ''
|
||||||
|
Place where the hidden icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
diagnostics_placement = mkOption {
|
||||||
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
|
default = "after";
|
||||||
|
description = ''
|
||||||
|
Place where the diagnostics icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
bookmarks_placement = mkOption {
|
||||||
|
type = enum ["before" "after" "signcolumn" "right_align"];
|
||||||
|
default = "after";
|
||||||
|
description = ''
|
||||||
|
Place where the bookmark icons will be rendered.
|
||||||
|
`signcolumn` requires `view.signcolumn` to be enabled.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
padding = mkOption {
|
padding = mkOption {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,9 @@
|
||||||
{
|
{lib, ...}: let
|
||||||
pkgs,
|
inherit (lib.generators) mkLuaInline;
|
||||||
lib,
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
...
|
inherit (lib.types) attrs either nullOr;
|
||||||
}: let
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.nvim.types) luaInline mkPluginSetupOption;
|
||||||
inherit (lib.types) attrs enum nullOr;
|
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
|
||||||
inherit (lib.nvim.lua) mkLuaInline;
|
|
||||||
in {
|
in {
|
||||||
options.vim.formatter.conform-nvim = {
|
options.vim.formatter.conform-nvim = {
|
||||||
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
||||||
|
|
@ -31,26 +28,46 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
format_on_save = mkOption {
|
format_on_save = mkOption {
|
||||||
type = nullOr attrs;
|
type = nullOr (either attrs luaInline);
|
||||||
default = {
|
default = mkLuaInline ''
|
||||||
lsp_format = "fallback";
|
function()
|
||||||
timeout_ms = 500;
|
if not vim.g.formatsave or vim.b.disableFormatSave then
|
||||||
};
|
return
|
||||||
|
else
|
||||||
|
return {lsp_format = "fallback", timeout_ms = 500}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
defaultText = literalMD ''
|
||||||
|
enabled by default, and respects {option}`vim.lsp.formatOnSave` and
|
||||||
|
{option}`vim.lsp.mappings.toggleFormatSave`
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Table that will be passed to `conform.format()`. If this
|
Attribute set or Lua function that will be passed to
|
||||||
is set, Conform will run the formatter on save.
|
`conform.format()`. If this is set, Conform will run the formatter
|
||||||
|
on save.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
format_after_save = mkOption {
|
format_after_save = let
|
||||||
type = nullOr attrs;
|
defaultFormatAfterSaveOpts = {lsp_format = "fallback";};
|
||||||
default = {lsp_format = "fallback";};
|
in
|
||||||
description = ''
|
mkOption {
|
||||||
Table that will be passed to `conform.format()`. If this
|
type = nullOr (either attrs luaInline);
|
||||||
is set, Conform will run the formatter asynchronously after
|
default = mkLuaInline ''
|
||||||
save.
|
function()
|
||||||
'';
|
if not vim.g.formatsave or vim.b.disableFormatSave then
|
||||||
};
|
return
|
||||||
|
else
|
||||||
|
return ${toLuaObject defaultFormatAfterSaveOpts}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Table or function(luainline) that will be passed to `conform.format()`. If this
|
||||||
|
is set, Conform will run the formatter asynchronously after save.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,11 @@ in {
|
||||||
(mkIf cfg.codeActions.enable {
|
(mkIf cfg.codeActions.enable {
|
||||||
vim.lsp.null-ls = {
|
vim.lsp.null-ls = {
|
||||||
enable = true;
|
enable = true;
|
||||||
setupOpts.sources.gitsigns-ca = mkLuaInline ''
|
setupOpts.sources = [
|
||||||
require("null-ls").builtins.code_actions.gitsigns
|
(mkLuaInline ''
|
||||||
'';
|
require("null-ls").builtins.code_actions.gitsigns
|
||||||
|
'')
|
||||||
|
];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Astro LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Astro LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Enable Bash LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Enable Bash LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Bash LSP server to use";
|
description = "Bash LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "clang LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "clang LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "The clang LSP server to use";
|
description = "The clang LSP server to use";
|
||||||
|
|
|
||||||
56
modules/plugins/languages/clojure.nix
Normal file
56
modules/plugins/languages/clojure.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
inherit (lib.types) either listOf package str;
|
||||||
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.clojure;
|
||||||
|
in {
|
||||||
|
options.vim.languages.clojure = {
|
||||||
|
enable = mkEnableOption "Clojure language support";
|
||||||
|
|
||||||
|
treesitter = {
|
||||||
|
enable = mkEnableOption "Clojure treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
|
package = mkGrammarOption pkgs "clojure";
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
enable = mkEnableOption "Clojure LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
package = mkOption {
|
||||||
|
type = either package (listOf str);
|
||||||
|
default = pkgs.clojure-lsp;
|
||||||
|
description = "Clojure LSP";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
vim.lsp.lspconfig.sources.clojure-lsp = ''
|
||||||
|
lspconfig.clojure_lsp.setup {
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${getExe cfg.lsp.package}"}''
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
@ -91,7 +91,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "C# LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "C# LSP support" // {default = config.vim.lsp.enable;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "C# LSP server to use";
|
description = "C# LSP server to use";
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "CSS LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "CSS LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "CSS LSP server to use";
|
description = "CSS LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "CUE LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "CUE LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ in {
|
||||||
flutter-tools = {
|
flutter-tools = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.languages.enableLSP;
|
default = config.vim.lsp.enable;
|
||||||
description = "Enable flutter-tools for flutter support";
|
description = "Enable flutter-tools for flutter support";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -143,8 +143,6 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf ftcfg.enable {
|
(mkIf ftcfg.enable {
|
||||||
lsp.enable = true;
|
|
||||||
|
|
||||||
startPlugins = [
|
startPlugins = [
|
||||||
(
|
(
|
||||||
if ftcfg.enableNoResolvePatch
|
if ftcfg.enableNoResolvePatch
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
inherit (lib.nvim.languages) mkEnable;
|
inherit (lib.nvim.languages) mkEnable;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -8,6 +9,7 @@ in {
|
||||||
./cue.nix
|
./cue.nix
|
||||||
./dart.nix
|
./dart.nix
|
||||||
./clang.nix
|
./clang.nix
|
||||||
|
./clojure.nix
|
||||||
./css.nix
|
./css.nix
|
||||||
./elixir.nix
|
./elixir.nix
|
||||||
./fsharp.nix
|
./fsharp.nix
|
||||||
|
|
@ -44,10 +46,13 @@ in {
|
||||||
./wgsl.nix
|
./wgsl.nix
|
||||||
./yaml.nix
|
./yaml.nix
|
||||||
./ruby.nix
|
./ruby.nix
|
||||||
|
|
||||||
|
# This is now a hard deprecation.
|
||||||
|
(mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"])
|
||||||
];
|
];
|
||||||
|
|
||||||
options.vim.languages = {
|
options.vim.languages = {
|
||||||
enableLSP = mkEnable "LSP";
|
# Those are still managed by plugins, and should be enabled here.
|
||||||
enableDAP = mkEnable "Debug Adapter";
|
enableDAP = mkEnable "Debug Adapter";
|
||||||
enableTreesitter = mkEnable "Treesitter";
|
enableTreesitter = mkEnable "Treesitter";
|
||||||
enableFormat = mkEnable "Formatting";
|
enableFormat = mkEnable "Formatting";
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Elixir LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Elixir LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Elixir LSP server to use";
|
description = "Elixir LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "F# LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "F# LSP support" // {default = config.vim.lsp.enable;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
default = defaultServer;
|
default = defaultServer;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Gleam LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Gleam LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Go LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Go LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Go LSP server to use";
|
description = "Go LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "LSP support for Haskell" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "LSP support for Haskell" // {default = config.vim.lsp.enable;};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "Haskell LSP package or command to run the Haskell LSP";
|
description = "Haskell LSP package or command to run the Haskell LSP";
|
||||||
example = ''[ (lib.getExe pkgs.haskellPackages.haskell-language-server) "--debug" ]'';
|
example = ''[ (lib.getExe pkgs.haskellPackages.haskell-language-server) "--debug" ]'';
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "HCL LSP support (terraform-ls)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "HCL LSP support (terraform-ls)" // {default = config.vim.lsp.enable;};
|
||||||
# TODO: (maybe, is it better?) it would be cooler to use vscode-extensions.hashicorp.hcl probably, shouldn't be too hard
|
# TODO: (maybe, is it better?) it would be cooler to use vscode-extensions.hashicorp.hcl probably, shouldn't be too hard
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Helm LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Helm LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Helm LSP server to use";
|
description = "Helm LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.lsp.enable;};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "java language server package, or the command to run as a list of strings";
|
description = "java language server package, or the command to run as a list of strings";
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ in {
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.languages.enableLSP;
|
default = config.vim.lsp.enable;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable Julia LSP support.
|
Whether to enable Julia LSP support.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Kotlin LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Kotlin LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "kotlin_language_server package with Kotlin runtime";
|
description = "kotlin_language_server package with Kotlin runtime";
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "LuaLS package, or the command to run as a list of strings";
|
description = "LuaLS package, or the command to run as a list of strings";
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
@ -130,6 +130,18 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
markview-nvim = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption ""
|
||||||
|
// {
|
||||||
|
description = ''
|
||||||
|
[markview.nvim]: https://github.com/OXY2DEV/markview.nvim
|
||||||
|
|
||||||
|
[markview.nvim] - a hackable markdown, Typst, latex, html(inline) & YAML previewer
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
setupOpts = mkPluginSetupOption "markview-nvim" {};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extraDiagnostics = {
|
extraDiagnostics = {
|
||||||
|
|
@ -175,6 +187,13 @@ in {
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.extensions.markview-nvim.enable {
|
||||||
|
vim.startPlugins = ["markview-nvim"];
|
||||||
|
vim.pluginRC.markview-nvim = entryAnywhere ''
|
||||||
|
require("markview").setup(${toLuaObject cfg.extensions.markview-nvim.setupOpts})
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
(mkIf cfg.extraDiagnostics.enable {
|
||||||
vim.diagnostics.nvim-lint = {
|
vim.diagnostics.nvim-lint = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Nim LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Nim LSP support" // {default = config.vim.lsp.enable;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Nim LSP server to use";
|
description = "Nim LSP server to use";
|
||||||
type = str;
|
type = str;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
|
inputs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
|
|
@ -27,7 +28,7 @@
|
||||||
else ''{"${package}/bin/${defaultCmd}"}'';
|
else ''{"${package}/bin/${defaultCmd}"}'';
|
||||||
servers = {
|
servers = {
|
||||||
nil = {
|
nil = {
|
||||||
package = pkgs.nil;
|
package = inputs.nil.packages.${pkgs.stdenv.system}.nil;
|
||||||
internalFormatter = true;
|
internalFormatter = true;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.nil_ls.setup{
|
lspconfig.nil_ls.setup{
|
||||||
|
|
@ -143,7 +144,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Nix LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Nix LSP support" // {default = config.vim.lsp.enable;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Nix LSP server to use";
|
description = "Nix LSP server to use";
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Nu LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Nu LSP support" // {default = config.vim.lsp.enable;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = defaultServer;
|
default = defaultServer;
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "OCaml LSP support (ocaml-lsp)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "OCaml LSP support (ocaml-lsp)" // {default = config.vim.lsp.enable;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "OCaml LSP server to user";
|
description = "OCaml LSP server to user";
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Odin LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Odin LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "PHP LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "PHP LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "PHP LSP server to use";
|
description = "PHP LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Python LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Python LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Python LSP server to use";
|
description = "Python LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "R LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "R LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "R LSP server to use";
|
description = "R LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) either listOf package str enum;
|
inherit (lib.types) either listOf package str enum;
|
||||||
|
|
||||||
cfg = config.vim.languages.ruby;
|
cfg = config.vim.languages.ruby;
|
||||||
|
|
@ -24,7 +26,25 @@
|
||||||
flags = {
|
flags = {
|
||||||
debounce_text_changes = 150,
|
debounce_text_changes = 150,
|
||||||
},
|
},
|
||||||
cmd = { "${pkgs.solargraph}/bin/solargraph", "stdio" }
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{ "${cfg.lsp.package}/bin/solargraph", "stdio" }''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
rubylsp = {
|
||||||
|
package = pkgs.ruby-lsp;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.ruby_lsp.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach,
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{ "${cfg.lsp.package}/bin/ruby-lsp" }''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
@ -57,7 +77,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Ruby LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Ruby LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.trivial) boolToString;
|
inherit (lib.trivial) boolToString;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
|
|
@ -43,7 +43,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.lsp.enable;};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "rust-analyzer package, or the command to run as a list of strings";
|
description = "rust-analyzer package, or the command to run as a list of strings";
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||||
|
|
@ -68,7 +68,14 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
format = {
|
format = {
|
||||||
enable = mkEnableOption "Rust formatting" // {default = config.vim.languages.enableFormat;};
|
enable =
|
||||||
|
mkEnableOption "Rust formatting"
|
||||||
|
// {
|
||||||
|
default = !cfg.lsp.enable && config.vim.languages.enableFormat;
|
||||||
|
defaultText = literalMD ''
|
||||||
|
Disabled if Rust LSP is enabled, otherwise follows {option}`vim.languages.enableFormat`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
description = "Rust formatter to use";
|
description = "Rust formatter to use";
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Scala LSP support (metals)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Scala LSP support (metals)" // {default = config.vim.lsp.enable;};
|
||||||
package = mkPackageOption pkgs "metals" {
|
package = mkPackageOption pkgs "metals" {
|
||||||
default = ["metals"];
|
default = ["metals"];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "SQL LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "SQL LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "SQL LSP server to use";
|
description = "SQL LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Svelte LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Svelte LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Svelte LSP server to use";
|
description = "Svelte LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ in {
|
||||||
enable = mkEnableOption "Tailwindcss language support";
|
enable = mkEnableOption "Tailwindcss language support";
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Tailwindcss LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Tailwindcss LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Tailwindcss LSP server to use";
|
description = "Tailwindcss LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Terraform LSP support (terraform-ls)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Terraform LSP support (terraform-ls)" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "terraform-ls package";
|
description = "terraform-ls package";
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@
|
||||||
"eslint.config.js"
|
"eslint.config.js"
|
||||||
"eslint.config.mjs"
|
"eslint.config.mjs"
|
||||||
".eslintrc"
|
".eslintrc"
|
||||||
|
".eslintrc.cjs"
|
||||||
".eslintrc.json"
|
".eslintrc.json"
|
||||||
".eslintrc.js"
|
".eslintrc.js"
|
||||||
".eslintrc.yml"
|
".eslintrc.yml"
|
||||||
|
|
@ -120,7 +121,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Typescript/Javascript LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Typescript/Javascript LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Typescript/Javascript LSP server to use";
|
description = "Typescript/Javascript LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Typst LSP server to use";
|
description = "Typst LSP server to use";
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Vala LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Vala LSP support" // {default = config.vim.lsp.enable;};
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
description = "Vala LSP server to use";
|
description = "Vala LSP server to use";
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "WGSL LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "WGSL LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "YAML LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "YAML LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Zig LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Zig LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue