mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-25 17:19:47 +01:00
Merge branch 'main' into add-hcl-not-terraform
This commit is contained in:
commit
eb288de4cf
32 changed files with 400 additions and 286 deletions
|
@ -17,7 +17,6 @@ isMaximal: {
|
||||||
lspkind.enable = false;
|
lspkind.enable = false;
|
||||||
lightbulb.enable = true;
|
lightbulb.enable = true;
|
||||||
lspsaga.enable = false;
|
lspsaga.enable = false;
|
||||||
nvimCodeActionMenu.enable = isMaximal;
|
|
||||||
trouble.enable = true;
|
trouble.enable = true;
|
||||||
lspSignature.enable = true;
|
lspSignature.enable = true;
|
||||||
lsplines.enable = isMaximal;
|
lsplines.enable = isMaximal;
|
||||||
|
@ -204,6 +203,7 @@ isMaximal: {
|
||||||
go = ["90" "130"];
|
go = ["90" "130"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
fastaction.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
assistant = {
|
assistant = {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Custom Plugins {#ch-custom-plugins}
|
# Custom Plugins {#ch-custom-plugins}
|
||||||
|
|
||||||
**nvf**, by default, exposes a wide variety of plugins as module options
|
**nvf**, by default, exposes a wide variety of plugins as module options
|
||||||
for your convience and bundles necessary dependencies into **nvf**'s runtime.
|
for your convenience and bundles necessary dependencies into **nvf**'s runtime.
|
||||||
In case a plugin is not available in **nvf**, you may consider making a pull
|
In case a plugin is not available in **nvf**, you may consider making a pull
|
||||||
request to **nvf** to include it as a module or you may add it to your
|
request to **nvf** to include it as a module or you may add it to your
|
||||||
configuration locally.
|
configuration locally.
|
||||||
|
|
|
@ -11,7 +11,7 @@ entries in nvf:
|
||||||
inserted before the rest of the DAG
|
inserted before the rest of the DAG
|
||||||
2. `globalsScript` - used to set globals defined in `vim.globals`
|
2. `globalsScript` - used to set globals defined in `vim.globals`
|
||||||
3. `basic` - used to set basic configuration options
|
3. `basic` - used to set basic configuration options
|
||||||
4. `theme` - used to set up the theme, which has to be done before other plugins
|
4. `theme` (this is simply placed before `pluginConfigs`, meaning that surrounding entries don't depend on it) - used to set up the theme, which has to be done before other plugins
|
||||||
5. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option,
|
5. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option,
|
||||||
see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your own
|
see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your own
|
||||||
plugins) DAG, used to set up internal plugins
|
plugins) DAG, used to set up internal plugins
|
||||||
|
|
|
@ -4,6 +4,8 @@ Release notes for release 0.7
|
||||||
|
|
||||||
## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide-0-7}
|
## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide-0-7}
|
||||||
|
|
||||||
|
### `vim.configRC` removed {#sec-vim-configrc-removed}
|
||||||
|
|
||||||
In v0.7 we are removing `vim.configRC` in favor of making `vim.luaConfigRC` the
|
In v0.7 we are removing `vim.configRC` in favor of making `vim.luaConfigRC` the
|
||||||
top-level DAG, and thereby making the entire configuration Lua based. This
|
top-level DAG, and thereby making the entire configuration Lua based. This
|
||||||
change introduces a few breaking changes:
|
change introduces a few breaking changes:
|
||||||
|
@ -24,6 +26,17 @@ making good use of its extensive Lua API. Additionally, Vimscript is slow and
|
||||||
brings unnecessary performance overhead while working with different
|
brings unnecessary performance overhead while working with different
|
||||||
configuration formats.
|
configuration formats.
|
||||||
|
|
||||||
|
### `vim.lsp.nvimCodeActionMenu` removed in favor of `vim.ui.fastaction` {#sec-nvim-code-action-menu-deprecation}
|
||||||
|
|
||||||
|
The nvim-code-action-menu plugin has been archived and broken for a long time,
|
||||||
|
so it's being replaced with a young, but better alternative called
|
||||||
|
fastaction.nvim. Simply remove everything set under
|
||||||
|
`vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`.
|
||||||
|
|
||||||
|
Note that we are looking to add more alternatives in the future like
|
||||||
|
dressing.nvim and actions-preview.nvim, in case fastaction doesn't work for
|
||||||
|
everyone.
|
||||||
|
|
||||||
## Changelog {#sec-release-0.7-changelog}
|
## Changelog {#sec-release-0.7-changelog}
|
||||||
|
|
||||||
[ItsSorae](https://github.com/ItsSorae):
|
[ItsSorae](https://github.com/ItsSorae):
|
||||||
|
@ -53,6 +66,7 @@ configuration formats.
|
||||||
longer filtered and thus should be used instead.
|
longer filtered and thus should be used instead.
|
||||||
- Add dap-go for better dap configurations
|
- Add dap-go for better dap configurations
|
||||||
- Make noice.nvim customizable
|
- Make noice.nvim customizable
|
||||||
|
- Standardize border style options and add custom borders
|
||||||
|
|
||||||
[rust-tools.nvim]: https://github.com/simrat39/rust-tools.nvim
|
[rust-tools.nvim]: https://github.com/simrat39/rust-tools.nvim
|
||||||
[rustaceanvim]: https://github.com/mrcjkb/rustaceanvim
|
[rustaceanvim]: https://github.com/mrcjkb/rustaceanvim
|
||||||
|
@ -71,7 +85,8 @@ configuration formats.
|
||||||
|
|
||||||
- Fix "Emac" typo
|
- Fix "Emac" typo
|
||||||
|
|
||||||
- Add [new-file-template.nvim] to automatically fill new file contents using templates.
|
- Add [new-file-template.nvim] to automatically fill new file contents using
|
||||||
|
templates.
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
|
@ -93,7 +108,6 @@ configuration formats.
|
||||||
plugin's options can now be found under `indentBlankline.setupOpts`, the
|
plugin's options can now be found under `indentBlankline.setupOpts`, the
|
||||||
previous iteration of the module also included out of place/broken options,
|
previous iteration of the module also included out of place/broken options,
|
||||||
which have been removed for the time being. These are:
|
which have been removed for the time being. These are:
|
||||||
|
|
||||||
- `listChar` - this was already unused
|
- `listChar` - this was already unused
|
||||||
- `fillChar` - this had nothing to do with the plugin, please configure it
|
- `fillChar` - this had nothing to do with the plugin, please configure it
|
||||||
yourself by adding `vim.opt.listchars:append({ space = '<char>' })` to your
|
yourself by adding `vim.opt.listchars:append({ space = '<char>' })` to your
|
||||||
|
@ -102,6 +116,9 @@ configuration formats.
|
||||||
yourself by adding `vim.opt.listchars:append({ eol = '<char>' })` to your
|
yourself by adding `vim.opt.listchars:append({ eol = '<char>' })` to your
|
||||||
lua configuration
|
lua configuration
|
||||||
|
|
||||||
|
- Replace `vim.lsp.nvimCodeActionMenu` with `vim.ui.fastaction`, see the
|
||||||
|
breaking changes section above for more details
|
||||||
|
|
||||||
[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
|
||||||
|
@ -146,7 +163,31 @@ configuration formats.
|
||||||
- Add `nvf-print-config` & `nvf-print-config-path` helper scripts to Neovim
|
- Add `nvf-print-config` & `nvf-print-config-path` helper scripts to Neovim
|
||||||
closure. Both of those scripts have been automatically added to your PATH upon
|
closure. Both of those scripts have been automatically added to your PATH upon
|
||||||
using neovimConfig or `programs.nvf.enable`.
|
using neovimConfig or `programs.nvf.enable`.
|
||||||
|
|
||||||
- `nvf-print-config` will display your `init.lua`, in full.
|
- `nvf-print-config` will display your `init.lua`, in full.
|
||||||
- `nvf-print-config-path` will display the path to _a clone_ of your
|
- `nvf-print-config-path` will display the path to _a clone_ of your
|
||||||
`init.lua`. This is not the path used by the Neovim wrapper, but an
|
`init.lua`. This is not the path used by the Neovim wrapper, but an
|
||||||
identical clone.
|
identical clone.
|
||||||
|
|
||||||
|
- Add `vim.ui.breadcrumbs.lualine` to allow fine-tuning breadcrumbs behaviour on
|
||||||
|
Lualine. Only `vim.ui.breadcrumbs.lualine.winbar` is supported for the time
|
||||||
|
being.
|
||||||
|
|
||||||
|
- [](#opt-vim.ui.breadcrumbs.lualine.winbar.enable) has been added to allow
|
||||||
|
controlling the default behaviour of the `nvim-navic` component on Lualine,
|
||||||
|
which used to occupy `winbar.lualine_c` as long as breadcrumbs are enabled.
|
||||||
|
- `vim.ui.breadcrumbs.alwaysRender` has been renamed to
|
||||||
|
[](#opt-vim.ui.breadcrumbs.lualine.winbar.alwaysRender) to be conform to the
|
||||||
|
new format.
|
||||||
|
|
||||||
|
- Add [basedpyright](https://github.com/detachhead/basedpyright) as a Python LSP
|
||||||
|
server and make it default.
|
||||||
|
|
||||||
|
- Add [python-lsp-server](https://github.com/python-lsp/python-lsp-server) as an
|
||||||
|
additional Python LSP server.
|
||||||
|
|
||||||
|
[ppenguin](https://github.com/ppenguin):
|
||||||
|
|
||||||
|
- Telescope:
|
||||||
|
- Fixed `project-nvim` command and keybinding
|
||||||
|
- Added default ikeybind/command for `Telescope resume` (`<leader>fr`)
|
||||||
|
|
46
flake.lock
46
flake.lock
|
@ -69,11 +69,11 @@
|
||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1724456641,
|
"lastModified": 1726188505,
|
||||||
"narHash": "sha256-SMgnviF6ofBPbyV3+rljPGcX0Hn9HBOhgXE10Cyjaic=",
|
"narHash": "sha256-3dkxJo6y/aKfwkAg6YnpdiQAoZKgHhWHz7ilGJHCoVU=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "c261925dbbf02f523af0e8add844df64fddf0359",
|
"rev": "ea00b3d2162d85dd085a6ba6d49aa2a186e588e7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -129,11 +129,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1724395761,
|
"lastModified": 1726142289,
|
||||||
"narHash": "sha256-zRkDV/nbrnp3Y8oCADf5ETl1sDrdmAW6/bBVJ8EbIdQ=",
|
"narHash": "sha256-Jks8O42La+nm5AMTSq/PvM5O+fUAhIy0Ce1QYqLkyZ4=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ae815cee91b417be55d43781eb4b73ae1ecc396c",
|
"rev": "280db3decab4cbeb22a4599bd472229ab74d25e1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -571,6 +571,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugin-fastaction-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721396662,
|
||||||
|
"narHash": "sha256-L7na78FsE+QHlEwxMpiwQcoOPhtmrknvdTZfzUoDANI=",
|
||||||
|
"owner": "Chaitanyabsprip",
|
||||||
|
"repo": "fastaction.nvim",
|
||||||
|
"rev": "2384dea7ba81d2709d0bee0e4bc7a8831ff13a9d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Chaitanyabsprip",
|
||||||
|
"repo": "fastaction.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"plugin-fidget-nvim": {
|
"plugin-fidget-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1052,22 +1068,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugin-nvim-code-action-menu": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1702287297,
|
|
||||||
"narHash": "sha256-pY+aP9iBuJhvDZzVEsOHZmnfaq3vUP7TfKEEQrj+Mo8=",
|
|
||||||
"owner": "weilbith",
|
|
||||||
"repo": "nvim-code-action-menu",
|
|
||||||
"rev": "8c7672a4b04d3cc4edd2c484d05b660a9cb34a1b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "weilbith",
|
|
||||||
"repo": "nvim-code-action-menu",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"plugin-nvim-colorizer-lua": {
|
"plugin-nvim-colorizer-lua": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1855,6 +1855,7 @@
|
||||||
"plugin-dracula": "plugin-dracula",
|
"plugin-dracula": "plugin-dracula",
|
||||||
"plugin-dressing-nvim": "plugin-dressing-nvim",
|
"plugin-dressing-nvim": "plugin-dressing-nvim",
|
||||||
"plugin-elixir-tools": "plugin-elixir-tools",
|
"plugin-elixir-tools": "plugin-elixir-tools",
|
||||||
|
"plugin-fastaction-nvim": "plugin-fastaction-nvim",
|
||||||
"plugin-fidget-nvim": "plugin-fidget-nvim",
|
"plugin-fidget-nvim": "plugin-fidget-nvim",
|
||||||
"plugin-flutter-tools": "plugin-flutter-tools",
|
"plugin-flutter-tools": "plugin-flutter-tools",
|
||||||
"plugin-gesture-nvim": "plugin-gesture-nvim",
|
"plugin-gesture-nvim": "plugin-gesture-nvim",
|
||||||
|
@ -1885,7 +1886,6 @@
|
||||||
"plugin-nvim-autopairs": "plugin-nvim-autopairs",
|
"plugin-nvim-autopairs": "plugin-nvim-autopairs",
|
||||||
"plugin-nvim-bufferline-lua": "plugin-nvim-bufferline-lua",
|
"plugin-nvim-bufferline-lua": "plugin-nvim-bufferline-lua",
|
||||||
"plugin-nvim-cmp": "plugin-nvim-cmp",
|
"plugin-nvim-cmp": "plugin-nvim-cmp",
|
||||||
"plugin-nvim-code-action-menu": "plugin-nvim-code-action-menu",
|
|
||||||
"plugin-nvim-colorizer-lua": "plugin-nvim-colorizer-lua",
|
"plugin-nvim-colorizer-lua": "plugin-nvim-colorizer-lua",
|
||||||
"plugin-nvim-cursorline": "plugin-nvim-cursorline",
|
"plugin-nvim-cursorline": "plugin-nvim-cursorline",
|
||||||
"plugin-nvim-dap": "plugin-nvim-dap",
|
"plugin-nvim-dap": "plugin-nvim-dap",
|
||||||
|
|
|
@ -133,8 +133,8 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-code-action-menu = {
|
plugin-fastaction-nvim = {
|
||||||
url = "github:weilbith/nvim-code-action-menu";
|
url = "github:Chaitanyabsprip/fastaction.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,6 @@ in {
|
||||||
formatOnSave = true;
|
formatOnSave = true;
|
||||||
lightbulb.enable = true;
|
lightbulb.enable = true;
|
||||||
lspsaga.enable = false;
|
lspsaga.enable = false;
|
||||||
nvimCodeActionMenu.enable = true;
|
|
||||||
trouble.enable = true;
|
trouble.enable = true;
|
||||||
lspSignature.enable = true;
|
lspSignature.enable = true;
|
||||||
rust.enable = false;
|
rust.enable = false;
|
||||||
|
|
|
@ -67,7 +67,6 @@ in {
|
||||||
formatOnSave = true;
|
formatOnSave = true;
|
||||||
lightbulb.enable = true;
|
lightbulb.enable = true;
|
||||||
lspsaga.enable = false;
|
lspsaga.enable = false;
|
||||||
nvimCodeActionMenu.enable = true;
|
|
||||||
trouble.enable = true;
|
trouble.enable = true;
|
||||||
lspSignature.enable = true;
|
lspSignature.enable = true;
|
||||||
rust.enable = false;
|
rust.enable = false;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
typesCustom = import ./custom.nix {inherit lib;};
|
typesCustom = import ./custom.nix {inherit lib;};
|
||||||
in {
|
in {
|
||||||
inherit (typesDag) dagOf;
|
inherit (typesDag) dagOf;
|
||||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType;
|
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||||
inherit (typesCustom) anythingConcatLists char;
|
inherit (typesCustom) anythingConcatLists char;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,9 +51,13 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
borderPresets = ["none" "single" "double" "rounded" "solid" "shadow"];
|
||||||
in {
|
in {
|
||||||
inherit extraPluginType fromInputs pluginType;
|
inherit extraPluginType fromInputs pluginType;
|
||||||
|
|
||||||
|
borderType = either (enum borderPresets) (listOf (either str (listOf str)));
|
||||||
|
|
||||||
pluginsOpt = {
|
pluginsOpt = {
|
||||||
description,
|
description,
|
||||||
example,
|
example,
|
||||||
|
|
|
@ -7,5 +7,12 @@ in {
|
||||||
Tidalcycles language support has been removed as of 2024-06-06 as it was long unmaintained. If
|
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.
|
you depended on this functionality, please open an issue.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
|
# 2024-07-20
|
||||||
|
(mkRemovedOptionModule ["vim" "lsp" "nvimCodeActionMenu"] ''
|
||||||
|
nvimCodeActionMenu has been deprecated and removed upstream. As of 0.7, fastaction will be
|
||||||
|
available under `vim.ui.fastaction` as a replacement. Simply remove everything under
|
||||||
|
`vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`.
|
||||||
|
'')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,13 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression literalMD;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.types) enum bool str int;
|
inherit (lib.types) enum bool str int either;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.types) luaInline;
|
||||||
|
|
||||||
cfg = config.vim;
|
cfg = config.vim;
|
||||||
in {
|
in {
|
||||||
|
@ -158,9 +160,29 @@ in {
|
||||||
default = "sensitive";
|
default = "sensitive";
|
||||||
description = "Set the case sensitivity of search";
|
description = "Set the case sensitivity of search";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
undoFile = {
|
||||||
|
enable = mkEnableOption "undofile for persistent undo behaviour";
|
||||||
|
path = mkOption {
|
||||||
|
type = either str luaInline;
|
||||||
|
default = mkLuaInline "vim.fn.stdpath('state') .. '/undo'";
|
||||||
|
defaultText = literalMD ''
|
||||||
|
```nix
|
||||||
|
mkLuaInline "vim.fn.stdpath('state') .. '/undo'"
|
||||||
|
```
|
||||||
|
'';
|
||||||
|
example = literalMD ''
|
||||||
|
```nix
|
||||||
|
mkLuaInline "os.getenv('XDG_DATA_HOME') .. '/nvf/undo'"
|
||||||
|
```
|
||||||
|
'';
|
||||||
|
description = "Path to the directory in which undo history will be stored";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.vim.luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
config = {
|
||||||
|
vim.luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
||||||
-- Settings that are set for everything
|
-- Settings that are set for everything
|
||||||
vim.o.encoding = "utf-8"
|
vim.o.encoding = "utf-8"
|
||||||
vim.o.hidden = true
|
vim.o.hidden = true
|
||||||
|
@ -178,6 +200,11 @@ in {
|
||||||
vim.g.mapleader = ${toLuaObject cfg.leaderKey}
|
vim.g.mapleader = ${toLuaObject cfg.leaderKey}
|
||||||
vim.g.maplocalleader = ${toLuaObject cfg.leaderKey}
|
vim.g.maplocalleader = ${toLuaObject cfg.leaderKey}
|
||||||
|
|
||||||
|
${optionalString cfg.undoFile.enable ''
|
||||||
|
vim.o.undofile = true
|
||||||
|
vim.o.undodir = ${toLuaObject cfg.undoFile.path}
|
||||||
|
''}
|
||||||
|
|
||||||
${optionalString cfg.splitBelow ''
|
${optionalString cfg.splitBelow ''
|
||||||
vim.o.splitbelow = true
|
vim.o.splitbelow = true
|
||||||
''}
|
''}
|
||||||
|
@ -266,4 +293,5 @@ in {
|
||||||
vim.o.ignorecase = false
|
vim.o.ignorecase = false
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.python;
|
cfg = config.vim.languages.python;
|
||||||
|
|
||||||
defaultServer = "pyright";
|
defaultServer = "basedpyright";
|
||||||
servers = {
|
servers = {
|
||||||
pyright = {
|
pyright = {
|
||||||
package = pkgs.pyright;
|
package = pkgs.pyright;
|
||||||
|
@ -30,6 +30,36 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
basedpyright = {
|
||||||
|
package = pkgs.basedpyright;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.basedpyright.setup{
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/basedpyright-langserver", "--stdio"}''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
python-lsp-server = {
|
||||||
|
package = pkgs.python-lsp-server;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.pylsp.setup{
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/pylsp"}''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = "black";
|
defaultFormat = "black";
|
||||||
|
@ -61,11 +91,12 @@
|
||||||
black-and-isort = {
|
black-and-isort = {
|
||||||
package = pkgs.writeShellApplication {
|
package = pkgs.writeShellApplication {
|
||||||
name = "black";
|
name = "black";
|
||||||
|
runtimeInputs = [pkgs.black pkgs.isort];
|
||||||
text = ''
|
text = ''
|
||||||
black --quiet - "$@" | isort --profile black -
|
black --quiet - "$@" | isort --profile black -
|
||||||
'';
|
'';
|
||||||
runtimeInputs = [pkgs.black pkgs.isort];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nullConfig = ''
|
nullConfig = ''
|
||||||
table.insert(
|
table.insert(
|
||||||
ls_sources,
|
ls_sources,
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
# lsp plugins
|
# lsp plugins
|
||||||
./lspsaga
|
./lspsaga
|
||||||
./nvim-code-action-menu
|
|
||||||
./trouble
|
./trouble
|
||||||
./lsp-signature
|
./lsp-signature
|
||||||
./lightbulb
|
./lightbulb
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.attrsets) mapAttrs;
|
inherit (lib.attrsets) mapAttrs;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
cfg = config.vim.lsp;
|
||||||
in {
|
in {
|
||||||
|
@ -22,7 +23,7 @@ in {
|
||||||
|
|
||||||
${
|
${
|
||||||
optionalString config.vim.ui.borders.enable ''
|
optionalString config.vim.ui.borders.enable ''
|
||||||
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
|
require('lspconfig.ui.windows').default_options.border = ${toLuaObject config.vim.ui.borders.globalStyle}
|
||||||
''
|
''
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -36,7 +36,7 @@ in {
|
||||||
(mkSetLuaBinding mappings.nextDiagnostic "require('lspsaga.diagnostic').navigate('next')")
|
(mkSetLuaBinding mappings.nextDiagnostic "require('lspsaga.diagnostic').navigate('next')")
|
||||||
(mkSetLuaBinding mappings.previousDiagnostic "require('lspsaga.diagnostic').navigate('prev')")
|
(mkSetLuaBinding mappings.previousDiagnostic "require('lspsaga.diagnostic').navigate('prev')")
|
||||||
|
|
||||||
(mkIf (!cfg.nvimCodeActionMenu.enable) (mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action"))
|
(mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action")
|
||||||
(mkIf (!cfg.lspSignature.enable) (mkSetLuaBinding mappings.signatureHelp "require('lspsaga.signaturehelp').signature_help"))
|
(mkIf (!cfg.lspSignature.enable) (mkSetLuaBinding mappings.signatureHelp "require('lspsaga.signaturehelp').signature_help"))
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings pushDownDefault;
|
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
|
||||||
|
|
||||||
self = import ./nvim-code-action-menu.nix {inherit lib;};
|
|
||||||
mappingDefinitions = self.options.vim.lsp.nvimCodeActionMenu.mappings;
|
|
||||||
mappings = addDescriptionsToMappings cfg.nvimCodeActionMenu.mappings mappingDefinitions;
|
|
||||||
in {
|
|
||||||
config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) {
|
|
||||||
vim = {
|
|
||||||
startPlugins = ["nvim-code-action-menu"];
|
|
||||||
|
|
||||||
maps.normal = mkSetBinding mappings.open ":CodeActionMenu<CR>";
|
|
||||||
|
|
||||||
binds.whichKey.register = pushDownDefault {
|
|
||||||
"<leader>c" = "+CodeAction";
|
|
||||||
};
|
|
||||||
|
|
||||||
pluginRC.code-action-menu = entryAnywhere ''
|
|
||||||
-- border configuration
|
|
||||||
vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}'
|
|
||||||
|
|
||||||
-- show individual sections of the code action menu
|
|
||||||
${lib.optionalString cfg.nvimCodeActionMenu.show.details "vim.g.code_action_menu_show_details = true"}
|
|
||||||
${lib.optionalString cfg.nvimCodeActionMenu.show.diff "vim.g.code_action_menu_show_diff = true"}
|
|
||||||
${lib.optionalString cfg.nvimCodeActionMenu.show.actionKind "vim.g.code_action_menu_show_action_kind = true"}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{lib, ...}: let
|
|
||||||
inherit (lib.options) mkEnableOption;
|
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
|
||||||
in {
|
|
||||||
options.vim.lsp = {
|
|
||||||
nvimCodeActionMenu = {
|
|
||||||
enable = mkEnableOption "nvim code action menu";
|
|
||||||
|
|
||||||
show = {
|
|
||||||
details = mkEnableOption "Show details" // {default = true;};
|
|
||||||
diff = mkEnableOption "Show diff" // {default = true;};
|
|
||||||
actionKind = mkEnableOption "Show action kind" // {default = true;};
|
|
||||||
};
|
|
||||||
|
|
||||||
mappings = {
|
|
||||||
open = mkMappingOption "Open code action menu [nvim-code-action-menu]" "<leader>ca";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -11,7 +11,7 @@
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
|
||||||
cfg = config.vim.statusline.lualine;
|
cfg = config.vim.statusline.lualine;
|
||||||
breadcrumbsCfg = config.vim.ui.breadcrumbs;
|
bCfg = config.vim.ui.breadcrumbs;
|
||||||
in {
|
in {
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
# TODO: move into nvim-tree file
|
# TODO: move into nvim-tree file
|
||||||
|
@ -20,13 +20,14 @@ in {
|
||||||
extensions = ["nvim-tree"];
|
extensions = ["nvim-tree"];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(mkIf (breadcrumbsCfg.enable && breadcrumbsCfg.source == "nvim-navic") {
|
|
||||||
|
(mkIf (bCfg.enable && bCfg.lualine.winbar.enable && bCfg.source == "nvim-navic") {
|
||||||
vim.statusline.lualine.setupOpts = {
|
vim.statusline.lualine.setupOpts = {
|
||||||
# TODO: rewrite in new syntax
|
# TODO: rewrite in new syntax
|
||||||
winbar.lualine_c = mkDefault [
|
winbar.lualine_c = mkDefault [
|
||||||
[
|
[
|
||||||
"navic"
|
"navic"
|
||||||
(mkLuaInline "draw_empty = ${boolToString config.vim.ui.breadcrumbs.alwaysRender}")
|
(mkLuaInline "draw_empty = ${boolToString bCfg.lualine.winbar.alwaysRender}")
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -34,7 +35,6 @@ in {
|
||||||
(mkIf cfg.enable {
|
(mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["lualine"];
|
startPlugins = ["lualine"];
|
||||||
|
|
||||||
pluginRC.lualine = entryAnywhere ''
|
pluginRC.lualine = entryAnywhere ''
|
||||||
local lualine = require('lualine')
|
local lualine = require('lualine')
|
||||||
lualine.setup ${toLuaObject cfg.setupOpts}
|
lualine.setup ${toLuaObject cfg.setupOpts}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
inherit (lib.attrsets) attrNames;
|
inherit (lib.attrsets) attrNames;
|
||||||
inherit (lib.types) bool lines enum;
|
inherit (lib.types) bool lines enum;
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryBefore;
|
||||||
|
|
||||||
cfg = config.vim.theme;
|
cfg = config.vim.theme;
|
||||||
supportedThemes = import ./supported-themes.nix {
|
supportedThemes = import ./supported-themes.nix {
|
||||||
|
@ -45,7 +45,7 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = [cfg.name];
|
startPlugins = [cfg.name];
|
||||||
luaConfigRC.theme = entryAfter ["basic"] ''
|
luaConfigRC.theme = entryBefore ["pluginConfigs"] ''
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}}
|
${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}}
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -4,31 +4,34 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.lists) optionals;
|
inherit (lib.nvim.types) borderType;
|
||||||
inherit (lib.types) enum;
|
|
||||||
|
|
||||||
cfg = config.vim.ui.borders;
|
cfg = config.vim.ui.borders;
|
||||||
|
|
||||||
defaultStyles = ["none" "single" "double" "rounded"];
|
|
||||||
in {
|
in {
|
||||||
options.vim.ui.borders = {
|
options.vim.ui.borders = {
|
||||||
enable = mkEnableOption "visible borders for most windows";
|
enable = mkEnableOption "visible borders for most windows";
|
||||||
|
|
||||||
globalStyle = mkOption {
|
globalStyle = mkOption {
|
||||||
type = enum defaultStyles;
|
type = borderType;
|
||||||
default = "rounded";
|
default = "rounded";
|
||||||
description = ''
|
description = ''
|
||||||
The global border style to use.
|
The global border style to use.
|
||||||
|
|
||||||
|
If a list is given, it should have a length of eight or any divisor of
|
||||||
|
eight. The array will specify the eight chars building up the border in
|
||||||
|
a clockwise fashion starting with the top-left corner. You can specify
|
||||||
|
a different highlight group for each character by passing a
|
||||||
|
[char, "YourHighlightGroup"] instead
|
||||||
'';
|
'';
|
||||||
|
example = ["╔" "═" "╗" "║" "╝" "═" "╚" "║"];
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: make per-plugin borders configurable
|
|
||||||
plugins = let
|
plugins = let
|
||||||
mkPluginStyleOption = name: {
|
mkPluginStyleOption = name: {
|
||||||
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
||||||
|
|
||||||
style = mkOption {
|
style = mkOption {
|
||||||
type = enum (defaultStyles ++ optionals (name != "which-key") ["shadow"]);
|
type = borderType;
|
||||||
default = cfg.globalStyle;
|
default = cfg.globalStyle;
|
||||||
description = "The border style to use for the ${name} plugin";
|
description = "The border style to use for the ${name} plugin";
|
||||||
};
|
};
|
||||||
|
@ -40,7 +43,7 @@ in {
|
||||||
lspsaga = mkPluginStyleOption "lspsaga";
|
lspsaga = mkPluginStyleOption "lspsaga";
|
||||||
nvim-cmp = mkPluginStyleOption "nvim-cmp";
|
nvim-cmp = mkPluginStyleOption "nvim-cmp";
|
||||||
lsp-signature = mkPluginStyleOption "lsp-signature";
|
lsp-signature = mkPluginStyleOption "lsp-signature";
|
||||||
code-action-menu = mkPluginStyleOption "code-actions-menu";
|
fastaction = mkPluginStyleOption "fastaction";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.types) nullOr listOf enum bool str int;
|
inherit (lib.types) nullOr listOf enum bool str int either;
|
||||||
inherit (lib.modules) mkRenamedOptionModule;
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
inherit (lib.nvim.types) mkPluginSetupOption borderType;
|
||||||
mkSimpleIconOption = default:
|
mkSimpleIconOption = default:
|
||||||
mkOption {
|
mkOption {
|
||||||
inherit default;
|
inherit default;
|
||||||
|
@ -31,6 +31,8 @@ in {
|
||||||
(renameSetupOpt ["sourceBuffer" "scrolloff"] ["source_buffer" "scrolloff"])
|
(renameSetupOpt ["sourceBuffer" "scrolloff"] ["source_buffer" "scrolloff"])
|
||||||
# TODO: every option under icon is renamed to first letter capitalized
|
# TODO: every option under icon is renamed to first letter capitalized
|
||||||
(renameSetupOpt ["icon"] ["icon"])
|
(renameSetupOpt ["icon"] ["icon"])
|
||||||
|
|
||||||
|
(mkRenamedOptionModule ["vim" "ui" "breadcrumbs" "alwaysRender"] ["vim" "ui" "breadcrumbs" "lualine" "winbar" "alwaysRender"])
|
||||||
];
|
];
|
||||||
|
|
||||||
options.vim.ui.breadcrumbs = {
|
options.vim.ui.breadcrumbs = {
|
||||||
|
@ -43,17 +45,43 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# maybe this should be an option to *disable* alwaysRender optionally but oh well
|
# Options for configuring Lualine integration of nvim-navic
|
||||||
# too late
|
lualine.winbar = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true; # for retaining previous behaviour
|
||||||
|
example = false;
|
||||||
|
description = ''
|
||||||
|
Whether to automatically configure a winbar component for
|
||||||
|
Lualine on the Winbar section.
|
||||||
|
|
||||||
|
::: {.note}
|
||||||
|
This is **set to `true` by default**, which means nvim-navic
|
||||||
|
will occupy `winbar.lualine_c` for the breadcrumbs feature
|
||||||
|
unless this option is set to `false`.
|
||||||
|
:::
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
alwaysRender = mkOption {
|
alwaysRender = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to always display the breadcrumbs component on winbar (always renders winbar)";
|
example = false;
|
||||||
|
description = ''
|
||||||
|
Whether to always display the breadcrumbs component
|
||||||
|
on winbar.
|
||||||
|
|
||||||
|
::: {.note}
|
||||||
|
This will pass `draw_empty` to the `nvim_navic` winbar
|
||||||
|
component, which causes the component to be drawn even
|
||||||
|
if it's empty
|
||||||
|
:::
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
navbuddy = {
|
navbuddy = {
|
||||||
enable = mkEnableOption "navbuddy LSP helper UI. Enabling this option automatically loads and enables nvim-navic";
|
enable = mkEnableOption "navbuddy LSP helper UI. Enabling this option automatically loads and enables nvim-navic";
|
||||||
|
|
||||||
mappings = {
|
mappings = {
|
||||||
close = mkOption {
|
close = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
|
@ -212,8 +240,7 @@ in {
|
||||||
# position = {}
|
# position = {}
|
||||||
|
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
# TODO: let this type accept a custom string
|
type = borderType;
|
||||||
type = enum ["single" "rounded" "double" "solid" "none"];
|
|
||||||
default = config.vim.ui.borders.globalStyle;
|
default = config.vim.ui.borders.globalStyle;
|
||||||
description = "border style to use";
|
description = "border style to use";
|
||||||
};
|
};
|
||||||
|
@ -236,8 +263,7 @@ in {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
# TODO: let this type accept a custom string
|
type = borderType;
|
||||||
type = nullOr (enum ["single" "rounded" "double" "solid" "none"]);
|
|
||||||
default = config.vim.ui.borders.globalStyle;
|
default = config.vim.ui.borders.globalStyle;
|
||||||
description = "border style to use for the left section of Navbuddy UI";
|
description = "border style to use for the left section of Navbuddy UI";
|
||||||
};
|
};
|
||||||
|
@ -254,8 +280,7 @@ in {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
# TODO: let this type accept a custom string
|
type = borderType;
|
||||||
type = nullOr (enum ["single" "rounded" "double" "solid" "none"]);
|
|
||||||
default = config.vim.ui.borders.globalStyle;
|
default = config.vim.ui.borders.globalStyle;
|
||||||
description = "border style to use for the middle section of Navbuddy UI";
|
description = "border style to use for the middle section of Navbuddy UI";
|
||||||
};
|
};
|
||||||
|
@ -265,8 +290,7 @@ in {
|
||||||
# there is no size option for the right section, it fills the remaining space
|
# there is no size option for the right section, it fills the remaining space
|
||||||
right = {
|
right = {
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
# TODO: let this type accept a custom string
|
type = borderType;
|
||||||
type = nullOr (enum ["single" "rounded" "double" "solid" "none"]);
|
|
||||||
default = config.vim.ui.borders.globalStyle;
|
default = config.vim.ui.borders.globalStyle;
|
||||||
description = "border style to use for the right section of Navbuddy UI";
|
description = "border style to use for the right section of Navbuddy UI";
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,5 +8,6 @@
|
||||||
./illuminate
|
./illuminate
|
||||||
./breadcrumbs
|
./breadcrumbs
|
||||||
./borders
|
./borders
|
||||||
|
./fastaction
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
24
modules/plugins/ui/fastaction/config.nix
Normal file
24
modules/plugins/ui/fastaction/config.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
cfg = config.vim.ui.fastaction;
|
||||||
|
borderCfg = config.vim.ui.borders.plugins.fastaction;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
ui.fastaction.setupOpts = {
|
||||||
|
register_ui_select = mkDefault true;
|
||||||
|
popup.border = mkIf borderCfg.enable borderCfg.style;
|
||||||
|
};
|
||||||
|
|
||||||
|
startPlugins = ["fastaction-nvim"];
|
||||||
|
pluginRC.fastaction = entryAnywhere "require('fastaction').setup(${toLuaObject cfg.setupOpts})";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./nvim-code-action-menu.nix
|
./fastaction-nvim.nix
|
||||||
./config.nix
|
./config.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
9
modules/plugins/ui/fastaction/fastaction-nvim.nix
Normal file
9
modules/plugins/ui/fastaction/fastaction-nvim.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
options.vim.ui.fastaction = {
|
||||||
|
enable = mkEnableOption "overriding vim.ui.select with fastaction.nvim";
|
||||||
|
setupOpts = mkPluginSetupOption "fastaction" {};
|
||||||
|
};
|
||||||
|
}
|
|
@ -25,7 +25,7 @@ in {
|
||||||
|
|
||||||
${optionalString config.vim.ui.borders.plugins.which-key.enable ''
|
${optionalString config.vim.ui.borders.plugins.which-key.enable ''
|
||||||
window = {
|
window = {
|
||||||
border = "${config.vim.ui.borders.plugins.which-key.style}",
|
border = ${toLuaObject config.vim.ui.borders.plugins.which-key.style},
|
||||||
},
|
},
|
||||||
''}
|
''}
|
||||||
})
|
})
|
||||||
|
|
|
@ -17,17 +17,19 @@
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim.startPlugins = [
|
vim = {
|
||||||
|
startPlugins = [
|
||||||
"telescope"
|
"telescope"
|
||||||
"plenary-nvim"
|
"plenary-nvim"
|
||||||
];
|
];
|
||||||
|
|
||||||
vim.maps.normal = mkMerge [
|
maps.normal = mkMerge [
|
||||||
(mkSetBinding mappings.findFiles "<cmd> Telescope find_files<CR>")
|
(mkSetBinding mappings.findFiles "<cmd> Telescope find_files<CR>")
|
||||||
(mkSetBinding mappings.liveGrep "<cmd> Telescope live_grep<CR>")
|
(mkSetBinding mappings.liveGrep "<cmd> Telescope live_grep<CR>")
|
||||||
(mkSetBinding mappings.buffers "<cmd> Telescope buffers<CR>")
|
(mkSetBinding mappings.buffers "<cmd> Telescope buffers<CR>")
|
||||||
(mkSetBinding mappings.helpTags "<cmd> Telescope help_tags<CR>")
|
(mkSetBinding mappings.helpTags "<cmd> Telescope help_tags<CR>")
|
||||||
(mkSetBinding mappings.open "<cmd> Telescope<CR>")
|
(mkSetBinding mappings.open "<cmd> Telescope<CR>")
|
||||||
|
(mkSetBinding mappings.resume "<cmd> Telescope resume<CR>")
|
||||||
|
|
||||||
(mkSetBinding mappings.gitCommits "<cmd> Telescope git_commits<CR>")
|
(mkSetBinding mappings.gitCommits "<cmd> Telescope git_commits<CR>")
|
||||||
(mkSetBinding mappings.gitBufferCommits "<cmd> Telescope git_bcommits<CR>")
|
(mkSetBinding mappings.gitBufferCommits "<cmd> Telescope git_bcommits<CR>")
|
||||||
|
@ -53,11 +55,11 @@ in {
|
||||||
|
|
||||||
(
|
(
|
||||||
mkIf config.vim.projects.project-nvim.enable
|
mkIf config.vim.projects.project-nvim.enable
|
||||||
(mkSetBinding mappings.findProjects "<cmd Telescope projects<CR>")
|
(mkSetBinding mappings.findProjects "<cmd> Telescope projects<CR>")
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
vim.binds.whichKey.register = pushDownDefault {
|
binds.whichKey.register = pushDownDefault {
|
||||||
"<leader>f" = "+Telescope";
|
"<leader>f" = "+Telescope";
|
||||||
"<leader>fl" = "Telescope LSP";
|
"<leader>fl" = "Telescope LSP";
|
||||||
"<leader>fm" = "Cellular Automaton";
|
"<leader>fm" = "Cellular Automaton";
|
||||||
|
@ -65,7 +67,7 @@ in {
|
||||||
"<leader>fvc" = "Commits";
|
"<leader>fvc" = "Commits";
|
||||||
};
|
};
|
||||||
|
|
||||||
vim.pluginRC.telescope = entryAnywhere ''
|
pluginRC.telescope = entryAnywhere ''
|
||||||
local telescope = require('telescope')
|
local telescope = require('telescope')
|
||||||
telescope.setup(${toLuaObject cfg.setupOpts})
|
telescope.setup(${toLuaObject cfg.setupOpts})
|
||||||
|
|
||||||
|
@ -88,4 +90,5 @@ in {
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,13 +150,13 @@
|
||||||
in {
|
in {
|
||||||
options.vim.telescope = {
|
options.vim.telescope = {
|
||||||
mappings = {
|
mappings = {
|
||||||
findProjects = mkMappingOption "Find files [Telescope]" "<leader>fp";
|
findProjects = mkMappingOption "Find projects [Telescope]" "<leader>fp";
|
||||||
|
|
||||||
findFiles = mkMappingOption "Find files [Telescope]" "<leader>ff";
|
findFiles = mkMappingOption "Find files [Telescope]" "<leader>ff";
|
||||||
liveGrep = mkMappingOption "Live grep [Telescope]" "<leader>fg";
|
liveGrep = mkMappingOption "Live grep [Telescope]" "<leader>fg";
|
||||||
buffers = mkMappingOption "Buffers [Telescope]" "<leader>fb";
|
buffers = mkMappingOption "Buffers [Telescope]" "<leader>fb";
|
||||||
helpTags = mkMappingOption "Help tags [Telescope]" "<leader>fh";
|
helpTags = mkMappingOption "Help tags [Telescope]" "<leader>fh";
|
||||||
open = mkMappingOption "Open [Telescope]" "<leader>ft";
|
open = mkMappingOption "Open [Telescope]" "<leader>ft";
|
||||||
|
resume = mkMappingOption "Resume (previous search) [Telescope]" "<leader>fr";
|
||||||
|
|
||||||
gitCommits = mkMappingOption "Git commits [Telescope]" "<leader>fvcw";
|
gitCommits = mkMappingOption "Git commits [Telescope]" "<leader>fvcw";
|
||||||
gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "<leader>fvcb";
|
gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "<leader>fvcb";
|
||||||
|
|
|
@ -45,8 +45,6 @@ in {
|
||||||
'noice',
|
'noice',
|
||||||
'NvimTree',
|
'NvimTree',
|
||||||
'alpha',
|
'alpha',
|
||||||
'code-action-menu-menu',
|
|
||||||
'code-action-menu-warning-message',
|
|
||||||
'notify',
|
'notify',
|
||||||
'Navbuddy'
|
'Navbuddy'
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
inherit (lib.strings) toUpper;
|
inherit (lib.strings) toUpper;
|
||||||
inherit (lib.types) int float bool str enum listOf attrsOf oneOf nullOr submodule;
|
inherit (lib.types) int float bool str enum listOf attrsOf oneOf nullOr submodule;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
inherit (lib.nvim.types) mkPluginSetupOption luaInline borderType;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -453,7 +453,7 @@ in {
|
||||||
};
|
};
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
description = "Border style of the notification window";
|
description = "Border style of the notification window";
|
||||||
type = enum ["none" "single" "double" "rounded" "solid" "shadow"];
|
type = borderType;
|
||||||
default =
|
default =
|
||||||
if config.vim.ui.borders.enable
|
if config.vim.ui.borders.enable
|
||||||
then config.vim.ui.borders.globalStyle
|
then config.vim.ui.borders.globalStyle
|
||||||
|
|
|
@ -133,8 +133,8 @@ in {
|
||||||
vim = {
|
vim = {
|
||||||
luaConfigRC = {
|
luaConfigRC = {
|
||||||
globalsScript = entryAnywhere (concatLines globalsScript);
|
globalsScript = entryAnywhere (concatLines globalsScript);
|
||||||
# basic, theme
|
# basic
|
||||||
pluginConfigs = entryAfter ["theme"] pluginConfigs;
|
pluginConfigs = entryAfter ["basic"] pluginConfigs;
|
||||||
extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs;
|
extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs;
|
||||||
mappings = entryAfter ["extraPluginConfigs"] mappings;
|
mappings = entryAfter ["extraPluginConfigs"] mappings;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue