Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vincent-thomas/nvim
https://github.com/vincent-thomas/nvim
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/vincent-thomas/nvim
- Owner: vincent-thomas
- License: gpl-2.0
- Created: 2024-09-10T21:49:46.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-12-27T13:18:50.000Z (12 days ago)
- Last Synced: 2024-12-27T14:27:49.584Z (12 days ago)
- Language: Lua
- Size: 73.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VTs nvim.nix
## :bicyclist: Try
If you have Nix installed (with [flakes](https://wiki.nixos.org/wiki/Flakes) enabled),
you can test drive this by running:```console
nix run "github:vincent-thomas/nvim"
```## :robot: Design
Directory structure:
```sh
── flake.nix
── nvim # Neovim configs (lua), equivalent to ~/.config/nvim
── nix # Nix configs
```Directory structure:
```sh
── nvim
├── init.lua # Always sourced
├── lua
│ └── vt
│ └── .lua
├── plugin # Automatically sourced at startup
│ └── .lua # Plugin configurations
└── after # Empty in this template
├── plugin # Sourced at the very end of startup (rarely needed)
└── ftplugin # Sourced when opening a filetype, after sourcing ftplugin scripts
```### :open_file_folder: Nix
You can declare Neovim derivations in `nix/neovim-overlay.nix`.
There are two ways to add plugins:
- The traditional way, using `nixpkgs` as the source.
- By adding plugins as flake inputs (if you like living on the bleeding-edge).
Plugins added as flake inputs must be built in `nix/plugin-overlay.nix`.Directory structure:
```sh
── flake.nix
── nix
├── mkNeovim.nix # Function for creating the Neovim derivation
└── neovim-overlay.nix # Overlay that adds Neovim derivation
```### :mag: Initialization order
This derivation creates an `init.lua` as follows:
1. Add `nvim/lua` to the `runtimepath`.
1. Add the content of `nvim/init.lua`.
1. Add `nvim/*` to the `runtimepath`.
1. Add `nvim/after` to the `runtimepath`.This means that modules in `nvim/lua` can be `require`d in `init.lua` and `nvim/*/*.lua`.
Modules in `nvim/plugin/` are sourced automatically, as if they were plugins.
Because they are added to the runtime path at the end of the resulting `init.lua`,
Neovim sources them _after_ loading plugins.