mirror of
https://github.com/kossLAN/nvim-flake.git
synced 2025-11-04 17:59:50 -05:00
readme: make more personal
This commit is contained in:
parent
2019cab65d
commit
1f51668236
1 changed files with 3 additions and 164 deletions
167
README.md
167
README.md
|
|
@ -1,89 +1,6 @@
|
|||
<!-- markdownlint-disable -->
|
||||
<br />
|
||||
<div align="center">
|
||||
<a href="https://github.com/nix-community/kickstart-nix.nvim">
|
||||
<img src="./nvim-nix.svg" alt="kickstart-nix.nvim">
|
||||
</a>
|
||||
<!-- TODO: -->
|
||||
<!-- <p align="center"> -->
|
||||
<!-- <br /> -->
|
||||
<!-- TODO: -->
|
||||
<!-- <a href="./nvim/doc/kickstart-nix.txt"><strong>Explore the docs »</strong></a> -->
|
||||
<!-- <br /> -->
|
||||
<!-- <br /> -->
|
||||
<!-- <a href="https://github.com/nix-community/kickstart-nix.nvim/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml">Report Bug</a> -->
|
||||
<!-- · -->
|
||||
<!-- <a href="https://github.com/nix-community/kickstart-nix.nvim/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml">Request Feature</a> -->
|
||||
<!-- · -->
|
||||
<!-- <a href="https://github.com/nix-community/kickstart-nix.nvim/discussions/new?category=q-a">Ask Question</a> -->
|
||||
<!-- </p> -->
|
||||
<p>❄️</p>
|
||||
<p>
|
||||
<strong>
|
||||
A dead simple <a href="https://nixos.org/">Nix</a> flake template repository</br>
|
||||
for <a href="https://neovim.io/">Neovim</a>
|
||||
</strong>
|
||||
</p>
|
||||
## :books: Important Information
|
||||
|
||||
[![Neovim][neovim-shield]][neovim-url]
|
||||
[![Nix][nix-shield]][nix-url]
|
||||
[![Lua][lua-shield]][lua-url]
|
||||
|
||||
[![GPL2 License][license-shield]][license-url]
|
||||
[![Issues][issues-shield]][issues-url]
|
||||
</div>
|
||||
<!-- markdownlint-restore -->
|
||||
|
||||

|
||||
|
||||
## :grey_question: Why kickstart-nix.nvim
|
||||
|
||||
If Nix and Neovim have one thing in common,
|
||||
it's that many new users don't know where to get started.
|
||||
Most Nix-based Neovim setups assume deep expertise in both realms,
|
||||
abstracting away Neovim's core functionalities
|
||||
as well as the Nix internals used to build a Neovim config.
|
||||
Frameworks and module-based DSLs are opinionated and difficult to diverge from
|
||||
with one's own modifications.
|
||||
|
||||
`kickstart-nix.nvim` is different:
|
||||
It's geared for users of all levels,
|
||||
making the migration of Neovim configurations to Nix straightforward.
|
||||
This project aims to be as simple as possible, while allowing
|
||||
for maximum flexibility.
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> Similar to [`kickstart.nvim`](https://github.com/nvim-lua/kickstart.nvim),
|
||||
> this repository is meant to be used by **you** to begin your
|
||||
> **Nix**/Neovim journey; remove the things you don't use and add what you miss.
|
||||
|
||||
## :milky_way: Philosophy
|
||||
|
||||
- KISS principle with sane defaults.
|
||||
- Manage plugins + external dependencies using Nix
|
||||
(managing plugins shouldn't be the responsibility of a plugin).
|
||||
- Configuration entirely in Lua[^1] (Vimscript is also possible).
|
||||
This makes it easy to migrate from non-nix dotfiles.
|
||||
- Use Neovim's built-in loading mechanisms. See:
|
||||
- [`:h initialization`](https://neovim.io/doc/user/starting.html#initialization)
|
||||
- [`:h runtimepath`](https://neovim.io/doc/user/options.html#'runtimepath')
|
||||
- [`:h packadd`](https://neovim.io/doc/user/repeat.html#%3Apackadd)
|
||||
- Use Neovim's built-in LSP client, with Nix managing language servers.
|
||||
|
||||
[^1]: The absence of a Nix module DSL for Neovim configuration is deliberate.
|
||||
If you were to copy the `nvim` directory to `$XDG_CONFIG_HOME`,
|
||||
and install the plugins, it would work out of the box.
|
||||
|
||||
## :star2: Features
|
||||
|
||||
- Use either nixpkgs or flake inputs as plugin sources.
|
||||
- Usable on any device with Neovim and Nix installed.
|
||||
- Create multiple derivations with different sets of plugins,
|
||||
and simple regex filters to exclude config files.
|
||||
- Uses Nix to generate a `.luarc.json` in the devShell's `shellHook`.
|
||||
This sets up lua-language-server to recognize all plugins
|
||||
and the Neovim API.
|
||||
1. This is my personal configuration started from [Kickstart-nix.nvim](https://github.com/nix-community/kickstart-nix.nvim), I really liked the design and decided to base my configuration on it, if you are seeing this don't copy from me instead start from scratch, because I deviate a good amount with my own biases.
|
||||
|
||||
## :bicyclist: Test drive
|
||||
|
||||
|
|
@ -91,26 +8,9 @@ If you have Nix installed (with [flakes](https://wiki.nixos.org/wiki/Flakes) ena
|
|||
you can test drive this by running:
|
||||
|
||||
```console
|
||||
nix run "github:nix-community/kickstart-nix.nvim"
|
||||
nix run "github:kossLAN/NvimFlake"
|
||||
```
|
||||
|
||||
## :books: Usage
|
||||
|
||||
1. Click on [Use this template](https://github.com/nix-community/kickstart-nix.nvim/generate)
|
||||
to start a repo based on this template. **Do _not_ fork it**.
|
||||
1. Add/remove plugins to/from the [Neovim overlay](./nix/neovim-overlay.nix).
|
||||
1. Add/remove plugin configs to/from the `nvim/plugin` directory.
|
||||
1. Modify as you wish (you will probably want to add a color theme, ...).
|
||||
See: [Design](#robot-design).
|
||||
1. You can create more than one package using the `mkNeovim` function by
|
||||
- Passing different plugin lists.
|
||||
- Adding `ignoreConfigRegexes` (e.g. `= [ "^ftplugin/.*.lua" ]`).
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> The nix and lua files contain comments explaining
|
||||
> what everything does in detail.
|
||||
|
||||
## :zap: Installation
|
||||
|
||||
### :snowflake: NixOS (with flakes)
|
||||
|
|
@ -230,33 +130,6 @@ 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.
|
||||
|
||||
## :electric_plug: Pre-configured plugins
|
||||
|
||||
This configuration comes with [a few plugins pre-configured](./nix/neovim-overlay.nix).
|
||||
|
||||
You can add or remove plugins by
|
||||
|
||||
- Adding/Removing them in the [Nix list](./nix/neovim-overlay.nix).
|
||||
- Adding/Removing the config in `nvim/plugin/<plugin>.lua`.
|
||||
|
||||
## :anchor: Syncing updates
|
||||
|
||||
If you have used this template and would like to fetch updates
|
||||
that were added later...
|
||||
|
||||
Add this template as a remote:
|
||||
|
||||
```console
|
||||
git remote add upstream git@github.com:nix-community/kickstart-nix.nvim.git
|
||||
```
|
||||
|
||||
Fetch and merge changes:
|
||||
|
||||
```console
|
||||
git fetch upstream
|
||||
git merge upstream/main --allow-unrelated-histories
|
||||
```
|
||||
|
||||
## :pencil: Editing your config
|
||||
|
||||
When your neovim setup is a nix derivation, editing your config
|
||||
|
|
@ -280,40 +153,6 @@ in the `mkNeovim` function.
|
|||
|
||||
[^3]: Assuming Linux. Refer to `:h initialization` for Darwin.
|
||||
|
||||
This has one caveat: The wrapper which nix generates for the derivation
|
||||
calls `nvim` with `-u /nix/store/path/to/generated-init.lua`.
|
||||
So it won't source a local `init.lua` file.
|
||||
To work around this, you can put scripts in the `plugin` or `after/plugin` directory.
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> If you are starting out, and want to test things without having to
|
||||
> stage or commit new files for changes to take effect,
|
||||
> you can remove the `.git` directory and re-initialize it (`git init`)
|
||||
> when you are done.
|
||||
|
||||
## :link: Alternative / similar projects
|
||||
|
||||
- [`kickstart.nvim`](https://github.com/nvim-lua/kickstart.nvim):
|
||||
Single-file Neovim configuration template with a similar philosophy to this project.
|
||||
Does not use Nix to manage plugins.
|
||||
- [`neovim-flake`](https://github.com/jordanisaacs/neovim-flake):
|
||||
Configured using a Nix module DSL.
|
||||
- [`NixVim`](https://github.com/nix-community/nixvim):
|
||||
A module system for Neovim, with a focus on plugin configs.
|
||||
- [`lz.n`](https://github.com/nvim-neorocks/lz.n):
|
||||
A plugin-manager agnostic Lua library for lazy-loading plugins.
|
||||
Can be used with Nix.
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> When comparing with projects in the "non-Nix world", this
|
||||
> repository would be more comparable to `kickstart.nvim` (hence the name),
|
||||
> while the philosophies of `neovim-flake` and `NixVim` are more in line with
|
||||
> a Neovim distribution like [`LunarVim`](https://www.lunarvim.org/)
|
||||
> or [`LazyVim`](https://www.lazyvim.org/)
|
||||
> (though they are far more minimal by default).
|
||||
|
||||
<!-- MARKDOWN LINKS & IMAGES -->
|
||||
[neovim-shield]: https://img.shields.io/badge/NeoVim-%2357A143.svg?&style=for-the-badge&logo=neovim&logoColor=white
|
||||
[neovim-url]: https://neovim.io/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue