Skip to content

Commit

Permalink
README: Add neovim instructions
Browse files Browse the repository at this point in the history
Closes #214
  • Loading branch information
dasJ committed Aug 28, 2024
1 parent 44b3e27 commit 3c967d0
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,54 @@ treefmt-nix.mkWrapper nixpkgs {
```

More information about configuration can be found in [the official README](https://github.com/numtide/treefmt-nix?tab=readme-ov-file#integration-into-nix).

### neovim + nixd

```lua
local nvim_lsp = require("lspconfig")
nvim_lsp.nixd.setup({
settings = {
nixd = {
formatting = {
command = { "nixfmt" },
},
},
},
})
```

This only works when `nixfmt-rfc-style` is installed (see above for installation instructions).

### neovim + nil

```lua
local nvim_lsp = require("lspconfig")
nvim_lsp.nil_ls.setup({
settings = {
['nil'] = {
formatting = {
command = { "nixfmt" },
},
},
},
})
```

This only works when `nixfmt-rfc-style` is installed (see above for installation instructions).

### neovim + none-ls

```lua
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.nixfmt,
},
})
```

This only works when `nixfmt-rfc-style` is installed (see above for installation instructions).

## Development

### With Nix
Expand Down

0 comments on commit 3c967d0

Please sign in to comment.