Skip to content

Commit b7f891c

Browse files
Merge branch 'main' into languages/fish
2 parents 8c80081 + fde1338 commit b7f891c

17 files changed

Lines changed: 290 additions & 24 deletions

File tree

configuration.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ isMaximal: {
7272
extensions.crates-nvim.enable = isMaximal;
7373
};
7474
toml.enable = isMaximal;
75+
xml.enable = isMaximal;
7576

7677
# Language modules that are not as common.
7778
assembly.enable = false;
@@ -93,9 +94,11 @@ isMaximal: {
9394
just.enable = false;
9495
qml.enable = false;
9596
fish.enable = false;
97+
jinja.enable = false;
9698

9799
tailwind.enable = false;
98100
svelte.enable = false;
101+
tera.enable = false;
99102

100103
# Nim LSP is broken on Darwin and therefore
101104
# should be disabled by default. Users may still enable

docs/manual/configuring.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ configuring/custom-package.md
1717
configuring/custom-plugins.md
1818
configuring/overriding-plugins.md
1919
configuring/languages.md
20+
configuring/keybinds.md
2021
configuring/dags.md
2122
configuring/dag-entries.md
2223
configuring/autocmds.md
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Custom keymaps {#ch-keymaps}
2+
3+
Some plugin modules provide keymap options for your convenience. If a keymap is
4+
not provided by such module options, you may easily register your own custom
5+
keymaps via {option}`vim.keymaps`.
6+
7+
```nix
8+
{
9+
config.vim.keymaps = [
10+
{
11+
key = "<leader>m";
12+
mode = "n";
13+
silent = true;
14+
action = ":make<CR>";
15+
}
16+
{
17+
key = "<leader>l";
18+
mode = ["n" "x"];
19+
silent = true;
20+
action = "<cmd>cnext<CR>";
21+
}
22+
{
23+
key = "<leader>k";
24+
mode = ["n" "x"];
25+
26+
# While `lua` is `true`, `action` is expected to be
27+
# a valid Lua expression.
28+
lua = true;
29+
action = ''
30+
function()
31+
require('foo').do_thing()
32+
print('did thing')
33+
end
34+
'';
35+
}
36+
];
37+
}
38+
```

docs/manual/configuring/languages/lsp.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,43 @@ vim.languages.java = {
2121
};
2222
}
2323
```
24+
25+
## Custom LSP Servers {#ch-custom-lsp-servers}
26+
27+
Neovim 0.11, in an effort to improve the out-of-the-box experience of Neovim,
28+
has introduced a new `vim.lsp` API that can be used to register custom LSP
29+
servers with ease. In **nvf**, this translates to the custom `vim.lsp` API that
30+
can be used to register servers that are not present in existing language
31+
modules.
32+
33+
The {option}`vim.lsp.servers` submodule can be used to modify existing LSP
34+
definitions OR register your own custom LSPs respectively. For example, if you'd
35+
like to avoid having NVF pull the LSP packages you may modify the start command
36+
to use a string, which will cause the LSP API to discover LSP servers from
37+
{env}`PATH`. For example:
38+
39+
```nix
40+
{lib, ...}: {
41+
vim.lsp.servers = {
42+
# Get `basedpyright-langserver` from PATH, e.g., a dev shell.
43+
basedpyright.cmd = lib.mkForce ["basedpyright-langserver" "--stdio"];
44+
45+
# Define a custom LSP entry using `vim.lsp.servers`:
46+
ty = {
47+
cmd = lib.mkDefault [(lib.getExe pkgs.ty) "server"];
48+
filetypes = ["python"];
49+
root_markers = [
50+
".git"
51+
"pyproject.toml"
52+
"setup.cfg"
53+
"requirements.txt"
54+
"Pipfile"
55+
"pyrightconfig.json"
56+
];
57+
58+
# If your LSP accepts custom settings. See `:help lsp-config` for more details
59+
# on available fields. This is a freeform field.
60+
settings.ty = { /* ... */ };
61+
};
62+
}
63+
```

docs/manual/configuring/overriding-plugins.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ vim.pluginOverrides = {
1414
rev = "";
1515
hash = "";
1616
};
17+
1718
# It's also possible to use a flake input
1819
lazydev-nvim = inputs.lazydev-nvim;
1920
# Or a local path
2021
lazydev-nvim = ./lazydev;
21-
# Or a npins pin... etc
22+
# Or a npins pin nvfetcher source, etc.
2223
};
2324
```
2425

docs/manual/release-notes/rl-0.9.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,24 @@
132132
133133
- Added [sqruff](https://github.com/quarylabs/sqruff) support to `languages.sql`
134134
135+
- Lazy-load `crates.nvim` plugin when using
136+
`vim.languages.rust.extensions.crates-nvim.enable`
137+
135138
- Added [Pyrefly](https://pyrefly.org/) and [zuban](https://zubanls.com/)
136139
support to `languages.python`
137140
138141
- Added TOML support via {option}`languages.toml` and the
139142
[Tombi](https://tombi-toml.github.io/tombi/) language server, linter, and
140143
formatter.
141144
145+
- Added Jinja support via `languages.jinja`
146+
142147
- Added [hlargs.nvim](https://github.com/m-demare/hlargs.nvim) support as
143148
`visuals.hlargs-nvim`.
144149
150+
- Lazy-load `nvim-autopairs` plugin when using
151+
`vim.autopairs.nvim-autopairs.enable`
152+
145153
[Machshev](https://github.com/machshev):
146154
147155
- Added `ruff` and `ty` LSP support for Python under `programs.python`.
@@ -159,4 +167,15 @@
159167
- Added [Selenen](https://github.com/kampfkarren/selene) for more diagnostics in
160168
`languages.lua`.
161169
170+
- Added XML syntax highlighting, LSP support and formatting
171+
172+
- Added [tera](https://keats.github.io/tera/) language support (syntax
173+
highlighting only).
174+
175+
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
176+
https://github.com/gorbit99/codewindow.nvim
177+
178+
- Add [codewindow.nvim] plugin in `vim.assistant.codewindow` with `enable` and
179+
`setupOpts`
180+
162181
<!-- vim: set textwidth=80: -->

flake.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
systems.url = "github:nix-systems/default";
123123

124124
## Basic Inputs
125-
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
125+
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
126126

127127
flake-parts = {
128128
url = "github:hercules-ci/flake-parts";

modules/plugins/autopairs/nvim-autopairs/config.nix

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@
44
...
55
}: let
66
inherit (lib.modules) mkIf;
7-
inherit (lib.nvim.dag) entryAnywhere;
8-
inherit (lib.nvim.lua) toLuaObject;
9-
107
cfg = config.vim.autopairs.nvim-autopairs;
118
in {
129
config = mkIf cfg.enable {
13-
vim = {
14-
startPlugins = ["nvim-autopairs"];
15-
pluginRC.autopairs = entryAnywhere ''
16-
require('nvim-autopairs').setup(${toLuaObject cfg.setupOpts})
17-
'';
10+
vim.lazy.plugins.nvim-autopairs = {
11+
package = "nvim-autopairs";
12+
setupModule = "nvim-autopairs";
13+
setupOpts = cfg.setupOpts;
14+
event = ["InsertEnter"];
1815
};
1916
};
2017
}

modules/plugins/languages/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ in {
2020
./helm.nix
2121
./kotlin.nix
2222
./html.nix
23+
./tera.nix
2324
./haskell.nix
2425
./java.nix
26+
./jinja.nix
2527
./json.nix
2628
./lua.nix
2729
./markdown.nix
@@ -51,6 +53,7 @@ in {
5153
./yaml.nix
5254
./ruby.nix
5355
./just.nix
56+
./xml.nix
5457

5558
# This is now a hard deprecation.
5659
(mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"])

0 commit comments

Comments
 (0)