mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-24 12:28:32 +00:00
Compare commits
7 commits
386c513e23
...
43a28e7b3d
Author | SHA1 | Date | |
---|---|---|---|
![]() |
43a28e7b3d | ||
![]() |
fa0f962663 | ||
![]() |
1b02bc3bb3 | ||
![]() |
52462be36b | ||
ef413736e9 | |||
![]() |
e77632e4eb | ||
![]() |
b39b84490f |
6 changed files with 33 additions and 26 deletions
|
@ -7,37 +7,26 @@ section contains a general overview to how you may utilize said functions.
|
|||
|
||||
## Custom Key Mappings Support for a Plugin {#sec-custom-key-mappings}
|
||||
|
||||
To set a mapping, you should define it in `vim.maps.<<mode>>`.
|
||||
The available modes are:
|
||||
|
||||
- normal
|
||||
- insert
|
||||
- select
|
||||
- visual
|
||||
- terminal
|
||||
- normalVisualOp
|
||||
- visualOnly
|
||||
- operator
|
||||
- insertCommand
|
||||
- lang
|
||||
- command
|
||||
To set a mapping, you should define it in `vim.keymaps`.
|
||||
|
||||
An example, simple keybinding, can look like this:
|
||||
|
||||
```nix
|
||||
{
|
||||
vim.maps.normal = {
|
||||
"<leader>wq" = {
|
||||
vim.keymaps = [
|
||||
{
|
||||
key = "<leader>wq";
|
||||
mode = ["n"];
|
||||
action = ":wq<CR>";
|
||||
silent = true;
|
||||
desc = "Save file and quit";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
There are many settings available in the options. Please refer to the
|
||||
[documentation](https://notashelf.github.io/nvf/options.html#opt-vim.maps.command._name_.action)
|
||||
[documentation](https://notashelf.github.io/nvf/options.html#opt-vim.keymaps)
|
||||
to see a list of them.
|
||||
|
||||
**nvf** provides a list of helper commands, so that you don't have to write the
|
||||
|
|
|
@ -166,7 +166,7 @@ everyone.
|
|||
friendly-snippets for bundled snippets. [](#opt-vim.snippets.luasnip.enable)
|
||||
can be used to toggle Luasnip.
|
||||
- Add sorting function options for completion sources under
|
||||
[](#opt-vim.autocomplete.nvim-cmp.sorting.comparators)
|
||||
[](#opt-vim.autocomplete.nvim-cmp.setupOpts.sorting.comparators)
|
||||
|
||||
[Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd()
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ in {
|
|||
|
||||
default = {};
|
||||
type = submodule {
|
||||
freeformType = attrsOf anything;
|
||||
freeformType = anything;
|
||||
options = opts;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRemovedOptionModule;
|
||||
inherit (lib.modules) mkRemovedOptionModule mkRenamedOptionModule;
|
||||
in {
|
||||
imports = [
|
||||
# 2024-06-06
|
||||
|
@ -14,5 +14,23 @@ in {
|
|||
available under `vim.ui.fastaction` as a replacement. Simply remove everything under
|
||||
`vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`.
|
||||
'')
|
||||
|
||||
(mkRemovedOptionModule ["vim" "autopairs" "enable"] ''
|
||||
vim.autopairs.enable has been removed in favor of per-plugin modules.
|
||||
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
|
||||
'')
|
||||
(mkRemovedOptionModule ["vim" "autopairs" "type"] ''
|
||||
vim.autopairs.type has been removed in favor of per-plugin modules.
|
||||
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
|
||||
'')
|
||||
(mkRemovedOptionModule ["vim" "autocomplete" "enable"] ''
|
||||
vim.autocomplete.enable has been removed in favor of per-plugin modules.
|
||||
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
|
||||
'')
|
||||
(mkRemovedOptionModule ["vim" "autocomplete" "type"] ''
|
||||
vim.autocomplete.type has been removed in favor of per-plugin modules.
|
||||
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
|
||||
'')
|
||||
(mkRenamedOptionModule ["vim" "lsp" "lspkind" "mode"] ["vim" "lsp" "lspkind" "setupOpts" "mode"])
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.options) mkOption literalMD;
|
||||
inherit (lib.types) either str listOf attrsOf nullOr submodule;
|
||||
inherit (lib.nvim.config) mkBool;
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
See `:help map-modes` for a list of modes.
|
||||
'';
|
||||
example = ''`["n" "v" "c"]` for normal, visual and command mode'';
|
||||
example = literalMD ''`["n" "v" "c"]` for normal, visual and command mode'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -81,8 +81,8 @@ in {
|
|||
'';
|
||||
description = ''
|
||||
The function used to customize the completion menu entires. This is
|
||||
outside of `setupOpts` because of internal reasons, make sure to use
|
||||
this one, instead of its `setupOpts` equivalent.
|
||||
outside of `setupOpts` to allow for an easier integration with
|
||||
lspkind.nvim.
|
||||
|
||||
See `:help cmp-config.formatting.format`.
|
||||
'';
|
||||
|
|
Loading…
Add table
Reference in a new issue