dev: rebase on a less personalized neovim flake

This commit is contained in:
NotAShelf 2023-02-01 22:11:37 +03:00
commit 9c00808863
No known key found for this signature in database
GPG key ID: 5B5C8895F28445F1
70 changed files with 4910 additions and 0 deletions

42
docs/custom-configs.adoc Normal file
View file

@ -0,0 +1,42 @@
[[ch-custom-configuration]]
== Custom Configuration
Custom configuration is done with the `neovimConfiguration` function. It takes in the configuration as a module. The output of the configuration function is an attrset.
[source,nix]
----
{
options = "The options that were available to configure";
config = "The outputted configuration";
pkgs = "The package set used to evaluate the module";
neovim = "The built neovim package";
}
----
The following is an example of a barebones vim configuration with the default theme enabled.
[source,nix]
----
{
inputs.neovim-flake.url = "github:jordanisaacs/neovim-flake";
outputs = {nixpkgs, neovim-flake, ...}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
configModule = {
# Add any custom options (and feel free to upstream them!)
# options = ...
config.vim.theme.enable = true;
};
customNeovim = neovim-flake.lib.neovimConfiguration {
modules = [configModule];
inherit pkgs;
};
in {
packages.${system}.neovim = customNeovim.neovim;
};
}
----

36
docs/default-configs.adoc Normal file
View file

@ -0,0 +1,36 @@
[[ch-default-configs]]
== Default Configs
While you can configure neovim-flake yourself using the builder, here are a few default configurations you can use.
[[sec-default-tidal]]
=== Tidal Cycles
[source,console]
$ nix run github:jordanisaacs/neovim-flake#tidal file.tidal
Utilizing https://github.com/tidalcycles/vim-tidal[vim-tidal] and mitchmindtree's fantastic https://github.com/mitchmindtree/tidalcycles.nix[tidalcycles.nix] start playing with tidal cycles in a single command.
In your tidal file, type a cycle e.g. `d1 $ s "drum"` and then press _ctrl+enter_. Super collider with superdirt, and a modified GHCI with tidal will start up and begin playing. Note, you need jack enabled on your system. If you are using pipewire, its as easy as setting `services.pipewire.jack.enable = true`.
[[sec-default-nix]]
=== Nix
[source,console]
$ nix run github:jordanisaacs/neovim-flake#nix test.nix
Enables all the of neovim plugins, with language support for specifically Nix. This lets you see what a fully configured neovim setup looks like without downloading a whole bunch of language servers and associated tools.
[[sec-default-maximal]]
=== Maximal
[source,console]
$ nix shell github:jordanisaacs/neovim-flake#maximal test.nix
It is the same fully configured neovim as with the <<sec-default-nix,Nix>> config, but with every supported language enabled.
[NOTE]
====
Running the maximal config will download *a lot* of packages as it is downloading language servers, formatters, and more.
====

54
docs/default.nix Normal file
View file

@ -0,0 +1,54 @@
{
pkgs,
lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib,
nmdSrc,
}: let
nmd = import nmdSrc {inherit lib pkgs;};
scrubbedPkgsModule = {
imports = [
{
_module.args = {
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
};
}
];
};
nvimModuleDocs = nmd.buildModulesDocs {
modules =
import ../modules/modules.nix {
inherit pkgs lib;
check = false;
}
++ [scrubbedPkgsModule];
moduleRootPaths = [./..];
mkModuleUrl = path: "https://github.com/jordanisaacs/neovim-flake/blob/main/${path}#blob-path";
channelName = "neovim-flake";
docBook.id = "neovim-flake-options";
};
docs = nmd.buildDocBookDocs {
pathName = "neovim-flake";
projectName = "neovim-flake";
modulesDocs = [nvimModuleDocs];
documentsDirectory = ./.;
documentType = "book";
chunkToc = ''
<toc>
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-neovim-flake-manual">
<?dbhtml filename="index.html"?>
<d:tocentry linkend="ch-options">
<?dbhtml filename="options.html"?>
</d:tocentry>
<d:tocentry linkend="ch-release-notes">
<?dbhtml filename="release-notes.html"?>
</d:tocentry>
</d:tocentry>
</toc>
'';
};
in {
options.json = nvimModuleDocs.json.override {path = "share/doc/neovim-flake/options.json";};
manPages = docs.manPages;
manual = {inherit (docs) html htmlOpenTool;};
}

71
docs/languages.adoc Normal file
View file

@ -0,0 +1,71 @@
[[ch-languages]]
== Language Support
Language specific support combines some combination of language specific plugins, `treesitter` support, `nvim-lspconfig` langauge servers, and `null-ls` integration. This gets you capabilities ranging from autocompletion to formatting to diagnostics. The following languages have support beyond just `treesitter` highlighting.
[[sec-languages-rust]]
=== Rust
*LSP Server*: https://github.com/rust-analyzer/rust-analyzer[rust-analyzer]
*Formatting*: Built into LSP, uses https://github.com/rust-lang/rustfmt[rustfmt]
*Plugins*: See <<sec-plugins-rust,here>>
[[sec-languages-nix]]
=== Nix
*LSP Server*: Choice between https://github.com/oxalica/nil[nil] and https://github.com/nix-community/rnix-lsp[rnix-lsp]
*Formatting*: Choice between https://github.com/kamadorueda/alejandra[alejandra] and https://github.com/nix-community/nixpkgs-fmt[nixpkgs-fmt]
[[sec-languages-sql]]
=== SQL
*LSP Server*: https://github.com/lighttiger2505/sqls[sqls]
*Formatting*: Disabled LSP formatting, instead using https://github.com/sqlfluff/sqlfluff[sqlfluff]
*Linting*: https://github.com/sqlfluff/sqlfluff[sqlfluff]
*Plugins*: See <<sec-plugins-sql,here>>
[[sec-languages-clang]]
=== C/C++
*LSP Server*: https://github.com/MaskRay/ccls[ccls]
*Formatting*: Built into language server
[[sec-languages-typescript]]
=== Typescript
*LSP Server*: https://github.com/typescript-language-server/typescript-language-server[typescript-language-server]
*Formatting*: Disabled LSP formatting, instead using https://github.com/prettier/prettier[prettier]
*Linting*: https://github.com/prettier/prettier[eslint]
[[sec-languages-python]]
=== Python
*LSP Server*: https://github.com/microsoft/pyright[pyright]
*Formatting*: https://github.com/psf/black[black]
[[sec-languages-zig]]
=== Zig
*LSP Server*: https://github.com/zigtools/zls[zls]
*Formatting*: Built into LSP, uses `zig fmt`.
[[sec-languages-markdown]]
=== Markdown
*Plugins*: See <<sec-plugins-markdown,here>>
[[sec-languages-html]]
=== HTML
*Plugins*: See <<sec-plugins-html,here>>

View file

@ -0,0 +1,42 @@
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refmeta>
<refentrytitle>neovim-flake configuration</refentrytitle>
<manvolnum>5</manvolnum>
<refmiscinfo class="source">neovim-flake</refmiscinfo>
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
</refmeta>
<refnamediv>
<refname>neovim configuration</refname>
<refpurpose>neovim-flake configuration specification</refpurpose>
</refnamediv>
<refsection>
<title>Description</title>
<para>
Custom configuration is done with the neovim-flake.lib.neovimConfiguration function. It takes in the configuration as a module.
<programlisting>
neovim-flake.lib.neovimConfiguration {
inherit pkgs;
modules = [{config = xxx;}];
};
</programlisting>
The output of the configuration function is an attrset.
</para>
<programlisting>
{
options = "The options that were available to configure";
config = "The outputted configuration";
pkgs = "The package set used to evaluate the module";
neovim = "The built neovim package";
}
</programlisting>
</refsection>
<refsection>
<title>Options</title>
<para>
You can use the following options in your neovim configuration.
</para>
<xi:include href="./nmd-result/neovim-flake-options.xml"/>
</refsection>
</refentry>

13
docs/man-pages.xml Normal file
View file

@ -0,0 +1,13 @@
<reference xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>neovim-flake Reference Pages</title>
<info>
<author><personname>neovim-flake contributors</personname></author>
<copyright>
<year>20212022</year>
<holder>neovim-flake contributors</holder>
</copyright>
</info>
<xi:include href="man-configuration.xml" />
</reference>

27
docs/manual.xml Normal file
View file

@ -0,0 +1,27 @@
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="book-neovim-flake-manual">
<info>
<title>neovim-flake Manual</title>
</info>
<preface>
<title>Preface</title>
<para>
If you encounter problems or want to discuss neovim-flake then join the Matrix room
<link xlink:href="https://matrix.to/#/%23neovim-flake:matrix.org">#neovim-flake:matrix.org</link>.
If your problem is caused by a bug in neovim-flake then it should be reported on the
<link xlink:href="https://github.com/jordanisaacs/neovim-flake/issues">neovim-flake issue tracker</link>.
</para>
</preface>
<xi:include href="default-configs.xml"/>
<xi:include href="custom-configs.xml"/>
<xi:include href="languages.xml"/>
<xi:include href="plugins.xml"/>
<appendix xml:id="ch-options">
<title>Configuration Options</title>
<xi:include href="./nmd-result/neovim-flake-options.xml" />
</appendix>
<xi:include href="./release-notes/release-notes.xml" />
</book>

111
docs/plugins.adoc Normal file
View file

@ -0,0 +1,111 @@
[[ch-plugins]]
== Plugins
The following are the neovim plugins used within neovim-flake. Some plugins are explicitly enabled by the user, while others are enabled implicitly.
[[sec-plugins-server]]
=== Language Server
* https://github.com/neovim/nvim-lspconfig[nvim-lspconfig] common configurations for built-in language server
* https://github.com/jose-elias-alvarez/null-ls.nvim[null-ls.nvim] neovim as a language server to inject LSP diagnostics, code actions, etc.
* https://github.com/glepnir/lspsaga.nvim[lspsaga.nvim] useful UI and tools for lsp
* https://github.com/folke/trouble.nvim[trouble.nvim] pretty list of lsp data
* https://github.com/weilbith/nvim-code-action-menu[nvim-code-action-menu] a better code action menu with diff support
* https://github.com/ray-x/lsp_signature.nvim[lsp-signature] show function signatures as you type
* https://github.com/onsails/lspkind-nvim[lspkind-nvim] for pictograms in lsp (with support for nvim-cmp)
[[sec-plugins-buffer]]
=== Buffers
* https://github.com/akinsho/bufferline.nvim[nvim-bufferline-lua] a buffer line with tab integration
* https://github.com/famiu/bufdelete.nvim[bufdelete-nvim] delete buffers without losing window layout
[[sec-plugins-statuslines]]
=== Statuslines
* https://github.com/hoob3rt/lualine.nvim[lualine.nvim] statusline written in lua.
[[sec-plugins-filetrees]]
=== Filetrees
* https://github.com/kyazdani42/nvim-tree.lua[nvim-tree-lua] a file explorer tree written in lua. Using
[[sec-plugins-git]]
=== Git
* https://github.com/lewis6991/gitsigns.nvim[gitsigns.nvim] a variety of git decorations
[[sec-plugins-treesitter]]
=== Treesitter
* https://github.com/romgrk/nvim-treesitter-context[nvim-treesitter-context] a context bar using tree-sitter
[[sec-plugins-visuals]]
=== Visuals
* https://github.com/lukas-reineke/indent-blankline.nvim[indent-blankline] for indentation guides
* https://github.com/kyazdani42/nvim-web-devicons[nvim-web-devicons] Plugins and colors for icons. Requires patched font
[[sec-plugins-utilities]]
=== Utilities
* https://github.com/nvim-telescope/telescope.nvim[telescope] an extendable fuzzy finder of lists. Working ripgrep and fd
* https://github.com/folke/which-key.nvim[which-key] a popup that displays possible keybindings of command being typed
[[sec-plugins-completions]]
=== Completions
* https://github.com/hrsh7th/nvim-cmp[nvim-cmp] a completion engine that utilizes sources
** https://github.com/hrsh7th/cmp-buffer[cmp-buffer] a source for buffer words
** https://github.com/hrsh7th/cmp-nvim-lsp[cmp-nvim-lsp] a source for builtin LSP client
** https://github.com/hrsh7th/cmp-vsnip[cmp-vsnip] a source for vim-vsnip autocomplete
** https://github.com/hrsh7th/cmp-path[cmp-path] a source for path autocomplete
** https://github.com/ray-x/cmp-treesitter[cmp-treesitter] treesitter nodes autcomplete
[[sec-plugins-snippets]]
=== Snippets
* https://github.com/hrsh7th/vim-vsnip[vim-vsnip] a snippet plugin that supports LSP/VSCode's snippet format
[[sec-plugins-autopairs]]
=== Autopairs
* https://github.com/windwp/nvim-autopairs[nvim-autopairs] an autopair plugin for neovim
[[sec-plugins-themes]]
=== Themes
* https://github.com/navarasu/onedark.nvim[onedark] a dark colorscheme with multiple options
* https://github.com/folke/tokyonight.nvim[tokyonight-nvim] a neovim theme with multiple color options
* https://github.com/catppuccin/nvim[catppuccin] a pastel theme with 4 color options
[[sec-plugins-markdown]]
=== Markdown
* https://github.com/ellisonleao/glow.nvim[glow.nvim] a markdown preview directly in neovim using glow
[[sec-plugins-rust]]
=== Rust
* https://github.com/simrat39/rust-tools.nvim[rust-tools] provides tools for rust
* https://github.com/Saecki/crates.nvim[crates.nvim] provides tools for working with `cargo.toml`
[[sec-plugins-tidalcycles]]
=== Tidal Cycles
* https://github.com/tidalcycles/vim-tidal[vim-tidal] for tidal cycles integration into vim
[[sec-plugins-sql]]
=== SQL
* https://github.com/nanotee/sqls.nvim[sqls.nvim] for useful actions that leverage `sqls` LSP
[[sec-plugins-html]]
=== HTML
* https://github.com/windwp/nvim-ts-autotag[nvim-ts-autotag] uses treesitter to autoclose/rename html tags
[[sec-plugins-dependencies]]
=== Dependencies
* https://github.com/nvim-lua/plenary.nvim[plenary] which is a dependency of some plugins, installed automatically if needed

View file

@ -0,0 +1,9 @@
[[ch-release-notes]]
[appendix]
== Release Notes
This section lists the release notes for tagged version of neovim-flake and current main.
:leveloffset: 1
include::rl-0.1.adoc[]

View file

@ -0,0 +1,32 @@
[[sec-release-0.1]]
== Release 0.1
This is the current master branch and information here is not final. These are changes from the v0.01 tag.
Special thanks to https://github.com/nix-community/home-manager/[home-manager] for this release. Docs/manual generation, the new module evaluation system, and DAG implementation are from them.
[[sec-release-0.1-changelog]]
=== Changelog
https://github.com/jordanisaacs[jordanisaacs]:
* Removed hare language support (lsp/tree-sitter/etc). `vim.lsp.hare` is no longer defined. If you use hare and would like it added back, please file an issue.
* <<opt-vim.startPlugins>> & <<opt-vim.optPlugins>> are now an enum of `string` for options sourced from the flake inputs. Users can still provide vim plugin packages.
+
If you are contributing and adding a new plugin, add the plugin name to `availablePlugins` in https://github.com/jordanisaacs/neovim-flake/blob/20cec032bd74bc3d20ac17ce36cd84786a04fd3e/modules/lib/types-plugin.nix[types-plugin.nix].
* `neovimBuilder` has been removed for configuration. Using an overlay is no longer required. See the manual for the new way to configuration.
* Treesitter grammars are now configurable with <<opt-vim.treesitter.grammars>>. Utilizes the nixpkgs `nvim-treesitter` plugin rather than a custom input in order to take advantage of build support of pinned versions. See https://discourse.nixos.org/t/psa-if-you-are-on-unstable-try-out-nvim-treesitter-withallgrammars/23321?u=snowytrees[discourse] for more information. Packages can be found under the `vimPlugins.nvim-treesitter.builtGrammars` namespace.
* <<opt-vim.configRC>> and <<opt-vim.luaConfigRC>> are now of type DAG lines. This allows for ordering of the config. Usage is the same is in home-manager's `home.activation` option.
+
[source,nix]
----
vim.luaConfigRC = lib.nvim.dag.entryAnywhere "config here"
----
https://github.com/MoritzBoehme[MoritzBoehme]:
* `catppuccin` theme is now available as a neovim theme <<opt-vim.theme.style>> and lualine theme <<opt-vim.statusline.lualine.theme>>.