Compare commits

...

19 commits

Author SHA1 Message Date
raf
9617fd4445
Merge 72634c2603 into 7a8b95cf7c 2024-10-06 15:22:44 +03:00
diniamo
7a8b95cf7c
Surround setupopts (#402)
* surround: fix keymaps

* surround: make description multi-line
2024-10-06 14:35:07 +03:00
Ching Pei Yang
b637f921d5
maps: allow same key on multiple mode (#360)
* mappings: add new keymap option

* mappings: impl keymap option

* doc: update release notes

* map: fix misinformation

* map: remove redundant variable

* fixup! mappings: impl keymap option
2024-10-06 11:23:01 +02:00
649f5513f9
flake.lock: Update
Flake lock file updates:

• Updated input 'plugin-catppuccin':
    'github:catppuccin/nvim/5215ea59df6d0a7e27da9a5cd1165e06d1b04cbe' (2024-05-26)
  → 'github:catppuccin/nvim/7be452ee067978cdc8b2c5f3411f0c71ffa612b9' (2024-10-05)
2024-10-06 02:41:05 +03:00
raf
18ae3e1f6c
Merge branch 'main' into v0.7 2024-10-05 23:40:48 +00:00
614ad33a60
meta: add changelog reminder to the pull request template
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
2024-10-06 01:46:59 +03:00
fdd0642c7d
docs: update 0.7 release notes 2024-10-06 01:40:02 +03:00
379d2a9f16
meta: improve github pull request template 2024-10-06 01:39:58 +03:00
Charlie Root
f01e404b2e
languages/elixir.nix: fix elixir-tools setup (#401) 2024-10-06 00:56:33 +03:00
raf
3299facbaa
Merge branch 'main' into v0.7 2024-10-05 13:48:20 +00:00
Charlie Root
bdf777dc8a
feature: add base16 support (#389)
* modules: add base16 Theming support

theme/theme.nix: fix formatting

supported-themes.nix: formatting

clean up base16-colors.nix

theme: fix plugin setup, change base16 flake input

* theme/theme.nix: fix formatting

* types/theme.nix: add check regex matching

types/theme.nix: fixed regex matching

* lib/types: rename custom.nix to types.nix, mov theme.nix into types.nix

* plugins/theme: apply requested changes

types/types.nix: remove unneeded inherit

theme/theme.nix: remove commented inherit

* theme/theme.nix: fix up base16 helper func

Co-authored-by: diniamo <55629891+diniamo@users.noreply.github.com>

* theme/theme.nix: move listToAttrs inheriting, fix base16-colors declaration

* theme/theme.nix: add documentation to vim.theme.name

* release-notes/rl-0.7.md: add changelog entry for base16

* theme/theme.nix: fix documentation rendering

---------

Co-authored-by: diniamo <55629891+diniamo@users.noreply.github.com>
2024-10-05 16:47:33 +03:00
poz
cc14a1c1f6
plugins/neo-tree: fix file icons (#397)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
2024-10-04 17:00:17 +03:00
diniamo
108cfd8383
themes/catppuccin: enable navic integration (#395)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
2024-10-02 19:21:45 +03:00
raf
9ea9995b92
statusline/lualine: update & add missing themes (#393)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* statusline/lualine: update & add missing themes

* docs: document lualine update
2024-10-01 08:18:29 +03:00
7417c6e4f3
docs: fix missing documentation link in README 2024-10-01 08:12:06 +03:00
3cba3ca30c
statusline/lualine: disable LSP indicator on neo-tree
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
2024-09-30 01:10:33 +03:00
72634c2603
add more setupOpts for conform.nvim 2024-09-26 17:58:01 +03:00
0ff9476eae
add conform.nvim & nvim-lint 2024-09-26 17:43:20 +03:00
ecbaecfeac
lib/languages: move mkEnable up & add desc comment 2024-09-26 17:01:27 +03:00
27 changed files with 515 additions and 259 deletions

8
.github/README.md vendored
View file

@ -124,10 +124,16 @@ The _recommended_ way of installing **nvf** is using either the NixOS or the
Home-Manager module, though it is completely possible and no less supported to Home-Manager module, though it is completely possible and no less supported to
install **nvf** as a standalone package, or a flake output. install **nvf** as a standalone package, or a flake output.
See the [**nvf** manual] for detailed and up-to-date installation guides, See the rendered [nvf manual] for detailed and up-to-date installation guides,
configurations, available options, release notes and more. Tips for installing configurations, available options, release notes and more. Tips for installing
userspace plugins is also contained in the documentation. userspace plugins is also contained in the documentation.
> [!TIP]
> While using NixOS or Home-Manager modules,
> `programs.nvf.enableManpages = true;` will allow you to view option
> documentation from the comfort of your terminal via `man 5 nvf`. The more you
> know.
Please create an issue on the [issue tracker] if you find the documentation Please create an issue on the [issue tracker] if you find the documentation
lacking or confusing. Any improvements to the documentation through pull lacking or confusing. Any improvements to the documentation through pull
requests are also welcome, and appreciated. requests are also welcome, and appreciated.

View file

@ -1,39 +1,57 @@
# Description <!--
^ Please include a clear and concise description of the aim of your Pull Request above this line ^
A clear and concise description of the aim of your Pull Request. For plugin dependency/module additions, please make sure to link the source link of the added plugin
or dependency in this section.
**If your pull request aims to fix an open issue or a present bug, please link the relevant issue below. If not, please remove this section** If your pull request aims to fix an open issue or a please bug, please also link the relevant issue
Fixes #(issue) below this line. You may attach an issue to your pull request with `Fixes #<issue number>` outside
this comment.
-->
## Type of change ## Sanity Checking
Please delete any options that are not relevant. <!--
Please check all that apply. As before, this section is not a hard requirement but checklists with more checked
items are likely to be merged faster. You may save some time in maintainer review by performing self-reviews here
before submitting your pull request.
- Bug fix (non-breaking change which fixes an issue) If your pull request includes any change or unexpected behaviour not covered below, please do make sure to include
- New feature (non-breaking change which adds functionality) it above in your description.
- Breaking change (fix or feature that would cause existing functionality to not work as expected) -->
- Translation/Language update
- Docs
- Other
## Checklist [editorconfig]: https://editorconfig.org
[changelog]: https://github.com/NotAShelf/nvf/tree/main/docs/release-notes
Please try to check at least a majority of the checklist before opening your pull request. Exceptions to this will be reviewed on a case by case basis. - [ ] I have updated the [changelog] as per my changes.
- [ ] I have tested, and self-reviewed my code.
- Style and consistency
- [ ] I ran **Alejandra** to format my code (`nix fmt`).
- [ ] My code conforms to the [editorconfig] configuration of the project.
- [ ] My changes are consistent with the rest of the codebase.
- If new changes are particularly complex:
- [ ] My code includes comments in particularly complex areas
- [ ] I have added a section in the manual.
- [ ] _(For breaking changes)_ I have included a migration guide.
- Package(s) built:
- [ ] `.#nix` (default package)
- [ ] `.#maximal`
- [ ] `.#docs-html`
- Tested on platform(s)
- [ ] `x86_64-linux`
- [ ] `aarch64-linux`
- [ ] `x86_64-darwin`
- [ ] `aarch64-darwin`
- [ ] My code follows the style and contributing guidelines of this project. <!--
- [ ] I ran Alejandra to format my code (`nix fmt`). If your changes touch upon a portion of the codebase that you do not understand well, please make sure to consult
- [ ] I have performed a self-review of my own code and tested it. the maintainers on your changes. In most cases, making an issue before creating your PR will help you avoid duplicate
- [ ] I have commented my code, particularly in hard-to-understand areas. efforts in the long run.
- [ ] My changes generate no new warnings. -->
- [ ] This change requires a documentation update.
- [ ] I have updated the documentation accordingly.
## Screenshots & Logs ---
You are kindly requested to attach screenshots of your changes in actions and preferably your build/run logs for all available packages. If you are not sure how to do this, you can refer to the [documentation](https://notashelf.github.io/neovim-flake/). Add a :+1: [reaction] to [pull requests you find important].
**Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.** [reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
[pull requests you find important]: https://github.com/NixOS/nixpkgs/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc
```console
# Paste your logs here
```

View file

@ -28,10 +28,10 @@ configuration formats.
### `vim.maps` rewrite {#sec-vim-maps-rewrite} ### `vim.maps` rewrite {#sec-vim-maps-rewrite}
Instead of specifying map modes using submodules (eg.: `vim.maps.normal`), a new Instead of specifying map modes using submodules (eg.: `vim.maps.normal`), a new `vim.keymaps`
`mode` option has mode has been introduced. It can be either a string, or a list submodule with support for a `mode` option has been introduced. It can be either a string, or a
of strings, where a string represents the short-name of the map mode(s), that list of strings, where a string represents the short-name of the map mode(s), that the mapping
the mapping should be set for. See `:help map-modes` for more information. should be set for. See `:help map-modes` for more information.
For example: For example:
@ -42,10 +42,13 @@ vim.maps.normal."<leader>m" = { ... };
has to be replaced by has to be replaced by
```nix ```nix
vim.maps."<leader>m" = { vim.keymaps = [
{
key = "<leader>m";
mode = "n"; mode = "n";
}
... ...
}; ];
``` ```
### `vim.lsp.nvimCodeActionMenu` removed in favor of `vim.ui.fastaction` {#sec-nvim-code-action-menu-deprecation} ### `vim.lsp.nvimCodeActionMenu` removed in favor of `vim.ui.fastaction` {#sec-nvim-code-action-menu-deprecation}
@ -103,13 +106,17 @@ everyone.
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp [ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim [new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
[neo-tree.nvim]: https://github.com/nvim-neo-tree/neo-tree.nvim
- Add [ocaml-lsp] support - Add [ocaml-lsp] support
- Fix "Emac" typo - Fix "Emac" typo
- Add [new-file-template.nvim] to automatically fill new file contents using - Add [new-file-template.nvim] to automatically fill new file contents using
templates. templates
- Make [neo-tree.nvim] display file icons properly by enabling
`visuals.nvimWebDevicons`
[diniamo](https://github.com/diniamo): [diniamo](https://github.com/diniamo):
@ -143,6 +150,8 @@ everyone.
- Replace `vim.lsp.nvimCodeActionMenu` with `vim.ui.fastaction`, see the - Replace `vim.lsp.nvimCodeActionMenu` with `vim.ui.fastaction`, see the
breaking changes section above for more details breaking changes section above for more details
- Add a `setupOpts` option to nvim-surround, which allows modifying options that aren't defined in nvf. Move the alternate nvim-surround keybinds to use `setupOpts`.
[Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd() [Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd()
- Make Neovim's configuration file entirely Lua based. This comes with a few - Make Neovim's configuration file entirely Lua based. This comes with a few
@ -218,14 +227,25 @@ everyone.
- Add [](#opt-vim.dashboard.dashboard-nvim.setupOpts) to allow user - Add [](#opt-vim.dashboard.dashboard-nvim.setupOpts) to allow user
configuration for [dashboard.nvim](https://github.com/nvimdev/dashboard-nvim) configuration for [dashboard.nvim](https://github.com/nvimdev/dashboard-nvim)
- Update `lualine.nvim` input and add missing themes:
- Adds `ayu`, `gruvbox_dark`, `iceberg`, `moonfly`, `onedark`,
`powerline_dark` and `solarized_light` themes.
[ppenguin](https://github.com/ppenguin): [ppenguin](https://github.com/ppenguin):
- Telescope: - Telescope:
- Fixed `project-nvim` command and keybinding - Fixed `project-nvim` command and keybinding
- Added default ikeybind/command for `Telescope resume` (`<leader>fr`) - Added default ikeybind/command for `Telescope resume` (`<leader>fr`)
[Soliprem](https://github.com/Soliprem) [Soliprem](https://github.com/Soliprem):
- Add LSP and Treesitter support for R under `vim.languages.R`. - Add LSP and Treesitter support for R under `vim.languages.R`.
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with - Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
ccc ccc
[Bloxx12](https://github.com/Bloxx12)
- Add support for [base16 theming](https://github.com/RRethy/base16-nvim) under
`vim.theme`
- Fix internal breakage in `elixir-tools` setup.

63
flake.lock generated
View file

@ -172,6 +172,22 @@
"type": "github" "type": "github"
} }
}, },
"plugin-base16": {
"flake": false,
"locked": {
"lastModified": 1716483968,
"narHash": "sha256-GRF/6AobXHamw8TZ3FjL7SI6ulcpwpcohsIuZeCSh2A=",
"owner": "rrethy",
"repo": "base16-nvim",
"rev": "6ac181b5733518040a33017dde654059cd771b7c",
"type": "github"
},
"original": {
"owner": "rrethy",
"repo": "base16-nvim",
"type": "github"
}
},
"plugin-bufdelete-nvim": { "plugin-bufdelete-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -191,11 +207,11 @@
"plugin-catppuccin": { "plugin-catppuccin": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1716704960, "lastModified": 1728131011,
"narHash": "sha256-UDPS+1o8FQGkfqiG4GX4DNUI2pU5hIvagmfnWTKDb44=", "narHash": "sha256-j6F078taxuGzr3jngrc+Pc5I1kDdxTLMETgq6Xn4w/4=",
"owner": "catppuccin", "owner": "catppuccin",
"repo": "nvim", "repo": "nvim",
"rev": "5215ea59df6d0a7e27da9a5cd1165e06d1b04cbe", "rev": "7be452ee067978cdc8b2c5f3411f0c71ffa612b9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -396,6 +412,22 @@
"type": "github" "type": "github"
} }
}, },
"plugin-conform-nvim": {
"flake": false,
"locked": {
"lastModified": 1726168403,
"narHash": "sha256-AWgG+16Bh/xu50pU78mKIcQy9MKzWF1YKdbEt5jX0WQ=",
"owner": "stevearc",
"repo": "conform.nvim",
"rev": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c",
"type": "github"
},
"original": {
"owner": "stevearc",
"repo": "conform.nvim",
"type": "github"
}
},
"plugin-copilot-cmp": { "plugin-copilot-cmp": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -799,11 +831,11 @@
"plugin-lualine": { "plugin-lualine": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1712310396, "lastModified": 1723473562,
"narHash": "sha256-WcH2dWdRDgMkwBQhcgT+Z/ArMdm+VbRhmQftx4t2kNI=", "narHash": "sha256-gCm7m96PkZyrgjmt7Efc+NMZKStAq1zr7JRCYOgGDuE=",
"owner": "hoob3rt", "owner": "hoob3rt",
"repo": "lualine.nvim", "repo": "lualine.nvim",
"rev": "0a5a66803c7407767b799067986b4dc3036e1983", "rev": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1133,6 +1165,22 @@
"type": "github" "type": "github"
} }
}, },
"plugin-nvim-lint": {
"flake": false,
"locked": {
"lastModified": 1727002360,
"narHash": "sha256-mg3IqNfIeWimasYEHilqv4Yx67hTHBubq19nLTNrjLk=",
"owner": "mfussenegger",
"repo": "nvim-lint",
"rev": "968a35d54b3a4c1ce66609cf80b14d4ae44fe77f",
"type": "github"
},
"original": {
"owner": "mfussenegger",
"repo": "nvim-lint",
"type": "github"
}
},
"plugin-nvim-lspconfig": { "plugin-nvim-lspconfig": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -1802,6 +1850,7 @@
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nmd": "nmd", "nmd": "nmd",
"plugin-alpha-nvim": "plugin-alpha-nvim", "plugin-alpha-nvim": "plugin-alpha-nvim",
"plugin-base16": "plugin-base16",
"plugin-bufdelete-nvim": "plugin-bufdelete-nvim", "plugin-bufdelete-nvim": "plugin-bufdelete-nvim",
"plugin-catppuccin": "plugin-catppuccin", "plugin-catppuccin": "plugin-catppuccin",
"plugin-ccc": "plugin-ccc", "plugin-ccc": "plugin-ccc",
@ -1816,6 +1865,7 @@
"plugin-cmp-vsnip": "plugin-cmp-vsnip", "plugin-cmp-vsnip": "plugin-cmp-vsnip",
"plugin-codewindow-nvim": "plugin-codewindow-nvim", "plugin-codewindow-nvim": "plugin-codewindow-nvim",
"plugin-comment-nvim": "plugin-comment-nvim", "plugin-comment-nvim": "plugin-comment-nvim",
"plugin-conform-nvim": "plugin-conform-nvim",
"plugin-copilot-cmp": "plugin-copilot-cmp", "plugin-copilot-cmp": "plugin-copilot-cmp",
"plugin-copilot-lua": "plugin-copilot-lua", "plugin-copilot-lua": "plugin-copilot-lua",
"plugin-crates-nvim": "plugin-crates-nvim", "plugin-crates-nvim": "plugin-crates-nvim",
@ -1862,6 +1912,7 @@
"plugin-nvim-dap-ui": "plugin-nvim-dap-ui", "plugin-nvim-dap-ui": "plugin-nvim-dap-ui",
"plugin-nvim-docs-view": "plugin-nvim-docs-view", "plugin-nvim-docs-view": "plugin-nvim-docs-view",
"plugin-nvim-lightbulb": "plugin-nvim-lightbulb", "plugin-nvim-lightbulb": "plugin-nvim-lightbulb",
"plugin-nvim-lint": "plugin-nvim-lint",
"plugin-nvim-lspconfig": "plugin-nvim-lspconfig", "plugin-nvim-lspconfig": "plugin-nvim-lspconfig",
"plugin-nvim-navbuddy": "plugin-nvim-navbuddy", "plugin-nvim-navbuddy": "plugin-nvim-navbuddy",
"plugin-nvim-navic": "plugin-nvim-navic", "plugin-nvim-navic": "plugin-nvim-navic",

View file

@ -206,6 +206,18 @@
flake = false; flake = false;
}; };
# Formatters
plugin-conform-nvim = {
url = "github:stevearc/conform.nvim";
flake = false;
};
# Diagnostics
plugin-nvim-lint = {
url = "github:mfussenegger/nvim-lint";
flake = false;
};
# Copying/Registers # Copying/Registers
plugin-registers = { plugin-registers = {
url = "github:tversteeg/registers.nvim"; url = "github:tversteeg/registers.nvim";
@ -349,6 +361,11 @@
}; };
# Themes # Themes
plugin-base16 = {
url = "github:rrethy/base16-nvim";
flake = false;
};
plugin-tokyonight = { plugin-tokyonight = {
url = "github:folke/tokyonight.nvim"; url = "github:folke/tokyonight.nvim";
flake = false; flake = false;

View file

@ -5,6 +5,15 @@
inherit (lib.attrsets) listToAttrs; inherit (lib.attrsets) listToAttrs;
inherit (lib.types) bool; inherit (lib.types) bool;
in { in {
# A wrapper around `mkOption` to create a boolean option that is
# used for Language Server modules.
mkEnable = desc:
mkOption {
description = "Turn on ${desc} for enabled languages by default";
type = bool;
default = false;
};
# Converts a boolean to a yes/no string. This is used in lots of # Converts a boolean to a yes/no string. This is used in lots of
# configuration formats. # configuration formats.
diagnosticsToLua = { diagnosticsToLua = {
@ -27,11 +36,4 @@ in {
value = diagnosticsProviders.${type}.nullConfig package; value = diagnosticsProviders.${type}.nullConfig package;
}) })
config); config);
mkEnable = desc:
mkOption {
description = "Turn on ${desc} for enabled languages by default";
type = bool;
default = false;
};
} }

View file

@ -6,10 +6,10 @@
typesDag = import ./dag.nix {inherit lib;}; typesDag = import ./dag.nix {inherit lib;};
typesPlugin = import ./plugins.nix {inherit inputs lib;}; typesPlugin = import ./plugins.nix {inherit inputs lib;};
typesLanguage = import ./languages.nix {inherit lib;}; typesLanguage = import ./languages.nix {inherit lib;};
typesCustom = import ./custom.nix {inherit lib;}; typesTypes = import ./types.nix {inherit lib;};
in { in {
inherit (typesDag) dagOf; inherit (typesDag) dagOf;
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType; inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
inherit (typesLanguage) diagnostics mkGrammarOption; inherit (typesLanguage) diagnostics mkGrammarOption;
inherit (typesCustom) anythingConcatLists char; inherit (typesTypes) anythingConcatLists char hexColor;
} }

View file

@ -1,8 +1,9 @@
{lib}: let {lib}: let
inherit (lib) isStringLike showOption showFiles getFiles mergeOneOption mergeEqualOption mkOptionType; inherit (lib) isStringLike showOption showFiles getFiles mergeOneOption mergeEqualOption mkOptionType;
inherit (lib.strings) isString;
inherit (lib.types) anything attrsOf; inherit (lib.types) anything attrsOf;
inherit (lib.nvim.types) anythingConcatLists; inherit (lib.nvim.types) anythingConcatLists;
inherit (builtins) typeOf isAttrs any head concatLists stringLength; inherit (builtins) typeOf isAttrs any head concatLists stringLength match;
in { in {
# HACK: Does this break anything in our case? # HACK: Does this break anything in our case?
# A modified version of the nixpkgs anything type that concatenates lists # A modified version of the nixpkgs anything type that concatenates lists
@ -58,4 +59,11 @@ in {
check = value: stringLength value < 2; check = value: stringLength value < 2;
merge = mergeEqualOption; merge = mergeEqualOption;
}; };
hexColor = mkOptionType {
name = "hex-color";
descriptionClass = "noun";
description = "RGB color in hex format";
check = v: isString v && (match "#?[0-9a-fA-F]{6}" v) != null;
};
} }

View file

@ -24,6 +24,7 @@
"dashboard" "dashboard"
"debugger" "debugger"
"filetree" "filetree"
"formatter"
"git" "git"
"languages" "languages"
"lsp" "lsp"

View file

@ -3,32 +3,75 @@
lib, lib,
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf mkMerge;
inherit (lib.trivial) pipe;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.lists) flatten;
legacyMapModes = {
normal = ["n"];
insert = ["i"];
select = ["s"];
visual = ["v"];
terminal = ["t"];
normalVisualOp = ["n" "v" "o"];
visualOnly = ["n" "x"];
operator = ["o"];
insertCommand = ["i" "c"];
lang = ["l"];
command = ["c"];
};
cfg = config.vim; cfg = config.vim;
in { in {
config = { config = {
vim.maps = mkIf cfg.disableArrows { vim.keymaps = mkMerge [
"<up>" = { (
mkIf cfg.disableArrows [
{
key = "<up>";
mode = ["n" "i"]; mode = ["n" "i"];
action = "<nop>"; action = "<nop>";
noremap = false; noremap = false;
}; }
"<down>" = { {
key = "<down>";
mode = ["n" "i"]; mode = ["n" "i"];
action = "<nop>"; action = "<nop>";
noremap = false; noremap = false;
}; }
"<left>" = { {
key = "<left>";
mode = ["n" "i"]; mode = ["n" "i"];
action = "<nop>"; action = "<nop>";
noremap = false; noremap = false;
}; }
"<right>" = { {
key = "<right>";
mode = ["n" "i"]; mode = ["n" "i"];
action = "<nop>"; action = "<nop>";
noremap = false; noremap = false;
}; }
}; ]
)
(
pipe cfg.maps
[
(mapAttrsToList (
oldMode: keybinds:
mapAttrsToList (
key: bind:
bind
// {
inherit key;
mode = legacyMapModes.${oldMode};
}
)
keybinds
))
flatten
]
)
];
}; };
} }

View file

@ -1,6 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.types) either str listOf attrsOf nullOr submodule bool; inherit (lib.types) either str listOf attrsOf nullOr submodule;
inherit (lib.nvim.config) mkBool; inherit (lib.nvim.config) mkBool;
mapConfigOptions = { mapConfigOptions = {
@ -31,6 +31,10 @@
options = options =
mapConfigOptions mapConfigOptions
// { // {
key = mkOption {
type = str;
description = "The key that triggers this keybind.";
};
mode = mkOption { mode = mkOption {
type = either str (listOf str); type = either str (listOf str);
description = '' description = ''
@ -38,52 +42,56 @@
See `:help map-modes` for a list of modes. See `:help map-modes` for a list of modes.
''; '';
example = ''`["n" "v" "c"]` for normal, visual and command mode'';
}; };
}; };
}; };
# legacy stuff legacyMapOption = mode:
mapOption = submodule {
options = mapConfigOptions;
};
mapOptions = mode:
mkOption { mkOption {
description = "Mappings for ${mode} mode"; description = "Mappings for ${mode} mode";
type = attrsOf mapOption; type = attrsOf (submodule {
options = mapConfigOptions;
});
default = {}; default = {};
}; };
in { in {
options.vim = { options.vim = {
maps = mkOption { keymaps = mkOption {
type = submodule { type = listOf mapType;
freeformType = attrsOf mapType;
options = {
normal = mapOptions "normal";
insert = mapOptions "insert";
select = mapOptions "select";
visual = mapOptions "visual and select";
terminal = mapOptions "terminal";
normalVisualOp = mapOptions "normal, visual, select and operator-pending (same as plain 'map')";
visualOnly = mapOptions "visual only";
operator = mapOptions "operator-pending";
insertCommand = mapOptions "insert and command-line";
lang = mapOptions "insert, command-line and lang-arg";
command = mapOptions "command-line";
};
};
default = {};
description = "Custom keybindings."; description = "Custom keybindings.";
example = '' example = ''
maps = { vim.keymaps = [
"<leader>m" = { {
key = "<leader>m";
mode = "n"; mode = "n";
silent = true; silent = true;
action = "<cmd>make<CR>"; action = ":make<CR>";
}; # Same as nnoremap <leader>m <silent> <cmd>make<CR> }
}; {
key = "<leader>l";
mode = ["n" "x"];
silent = true;
action = "<cmd>cnext<CR>";
}
];
''; '';
default = {};
};
maps = {
normal = legacyMapOption "normal";
insert = legacyMapOption "insert";
select = legacyMapOption "select";
visual = legacyMapOption "visual and select";
terminal = legacyMapOption "terminal";
normalVisualOp = legacyMapOption "normal, visual, select and operator-pending (same as plain 'map')";
visualOnly = legacyMapOption "visual only";
operator = legacyMapOption "operator-pending";
insertCommand = legacyMapOption "insert and command-line";
lang = legacyMapOption "insert, command-line and lang-arg";
command = legacyMapOption "command-line";
}; };
}; };
} }

View file

@ -0,0 +1,3 @@
{
imports = [./nvim-lint];
}

View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.diagnostics.nvim-lint;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["nvim-lint"];
pluginRC.nvim-lint = entryAnywhere ''
require("lint").setup(${toLuaObject cfg.setupOpts})
'';
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./nvim-lint.nix
./config.nix
];
}

View file

@ -0,0 +1,36 @@
{
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) attrs attrsOf listOf str;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.diagnostics.nvim-lint = {
enable = mkEnableOption "asynchronous linter plugin for Neovim [nvim-lint]";
setupOpts = mkPluginSetupOption "conform.nvim" {
linters_by_ft = mkOption {
type = attrsOf (listOf str);
default = {};
example = {
text = ["vale"];
markdown = ["vale"];
};
description = ''
Map of filetype to formatters. This option takes a set of
`key = value` format where the `value will` be converted
to its Lua equivalent. You are responsible for passing the
correct Nix data types to generate a correct Lua value that
conform is able to accept.
'';
};
default_format_opts = mkOption {
type = attrs;
default = {lsp_format = "fallback";};
description = "Default values when calling `conform.format()`";
};
};
};
}

View file

@ -20,6 +20,8 @@ in {
"neo-tree-nvim" "neo-tree-nvim"
]; ];
visuals.nvimWebDevicons.enable = true;
pluginRC.neo-tree = entryAnywhere '' pluginRC.neo-tree = entryAnywhere ''
require("neo-tree").setup(${toLuaObject cfg.setupOpts}) require("neo-tree").setup(${toLuaObject cfg.setupOpts})
''; '';

View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.formatter.conform-nvim;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["conform-nvim"];
pluginRC.conform-nvim = entryAnywhere ''
require("conform").setup(${toLuaObject cfg.setupOpts})
'';
};
};
}

View file

@ -0,0 +1,61 @@
{
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) attrs enum;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.formatter.conform-nvim = {
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
setupOpts = mkPluginSetupOption "conform.nvim" {
formatters_by_ft = mkOption {
type = attrs;
default = {};
example = literalExpression "lua = [\"${pkgs.stylua}/bin/stylua\"]";
description = ''
Map of filetype to formatters. This option takes a set of
`key = value` format where the `value will` be converted
to its Lua equivalent. You are responsible for passing the
correct Nix data types to generate a correct Lua value that
conform is able to accept.
'';
};
default_format_opts = mkOption {
type = attrs;
default = {lsp_format = "fallback";};
description = "Default values when calling `conform.format()`";
};
format_on_save = mkOption {
type = attrs;
default = {
lsp_format = "fallback";
timeout_ms = 500;
};
description = ''
Table that will be passed to `conform.format()`. If this
is set, Conform will run the formatter on save.
'';
};
format_after_save = mkOption {
type = attrs;
default = {lsp_format = "fallback";};
description = ''
Table that will be passed to `conform.format()`. If this
is set, Conform will run the formatter asynchronously after
save.
'';
};
log_level = mkOption {
type = enum ["vim.log.levels.ERROR" "vim.log.levels.WARN" "vim.log.levels.INFO" "vim.log.levels.DEBUG"];
default = "vim.log.levels.ERROR"; # TODO: make this luaInline
description = "Logging level for conform-nvim";
};
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./conform-nvim.nix
./config.nix
];
}

View file

@ -0,0 +1,3 @@
{
imports = [./conform-nvim];
}

View file

@ -114,12 +114,12 @@ in {
(mkIf cfg.elixir-tools.enable { (mkIf cfg.elixir-tools.enable {
vim.startPlugins = ["elixir-tools"]; vim.startPlugins = ["elixir-tools"];
vim.pluginRC.elixir-tools = entryAnywhere '' vim.pluginRC.elixir-tools = entryAnywhere ''
local elixir-tools = require("elixir") local elixir = require("elixir")
local elixirls = require("elixir-tools.elixirls") local elixirls = require("elixir.elixirls")
-- disable imperative insstallations of various -- disable imperative insstallations of various
-- elixir related tools installed by elixir-tools -- elixir related tools installed by elixir-tools
elixir-tools.setup { elixir.setup {
nextls = { nextls = {
enable = false -- defaults to false enable = false -- defaults to false
}, },

View file

@ -17,29 +17,36 @@
"ayu_dark" "ayu_dark"
"ayu_light" "ayu_light"
"ayu_mirage" "ayu_mirage"
"ayu"
"codedark" "codedark"
"dracula" "dracula"
"everforest" "everforest"
"gruvbox" "gruvbox"
"gruvbox_dark"
"gruvbox_light" "gruvbox_light"
"gruvbox_material" "gruvbox_material"
"horizon" "horizon"
"iceberg_dark" "iceberg_dark"
"iceberg_light" "iceberg_light"
"iceberg"
"jellybeans" "jellybeans"
"material" "material"
"modus_vivendi" "modus_vivendi"
"molokai" "molokai"
"moonfly"
"nightfly" "nightfly"
"nord" "nord"
"oceanicnext" "oceanicnext"
"onedark"
"onelight" "onelight"
"palenight" "palenight"
"papercolor_dark" "papercolor_dark"
"papercolor_light" "papercolor_light"
"powerline_dark"
"powerline" "powerline"
"seoul256" "seoul256"
"solarized_dark" "solarized_dark"
"solarized_light"
"tomorrow" "tomorrow"
"wombat" "wombat"
]; ];
@ -224,7 +231,7 @@ in {
local buf_ft = vim.api.nvim_get_option_value('filetype', {}) local buf_ft = vim.api.nvim_get_option_value('filetype', {})
-- List of buffer types to exclude -- List of buffer types to exclude
local excluded_buf_ft = {"toggleterm", "NvimTree", "TelescopePrompt"} local excluded_buf_ft = {"toggleterm", "NvimTree", "neo-tree", "TelescopePrompt"}
-- Check if the current buffer type is in the excluded list -- Check if the current buffer type is in the excluded list
for _, excluded_type in ipairs(excluded_buf_ft) do for _, excluded_type in ipairs(excluded_buf_ft) do

View file

@ -4,7 +4,14 @@
}: let }: let
inherit (lib.strings) optionalString; inherit (lib.strings) optionalString;
inherit (lib.trivial) boolToString warnIf; inherit (lib.trivial) boolToString warnIf;
inherit (lib.nvim.lua) toLuaObject;
in { in {
base16 = {
setup = {base16-colors, ...}: ''
-- Base16 theme
require('base16-colorscheme').setup(${toLuaObject base16-colors})
'';
};
onedark = { onedark = {
setup = {style ? "dark", ...}: '' setup = {style ? "dark", ...}: ''
-- OneDark theme -- OneDark theme
@ -20,6 +27,7 @@ in {
setup = { setup = {
style ? "night", style ? "night",
transparent, transparent,
...
}: '' }: ''
require('tokyonight').setup { require('tokyonight').setup {
transparent = ${boolToString transparent}; transparent = ${boolToString transparent};
@ -42,6 +50,7 @@ in {
setup = { setup = {
style ? "mocha", style ? "mocha",
transparent ? false, transparent ? false,
...
}: '' }: ''
-- Catppuccin theme -- Catppuccin theme
require('catppuccin').setup { require('catppuccin').setup {
@ -69,7 +78,7 @@ in {
notify = true, -- nvim-notify notify = true, -- nvim-notify
which_key = true, which_key = true,
navic = { navic = {
enabled = false, enabled = true,
custom_bg = "NONE", -- "lualine" will set background to mantle custom_bg = "NONE", -- "lualine" will set background to mantle
}, },
}, },

View file

@ -4,32 +4,51 @@
... ...
}: let }: let
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.attrsets) attrNames; inherit (lib.attrsets) attrNames listToAttrs;
inherit (lib.strings) hasPrefix;
inherit (lib.types) bool lines enum; inherit (lib.types) bool lines enum;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryBefore; inherit (lib.nvim.dag) entryBefore;
inherit (lib.nvim.types) hexColor;
cfg = config.vim.theme; cfg = config.vim.theme;
supportedThemes = import ./supported-themes.nix { supportedThemes = import ./supported-themes.nix {
inherit lib config; inherit lib config;
}; };
numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F"];
base16Options = listToAttrs (map (n: {
name = "base0${n}";
value = mkOption {
description = "The base0${n} color to use";
type = hexColor;
apply = v:
if hasPrefix "#" v
then v
else "#${v}";
};
})
numbers);
in { in {
options.vim.theme = { options.vim.theme = {
enable = mkOption { enable = mkOption {
type = bool; type = bool;
description = "Enable theming"; description = "Enable theming";
}; };
name = mkOption { name = mkOption {
type = enum (attrNames supportedThemes); type = enum (attrNames supportedThemes);
description = "Supported themes can be found in `supportedThemes.nix`"; description = ''
Supported themes can be found in {file}`supportedThemes.nix`.
Setting the theme to "base16" enables base16 theming and
requires all of the colors in {option}`vim.theme.base16-colors` to be set.
'';
}; };
base16-colors = base16Options;
style = mkOption { style = mkOption {
type = enum supportedThemes.${cfg.name}.styles; type = enum supportedThemes.${cfg.name}.styles;
description = "Specific style for theme if it supports it"; description = "Specific style for theme if it supports it";
}; };
transparent = mkOption { transparent = mkOption {
type = bool; type = bool;
default = false; default = false;
@ -47,7 +66,7 @@ in {
startPlugins = [cfg.name]; startPlugins = [cfg.name];
luaConfigRC.theme = entryBefore ["pluginConfigs"] '' luaConfigRC.theme = entryBefore ["pluginConfigs"] ''
${cfg.extraConfig} ${cfg.extraConfig}
${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}} ${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent base16-colors;}}
''; '';
}; };
}; };

View file

@ -3,42 +3,29 @@
lib, lib,
... ...
}: let }: let
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
inherit (lib.nvim.dag) entryAnywhere; inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.utility.surround; cfg = config.vim.utility.surround;
self = import ./surround.nix {inherit lib config;};
mappingDefinitions = self.options.vim.utility.surround.mappings;
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
startPlugins = [ startPlugins = ["nvim-surround"];
"nvim-surround" pluginRC.surround = entryAnywhere "require('nvim-surround').setup(${toLuaObject cfg.setupOpts})";
];
pluginRC.surround = entryAnywhere '' utility.surround.setupOpts.keymaps = mkIf cfg.useVendoredKeybindings {
require('nvim-surround').setup() insert = "<C-g>z";
''; insert_line = "<C-g>Z";
normal = "gz";
maps = { normal_cur = "gZ";
insert = mkMerge [ normal_line = "gzz";
(mkIf (mappings.insert != null) (mkSetBinding mappings.insert "<Plug>(nvim-surround-insert)")) normal_cur_line = "gZZ";
(mkIf (mappings.insertLine != null) (mkSetBinding mappings.insertLine "<Plug>(nvim-surround-insert-line)")) visual = "gz";
]; visual_line = "gZ";
normal = mkMerge [ delete = "gzd";
(mkIf (mappings.normal != null) (mkSetBinding mappings.normal "<Plug>(nvim-surround-normal)")) change = "gzr";
(mkIf (mappings.normalCur != null) (mkSetBinding mappings.normalCur "<Plug>(nvim-surround-normal-cur)")) change_line = "gZR";
(mkIf (mappings.normalLine != null) (mkSetBinding mappings.normalLine "<Plug>(nvim-surround-normal-line)"))
(mkIf (mappings.normalCurLine != null) (mkSetBinding mappings.normalCurLine "<Plug>(nvim-surround-normal-cur-line)"))
(mkIf (mappings.delete != null) (mkSetBinding mappings.delete "<Plug>(nvim-surround-delete)"))
(mkIf (mappings.change != null) (mkSetBinding mappings.change "<Plug>(nvim-surround-change)"))
];
visualOnly = mkMerge [
(mkIf (mappings.visual != null) (mkSetBinding mappings.visual "<Plug>(nvim-surround-visual)"))
(mkIf (mappings.visualLine != null) (mkSetBinding mappings.visualLine "<Plug>(nvim-surround-visual-line)"))
];
}; };
}; };
}; };

View file

@ -1,90 +1,24 @@
{ {lib, ...}: let
lib,
config,
...
}: let
inherit (lib.modules) mkIf mkDefault;
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.types) bool nullOr str; inherit (lib.types) bool;
inherit (lib.nvim.types) mkPluginSetupOption;
in { in {
options.vim.utility.surround = { options.vim.utility.surround = {
enable = mkOption { enable = mkOption {
type = bool; type = bool;
default = false; default = false;
description = "nvim-surround: add/change/delete surrounding delimiter pairs with ease. Note that the default mappings deviate from upstreeam to avoid conflicts with nvim-leap."; description = ''
nvim-surround: add/change/delete surrounding delimiter pairs with ease.
Note that the default mappings deviate from upstreeam to avoid conflicts
with nvim-leap.
'';
}; };
setupOpts = mkPluginSetupOption "nvim-surround" {};
useVendoredKeybindings = mkOption { useVendoredKeybindings = mkOption {
type = bool; type = bool;
default = true; default = true;
description = "Use alternative set of keybindings that avoids conflicts with other popular plugins, e.g. nvim-leap"; description = "Use alternative set of keybindings that avoids conflicts with other popular plugins, e.g. nvim-leap";
}; };
mappings = {
insert = mkOption {
type = nullOr str;
default = "<C-g>z";
description = "Add surround character around the cursor";
};
insertLine = mkOption {
type = nullOr str;
default = "<C-g>Z";
description = "Add surround character around the cursor on new lines";
};
normal = mkOption {
type = nullOr str;
default = "gz";
description = "Surround motion with character";
};
normalCur = mkOption {
type = nullOr str;
default = "gZ";
description = "Surround motion with character on new lines";
};
normalLine = mkOption {
type = nullOr str;
default = "gzz";
description = "Surround line with character";
};
normalCurLine = mkOption {
type = nullOr str;
default = "gZZ";
description = "Surround line with character on new lines";
};
visual = mkOption {
type = nullOr str;
default = "gz";
description = "Surround selection with character";
};
visualLine = mkOption {
type = nullOr str;
default = "gZ";
description = "Surround selection with character on new lines";
};
delete = mkOption {
type = nullOr str;
default = "gzd";
description = "Delete surrounding character";
};
change = mkOption {
type = nullOr str;
default = "gzr";
description = "Change surrounding character";
};
};
};
config.vim.utility.surround = let
cfg = config.vim.utility.surround;
in {
mappings = mkIf (! cfg.useVendoredKeybindings) (mkDefault {
insert = null;
insertLine = null;
normal = null;
normalCur = null;
normalLine = null;
normalCurLine = null;
visual = null;
visualLine = null;
delete = null;
change = null;
});
}; };
} }

View file

@ -3,8 +3,8 @@
lib, lib,
... ...
}: let }: let
inherit (builtins) map mapAttrs filter removeAttrs attrNames; inherit (builtins) map mapAttrs filter;
inherit (lib.attrsets) mapAttrsToList filterAttrs attrsToList; inherit (lib.attrsets) mapAttrsToList filterAttrs;
inherit (lib.strings) concatLines concatMapStringsSep; inherit (lib.strings) concatLines concatMapStringsSep;
inherit (lib.trivial) showWarnings; inherit (lib.trivial) showWarnings;
inherit (lib.generators) mkLuaInline; inherit (lib.generators) mkLuaInline;
@ -41,40 +41,9 @@ in {
inherit (keymap) desc silent nowait script expr unique noremap; inherit (keymap) desc silent nowait script expr unique noremap;
}; };
toLuaKeymap = { toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})";
name,
value,
}: "vim.keymap.set(${toLuaObject value.mode}, ${toLuaObject name}, ${toLuaObject (getAction value)}, ${toLuaObject (getOpts value)})";
namedModes = { keymaps = concatLines (map toLuaKeymap cfg.keymaps);
"normal" = ["n"];
"insert" = ["i"];
"select" = ["s"];
"visual" = ["v"];
"terminal" = ["t"];
"normalVisualOp" = ["n" "v" "o"];
"visualOnly" = ["n" "x"];
"operator" = ["o"];
"insertCommand" = ["i" "c"];
"lang" = ["l"];
"command" = ["c"];
};
maps =
removeAttrs cfg.maps (attrNames namedModes)
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.normal;}) cfg.maps.normal
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.insert;}) cfg.maps.insert
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.select;}) cfg.maps.select
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.visual;}) cfg.maps.visual
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.terminal;}) cfg.maps.terminal
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.normalVisualOp;}) cfg.maps.normalVisualOp
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.visualOnly;}) cfg.maps.visualOnly
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.operator;}) cfg.maps.operator
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.insertCommand;}) cfg.maps.insertCommand
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.lang;}) cfg.maps.lang
// mapAttrs (_: legacyMap: legacyMap // {mode = namedModes.command;}) cfg.maps.command;
keymaps = concatLines (map toLuaKeymap (attrsToList (filterAttrs (_: value: value != null) maps)));
in { in {
vim = { vim = {
luaConfigRC = { luaConfigRC = {