Compare commits
98 Commits
2b50b5de32
...
5a90539944
Author | SHA1 | Date |
---|---|---|
diniamo | 5a90539944 | |
diniamo | b30cf04904 | |
diniamo | b5d8e58282 | |
Frothy | 3ceefe8849 | |
NotAShelf | 4ee562d438 | |
raf | a86c59457c | |
diniamo | a437dbd158 | |
raf | c1b3900846 | |
diniamo | 9cff1b03d6 | |
NotAShelf | dfa2718bb3 | |
raf | fcab30e7bb | |
Phan Đăng Khoa | 68b0647936 | |
NotAShelf | c50522f6b0 | |
raf | ae45cdf92a | |
jacekpoz | 8eb8326bd6 | |
NotAShelf | 200a45ec73 | |
Frothy | 08547724e4 | |
raf | 5748bb5eb9 | |
Frothy | 367320dcd9 | |
Frothy | fc4e471490 | |
Yoni Firroloni | 1061c920be | |
NotAShelf | 9bbdb8d48a | |
NotAShelf | f9343f1bc7 | |
raf | 6624841e63 | |
Ching Pei Yang | 9baebb0d82 | |
Frothy | 2c9a9b4d29 | |
Frothy | 68ca227a87 | |
Frothy | 69257c03a3 | |
Frothy | ac20dfbdd4 | |
raf | 9074b6e5e7 | |
dependabot[bot] | 011f662fa0 | |
raf | f59a915da9 | |
NotAShelf | 60d9ebb3f0 | |
NotAShelf | bb06827474 | |
Ching Pei Yang | af72dc105d | |
NotAShelf | 9d0247c599 | |
NotAShelf | f0f2c08e9f | |
NotAShelf | cfbed8ceb1 | |
NotAShelf | 1ce25d7ca3 | |
NotAShelf | eefc7a9d1d | |
NotAShelf | 74c94b8a54 | |
raf | 74df3a5f03 | |
jacekpoz | 7224c1e6af | |
jacekpoz | f343ab8b3a | |
jacekpoz | 208d1e6741 | |
NotAShelf | 493854e44f | |
jacekpoz | cc0aba4e21 | |
jacekpoz | db810bbf9f | |
raf | 1fd4a2a1b8 | |
NotAShelf | 7cafa56cdb | |
NotAShelf | b5f38b8e5e | |
NotAShelf | 355d4830e5 | |
Ching Pei Yang | 8aa3a23e97 | |
Ching Pei Yang | 7d9f1e0481 | |
Ching Pei Yang | 82e92a56da | |
Ching Pei Yang | 981fe07075 | |
raf | 2615c568f8 | |
NotAShelf | 407ecf00d5 | |
NotAShelf | 7c1a8e2c1e | |
NotAShelf | ea5f229efd | |
NotAShelf | 41f7abcdc3 | |
NotAShelf | a85bf963e6 | |
raf | 26755a6b93 | |
NotAShelf | 96b92b5652 | |
NotAShelf | 544c98a03b | |
NotAShelf | e96897f6b3 | |
raf | 12fd9d69dc | |
Frothy | dc0fa76295 | |
NotAShelf | e0790f2bdb | |
NotAShelf | bf090172d2 | |
NotAShelf | 7481423bed | |
NotAShelf | 6eba2a5585 | |
NotAShelf | 1847b9f1bf | |
NotAShelf | d06ff3d7db | |
Frothy | 83583e9b64 | |
raf | efd8b44ce1 | |
Frothy | 9fe96ce010 | |
raf | a777941eed | |
raf | a20f84edfb | |
Ching Pei Yang | 666de6a5be | |
Pei Yang Ching | 3ad560ea30 | |
Pei Yang Ching | 2c37513012 | |
NotAShelf | ab2685579a | |
raf | 5b982fafa0 | |
NotAShelf | d25492788c | |
Frothy | e1edeb5189 | |
Frothy | 4df41ae0d0 | |
NotAShelf | 0ae4408fd8 | |
NotAShelf | 32615fca69 | |
NotAShelf | 768449eff7 | |
NotAShelf | 4d41469b3d | |
NotAShelf | fbc138a51b | |
NotAShelf | d5fde3f445 | |
Frothy | 90ee038794 | |
NotAShelf | f66a879dce | |
Frothy | ee240a1483 | |
NotAShelf | 94ffd5ec9f | |
ItsSorae | 4056deb411 |
|
@ -0,0 +1,4 @@
|
|||
github: NotAShelf
|
||||
ko_fi: NotAShelf
|
||||
liberapay: NotAShelf
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
<div align="center">
|
||||
<img src="assets/nvf-logo-work.svg" alt="nvf Logo" width="200">
|
||||
<h1 ❄️ nvf</h1>
|
||||
<br/>
|
||||
<h1>nvf</h1>
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
@ -182,9 +183,10 @@ recommend checking their work out.
|
|||
|
||||
## License
|
||||
|
||||
Following the [original neovim-flake](https://github.com/jordanisaacs/neovim-flake)
|
||||
**nvf** has been made available under the **MIT License**. However, all assets
|
||||
and documentation are published under the [CC BY License].
|
||||
Following the license of the [original neovim-flake](https://github.com/jordanisaacs/neovim-flake),
|
||||
**nvf** has been made available under the [**MIT License**](LICENSE). However, all assets
|
||||
and documentation are published under the
|
||||
[**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE).
|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ jobs:
|
|||
package:
|
||||
- default
|
||||
- nix
|
||||
- tidal
|
||||
- maximal
|
||||
steps:
|
||||
- uses: easimon/maximize-build-space@v10
|
||||
|
@ -38,7 +37,7 @@ jobs:
|
|||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
|
||||
- uses: cachix/cachix-action@v14
|
||||
- uses: cachix/cachix-action@v15
|
||||
with:
|
||||
authToken: ${{ secrets.CACHIX_TOKEN }}
|
||||
extraPullNames: nix-community
|
||||
|
|
|
@ -15,10 +15,6 @@ inputs: let
|
|||
configuration.imports = modules;
|
||||
};
|
||||
|
||||
tidalConfig = {
|
||||
config.vim.languages.tidal.enable = true;
|
||||
};
|
||||
|
||||
mainConfig = isMaximal: {
|
||||
config.vim = {
|
||||
viAlias = true;
|
||||
|
@ -58,7 +54,16 @@ inputs: let
|
|||
enableTreesitter = true;
|
||||
enableExtraDiagnostics = true;
|
||||
|
||||
# Nim LSP is broken on Darwin and therefore
|
||||
# should be disabled by default. Users may still enable
|
||||
# `vim.languages.vim` to enable it, this does not restrict
|
||||
# that.
|
||||
# See: <https://github.com/PMunch/nimlsp/issues/178#issue-2128106096>
|
||||
nim.enable = false;
|
||||
|
||||
nix.enable = true;
|
||||
|
||||
markdown.enable = isMaximal;
|
||||
html.enable = isMaximal;
|
||||
css.enable = isMaximal;
|
||||
sql.enable = isMaximal;
|
||||
|
@ -66,14 +71,14 @@ inputs: let
|
|||
ts.enable = isMaximal;
|
||||
svelte.enable = isMaximal;
|
||||
go.enable = isMaximal;
|
||||
elixir.enable = isMaximal;
|
||||
zig.enable = isMaximal;
|
||||
ocaml.enable = isMaximal;
|
||||
python.enable = isMaximal;
|
||||
dart.enable = isMaximal;
|
||||
elixir.enable = isMaximal;
|
||||
bash.enable = isMaximal;
|
||||
terraform.enable = isMaximal;
|
||||
nim.enable = false;
|
||||
tailwind.enable = isMaximal;
|
||||
typst.enable = isMaximal;
|
||||
clang = {
|
||||
enable = isMaximal;
|
||||
lsp.server = "clangd";
|
||||
|
@ -81,14 +86,14 @@ inputs: let
|
|||
|
||||
rust = {
|
||||
enable = isMaximal;
|
||||
crates.enable = true;
|
||||
crates.enable = isMaximal;
|
||||
};
|
||||
};
|
||||
|
||||
visuals = {
|
||||
enable = true;
|
||||
nvimWebDevicons.enable = true;
|
||||
scrollBar.enable = true;
|
||||
scrollBar.enable = isMaximal;
|
||||
smoothScroll.enable = true;
|
||||
cellularAutomaton.enable = false;
|
||||
fidget-nvim.enable = true;
|
||||
|
@ -175,7 +180,7 @@ inputs: let
|
|||
|
||||
utility = {
|
||||
ccc.enable = isMaximal;
|
||||
vim-wakatime.enable = isMaximal;
|
||||
vim-wakatime.enable = false;
|
||||
icon-picker.enable = isMaximal;
|
||||
surround.enable = isMaximal;
|
||||
diffview-nvim.enable = true;
|
||||
|
@ -251,5 +256,5 @@ inputs: let
|
|||
};
|
||||
};
|
||||
in {
|
||||
inherit neovimConfiguration mainConfig tidalConfig;
|
||||
inherit neovimConfiguration mainConfig;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,10 @@ configuring.md
|
|||
hacking.md
|
||||
```
|
||||
|
||||
```{=include=} appendix html:into-file=//plugins.html
|
||||
plugins.md
|
||||
```
|
||||
|
||||
```{=include=} appendix html:into-file=//options.html
|
||||
options.md
|
||||
```
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# Plugin specific quirks {#ch-plugins}
|
||||
|
||||
At times, certain plugins refuse to play nicely. Be it as a result of generating
|
||||
lua from Nix, or the state of packaging. This page shall list any plugins that
|
||||
are known to misbehave, and potential workarounds.
|
||||
|
||||
```{=include=} chapters
|
||||
plugins/nodejs.md
|
||||
```
|
||||
<!--
|
||||
If adding a new section, uncomment this part and add your page to
|
||||
plugins/<page>.md
|
||||
```{=include=} chapters
|
||||
plugins/page.md
|
||||
```
|
||||
-->
|
|
@ -0,0 +1,18 @@
|
|||
# NodeJS {#ch-plugins-nodejs}
|
||||
|
||||
## eslint-plugin-prettier {#sec-eslint-plugin-prettier}
|
||||
|
||||
When working with NodeJS, everything works as expected, but some projects have settings that can fool nvf.
|
||||
|
||||
If [this plugin](https://github.com/prettier/eslint-plugin-prettier) or similar is included, you might get a situation where your eslint configuration diagnoses your formatting according to its own config (usually `.eslintrc.js`).
|
||||
|
||||
The issue there is your formatting is made via prettierd.
|
||||
|
||||
This results in auto-formating relying on your prettier config, while your eslint config diagnoses formatting [which it's not supposed to](https://prettier.io/docs/en/comparison.html))
|
||||
|
||||
In the end, you get discrepancies between what your editor does and what it wants.
|
||||
|
||||
Solutions are:
|
||||
|
||||
1. Don't add a formatting config to eslint, and separate prettier and eslint.
|
||||
2. PR this repo to add an ESLint formatter and configure nvf to use it.
|
|
@ -5,7 +5,6 @@ Below are the commands you may run to try out different configurations provided
|
|||
configurations are provided:
|
||||
|
||||
- Nix
|
||||
- Tidal
|
||||
- Maximal
|
||||
|
||||
You may try out any of the provided configurations using the `nix run` command on a system where Nix is installed.
|
||||
|
@ -22,7 +21,6 @@ once you garbage collect.
|
|||
|
||||
```console
|
||||
$ nix run github:notashelf/nvf#nix
|
||||
$ nix run github:notashelf/nvf#tidal
|
||||
$ nix run github:notashelf/nvf#maximal
|
||||
```
|
||||
|
||||
|
@ -33,10 +31,6 @@ $ nix run github:notashelf/nvf#maximal
|
|||
`Nix` configuration by default provides LSP/diagnostic support for Nix alongisde a set of visual and functional plugins.
|
||||
By running `nix run .#`, which is the default package, you will build Neovim with this config.
|
||||
|
||||
#### Tidal {#sec-configs-tidal}
|
||||
|
||||
Tidal is an alternative config that adds vim-tidal on top of the plugins from the Nix configuration.
|
||||
|
||||
#### Maximal {#sec-configs-maximal}
|
||||
|
||||
`Maximal` is the ultimate configuration that will enable support for more commonly used language as well as additional
|
||||
|
|
|
@ -10,4 +10,5 @@ rl-0.3.md
|
|||
rl-0.4.md
|
||||
rl-0.5.md
|
||||
rl-0.6.md
|
||||
rl-0.7.md
|
||||
```
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
# Release 0.7 {#sec-release-0.7}
|
||||
|
||||
Release notes for release 0.7
|
||||
|
||||
## Changelog {#sec-release-0.7-changelog}
|
||||
|
||||
[ItsSorae](https://github.com/ItsSorae):
|
||||
|
||||
- Add support for [typst](https://typst.app/) under `vim.languages.typst` This
|
||||
will enable the `typst-lsp` language server, and the `typstfmt` formatter
|
||||
|
||||
[frothymarrow](https://github.com/frothymarrow):
|
||||
|
||||
- Modified type for
|
||||
[](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides) from
|
||||
`anything` to a `submodule` for better type checking.
|
||||
- Fix null `vim.lsp.mappings` generating an error and not being filtered out.
|
||||
- Add basic transparency support for `oxocarbon` theme by setting the
|
||||
highlight group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and
|
||||
optionally `NvimTreeNormal` to `none`.
|
||||
|
||||
[horriblename](https://github.com/horriblename):
|
||||
|
||||
- Fix broken treesitter-context keybinds in visual mode
|
||||
- Depcrecate use of `__empty` to define empty tables in lua. Empty attrset are
|
||||
no longer filtered and thus should be used instead.
|
||||
|
||||
[NotAShelf](https://github.com/notashelf)
|
||||
|
||||
- Add `deno fmt` as the default Markdown formatter. This will be enabled
|
||||
automatically if you have autoformatting enabled, but can be disabled manually
|
||||
if you choose to.
|
||||
|
||||
- Add `vim.extraLuaFiles` for optionally sourcing additional lua files in your
|
||||
configuration.
|
||||
|
||||
- Refactor `programs.languages.elixir` to use lspconfig and none-ls for LSP and
|
||||
formatter setups respectively. Diagnostics support is considered, and may be
|
||||
added once the [credo](https://github.com/rrrene/credo) linter has been added
|
||||
to nixpkgs. A pull request is currently open.
|
||||
|
||||
- Remove vim-tidal and friends
|
||||
|
||||
- Clean up Lualine module to reduce theme dependency on Catppuccin, and fixed
|
||||
blending issues in component separators.
|
||||
|
||||
[jacekpoz](https://github.com/jacekpoz):
|
||||
|
||||
- Add [ocaml-lsp](https://github.com/ocaml/ocaml-lsp) support.
|
||||
|
||||
- Fix Emac typo
|
527
flake.lock
527
flake.lock
File diff suppressed because it is too large
Load Diff
40
flake.nix
40
flake.nix
|
@ -30,7 +30,7 @@
|
|||
neovim-flake =
|
||||
nixpkgs.lib.warn ''
|
||||
homeManagerModules.neovim-flake has been deprecated.
|
||||
Plese use the homeManagereModules.nvf instead
|
||||
Plese use the homeManagerModules.nvf instead
|
||||
''
|
||||
self.homeManagerModules.nvf;
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
|||
nixosModules.neovim-flake has been deprecated.
|
||||
Please use the nixosModules.nvf instead
|
||||
''
|
||||
self.nixosModules.neovim-flake;
|
||||
self.nixosModules.nvf;
|
||||
|
||||
nvf = {
|
||||
imports = [(import ./flake/modules/nixos.nix self.packages inputs)];
|
||||
|
@ -76,7 +76,8 @@
|
|||
|
||||
# Flake inputs
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
## Basic Inputs
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
systems.url = "github:nix-systems/default";
|
||||
|
@ -98,13 +99,7 @@
|
|||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
|
||||
### Plugins
|
||||
# Tidal cycles
|
||||
tidalcycles = {
|
||||
url = "github:mitchmindtree/tidalcycles.nix";
|
||||
inputs.vim-tidal-src.url = "github:tidalcycles/vim-tidal";
|
||||
};
|
||||
|
||||
## Plugins
|
||||
# LSP plugins
|
||||
plugin-nvim-lspconfig = {
|
||||
url = "github:neovim/nvim-lspconfig";
|
||||
|
@ -183,26 +178,11 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
plugin-elixir-ls = {
|
||||
url = "github:elixir-lsp/elixir-ls";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-elixir-tools = {
|
||||
url = "github:elixir-tools/elixir-tools.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-glow-nvim = {
|
||||
url = "github:ellisonleao/glow.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-image-nvim = {
|
||||
url = "github:3rd/image.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Copying/Registers
|
||||
plugin-registers = {
|
||||
url = "github:tversteeg/registers.nvim";
|
||||
|
@ -502,6 +482,16 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
plugin-glow-nvim = {
|
||||
url = "github:ellisonleao/glow.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-image-nvim = {
|
||||
url = "github:3rd/image.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Note-taking
|
||||
plugin-obsidian-nvim = {
|
||||
url = "github:epwalsh/obsidian.nvim";
|
||||
|
|
|
@ -1,21 +1,11 @@
|
|||
{lib, ...}: {
|
||||
perSystem = {
|
||||
system,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
apps =
|
||||
{
|
||||
nix.program = lib.getExe config.packages.nix;
|
||||
maximal.program = lib.getExe config.packages.maximal;
|
||||
default = config.apps.nix;
|
||||
}
|
||||
// (
|
||||
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
|
||||
then {
|
||||
tidal.program = lib.getExe config.packages.tidal;
|
||||
}
|
||||
else {}
|
||||
);
|
||||
{lib, ...}: let
|
||||
inherit (lib.meta) getExe;
|
||||
in {
|
||||
perSystem = {config, ...}: {
|
||||
apps = {
|
||||
nix.program = getExe config.packages.nix;
|
||||
maximal.program = getExe config.packages.maximal;
|
||||
default = config.apps.nix;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
legacyPackages = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
inputs.tidalcycles.overlays.default
|
||||
inputs.self.overlays.default
|
||||
(_: _: {
|
||||
rnix-lsp = inputs'.rnix-lsp.defaultPackage;
|
||||
|
|
|
@ -6,12 +6,12 @@ packages: inputs: {
|
|||
...
|
||||
}: let
|
||||
inherit (lib) maintainers;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.modules) mkIf mkAliasOptionModule;
|
||||
inherit (lib.lists) optional;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) attrsOf anything bool;
|
||||
|
||||
cfg = config.programs.neovim-flake;
|
||||
cfg = config.programs.nvf;
|
||||
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
||||
|
||||
neovimConfigured = neovimConfiguration {
|
||||
|
@ -19,22 +19,26 @@ packages: inputs: {
|
|||
modules = [cfg.settings];
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
(mkAliasOptionModule ["programs" "neovim-flake"] ["programs" "nvf"])
|
||||
];
|
||||
|
||||
meta.maintainers = with maintainers; [NotAShelf];
|
||||
|
||||
options.programs.neovim-flake = {
|
||||
enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper";
|
||||
options.programs.nvf = {
|
||||
enable = mkEnableOption "nvf, the extensible neovim configuration wrapper";
|
||||
|
||||
enableManpages = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Whether to enable manpages for neovim-flake.";
|
||||
description = "Whether to enable manpages for nvf.";
|
||||
};
|
||||
|
||||
defaultEditor = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to set `neovim-flake` as the default editor.
|
||||
Whether to set `nvf` as the default editor.
|
||||
|
||||
This will set the `EDITOR` environment variable as `nvim`
|
||||
if set to true.
|
||||
|
@ -46,14 +50,14 @@ in {
|
|||
visible = false;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The built neovim-flake package, wrapped with the user's configuration.
|
||||
The built nvf package, wrapped with the user's configuration.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = attrsOf anything;
|
||||
default = {};
|
||||
description = "Attribute set of neovim-flake preferences.";
|
||||
description = "Attribute set of nvf preferences.";
|
||||
example = literalExpression ''
|
||||
{
|
||||
vim.viAlias = false;
|
||||
|
@ -75,7 +79,7 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
|
||||
programs.nvf.finalPackage = neovimConfigured.neovim;
|
||||
|
||||
home = {
|
||||
sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";};
|
||||
|
|
|
@ -6,12 +6,12 @@ packages: inputs: {
|
|||
...
|
||||
}: let
|
||||
inherit (lib) maintainers;
|
||||
inherit (lib.modules) mkIf mkOverride;
|
||||
inherit (lib.modules) mkIf mkOverride mkAliasOptionModule;
|
||||
inherit (lib.lists) optional;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) attrsOf anything bool;
|
||||
|
||||
cfg = config.programs.neovim-flake;
|
||||
cfg = config.programs.nvf;
|
||||
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
||||
|
||||
neovimConfigured = neovimConfiguration {
|
||||
|
@ -19,22 +19,26 @@ packages: inputs: {
|
|||
modules = [cfg.settings];
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
(mkAliasOptionModule ["programs" "neovim-flake"] ["programs" "nvf"])
|
||||
];
|
||||
|
||||
meta.maintainers = with maintainers; [NotAShelf];
|
||||
|
||||
options.programs.neovim-flake = {
|
||||
enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper";
|
||||
options.programs.nvf = {
|
||||
enable = mkEnableOption "nvf, the extensible neovim configuration wrapper";
|
||||
|
||||
enableManpages = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Whether to enable manpages for neovim-flake.";
|
||||
description = "Whether to enable manpages for nvf.";
|
||||
};
|
||||
|
||||
defaultEditor = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to set `neovim-flake` as the default editor.
|
||||
Whether to set `nvf` as the default editor.
|
||||
|
||||
This will set the `EDITOR` environment variable as `nvim`
|
||||
if set to true.
|
||||
|
@ -46,14 +50,14 @@ in {
|
|||
visible = false;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The built neovim-flake package, wrapped with the user's configuration.
|
||||
The built nvf package, wrapped with the user's configuration.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = attrsOf anything;
|
||||
default = {};
|
||||
description = "Attribute set of neovim-flake preferences.";
|
||||
description = "Attribute set of nvf preferences.";
|
||||
example = literalExpression ''
|
||||
{
|
||||
vim.viAlias = false;
|
||||
|
@ -75,7 +79,7 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
|
||||
programs.nvf.finalPackage = neovimConfigured.neovim;
|
||||
|
||||
environment = {
|
||||
variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "nvim");
|
||||
|
|
|
@ -9,13 +9,11 @@
|
|||
|
||||
nixConfig = mainConfig false;
|
||||
maximalConfig = mainConfig true;
|
||||
tidalConfig = {config.vim.tidal.enable = true;};
|
||||
in {
|
||||
flake.overlays.default = _final: prev: {
|
||||
inherit neovimConfiguration;
|
||||
neovim-nix = buildPkg prev [nixConfig];
|
||||
neovim-maximal = buildPkg prev [maximalConfig];
|
||||
neovim-tidal = buildPkg prev [tidalConfig];
|
||||
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,56 +7,50 @@
|
|||
}: let
|
||||
docs = import ../docs {inherit pkgs inputs;};
|
||||
in {
|
||||
packages =
|
||||
{
|
||||
# Documentation
|
||||
docs = docs.manual.html;
|
||||
docs-html = docs.manual.html;
|
||||
docs-manpages = docs.manPages;
|
||||
docs-json = docs.options.json;
|
||||
packages = {
|
||||
# Documentation
|
||||
docs = docs.manual.html;
|
||||
docs-html = docs.manual.html;
|
||||
docs-manpages = docs.manPages;
|
||||
docs-json = docs.options.json;
|
||||
|
||||
# Build and open the built manual in your system browser
|
||||
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
# use xdg-open to open the docs in the browser
|
||||
${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html}
|
||||
'';
|
||||
# Build and open the built manual in your system browser
|
||||
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
# use xdg-open to open the docs in the browser
|
||||
${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html}
|
||||
'';
|
||||
|
||||
# Exposed neovim configurations
|
||||
nix = config.legacyPackages.neovim-nix;
|
||||
maximal = config.legacyPackages.neovim-maximal;
|
||||
default = config.legacyPackages.neovim-nix;
|
||||
# Exposed neovim configurations
|
||||
nix = config.legacyPackages.neovim-nix;
|
||||
maximal = config.legacyPackages.neovim-maximal;
|
||||
default = config.legacyPackages.neovim-nix;
|
||||
|
||||
# Published docker images
|
||||
docker-nix = let
|
||||
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
||||
inherit (config.legacyPackages) neovim-nix;
|
||||
in
|
||||
dockerTools.buildImage {
|
||||
name = "nvf";
|
||||
tag = "latest";
|
||||
# Published docker images
|
||||
docker-nix = let
|
||||
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
||||
inherit (config.legacyPackages) neovim-nix;
|
||||
in
|
||||
dockerTools.buildImage {
|
||||
name = "nvf";
|
||||
tag = "latest";
|
||||
|
||||
copyToRoot = buildEnv {
|
||||
name = "neovim-root";
|
||||
pathsToLink = ["/bin"];
|
||||
paths = [
|
||||
neovim-nix
|
||||
gitFull
|
||||
bash
|
||||
];
|
||||
};
|
||||
|
||||
config = {
|
||||
Cmd = ["${neovim-nix}/bin/nvim"];
|
||||
WorkingDir = "/home/neovim/demo";
|
||||
Volumes = {"/home/neovim/demo" = {};};
|
||||
};
|
||||
copyToRoot = buildEnv {
|
||||
name = "neovim-root";
|
||||
pathsToLink = ["/bin"];
|
||||
paths = [
|
||||
neovim-nix
|
||||
gitFull
|
||||
bash
|
||||
];
|
||||
};
|
||||
}
|
||||
// (
|
||||
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
|
||||
then {tidal = config.legacyPackages.neovim-tidal;}
|
||||
else {}
|
||||
);
|
||||
|
||||
config = {
|
||||
Cmd = ["${neovim-nix}/bin/nvim"];
|
||||
WorkingDir = "/home/neovim/demo";
|
||||
Volumes = {"/home/neovim/demo" = {};};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
|
||||
inherit (lib.attrsets) mapAttrsToList filterAttrs;
|
||||
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.trivial) boolToString warn;
|
||||
in rec {
|
||||
wrapLuaConfig = {
|
||||
luaBefore ? "",
|
||||
|
@ -66,7 +66,10 @@ in rec {
|
|||
if isLuaInline args
|
||||
then args.expr
|
||||
else if hasAttr "__empty" args
|
||||
then "{ }"
|
||||
then
|
||||
warn ''
|
||||
Using `__empty` to define an empty lua table is deprecated. Use an empty attrset instead.
|
||||
'' "{ }"
|
||||
else
|
||||
"{"
|
||||
+ (concatStringsSep ","
|
||||
|
|
|
@ -25,7 +25,7 @@ inputs: {
|
|||
# check can be disabled while calling this file is called
|
||||
# to avoid checking in all modules
|
||||
nvimModules = import ./modules.nix {
|
||||
inherit check pkgs;
|
||||
inherit pkgs check;
|
||||
lib = extendedLib;
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRemovedOptionModule;
|
||||
in {
|
||||
imports = [
|
||||
# 2024-06-06
|
||||
(mkRemovedOptionModule ["vim" "tidal"] ''
|
||||
Tidalcycles language support has been removed as of 2024-06-06 as it was long unmaintained. If
|
||||
you depended on this functionality, please open an issue.
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
check ? true,
|
||||
pkgs,
|
||||
lib,
|
||||
check ? true,
|
||||
}: let
|
||||
inherit (lib.modules) mkDefault;
|
||||
inherit (lib.lists) concatLists;
|
||||
|
@ -53,7 +53,13 @@
|
|||
"warnings"
|
||||
];
|
||||
|
||||
allModules = concatLists [neovim plugins wrapper];
|
||||
# Extra modules, such as deprecation warnings
|
||||
# or renames in one place.
|
||||
extra = map (p: ./extra + "/${p}") [
|
||||
"deprecations.nix"
|
||||
];
|
||||
|
||||
allModules = concatLists [neovim plugins wrapper extra];
|
||||
|
||||
pkgsModule = {config, ...}: {
|
||||
config = {
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) enum either package listOf str bool;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
|
||||
cfg = config.vim.languages.bash;
|
||||
|
||||
|
@ -55,6 +57,7 @@
|
|||
ls_sources,
|
||||
null_ls.builtins.diagnostics.shellcheck.with({
|
||||
command = "${pkg}/bin/shellcheck",
|
||||
diagnostics_format = "#{m} [#{c}]"
|
||||
})
|
||||
)
|
||||
'';
|
||||
|
@ -114,4 +117,30 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.bash-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources.bash-format = formats.${cfg.format.type}.nullConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||
lang = "bash";
|
||||
config = cfg.extraDiagnostics.types;
|
||||
inherit diagnosticsProviders;
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||
|
||||
cfg = config.vim.languages.bash;
|
||||
diagnosticsProviders = {
|
||||
shellcheck = {
|
||||
package = pkgs.shellcheck;
|
||||
nullConfig = pkg: ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.diagnostics.shellcheck.with({
|
||||
command = "${pkg}/bin/shellcheck",
|
||||
})
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
formats = {
|
||||
shfmt = {
|
||||
package = pkgs.shfmt;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
command = "${pkgs.shfmt}/bin/shfmt",
|
||||
})
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
servers = {
|
||||
bash-ls = {
|
||||
package = pkgs.nodePackages.bash-language-server;
|
||||
lspConfig = ''
|
||||
lspconfig.bashls.setup{
|
||||
capabilities = capabilities;
|
||||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/bash-language-server", "start"}''
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.bash-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources.bash-format = formats.${cfg.format.type}.nullConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||
lang = "bash";
|
||||
config = cfg.extraDiagnostics.types;
|
||||
inherit diagnosticsProviders;
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
./bash.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
defaultServer = "vscode-langservers-extracted";
|
||||
servers = {
|
||||
vscode-langservers-extracted = {
|
||||
package = pkgs.nodePackages.vscode-langservers-extracted;
|
||||
package = pkgs.vscode-langservers-extracted;
|
||||
lspConfig = ''
|
||||
-- enable (broadcasting) snippet capability for completion
|
||||
-- see <https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#cssls>
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum either listOf package nullOr str bool;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.languages.dart;
|
||||
ftcfg = cfg.flutter-tools;
|
||||
|
||||
defaultServer = "dart";
|
||||
servers = {
|
||||
dart = {
|
||||
|
@ -48,15 +53,16 @@ in {
|
|||
default = defaultServer;
|
||||
};
|
||||
package = mkOption {
|
||||
description = "Dart LSP server package, or the command to run as a list of strings";
|
||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||
description = "Dart LSP server package, or the command to run as a list of strings";
|
||||
};
|
||||
|
||||
opts = mkOption {
|
||||
description = "Options to pass to Dart LSP server";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Options to pass to Dart LSP server";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -70,23 +76,26 @@ in {
|
|||
|
||||
flutter-tools = {
|
||||
enable = mkOption {
|
||||
description = "Enable flutter-tools for flutter support";
|
||||
type = bool;
|
||||
default = config.vim.languages.enableLSP;
|
||||
description = "Enable flutter-tools for flutter support";
|
||||
};
|
||||
|
||||
enableNoResolvePatch = mkOption {
|
||||
description = ''
|
||||
Patch flutter-tools so that it doesn't resolve symlinks when detecting flutter path.
|
||||
This is required if you want to use a flutter package built with nix.
|
||||
If you are using a flutter SDK installed from a different source and encounter the error "`dart` missing from PATH", disable this option.
|
||||
'';
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to patch flutter-tools so that it doesn't resolve
|
||||
symlinks when detecting flutter path.
|
||||
|
||||
This is required if you want to use a flutter package built with nix.
|
||||
If you are using a flutter SDK installed from a different source
|
||||
and encounter the error "`dart` missing from PATH", disable this option.
|
||||
'';
|
||||
};
|
||||
|
||||
color = {
|
||||
enable = mkEnableOption "Whether or mot to highlight color variables at all";
|
||||
enable = mkEnableOption "highlighting color variables";
|
||||
|
||||
highlightBackground = mkOption {
|
||||
type = bool;
|
||||
|
@ -112,4 +121,47 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
|
||||
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
|
||||
(mkIf ftcfg.enable {
|
||||
vim.startPlugins =
|
||||
if ftcfg.enableNoResolvePatch
|
||||
then ["flutter-tools-patched"]
|
||||
else ["flutter-tools"];
|
||||
|
||||
vim.luaConfigRC.flutter-tools = entryAnywhere ''
|
||||
require('flutter-tools').setup {
|
||||
lsp = {
|
||||
color = { -- show the derived colours for dart variables
|
||||
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
||||
background = ${boolToString ftcfg.color.highlightBackground}, -- highlight the background
|
||||
foreground = ${boolToString ftcfg.color.highlightForeground}, -- highlight the foreground
|
||||
virtual_text = ${boolToString ftcfg.color.virtualText.enable}, -- show the highlight using virtual text
|
||||
virtual_text_str = ${ftcfg.color.virtualText.character} -- the virtual text character to highlight
|
||||
},
|
||||
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach;
|
||||
flags = lsp_flags,
|
||||
},
|
||||
${optionalString cfg.dap.enable ''
|
||||
debugger = {
|
||||
enabled = true,
|
||||
},
|
||||
''}
|
||||
}
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.languages.dart;
|
||||
ftcfg = cfg.flutter-tools;
|
||||
servers = {
|
||||
dart = {
|
||||
package = pkgs.dart;
|
||||
lspConfig = ''
|
||||
lspconfig.dartls.setup{
|
||||
capabilities = capabilities;
|
||||
on_attach=default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/dart", "language-server", "--protocol=lsp"}''
|
||||
};
|
||||
${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.dartOpts}"}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
|
||||
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
|
||||
(mkIf ftcfg.enable {
|
||||
vim.startPlugins =
|
||||
if ftcfg.enableNoResolvePatch
|
||||
then ["flutter-tools-patched"]
|
||||
else ["flutter-tools"];
|
||||
|
||||
vim.luaConfigRC.flutter-tools = entryAnywhere ''
|
||||
require('flutter-tools').setup {
|
||||
lsp = {
|
||||
color = { -- show the derived colours for dart variables
|
||||
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
||||
background = ${boolToString ftcfg.color.highlightBackground}, -- highlight the background
|
||||
foreground = ${boolToString ftcfg.color.highlightForeground}, -- highlight the foreground
|
||||
virtual_text = ${boolToString ftcfg.color.virtualText.enable}, -- show the highlight using virtual text
|
||||
virtual_text_str = ${ftcfg.color.virtualText.character} -- the virtual text character to highlight
|
||||
},
|
||||
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach;
|
||||
flags = lsp_flags,
|
||||
},
|
||||
${optionalString cfg.dap.enable ''
|
||||
debugger = {
|
||||
enabled = true,
|
||||
},
|
||||
''}
|
||||
}
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
./dart.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
|
@ -2,20 +2,19 @@
|
|||
inherit (lib.nvim.languages) mkEnable;
|
||||
in {
|
||||
imports = [
|
||||
./bash
|
||||
./dart
|
||||
./elixir
|
||||
./markdown
|
||||
./tidal
|
||||
|
||||
./bash.nix
|
||||
./dart.nix
|
||||
./clang.nix
|
||||
./css.nix
|
||||
./elixir.nix
|
||||
./go.nix
|
||||
./html.nix
|
||||
./java.nix
|
||||
./lua.nix
|
||||
./markdown.nix
|
||||
./nim.nix
|
||||
./nix.nix
|
||||
./ocaml.nix
|
||||
./php.nix
|
||||
./python.nix
|
||||
./rust.nix
|
||||
|
@ -24,6 +23,7 @@ in {
|
|||
./tailwind.nix
|
||||
./terraform.nix
|
||||
./ts.nix
|
||||
./typst.nix
|
||||
./zig.nix
|
||||
];
|
||||
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) enum either listOf package str;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.languages.elixir;
|
||||
|
||||
defaultServer = "elixirls";
|
||||
servers = {
|
||||
elixirls = {
|
||||
package = pkgs.elixir-ls;
|
||||
lspConfig = ''
|
||||
-- elixirls setup
|
||||
lspconfig.elixirls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/elixir-ls"}''
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = "mix";
|
||||
formats = {
|
||||
mix = {
|
||||
package = pkgs.elixir;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.mix.with({
|
||||
command = "${cfg.format.package}/bin/mix",
|
||||
})
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.elixir = {
|
||||
enable = mkEnableOption "Elixir language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Elixir treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "elixir";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Elixir LSP support" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
server = mkOption {
|
||||
description = "Elixir LSP server to use";
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Elixir LSP server package, or the command to run as a list of strings";
|
||||
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkEnableOption "Elixir formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
description = "Elixir formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Elixir formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
||||
elixir-tools = {
|
||||
enable = mkEnableOption "Elixir tools";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.elixir-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources.elixir-format = formats.${cfg.format.type}.nullConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.elixir-tools.enable {
|
||||
vim.startPlugins = ["elixir-tools"];
|
||||
vim.luaConfigRC.elixir-tools = entryAnywhere ''
|
||||
local elixir-tools = require("elixir")
|
||||
local elixirls = require("elixir-tools.elixirls")
|
||||
|
||||
-- disable imperative insstallations of various
|
||||
-- elixir related tools installed by elixir-tools
|
||||
elixir-tools.setup {
|
||||
nextls = {
|
||||
enable = false -- defaults to false
|
||||
},
|
||||
|
||||
credo = {
|
||||
enable = false -- defaults to true
|
||||
},
|
||||
|
||||
elixirls = {
|
||||
enable = false, -- defaults to true
|
||||
}
|
||||
}
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.languages.elixir;
|
||||
in {
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = [
|
||||
"elixir-tools"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.elixir-tools = entryAnywhere ''
|
||||
local elixir = require("elixir")
|
||||
local elixirls = require("elixir.elixirls")
|
||||
|
||||
elixir.setup {
|
||||
elixirls = {
|
||||
-- alternatively, point to an existing elixir-ls installation (optional)
|
||||
-- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}`
|
||||
cmd = "${getExe pkgs.elixir-ls}",
|
||||
|
||||
-- default settings, use the `settings` function to override settings
|
||||
settings = elixirls.settings {
|
||||
dialyzerEnabled = true,
|
||||
fetchDeps = false,
|
||||
enableTestLenses = false,
|
||||
suggestSpecs = false,
|
||||
},
|
||||
|
||||
on_attach = function(client, bufnr)
|
||||
local map_opts = { buffer = true, noremap = true}
|
||||
|
||||
-- run the codelens under the cursor
|
||||
vim.keymap.set("n", "<space>r", vim.lsp.codelens.run, map_opts)
|
||||
-- remove the pipe operator
|
||||
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", map_opts)
|
||||
-- add the pipe operator
|
||||
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", map_opts)
|
||||
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", map_opts)
|
||||
|
||||
-- bindings for standard LSP functions.
|
||||
vim.keymap.set("n", "<space>df", "<cmd>lua vim.lsp.buf.format()<cr>", map_opts)
|
||||
vim.keymap.set("n", "<space>gd", "<cmd>lua vim.diagnostic.open_float()<cr>", map_opts)
|
||||
vim.keymap.set("n", "<space>dt", "<cmd>lua vim.lsp.buf.definition()<cr>", map_opts)
|
||||
vim.keymap.set("n", "<space>K", "<cmd>lua vim.lsp.buf.hover()<cr>", map_opts)
|
||||
vim.keymap.set("n", "<space>gD","<cmd>lua vim.lsp.buf.implementation()<cr>", map_opts)
|
||||
vim.keymap.set("n", "<space>1gD","<cmd>lua vim.lsp.buf.type_definition()<cr>", map_opts)
|
||||
|
||||
-- keybinds for fzf-lsp.nvim: https://github.com/gfanto/fzf-lsp.nvim
|
||||
-- you could also use telescope.nvim: https://github.com/nvim-telescope/telescope.nvim
|
||||
-- there are also core vim.lsp functions that put the same data in the loclist
|
||||
vim.keymap.set("n", "<space>gr", ":References<cr>", map_opts)
|
||||
vim.keymap.set("n", "<space>g0", ":DocumentSymbols<cr>", map_opts)
|
||||
vim.keymap.set("n", "<space>gW", ":WorkspaceSymbols<cr>", map_opts)
|
||||
vim.keymap.set("n", "<leader>d", ":Diagnostics<cr>", map_opts)
|
||||
end
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./elixir-tools.nix
|
||||
];
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.languages.elixir = {
|
||||
enable = mkEnableOption "Elixir language support";
|
||||
};
|
||||
}
|
|
@ -4,7 +4,8 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (builtins) attrNames concatLists;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) bool enum either package listOf str;
|
||||
|
@ -29,15 +30,31 @@
|
|||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = "denofmt";
|
||||
formats = {
|
||||
denofmt = {
|
||||
package = pkgs.deno;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.deno_fmt.with({
|
||||
filetypes = ${expToLua (concatLists [cfg.format.extraFiletypes ["markdown"]])},
|
||||
command = "${cfg.format.package}/bin/deno",
|
||||
})
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.markdown = {
|
||||
enable = mkEnableOption "Markdown markup language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkOption {
|
||||
description = "Enable Markdown treesitter";
|
||||
type = bool;
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
description = "Enable Markdown treesitter";
|
||||
};
|
||||
mdPackage = mkGrammarOption pkgs "markdown";
|
||||
mdInlinePackage = mkGrammarOption pkgs "markdown-inline";
|
||||
|
@ -47,17 +64,56 @@ in {
|
|||
enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
server = mkOption {
|
||||
description = "Markdown LSP server to use";
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
description = "Markdown LSP server to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Markdown LSP server package, or the command to run as a list of strings";
|
||||
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
|
||||
description = "Markdown LSP server package, or the command to run as a list of strings";
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkEnableOption "Markdown formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
description = "Markdown formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Markdown formatter package";
|
||||
};
|
||||
|
||||
extraFiletypes = mkOption {
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = "Extra filetypes to format with the Markdown formatter";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.markdown-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources.markdown-format = formats.${cfg.format.type}.nullConfig;
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.lists) isList;
|
||||
|
||||
cfg = config.vim.languages.markdown;
|
||||
servers = {
|
||||
marksman = {
|
||||
package = pkgs.marksman;
|
||||
lspConfig = ''
|
||||
lspconfig.marksman.setup{
|
||||
capabilities = capabilities;
|
||||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/marksman", "server"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.markdown-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./config.nix
|
||||
./markdown.nix
|
||||
];
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) either enum listOf package str;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
|
||||
cfg = config.vim.languages.ocaml;
|
||||
|
||||
defaultServer = "ocaml-lsp";
|
||||
servers = {
|
||||
ocaml-lsp = {
|
||||
package = pkgs.ocamlPackages.ocaml-lsp;
|
||||
lspConfig = ''
|
||||
lspconfig.ocamllsp.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${getExe cfg.lsp.package}"}''
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = "ocamlformat";
|
||||
formats = {
|
||||
ocamlformat = {
|
||||
package = pkgs.ocamlPackages.ocamlformat;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.ocamlformat.with({
|
||||
command = "${cfg.format.package}/bin/ocamlformat",
|
||||
})
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.ocaml = {
|
||||
enable = mkEnableOption "OCaml language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "OCaml treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "ocaml";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "OCaml LSP support (ocaml-lsp)" // {default = config.vim.languages.enableLSP;};
|
||||
server = mkOption {
|
||||
description = "OCaml LSP server to user";
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
package = mkOption {
|
||||
description = "OCaml language server package, or the command to run as a list of strings";
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkEnableOption "OCaml formatting support (ocamlformat)" // {default = config.vim.languages.enableFormat;};
|
||||
type = mkOption {
|
||||
description = "OCaml formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
package = mkOption {
|
||||
description = "OCaml formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.ocaml-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources.ocamlformat = formats.${cfg.format.type}.nullConfig;
|
||||
vim.extraPackages = [formats.${cfg.format.type}.package];
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
defaultServer = "pyright";
|
||||
servers = {
|
||||
pyright = {
|
||||
package = pkgs.nodePackages.pyright;
|
||||
package = pkgs.pyright;
|
||||
lspConfig = ''
|
||||
lspconfig.pyright.setup{
|
||||
capabilities = capabilities;
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
defaultDiagnosticsProvider = ["eslint_d"];
|
||||
diagnosticsProviders = {
|
||||
eslint_d = {
|
||||
package = pkgs.nodePackages.eslint_d;
|
||||
package = pkgs.eslint_d;
|
||||
nullConfig = pkg: ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
cfg = config.vim.tidal;
|
||||
in {
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = [
|
||||
# From tidalcycles flake
|
||||
pkgs.vimPlugins.vim-tidal
|
||||
];
|
||||
|
||||
vim.globals = {
|
||||
"tidal_target" = "terminal";
|
||||
"tidal_flash_duration" = 150;
|
||||
"tidal_sc_enable" = cfg.openSC;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./tidal.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) int bool;
|
||||
in {
|
||||
options.vim.tidal = {
|
||||
enable = mkEnableOption "tidalcycles tools and plugins";
|
||||
|
||||
flash = mkOption {
|
||||
description = ''When sending a paragraph or a single line, vim-tidal will "flash" the selection for some milliseconds'';
|
||||
type = int;
|
||||
default = 150;
|
||||
};
|
||||
|
||||
openSC = mkOption {
|
||||
description = "Automatically run the supercollider CLI, sclang, alongside the Tidal GHCI terminal.";
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -80,7 +80,7 @@
|
|||
defaultDiagnosticsProvider = ["eslint_d"];
|
||||
diagnosticsProviders = {
|
||||
eslint_d = {
|
||||
package = pkgs.nodePackages.eslint_d;
|
||||
package = pkgs.eslint_d;
|
||||
nullConfig = pkg: ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) enum either listOf package str;
|
||||
inherit (lib.attrsets) attrNames;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.typst;
|
||||
|
||||
defaultFormat = "typstfmt";
|
||||
formats = {
|
||||
typstfmt = {
|
||||
package = pkgs.typstfmt;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.typstfmt.with({
|
||||
command = "${cfg.format.package}/bin/typstfmt",
|
||||
})
|
||||
)
|
||||
'';
|
||||
};
|
||||
# https://github.com/Enter-tainer/typstyle
|
||||
typstyle = {
|
||||
package = pkgs.typstyle;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.typstfmt.with({
|
||||
command = "${cfg.format.package}/bin/typstyle",
|
||||
})
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.typst = {
|
||||
enable = mkEnableOption "Typst language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Typst treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "typst";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
package = mkOption {
|
||||
description = "typst-lsp package, or the command to run as a list of strings";
|
||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||
type = either package (listOf str);
|
||||
default = pkgs.typst-lsp;
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkEnableOption "Typst document formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
description = "Typst formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Typst formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.typst-lsp = ''
|
||||
lspconfig.typst_lsp.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach=default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -16,7 +16,10 @@
|
|||
|
||||
mappingDefinitions = self.options.vim.lsp.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
mkBinding = binding: action: "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', '<cmd>lua ${action}<CR>', {noremap=true, silent=true, desc='${binding.description}'})";
|
||||
mkBinding = binding: action:
|
||||
if binding.value != null
|
||||
then "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', '<cmd>lua ${action}<CR>', {noremap=true, silent=true, desc='${binding.description}'})"
|
||||
else "";
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.attrsets) mapAttrs;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.nvim.dag) entryAnywhere entryAfter entryBetween;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
|
@ -12,26 +13,36 @@ in {
|
|||
config = mkIf cfg.null-ls.enable (mkMerge [
|
||||
{
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"none-ls"
|
||||
"plenary-nvim"
|
||||
];
|
||||
|
||||
# null-ls implies LSP already being set up
|
||||
# since it will hook into LSPs to receive information
|
||||
lsp.enable = true;
|
||||
startPlugins = ["none-ls"];
|
||||
|
||||
luaConfigRC.null_ls-setup = entryAnywhere ''
|
||||
local null_ls = require("null-ls")
|
||||
local null_helpers = require("null-ls.helpers")
|
||||
local null_methods = require("null-ls.methods")
|
||||
local ls_sources = {}
|
||||
'';
|
||||
luaConfigRC = {
|
||||
# early setup for null-ls
|
||||
null_ls-setup = entryAnywhere ''
|
||||
local null_ls = require("null-ls")
|
||||
local null_helpers = require("null-ls.helpers")
|
||||
local null_methods = require("null-ls.methods")
|
||||
local ls_sources = {}
|
||||
'';
|
||||
|
||||
luaConfigRC.null_ls = entryAfter ["null_ls-setup" "lsp-setup"] ''
|
||||
require('null-ls').setup({
|
||||
debug = false,
|
||||
diagnostics_format = "[#{m}] #{s} (#{c})",
|
||||
debounce = 250,
|
||||
default_timeout = 5000,
|
||||
sources = ls_sources,
|
||||
on_attach = default_on_attach
|
||||
})
|
||||
'';
|
||||
# null-ls setup
|
||||
null_ls = entryAfter ["null_ls-setup" "lsp-setup"] ''
|
||||
require('null-ls').setup({
|
||||
debug = ${boolToString cfg.null-ls.debug},
|
||||
diagnostics_format = "${cfg.null-ls.diagnostics_format}",
|
||||
debounce = ${toString cfg.null-ls.debounce},
|
||||
default_timeout = ${toString cfg.null-ls.default_timeout},
|
||||
sources = ls_sources,
|
||||
on_attach = default_on_attach
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
|
|
|
@ -1,10 +1,30 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) attrsOf str;
|
||||
inherit (lib.types) attrsOf str int;
|
||||
in {
|
||||
options.vim.lsp.null-ls = {
|
||||
enable = mkEnableOption "null-ls, also enabled automatically";
|
||||
|
||||
debug = mkEnableOption "debugging information for `null-ls";
|
||||
|
||||
diagnostics_format = mkOption {
|
||||
type = str;
|
||||
default = "[#{m}] #{s} (#{c})";
|
||||
description = "Diagnostic output format for null-ls";
|
||||
};
|
||||
|
||||
debounce = mkOption {
|
||||
type = int;
|
||||
default = 250;
|
||||
description = "Default debounce";
|
||||
};
|
||||
|
||||
default_timeout = mkOption {
|
||||
type = int;
|
||||
default = 5000;
|
||||
description = "Default timeout value, in miliseconds";
|
||||
};
|
||||
|
||||
sources = mkOption {
|
||||
description = "null-ls sources";
|
||||
type = attrsOf str;
|
||||
|
|
|
@ -15,7 +15,7 @@ in {
|
|||
];
|
||||
|
||||
options.vim.notes.orgmode = {
|
||||
enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emac Orgmode. Get the best of both worlds";
|
||||
enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emacs Orgmode. Get the best of both worlds";
|
||||
|
||||
setupOpts = mkPluginSetupOption "Orgmode" {
|
||||
org_agenda_files = mkOption {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) map;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
@ -31,44 +32,46 @@ in {
|
|||
};
|
||||
})
|
||||
(mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"lualine"
|
||||
];
|
||||
vim = {
|
||||
startPlugins = ["lualine"];
|
||||
|
||||
vim.luaConfigRC.lualine = entryAnywhere ''
|
||||
local lualine = require('lualine')
|
||||
lualine.setup ${toLuaObject cfg.setupOpts}
|
||||
'';
|
||||
luaConfigRC.lualine = entryAnywhere ''
|
||||
local lualine = require('lualine')
|
||||
lualine.setup ${toLuaObject cfg.setupOpts}
|
||||
'';
|
||||
|
||||
# this is for backwards-compatibility
|
||||
vim.statusline.lualine.setupOpts = {
|
||||
options = {
|
||||
icons_enabled = cfg.icons.enable;
|
||||
theme = cfg.theme;
|
||||
component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right];
|
||||
section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right];
|
||||
globalstatus = cfg.globalStatus;
|
||||
refresh = cfg.refresh;
|
||||
};
|
||||
# this is for backwards-compatibility
|
||||
statusline.lualine.setupOpts = {
|
||||
options = {
|
||||
icons_enabled = cfg.icons.enable;
|
||||
theme = cfg.theme;
|
||||
component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right];
|
||||
section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right];
|
||||
globalstatus = cfg.globalStatus;
|
||||
refresh = cfg.refresh;
|
||||
};
|
||||
|
||||
sections = {
|
||||
lualine_a = builtins.map mkLuaInline (cfg.activeSection.a ++ cfg.extraActiveSection.a);
|
||||
lualine_b = builtins.map mkLuaInline (cfg.activeSection.b ++ cfg.extraActiveSection.b);
|
||||
lualine_c = builtins.map mkLuaInline (cfg.activeSection.c ++ cfg.extraActiveSection.c);
|
||||
lualine_x = builtins.map mkLuaInline (cfg.activeSection.x ++ cfg.extraActiveSection.x);
|
||||
lualine_y = builtins.map mkLuaInline (cfg.activeSection.y ++ cfg.extraActiveSection.y);
|
||||
lualine_z = builtins.map mkLuaInline (cfg.activeSection.z ++ cfg.extraActiveSection.z);
|
||||
sections = {
|
||||
lualine_a = map mkLuaInline (cfg.activeSection.a ++ cfg.extraActiveSection.a);
|
||||
lualine_b = map mkLuaInline (cfg.activeSection.b ++ cfg.extraActiveSection.b);
|
||||
lualine_c = map mkLuaInline (cfg.activeSection.c ++ cfg.extraActiveSection.c);
|
||||
lualine_x = map mkLuaInline (cfg.activeSection.x ++ cfg.extraActiveSection.x);
|
||||
lualine_y = map mkLuaInline (cfg.activeSection.y ++ cfg.extraActiveSection.y);
|
||||
lualine_z = map mkLuaInline (cfg.activeSection.z ++ cfg.extraActiveSection.z);
|
||||
};
|
||||
|
||||
inactive_sections = {
|
||||
lualine_a = map mkLuaInline (cfg.inactiveSection.a ++ cfg.extraInactiveSection.a);
|
||||
lualine_b = map mkLuaInline (cfg.inactiveSection.b ++ cfg.extraInactiveSection.b);
|
||||
lualine_c = map mkLuaInline (cfg.inactiveSection.c ++ cfg.extraInactiveSection.c);
|
||||
lualine_x = map mkLuaInline (cfg.inactiveSection.x ++ cfg.extraInactiveSection.x);
|
||||
lualine_y = map mkLuaInline (cfg.inactiveSection.y ++ cfg.extraInactiveSection.y);
|
||||
lualine_z = map mkLuaInline (cfg.inactiveSection.z ++ cfg.extraInactiveSection.z);
|
||||
};
|
||||
|
||||
# probably don't need this?
|
||||
tabline = [];
|
||||
};
|
||||
inactive_sections = {
|
||||
lualine_a = builtins.map mkLuaInline (cfg.inactiveSection.a ++ cfg.extraInactiveSection.a);
|
||||
lualine_b = builtins.map mkLuaInline (cfg.inactiveSection.b ++ cfg.extraInactiveSection.b);
|
||||
lualine_c = builtins.map mkLuaInline (cfg.inactiveSection.c ++ cfg.extraInactiveSection.c);
|
||||
lualine_x = builtins.map mkLuaInline (cfg.inactiveSection.x ++ cfg.extraInactiveSection.x);
|
||||
lualine_y = builtins.map mkLuaInline (cfg.inactiveSection.y ++ cfg.extraInactiveSection.y);
|
||||
lualine_z = builtins.map mkLuaInline (cfg.inactiveSection.z ++ cfg.extraInactiveSection.z);
|
||||
};
|
||||
# probably don't need this?
|
||||
tabline = [];
|
||||
};
|
||||
})
|
||||
];
|
||||
|
|
|
@ -10,19 +10,45 @@
|
|||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
|
||||
supported_themes = import ./supported_themes.nix;
|
||||
colorPuccin =
|
||||
if config.vim.statusline.lualine.theme == "catppuccin"
|
||||
then "#181825"
|
||||
else "none";
|
||||
builtin_themes = [
|
||||
"auto"
|
||||
"16color"
|
||||
"gruvbox"
|
||||
"ayu_dark"
|
||||
"ayu_light"
|
||||
"ayu_mirage"
|
||||
"codedark"
|
||||
"dracula"
|
||||
"everforest"
|
||||
"gruvbox"
|
||||
"gruvbox_light"
|
||||
"gruvbox_material"
|
||||
"horizon"
|
||||
"iceberg_dark"
|
||||
"iceberg_light"
|
||||
"jellybeans"
|
||||
"material"
|
||||
"modus_vivendi"
|
||||
"molokai"
|
||||
"nightfly"
|
||||
"nord"
|
||||
"oceanicnext"
|
||||
"onelight"
|
||||
"palenight"
|
||||
"papercolor_dark"
|
||||
"papercolor_light"
|
||||
"powerline"
|
||||
"seoul256"
|
||||
"solarized_dark"
|
||||
"tomorrow"
|
||||
"wombat"
|
||||
];
|
||||
in {
|
||||
options.vim.statusline.lualine = {
|
||||
enable = mkEnableOption "lualine statusline plugin";
|
||||
setupOpts = mkPluginSetupOption "Lualine" {};
|
||||
|
||||
enable = mkEnableOption "lualine statusline plugin";
|
||||
|
||||
icons = {
|
||||
enable = mkEnableOption "icons for lualine" // {default = true;};
|
||||
};
|
||||
icons.enable = mkEnableOption "icons for lualine" // {default = true;};
|
||||
|
||||
refresh = {
|
||||
statusline = mkOption {
|
||||
|
@ -73,47 +99,15 @@ in {
|
|||
|
||||
theme = let
|
||||
themeSupported = elem config.vim.theme.name supported_themes;
|
||||
themesConcatted = builtin_themes ++ optional themeSupported config.vim.theme.name;
|
||||
in
|
||||
mkOption {
|
||||
description = "Theme for lualine";
|
||||
type = enum ([
|
||||
"auto"
|
||||
"16color"
|
||||
"gruvbox"
|
||||
"ayu_dark"
|
||||
"ayu_light"
|
||||
"ayu_mirage"
|
||||
"codedark"
|
||||
"dracula"
|
||||
"everforest"
|
||||
"gruvbox"
|
||||
"gruvbox_light"
|
||||
"gruvbox_material"
|
||||
"horizon"
|
||||
"iceberg_dark"
|
||||
"iceberg_light"
|
||||
"jellybeans"
|
||||
"material"
|
||||
"modus_vivendi"
|
||||
"molokai"
|
||||
"nightfly"
|
||||
"nord"
|
||||
"oceanicnext"
|
||||
"onelight"
|
||||
"palenight"
|
||||
"papercolor_dark"
|
||||
"papercolor_light"
|
||||
"powerline"
|
||||
"seoul256"
|
||||
"solarized_dark"
|
||||
"tomorrow"
|
||||
"wombat"
|
||||
]
|
||||
++ optional themeSupported config.vim.theme.name);
|
||||
type = enum themesConcatted;
|
||||
default = "auto";
|
||||
# TODO: xml generation error if the closing '' is on a new line.
|
||||
# issue: https://gitlab.com/rycee/nmd/-/issues/10
|
||||
defaultText = ''`config.vim.theme.name` if theme supports lualine else "auto"'';
|
||||
description = "Theme for lualine";
|
||||
};
|
||||
|
||||
sectionSeparator = {
|
||||
|
@ -159,6 +153,13 @@ in {
|
|||
},
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"",
|
||||
draw_empty = true,
|
||||
separator = { left = '', right = '' }
|
||||
}
|
||||
''
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -171,15 +172,21 @@ in {
|
|||
"filetype",
|
||||
colored = true,
|
||||
icon_only = true,
|
||||
icon = { align = 'left' },
|
||||
color = {bg='${colorPuccin}', fg='lavender'},
|
||||
icon = { align = 'left' }
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"filename",
|
||||
color = {bg='${colorPuccin}'},
|
||||
symbols = {modified = '', readonly = ''},
|
||||
symbols = {modified = ' ', readonly = ' '},
|
||||
separator = {right = ''}
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"",
|
||||
draw_empty = true,
|
||||
separator = { left = '', right = '' }
|
||||
}
|
||||
''
|
||||
];
|
||||
|
@ -200,13 +207,7 @@ in {
|
|||
removed = 'DiffDelete', -- Changes the diff's removed color you
|
||||
},
|
||||
symbols = {added = '+', modified = '~', removed = '-'}, -- Changes the diff symbols
|
||||
color = {
|
||||
bg='${colorPuccin}',
|
||||
fg='lavender'
|
||||
},
|
||||
separator = {
|
||||
right = ''
|
||||
},
|
||||
separator = {right = ''}
|
||||
}
|
||||
''
|
||||
];
|
||||
|
@ -251,18 +252,17 @@ in {
|
|||
return msg
|
||||
end,
|
||||
icon = ' ',
|
||||
color = {bg='${colorPuccin}', fg='lavender'},
|
||||
separator = {
|
||||
left = '',
|
||||
},
|
||||
separator = {left = ''},
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"diagnostics",
|
||||
sources = {'nvim_lsp', 'nvim_diagnostic', 'coc'},
|
||||
sources = {'nvim_lsp', 'nvim_diagnostic', 'nvim_diagnostic', 'vim_lsp', 'coc'},
|
||||
symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '},
|
||||
color = {bg='${colorPuccin}', fg='lavender'},
|
||||
colored = true,
|
||||
update_in_insert = false,
|
||||
always_visible = false,
|
||||
diagnostics_color = {
|
||||
color_error = { fg = 'red' },
|
||||
color_warn = { fg = 'yellow' },
|
||||
|
@ -277,19 +277,26 @@ in {
|
|||
type = listOf str;
|
||||
description = "active config for: | A | B | C X | (Y) | Z |";
|
||||
default = [
|
||||
''
|
||||
{
|
||||
"",
|
||||
draw_empty = true,
|
||||
separator = { left = '', right = '' }
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
'searchcount',
|
||||
maxcount = 999,
|
||||
timeout = 120,
|
||||
color = {bg='${colorPuccin}', fg='lavender'}
|
||||
separator = {left = ''}
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"branch",
|
||||
icon = ' •',
|
||||
color = {bg='${colorPuccin}', fg='lavender'},
|
||||
separator = {left = ''}
|
||||
}
|
||||
''
|
||||
];
|
||||
|
@ -301,17 +308,20 @@ in {
|
|||
default = [
|
||||
''
|
||||
{
|
||||
"progress",
|
||||
separator = {
|
||||
left = '',
|
||||
},
|
||||
"",
|
||||
draw_empty = true,
|
||||
separator = { left = '', right = '' }
|
||||
}
|
||||
''
|
||||
''
|
||||
{
|
||||
"location",
|
||||
"progress",
|
||||
separator = {left = ''}
|
||||
}
|
||||
''
|
||||
''
|
||||
{"location"}
|
||||
''
|
||||
''
|
||||
{
|
||||
"fileformat",
|
||||
|
@ -320,38 +330,44 @@ in {
|
|||
unix = '', -- e712
|
||||
dos = '', -- e70f
|
||||
mac = '', -- e711
|
||||
},
|
||||
}
|
||||
}
|
||||
''
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
extraActiveSection = {
|
||||
a = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for activeSection.a";
|
||||
default = [];
|
||||
};
|
||||
|
||||
b = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for activeSection.b";
|
||||
default = [];
|
||||
};
|
||||
|
||||
c = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for activeSection.c";
|
||||
default = [];
|
||||
};
|
||||
|
||||
x = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for activeSection.x";
|
||||
default = [];
|
||||
};
|
||||
|
||||
y = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for activeSection.y";
|
||||
default = [];
|
||||
};
|
||||
|
||||
z = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for activeSection.z";
|
||||
|
@ -402,26 +418,31 @@ in {
|
|||
description = "Extra entries for inactiveSection.a";
|
||||
default = [];
|
||||
};
|
||||
|
||||
b = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for inactiveSection.b";
|
||||
default = [];
|
||||
};
|
||||
|
||||
c = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for inactiveSection.c";
|
||||
default = [];
|
||||
};
|
||||
|
||||
x = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for inactiveSection.x";
|
||||
default = [];
|
||||
};
|
||||
|
||||
y = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for inactiveSection.y";
|
||||
default = [];
|
||||
};
|
||||
|
||||
z = mkOption {
|
||||
type = listOf str;
|
||||
description = "Extra entries for inactiveSection.z";
|
||||
|
|
|
@ -6,101 +6,42 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) mkLuaBinding mkBinding pushDownDefault;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.tabline.nvimBufferline;
|
||||
|
||||
self = import ./nvim-bufferline.nix {inherit lib;};
|
||||
inherit (self.options.vim.tabline.nvimBufferline) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable (
|
||||
let
|
||||
mouse = {
|
||||
right = "'vertical sbuffer %d'";
|
||||
close = ''
|
||||
function(bufnum)
|
||||
require("bufdelete").bufdelete(bufnum, false)
|
||||
end
|
||||
'';
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
||||
"bufdelete-nvim"
|
||||
];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete" mappings.closeCurrent.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
(mkBinding cfg.mappings.cyclePrevious ":BufferLineCyclePrev<CR>" mappings.cyclePrevious.description)
|
||||
(mkBinding cfg.mappings.pick ":BufferLinePick<CR>" mappings.pick.description)
|
||||
(mkBinding cfg.mappings.sortByExtension ":BufferLineSortByExtension<CR>" mappings.sortByExtension.description)
|
||||
(mkBinding cfg.mappings.sortByDirectory ":BufferLineSortByDirectory<CR>" mappings.sortByDirectory.description)
|
||||
(mkLuaBinding cfg.mappings.sortById "function() require(\"bufferline\").sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end) end" mappings.sortById.description)
|
||||
(mkBinding cfg.mappings.moveNext ":BufferLineMoveNext<CR>" mappings.moveNext.description)
|
||||
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description)
|
||||
];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>b" = "+Buffer";
|
||||
"<leader>bm" = "BufferLineMove";
|
||||
"<leader>bs" = "BufferLineSort";
|
||||
"<leader>bsi" = "BufferLineSortById";
|
||||
};
|
||||
in {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
||||
"bufdelete-nvim"
|
||||
];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete" mappings.closeCurrent.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
(mkBinding cfg.mappings.cyclePrevious ":BufferLineCyclePrev<CR>" mappings.cyclePrevious.description)
|
||||
(mkBinding cfg.mappings.pick ":BufferLinePick<CR>" mappings.pick.description)
|
||||
(mkBinding cfg.mappings.sortByExtension ":BufferLineSortByExtension<CR>" mappings.sortByExtension.description)
|
||||
(mkBinding cfg.mappings.sortByDirectory ":BufferLineSortByDirectory<CR>" mappings.sortByDirectory.description)
|
||||
(mkLuaBinding cfg.mappings.sortById "function() require(\"bufferline\").sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end) end" mappings.sortById.description)
|
||||
(mkBinding cfg.mappings.moveNext ":BufferLineMoveNext<CR>" mappings.moveNext.description)
|
||||
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description)
|
||||
];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>b" = "+Buffer";
|
||||
"<leader>bm" = "BufferLineMove";
|
||||
"<leader>bs" = "BufferLineSort";
|
||||
"<leader>bsi" = "BufferLineSortById";
|
||||
};
|
||||
|
||||
luaConfigRC.nvimBufferline = entryAnywhere ''
|
||||
require("bufferline").setup{
|
||||
options = {
|
||||
mode = "buffers",
|
||||
numbers = "both",
|
||||
close_command = ${mouse.close},
|
||||
right_mouse_command = ${mouse.right},
|
||||
indicator = {
|
||||
style = 'icon',
|
||||
indicator_icon = '▎',
|
||||
},
|
||||
buffer_close_icon = '',
|
||||
modified_icon = '●',
|
||||
close_icon = '',
|
||||
left_trunc_marker = '',
|
||||
right_trunc_marker = '',
|
||||
max_name_length = 18,
|
||||
max_prefix_length = 15,
|
||||
tab_size = 18,
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = true,
|
||||
show_tab_indicators = true,
|
||||
persist_buffer_sort = true,
|
||||
--separator_style = "thin",
|
||||
separator_style = { " ", " " },
|
||||
enforce_regular_tabs = true,
|
||||
always_show_bufferline = true,
|
||||
offsets = {
|
||||
{filetype = "NvimTree", text = "File Explorer", text_align = "center"}
|
||||
},
|
||||
sort_by = 'extension',
|
||||
diagnostics = "nvim_lsp", -- TODO: use coc if it's enabled
|
||||
diagnostics_update_in_insert = true,
|
||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
local s = ""
|
||||
for e, n in pairs(diagnostics_dict) do
|
||||
local sym = e == "error" and ""
|
||||
or (e == "warning" and "" or "" )
|
||||
if(sym ~= "") then
|
||||
s = s .. " " .. n .. sym
|
||||
end
|
||||
end
|
||||
return s
|
||||
end,
|
||||
numbers = function(opts)
|
||||
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
|
||||
end,
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
luaConfigRC.nvimBufferline = entryAnywhere ''
|
||||
require("bufferline").setup({options = ${toLuaObject cfg.setupOpts}})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) enum bool either nullOr str int listOf attrs;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||
in {
|
||||
options.vim.tabline.nvimBufferline = {
|
||||
enable = mkEnableOption "neovim bufferline";
|
||||
|
@ -16,5 +19,363 @@ in {
|
|||
moveNext = mkMappingOption "Move next buffer" "<leader>bmn";
|
||||
movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp";
|
||||
};
|
||||
|
||||
setupOpts = mkPluginSetupOption "Bufferline-nvim" {
|
||||
mode = mkOption {
|
||||
type = enum ["tabs" "buffers"];
|
||||
default = "tabs";
|
||||
description = "Mode to use for bufferline";
|
||||
};
|
||||
|
||||
style_preset = mkOption {
|
||||
type = enum ["default" "minimal" "no_bold" "no_italic"];
|
||||
default = "default";
|
||||
apply = value: mkLuaInline "require('bufferline').style_preset.${value}";
|
||||
description = "The base style of bufferline";
|
||||
};
|
||||
|
||||
themable = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether or not highlight groups to be overriden.
|
||||
|
||||
While false, bufferline.nvim sets highlights as default
|
||||
'';
|
||||
};
|
||||
|
||||
numbers = mkOption {
|
||||
type = either (enum ["none" "ordinal" "buffer_id" "both"]) luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(opts)
|
||||
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
|
||||
end
|
||||
'';
|
||||
description = "Whether or not to show buffer numbers";
|
||||
};
|
||||
|
||||
close_command = mkOption {
|
||||
type = either str luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(bufnum)
|
||||
require("bufdelete").bufdelete(bufnum, false)
|
||||
end
|
||||
'';
|
||||
description = "Command to run when closing a buffer";
|
||||
};
|
||||
|
||||
right_mouse_command = mkOption {
|
||||
type = nullOr (either str luaInline);
|
||||
default = "vertical sbuffer %d";
|
||||
description = "Command to run when right clicking a buffer";
|
||||
};
|
||||
|
||||
left_mouse_command = mkOption {
|
||||
type = nullOr (either str luaInline);
|
||||
default = "buffer %d";
|
||||
description = "Command to run when left clicking a buffer";
|
||||
};
|
||||
|
||||
middle_mouse_command = mkOption {
|
||||
type = nullOr (either str luaInline);
|
||||
default = null;
|
||||
description = "Command to run when middle clicking a buffer";
|
||||
};
|
||||
|
||||
indicator = {
|
||||
icon = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
The indicatotor icon to use for current buffer.
|
||||
|
||||
::: {.warning}
|
||||
This **must** be ommitted while style is not `icon`
|
||||
:::
|
||||
'';
|
||||
};
|
||||
|
||||
style = mkOption {
|
||||
type = enum ["icon" "underline" "none"];
|
||||
default = "underline";
|
||||
description = "Style for indicator";
|
||||
};
|
||||
};
|
||||
|
||||
buffer_close_icon = mkOption {
|
||||
type = str;
|
||||
default = " ";
|
||||
description = "Icon for close button";
|
||||
};
|
||||
|
||||
modified_icon = mkOption {
|
||||
type = str;
|
||||
default = "● ";
|
||||
description = "Icon for modified buffer";
|
||||
};
|
||||
|
||||
close_icon = mkOption {
|
||||
type = str;
|
||||
default = " ";
|
||||
description = "Icon for close button";
|
||||
};
|
||||
|
||||
left_trunc_marker = mkOption {
|
||||
type = str;
|
||||
default = "";
|
||||
description = "Icon for left truncation";
|
||||
};
|
||||
|
||||
right_trunc_marker = mkOption {
|
||||
type = str;
|
||||
default = "";
|
||||
description = "Icon for right truncation";
|
||||
};
|
||||
|
||||
name_formatter = mkOption {
|
||||
type = nullOr luaInline;
|
||||
default = null;
|
||||
description = ''
|
||||
`name_formatter` can be used to change the buffer's label in the
|
||||
bufferline.
|
||||
|
||||
::: {.note}
|
||||
Some names can/will break the bufferline so use this at your
|
||||
discretion knowing that it has some limitations that will
|
||||
**NOT** be fixed.
|
||||
:::
|
||||
'';
|
||||
};
|
||||
|
||||
max_name_length = mkOption {
|
||||
type = int;
|
||||
default = 18;
|
||||
description = "Max name length";
|
||||
};
|
||||
|
||||
max_prefix_length = mkOption {
|
||||
type = int;
|
||||
default = 15;
|
||||
description = "Length of prefix used when a buffer is de-duplicated";
|
||||
};
|
||||
|
||||
truncate_names = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Truncate names";
|
||||
};
|
||||
|
||||
tab_size = mkOption {
|
||||
type = int;
|
||||
default = 18;
|
||||
description = "The size of the tabs in bufferline";
|
||||
};
|
||||
|
||||
diagnostics = mkOption {
|
||||
type = enum [false "nvim_lsp" "coc"];
|
||||
default = "nvim_lsp";
|
||||
description = "Diagnostics provider to be used in buffer LSP indicators";
|
||||
};
|
||||
|
||||
diagnostics_update_in_insert = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to update diagnostics while in insert mode.
|
||||
|
||||
Setting this to true has performance implications, but they may be
|
||||
negligible depending on your setup. Set it to true if you know what
|
||||
you are doing.
|
||||
'';
|
||||
};
|
||||
|
||||
diagnostics_indicator = mkOption {
|
||||
type = nullOr luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(count, level, diagnostics_dict, context)
|
||||
local s = " "
|
||||
for e, n in pairs(diagnostics_dict) do
|
||||
local sym = e == "error" and " "
|
||||
or (e == "warning" and " " or " " )
|
||||
s = s .. n .. sym
|
||||
end
|
||||
return s
|
||||
end
|
||||
'';
|
||||
|
||||
description = ''
|
||||
Function to get the diagnostics indicator.
|
||||
The function should return a string to be used as the indicator.
|
||||
|
||||
Can be set to nil to keep the buffer name highlight, but delete the
|
||||
highlighting.
|
||||
'';
|
||||
};
|
||||
|
||||
custom_filter = mkOption {
|
||||
type = nullOr luaInline;
|
||||
default = null;
|
||||
example = literalExpression ''
|
||||
custom_filter = function(buf_number, buf_numbers)
|
||||
-- filter out filetypes you don't want to see
|
||||
if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
||||
return true
|
||||
end
|
||||
-- filter out by buffer name
|
||||
if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
||||
return true
|
||||
end
|
||||
-- filter out based on arbitrary rules
|
||||
-- e.g. filter out vim wiki buffer from tabline in your work repo
|
||||
if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
||||
return true
|
||||
end
|
||||
-- filter out by it's index number in list (don't show first buffer)
|
||||
if buf_numbers[1] ~= buf_number then
|
||||
return true
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
||||
description = ''
|
||||
Custom filter function for filtering out buffers.
|
||||
|
||||
::: {.note}
|
||||
This will be called a lot, so you are encouraged to keep it as
|
||||
short and lightweight as possible unless you are fully aware
|
||||
of the performance implications.
|
||||
:::
|
||||
'';
|
||||
};
|
||||
|
||||
offsets = mkOption {
|
||||
type = listOf attrs;
|
||||
default = [
|
||||
{
|
||||
filetype = "NvimTree";
|
||||
text = "File Explorer";
|
||||
highlight = "Directory";
|
||||
separator = true;
|
||||
}
|
||||
];
|
||||
description = "The windows to offset bufferline above, see `:help bufferline-offset`";
|
||||
};
|
||||
|
||||
color_icons = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether or not to add filetype icon highlights";
|
||||
};
|
||||
|
||||
get_element_icon = mkOption {
|
||||
type = nullOr luaInline;
|
||||
default = null;
|
||||
example = literalExpression ''
|
||||
function(element)
|
||||
local custom_map = {my_thing_ft: {icon = "my_thing_icon", hl = "DevIconDefault"}}
|
||||
return custom_map[element.filetype]
|
||||
end
|
||||
'';
|
||||
description = "The function bufferline uses to get the icon. Recommended to leave as default.";
|
||||
};
|
||||
|
||||
show_buffer_icons = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether or not to show buffer icons";
|
||||
};
|
||||
|
||||
show_buffer_close_icons = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether or not to show buffer close icons";
|
||||
};
|
||||
|
||||
show_close_icon = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether or not to show close icon";
|
||||
};
|
||||
|
||||
show_tab_indicators = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether or not to show tab indicators";
|
||||
};
|
||||
|
||||
show_duplicate_prefix = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether or not to show duplicate prefix";
|
||||
};
|
||||
|
||||
duplicates_across_groups = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to consider duplicate paths in different groups as duplicates";
|
||||
};
|
||||
|
||||
persist_buffer_sort = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether or not custom sorted buffers should persist";
|
||||
};
|
||||
|
||||
move_wraps_at_ends = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Whether or not the move command \"wraps\" at the first or last position";
|
||||
};
|
||||
|
||||
seperator_style = mkOption {
|
||||
type = either (enum ["thick" "thin" "slope" "slant"]) (listOf str);
|
||||
default = [" " " "];
|
||||
description = ''
|
||||
Style of the buffer separator.
|
||||
|
||||
Can be either one of the suspported values, or a list containing
|
||||
**at most** two elements for `focused` and `unfocused` respectively.
|
||||
'';
|
||||
};
|
||||
|
||||
enforce_regular_tabs = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Whether to enforce regular tabs";
|
||||
};
|
||||
|
||||
always_show_bufferline = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to always show bufferline";
|
||||
};
|
||||
|
||||
auto_toggle_bufferline = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Whether to auto toggle bufferline";
|
||||
};
|
||||
|
||||
hover = {
|
||||
enabled = mkEnableOption "hover" // {default = true;};
|
||||
delay = mkOption {
|
||||
type = int;
|
||||
default = 200;
|
||||
description = "Delay for hover, in ms";
|
||||
};
|
||||
|
||||
reveal = mkOption {
|
||||
type = listOf str;
|
||||
default = ["close"];
|
||||
description = "Reveal hover window";
|
||||
};
|
||||
};
|
||||
|
||||
sort_by = mkOption {
|
||||
type = either (enum ["insert_after_current" "insert_at_end" "id" "extension" "relative_directory" "directory" "tabs"]) luaInline;
|
||||
default = "extension";
|
||||
description = "Method to sort buffers by. Must be one of the supported valuees, or an inline Lua value.";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
{lib}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
}: let
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.trivial) boolToString warnIf;
|
||||
in {
|
||||
onedark = {
|
||||
setup = {
|
||||
style ? "dark",
|
||||
|
@ -19,7 +25,7 @@
|
|||
transparent,
|
||||
}: ''
|
||||
require('tokyonight').setup {
|
||||
transparent = ${lib.boolToString transparent};
|
||||
transparent = ${boolToString transparent};
|
||||
}
|
||||
vim.cmd[[colorscheme tokyonight-${style}]]
|
||||
'';
|
||||
|
@ -32,7 +38,7 @@
|
|||
transparent,
|
||||
}: ''
|
||||
require('dracula').setup({
|
||||
transparent_bg = ${lib.boolToString transparent},
|
||||
transparent_bg = ${boolToString transparent},
|
||||
});
|
||||
require('dracula').load();
|
||||
'';
|
||||
|
@ -46,11 +52,11 @@
|
|||
-- Catppuccin theme
|
||||
require('catppuccin').setup {
|
||||
flavour = "${style}",
|
||||
transparent_background = ${lib.boolToString transparent},
|
||||
transparent_background = ${boolToString transparent},
|
||||
integrations = {
|
||||
nvimtree = {
|
||||
enabled = true,
|
||||
transparent_panel = ${lib.boolToString transparent},
|
||||
transparent_panel = ${boolToString transparent},
|
||||
show_root = true,
|
||||
},
|
||||
|
||||
|
@ -85,11 +91,20 @@
|
|||
transparent ? false,
|
||||
}: let
|
||||
style' =
|
||||
lib.warnIf (style == "light") "oxocarbon: light theme is not well-supported" style;
|
||||
warnIf (style == "light") "oxocarbon: light theme is not well-supported" style;
|
||||
in ''
|
||||
require('oxocarbon')
|
||||
vim.opt.background = "${style'}"
|
||||
vim.cmd.colorscheme = "oxocarbon"
|
||||
require('oxocarbon')
|
||||
vim.opt.background = "${style'}"
|
||||
vim.cmd.colorscheme = "oxocarbon"
|
||||
${optionalString transparent ''
|
||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "LineNr", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "SignColumn", { bg = "none" })
|
||||
${optionalString config.vim.filetree.nvimTree.enable ''
|
||||
vim.api.nvim_set_hl(0, "NvimTreeNormal", { bg = "none" })
|
||||
''}
|
||||
''}
|
||||
'';
|
||||
styles = ["dark" "light"];
|
||||
};
|
||||
|
@ -122,7 +137,7 @@
|
|||
palette_overrides = {},
|
||||
overrides = {},
|
||||
dim_inactive = false,
|
||||
transparent_mode = ${lib.boolToString transparent},
|
||||
transparent_mode = ${boolToString transparent},
|
||||
})
|
||||
vim.o.background = "${style}"
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
|
@ -147,7 +162,7 @@
|
|||
styles = {
|
||||
bold = false,
|
||||
italic = false, -- I would like to add more options for this
|
||||
transparency = ${lib.boolToString transparent},
|
||||
transparency = ${boolToString transparent},
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
inherit (lib.nvim.dag) entryBefore;
|
||||
|
||||
cfg = config.vim.theme;
|
||||
supported_themes = import ./supported_themes.nix {inherit lib;};
|
||||
supported_themes = import ./supported_themes.nix {
|
||||
inherit lib config;
|
||||
};
|
||||
in {
|
||||
options.vim.theme = {
|
||||
enable = mkOption {
|
||||
|
|
|
@ -30,9 +30,9 @@ in {
|
|||
normal = mkSetBinding mappings.incrementalSelection.init ":lua require('nvim-treesitter.incremental_selection').init_selection()<CR>";
|
||||
|
||||
visualOnly = mkMerge [
|
||||
(mkSetBinding mappings.incrementalSelection.incrementByNode ":lua require('nvim-treesitter.incremental_selection').node_incremental()<CR>")
|
||||
(mkSetBinding mappings.incrementalSelection.incrementByScope ":lua require('nvim-treesitter.incremental_selection').scope_incremental()<CR>")
|
||||
(mkSetBinding mappings.incrementalSelection.decrementByNode ":lua require('nvim-treesitter.incremental_selection').node_decremental()<CR>")
|
||||
(mkSetBinding mappings.incrementalSelection.incrementByNode "<cmd>lua require('nvim-treesitter.incremental_selection').node_incremental()<CR>")
|
||||
(mkSetBinding mappings.incrementalSelection.incrementByScope "<cmd>lua require('nvim-treesitter.incremental_selection').scope_incremental()<CR>")
|
||||
(mkSetBinding mappings.incrementalSelection.decrementByNode "<cmd>lua require('nvim-treesitter.incremental_selection').node_decremental()<CR>")
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
@ -4,100 +4,128 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) attrsOf attrs bool enum;
|
||||
inherit (lib.types) attrsOf enum nullOr submodule bool str;
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
|
||||
settingSubmodule = submodule {
|
||||
options = {
|
||||
RGB = mkOption {
|
||||
description = "Colorize #RGB hex codes";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
RRGGBB = mkOption {
|
||||
description = "Colorize #RRGGBB hex codes";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
names = mkOption {
|
||||
description = ''Colorize "Name" codes like Blue'';
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
RRGGBBAA = mkOption {
|
||||
description = "Colorize #RRGGBBAA hex codes";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
AARRGGBB = mkOption {
|
||||
description = "Colorize 0xAARRGGBB hex codes";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
rgb_fn = mkOption {
|
||||
description = "Colorize CSS rgb() and rgba() functions";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
hsl_fn = mkOption {
|
||||
description = "Colorize CSS hsl() and hsla() functions";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
css = mkOption {
|
||||
description = "Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
css_fn = mkOption {
|
||||
description = "Enable all CSS *functions*: rgb_fn, hsl_fn";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
tailwind = mkOption {
|
||||
description = "Enable tailwind colors";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
sass = mkOption {
|
||||
description = "Enable sass colors";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
|
||||
virtualtext = mkOption {
|
||||
description = "String to display as virtualtext";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
mode = mkOption {
|
||||
description = "Set the display mode";
|
||||
type = nullOr (enum ["foreground" "background"]);
|
||||
default = null;
|
||||
};
|
||||
|
||||
always_update = mkOption {
|
||||
description = "Update color values even if buffer is not focused. Example use: cmp_menu, cmp_docs";
|
||||
default = null;
|
||||
type = nullOr bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "ui" "colorizer" "options"] ["vim" "ui" "colorizer" "setupOpts" "user_default_options"])
|
||||
(mkRenamedOptionModule ["vim" "ui" "colorizer" "options"] ["vim" "ui" "colorizer" "setupOpts" "defaultOptions"])
|
||||
(mkRenamedOptionModule ["vim" "ui" "colorizer" "filetypes"] ["vim" "ui" "colorizer" "setupOpts" "filetypes"])
|
||||
];
|
||||
|
||||
options.vim.ui.colorizer = {
|
||||
enable = mkEnableOption "color highlighting [nvim-colorizer.lua]";
|
||||
|
||||
setupOpts = mkPluginSetupOption "nvim-colorizer" {
|
||||
setupOpts = mkPluginSetupOption "colorizer" {
|
||||
filetypes = mkOption {
|
||||
type = attrsOf attrs;
|
||||
default = {
|
||||
css = {};
|
||||
scss = {};
|
||||
description = ''
|
||||
Filetypes to enable on and their option overrides.
|
||||
|
||||
"*" means enable on all filetypes. Filetypes prefixed with "!" are disabled.
|
||||
'';
|
||||
default = {};
|
||||
example = {
|
||||
"*" = {};
|
||||
"!vim" = {};
|
||||
javascript = {
|
||||
AARRGGBB = false;
|
||||
};
|
||||
};
|
||||
description = "Filetypes to highlight on";
|
||||
type = attrsOf settingSubmodule;
|
||||
};
|
||||
|
||||
user_default_options = {
|
||||
rgb = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "#RGB hex codes";
|
||||
};
|
||||
|
||||
rrggbb = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "#RRGGBB hex codes";
|
||||
};
|
||||
|
||||
names = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''"Name" codes such as "Blue"'';
|
||||
};
|
||||
|
||||
rgb_fn = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "CSS rgb() and rgba() functions";
|
||||
};
|
||||
|
||||
rrggbbaa = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "#RRGGBBAA hex codes";
|
||||
};
|
||||
|
||||
hsl_fn = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "CSS hsl() and hsla() functions";
|
||||
};
|
||||
|
||||
css = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB";
|
||||
};
|
||||
|
||||
css_fn = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Enable all CSS *functions*: rgb_fn, hsl_fn";
|
||||
};
|
||||
|
||||
mode = mkOption {
|
||||
type = enum ["foreground" "background"];
|
||||
default = "background";
|
||||
description = "Set the display mode";
|
||||
};
|
||||
|
||||
tailwind = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Enable tailwind colors";
|
||||
};
|
||||
|
||||
sass = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Enable sass colors";
|
||||
};
|
||||
|
||||
alwaysUpdate = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Update color values even if buffer is not focused, like when using cmp_menu, cmp_docs";
|
||||
};
|
||||
user_default_options = mkOption {
|
||||
description = "Default options";
|
||||
default = {};
|
||||
type = settingSubmodule;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) attrsOf str;
|
||||
inherit (lib.types) attrsOf nullOr str;
|
||||
in {
|
||||
options.vim.binds.whichKey = {
|
||||
enable = mkEnableOption "which-key keybind helper menu";
|
||||
|
||||
register = mkOption {
|
||||
description = "Register label for which-key keybind helper menu";
|
||||
type = attrsOf str;
|
||||
type = attrsOf (nullOr str);
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,10 +4,9 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkRemovedOptionModule mkRenamedOptionModule;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.attrsets) mapAttrs;
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.strings) toUpper;
|
||||
inherit (lib.types) int float bool str enum listOf attrsOf anything;
|
||||
inherit (lib.types) int float bool str enum listOf attrsOf oneOf nullOr submodule;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
in {
|
||||
|
@ -176,9 +175,183 @@ in {
|
|||
'';
|
||||
};
|
||||
overrides = mkOption {
|
||||
description = "Override options from the default notification config";
|
||||
type = attrsOf (attrsOf anything);
|
||||
default = {rust_analyzer = {name = "rust-analyzer";};};
|
||||
description = ''
|
||||
Overrides the default configuration for a notification group defined
|
||||
in [](#opt-vim.visuals.fidget-nvim.setupOpts.notification.configs).
|
||||
|
||||
If any of the fields are null, the value from the default
|
||||
configuration is used.
|
||||
|
||||
If default configuration is not defined, the following defaults are used:
|
||||
```lua
|
||||
{
|
||||
name = "Notifications",
|
||||
icon = "❰❰",
|
||||
ttl = 5,
|
||||
group_style = "Title",
|
||||
icon_style = "Special",
|
||||
annote_style = "Question",
|
||||
debug_style = "Comment",
|
||||
info_style = "Question",
|
||||
warn_style = "WarningMsg",
|
||||
error_style = "ErrorMsg",
|
||||
debug_annote = "DEBUG",
|
||||
info_annote = "INFO",
|
||||
warn_annote = "WARN",
|
||||
error_annote = "ERROR",
|
||||
update_hook = function(item)
|
||||
notification.set_content_key(item)
|
||||
end,
|
||||
}
|
||||
```
|
||||
'';
|
||||
type = attrsOf (submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
description = ''
|
||||
Name of the group, displayed in the notification window.
|
||||
Can be a string or a function that returns a string.
|
||||
|
||||
If a function, it is invoked every render cycle with the items
|
||||
list, useful for rendering animations and other dynamic content.
|
||||
|
||||
::: {.note}
|
||||
If you're looking for detailed information into the function
|
||||
signature, you can refer to the fidget API documentation available
|
||||
[here](https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/doc/fidget-api.txt#L70-L77)
|
||||
:::
|
||||
'';
|
||||
type = nullOr (oneOf [str luaInline]);
|
||||
default = null;
|
||||
};
|
||||
icon = mkOption {
|
||||
description = ''
|
||||
Icon of the group, displayed in the notification window.
|
||||
Can be a string or a function that returns a string.
|
||||
|
||||
If a function, it is invoked every render cycle with the items
|
||||
list, useful for rendering animations and other dynamic content.
|
||||
|
||||
::: {.note}
|
||||
If you're looking for detailed information into the function
|
||||
signature, you can refer to the fidget API documentation available
|
||||
[here](https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/doc/fidget-api.txt#L70-L77)
|
||||
:::
|
||||
'';
|
||||
type = nullOr (oneOf [str luaInline]);
|
||||
default = null;
|
||||
};
|
||||
icon_on_left = mkOption {
|
||||
description = "If true, icon is rendered on the left instead of right";
|
||||
type = nullOr bool;
|
||||
default = null;
|
||||
};
|
||||
annote_separator = mkOption {
|
||||
description = "Separator between message from annote";
|
||||
type = nullOr str;
|
||||
default = " ";
|
||||
};
|
||||
ttl = mkOption {
|
||||
description = "How long a notification item should exist";
|
||||
type = nullOr int;
|
||||
default = 5;
|
||||
};
|
||||
render_limit = mkOption {
|
||||
description = "How many notification items to show at once";
|
||||
type = nullOr int;
|
||||
default = null;
|
||||
};
|
||||
group_style = mkOption {
|
||||
description = "Style used to highlight group name";
|
||||
type = nullOr str;
|
||||
default = "Title";
|
||||
};
|
||||
icon_style = mkOption {
|
||||
description = "Style used to highlight icon, if null, use group_style";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
annote_style = mkOption {
|
||||
description = "Default style used to highlight item annotes";
|
||||
type = nullOr str;
|
||||
default = "Question";
|
||||
};
|
||||
debug_style = mkOption {
|
||||
description = "Style used to highlight debug item annotes";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
info_style = mkOption {
|
||||
description = "Style used to highlight info item annotes";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
warn_style = mkOption {
|
||||
description = "Style used to highlight warn item annotes";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
error_style = mkOption {
|
||||
description = "Style used to highlight error item annotes";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
debug_annote = mkOption {
|
||||
description = "Default annotation for debug items";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
info_annote = mkOption {
|
||||
description = "Default annotation for info items";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
warn_annote = mkOption {
|
||||
description = "Default annotation for warn items";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
error_annote = mkOption {
|
||||
description = "Default annotation for error items";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
priority = mkOption {
|
||||
description = "Order in which group should be displayed";
|
||||
type = nullOr int;
|
||||
default = 50;
|
||||
};
|
||||
skip_history = mkOption {
|
||||
description = "Whether messages should be preserved in history";
|
||||
type = nullOr bool;
|
||||
default = null;
|
||||
};
|
||||
update_hook = mkOption {
|
||||
description = ''
|
||||
Called when an item is updated.
|
||||
|
||||
If false, no action is taken.
|
||||
If a function, it is invoked with the item being updated.
|
||||
|
||||
::: {.note}
|
||||
If you're looking for detailed information into the function
|
||||
signature, you can refer to the fidget API documentation available
|
||||
[here](https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/doc/fidget-api.txt#L114)
|
||||
:::
|
||||
'';
|
||||
type = nullOr (oneOf [bool luaInline]);
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
example = literalExpression ''
|
||||
{
|
||||
rust_analyzer = {
|
||||
name = "Rust Analyzer";
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkMappingOption mkEnableOption mkOption types;
|
||||
in {
|
||||
options.vim.telescope = {
|
||||
mappings = {
|
||||
findProjects = mkMappingOption "Find files [Telescope]" "<leader>fp";
|
||||
|
||||
findFiles = mkMappingOption "Find files [Telescope]" "<leader>ff";
|
||||
liveGrep = mkMappingOption "Live grep [Telescope]" "<leader>fg";
|
||||
buffers = mkMappingOption "Buffers [Telescope]" "<leader>fb";
|
||||
helpTags = mkMappingOption "Help tags [Telescope]" "<leader>fh";
|
||||
open = mkMappingOption "Open [Telescope]" "<leader>ft";
|
||||
|
||||
gitCommits = mkMappingOption "Git commits [Telescope]" "<leader>fvcw";
|
||||
gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "<leader>fvcb";
|
||||
gitBranches = mkMappingOption "Git branches [Telescope]" "<leader>fvb";
|
||||
gitStatus = mkMappingOption "Git status [Telescope]" "<leader>fvs";
|
||||
gitStash = mkMappingOption "Git stash [Telescope]" "<leader>fvx";
|
||||
|
||||
lspDocumentSymbols = mkMappingOption "LSP Document Symbols [Telescope]" "<leader>flsb";
|
||||
lspWorkspaceSymbols = mkMappingOption "LSP Workspace Symbols [Telescope]" "<leader>flsw";
|
||||
lspReferences = mkMappingOption "LSP References [Telescope]" "<leader>flr";
|
||||
lspImplementations = mkMappingOption "LSP Implementations [Telescope]" "<leader>fli";
|
||||
lspDefinitions = mkMappingOption "LSP Definitions [Telescope]" "<leader>flD";
|
||||
lspTypeDefinitions = mkMappingOption "LSP Type Definitions [Telescope]" "<leader>flt";
|
||||
diagnostics = mkMappingOption "Diagnostics [Telescope]" "<leader>fld";
|
||||
|
||||
treesitter = mkMappingOption "Treesitter [Telescope]" "<leader>fs";
|
||||
};
|
||||
|
||||
enable = mkEnableOption "telescope.nvim: multi-purpose search and picker utility";
|
||||
|
||||
vimgrep_arguments = mkOption {
|
||||
description = "Arguments to use for the grep command";
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
"${pkgs.ripgrep}/bin/rg"
|
||||
"--color=never"
|
||||
"--no-heading"
|
||||
"--with-filename"
|
||||
"--line-number"
|
||||
"--column"
|
||||
"--smart-case"
|
||||
"--hidden"
|
||||
"--no-ignore"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||
inherit (lib.types) package bool str listOf attrsOf;
|
||||
inherit (lib.nvim.types) pluginsOpt extraPluginType;
|
||||
in {
|
||||
|
@ -38,7 +38,7 @@ in {
|
|||
|
||||
startPlugins = pluginsOpt {
|
||||
default = ["plenary-nvim"];
|
||||
example = literalExpression ''
|
||||
example = ''
|
||||
[pkgs.vimPlugins.telescope-nvim]
|
||||
'';
|
||||
|
||||
|
@ -54,7 +54,7 @@ in {
|
|||
|
||||
optPlugins = pluginsOpt {
|
||||
default = [];
|
||||
example = literalExpression ''
|
||||
example = ''
|
||||
[pkgs.vimPlugins.vim-ghost]
|
||||
'';
|
||||
description = ''
|
||||
|
@ -80,7 +80,8 @@ in {
|
|||
your custom plugins using nvf's modified DAG library.
|
||||
'';
|
||||
|
||||
example = literalExpression ''
|
||||
example = literalMD ''
|
||||
```nix
|
||||
with pkgs.vimPlugins; {
|
||||
aerial = {
|
||||
package = aerial-nvim;
|
||||
|
@ -93,13 +94,14 @@ in {
|
|||
after = ["aerial"]; # place harpoon configuration after aerial
|
||||
};
|
||||
}
|
||||
```
|
||||
'';
|
||||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
type = listOf package;
|
||||
default = [];
|
||||
example = literalExpression ''[pkgs.fzf pkgs.ripgrep]'';
|
||||
example = ''[pkgs.fzf pkgs.ripgrep]'';
|
||||
description = ''
|
||||
List of additional packages to make available to the Neovim
|
||||
wrapper.
|
||||
|
@ -107,7 +109,7 @@ in {
|
|||
};
|
||||
|
||||
# this defaults to `true` in the wrapper
|
||||
# and since we passs this value to the wrapper
|
||||
# and since we pass this value to the wrapper
|
||||
# with an inherit, it should be `true` here as well
|
||||
withRuby =
|
||||
mkEnableOption ''
|
||||
|
@ -118,29 +120,25 @@ in {
|
|||
};
|
||||
|
||||
withNodeJs = mkEnableOption ''
|
||||
NodeJs support in the Neovim wrapper.
|
||||
NodeJs support in the Neovim wrapper
|
||||
'';
|
||||
|
||||
luaPackages = mkOption {
|
||||
type = listOf str;
|
||||
default = [];
|
||||
example = literalExpression ''["magick" "serpent"]'';
|
||||
description = ''
|
||||
List of lua packages to install.
|
||||
'';
|
||||
example = ''["magick" "serpent"]'';
|
||||
description = "List of lua packages to install";
|
||||
};
|
||||
|
||||
withPython3 = mkEnableOption ''
|
||||
Python3 support in the Neovim wrapper.
|
||||
Python3 support in the Neovim wrapper
|
||||
'';
|
||||
|
||||
python3Packages = mkOption {
|
||||
type = listOf str;
|
||||
default = [];
|
||||
example = literalExpression ''["pynvim"]'';
|
||||
description = ''
|
||||
List of python packages to install.
|
||||
'';
|
||||
example = ''["pynvim"]'';
|
||||
description = "List of python packages to install";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -60,16 +60,11 @@
|
|||
config = (attrs) the configuration options for this mapping (noremap, silent...)
|
||||
}
|
||||
*/
|
||||
normalizeAction = action: let
|
||||
normalizeAction = action: {
|
||||
# Extract the values of the config options that have been explicitly set by the user
|
||||
config =
|
||||
filterAttrs (_: v: v != null)
|
||||
(getAttrs (attrNames mapConfigOptions) action);
|
||||
in {
|
||||
config =
|
||||
if config == {}
|
||||
then {"__empty" = null;}
|
||||
else config;
|
||||
action =
|
||||
if action.lua
|
||||
then mkLuaInline action.action
|
||||
|
@ -133,6 +128,14 @@ in {
|
|||
configRC = {
|
||||
globalsScript = entryAnywhere (concatStringsSep "\n" globalsScript);
|
||||
|
||||
# Call additional lua files with :luafile in Vimscript
|
||||
# section of the configuration, only after
|
||||
# the luaScript section has been evaluated
|
||||
extraLuaFiles = let
|
||||
callLuaFiles = map (file: "luafile ${file}") cfg.extraLuaFiles;
|
||||
in
|
||||
entryAfter ["globalScript"] (concatStringsSep "\n" callLuaFiles);
|
||||
|
||||
# wrap the lua config in a lua block
|
||||
# using the wrapLuaConfic function from the lib
|
||||
luaScript = let
|
||||
|
@ -148,7 +151,7 @@ in {
|
|||
inherit mapResult;
|
||||
};
|
||||
in
|
||||
entryAfter ["globalsScript"] luaConfig;
|
||||
entryAnywhere luaConfig;
|
||||
|
||||
extraPluginConfigs = let
|
||||
mapResult = result: (wrapLuaConfig {
|
||||
|
|
|
@ -37,8 +37,8 @@ in {
|
|||
To avoid leaking imperative user configuration into your
|
||||
configuration, this is enabled by default. If you wish
|
||||
to load configuration from user configuration directories
|
||||
(e.g. `$HOME/.config/nvim`, `$HOME/.config/nvim/after`
|
||||
and `$HOME/.local/share/nvim/site`) you may set this
|
||||
(e.g. {file}`$HOME/.config/nvim`, {file}`$HOME/.config/nvim/after`
|
||||
and {file}`$HOME/.local/share/nvim/site`) you may set this
|
||||
option to true.
|
||||
:::
|
||||
'';
|
||||
|
@ -68,16 +68,52 @@ in {
|
|||
active runtimepath of the Neovim. This can be used to
|
||||
add additional lookup paths for configs, plugins, spell
|
||||
languages and other things you would generally place in
|
||||
your `$HOME/.config/nvim`.
|
||||
your {file}`$HOME/.config/nvim`.
|
||||
|
||||
This is meant as a declarative alternative to throwing
|
||||
files into `~/.config/nvim` and having the Neovim
|
||||
files into {file}`~/.config/nvim` and having the Neovim
|
||||
wrapper pick them up. For more details on
|
||||
`vim.o.runtimepath`, and what paths to use; please see
|
||||
[the official documentation](https://neovim.io/doc/user/options.html#'runtimepath')
|
||||
'';
|
||||
};
|
||||
|
||||
extraLuaFiles = mkOption {
|
||||
type = listOf (either path str);
|
||||
default = [];
|
||||
example = literalExpression ''
|
||||
[
|
||||
# absolute path, as a string - impure
|
||||
"$HOME/.config/nvim/my-lua-file.lua"
|
||||
|
||||
# relative path, as a path - pure
|
||||
./nvim/my-lua-file.lua
|
||||
|
||||
# source type path - pure and reproducible
|
||||
(builtins.source {
|
||||
path = ./nvim/my-lua-file.lua;
|
||||
name = "my-lua-file";
|
||||
})
|
||||
]
|
||||
'';
|
||||
|
||||
description = ''
|
||||
Additional lua files that will be sourced by Neovim.
|
||||
Takes both absolute and relative paths, all of which
|
||||
will be called via the `luafile` command in Neovim.
|
||||
|
||||
See [lua-commands](https://neovim.io/doc/user/lua.html#lua-commands)
|
||||
on the Neovim documentation for more details.
|
||||
|
||||
::: {.warning}
|
||||
All paths passed to this option must be valid. If Neovim cannot
|
||||
resolve the path you are attempting to sourcee, then your configuration
|
||||
will error, and Neovim will not start. Please ensure that all paths
|
||||
are correct before using this option.
|
||||
:::
|
||||
'';
|
||||
};
|
||||
|
||||
globals = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
|
|
Loading…
Reference in New Issue