Skip to content

Commit 95aa559

Browse files
docs: add documentation for userconfigs
1 parent 1a0154b commit 95aa559

1 file changed

Lines changed: 37 additions & 4 deletions

File tree

README.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## What is it?
88

9-
Frosty is a modern and fully configured development environment for neovim with a focus on functionality and looks.
9+
Frosty is a modern and fully configured development environment for Neovim, with a focus on functionality and looks. Its designed to be best used as a Nix package, whilst still being compatible on systems without it.
1010

1111
## Installation
1212

@@ -16,21 +16,21 @@ Make sure that the `flake` and `nix-command` [experimental features](https://nix
1616

1717
To try frosty without installing:
1818

19-
```console
19+
```bash
2020
nix run github:SystematicError/frosty-vim
2121
```
2222

2323
### Non-nix
2424

25-
```console
25+
```bash
2626
git clone https://github.com/SystematicError/frosty-vim ~/.config/nvim --depth 1
2727
```
2828

2929
## Language support
3030

3131
These are the defaults, the config can be tweaked to add further support as needed.
3232

33-
Syntax highlighting and treesitter based functionality for 300+ languages are provided via parsers from [nixpkgs](https://search.nixos.org/packages?channel=unstable&query=vimPlugins.nvim-treesitter-parsers).
33+
Syntax highlighting and Treesitter based functionality for 300+ languages are provided via parsers from [nixpkgs](https://search.nixos.org/packages?channel=unstable&query=vimPlugins.nvim-treesitter-parsers).
3434
Additionally, further support is provided for the following languages:
3535

3636
| Language | Language Server | Formatter |
@@ -42,3 +42,36 @@ Additionally, further support is provided for the following languages:
4242
| Shell | [bashls](https://github.com/bash-lsp/bash-language-server) | [shfmt](https://github.com/mvdan/sh) |
4343

4444
\+ Languages supported by the [Biome toolchain](https://biomejs.dev/internals/language-support/)
45+
46+
## Customising the Nix package
47+
48+
The `flake.nix` file defines how the Frosty package gets built. Stuff like runtime dependencies and Treesitter parsers are defined there.
49+
50+
Frosty can also load a custom userconfig file through the `FROSTY_USERCONFIG` environment variable, without needing to modify the flake itself! Here's an example:
51+
52+
```lua
53+
-- File path: `~/frosty.lua`
54+
55+
-- Send a notification after starting up
56+
vim.schedule(function()
57+
vim.notify "Hello from the userconfig!"
58+
end)
59+
60+
-- The userconfig file should return a `LazySpec` (https://lazy.folke.io/spec)
61+
return {
62+
"alec-gibson/nvim-tetris",
63+
lazy = false,
64+
config = false,
65+
}
66+
67+
-- The :Tetris command should now be available if the userconfig loads correctly
68+
```
69+
70+
Now, running the command given below will load the userconfig:
71+
72+
```bash
73+
FROSTY_USERCONFIG="$HOME/frosty.lua" nvim
74+
```
75+
76+
> [!NOTE]
77+
> Fetching extra plugins via the userconfig file will require you to have `git` installed. After fetching a new plugin, Lazy might throw an error, but you can safely ignore this and restart Neovim.

0 commit comments

Comments
 (0)