Allow disabling nvf mappings#1450
Conversation
7f2ed04 to
7823de1
Compare
781252c to
3a40efb
Compare
3a40efb to
0f14749
Compare
horriblename
left a comment
There was a problem hiding this comment.
Thanks! I wouldn't have thought of that
LGTM but I'd like an approval from @NotAShelf or @Soliprem
isn't raf on for vacation according to matrix? |
|
I'm on """vacation""", meaning I am away from my main system involuntarily |
LMFAO, :3 |
|
I added the changelog entry, seems like this won't need too many other changes :) |
|
Rebased on latest main (I'm rebasing to make sure to catch small incompatibilities as they get into the repo, given this touches a lot of files.) (Also means anyone testing this branch by using it gets up-to-date options elsewhere.) |
c5c9ef8 to
40f40a4
Compare
40f40a4 to
a62ed88
Compare
d48066a to
997c941
Compare
997c941 to
78a4db0
Compare
78a4db0 to
5f51010
Compare
Soliprem
left a comment
There was a problem hiding this comment.
on a skim nothing jumps to the eye that I'd change, and I like the change itslef. LGTM, but I'll need to review this better with a fresh mind
5f51010 to
5ba3b72
Compare
NotAShelf
left a comment
There was a problem hiding this comment.
This is an interesting solution. I'm quite positive that this is the only way of scoping config and lib together, but I'm also not a huge fan of putting lib inside config. That said, I also cannot think of a better alternative so I'm not going to block this any further.
One thing I want to note is that useNvfKeymaps could probably be renamed to something like vim.keymaps.builtin.enable. I like this more with the possibility of renaming this project (if ever) and the possibility of adding more knobs for builtin keymaps in mind. Also open to different names idea if you think vim.keymaps.builtin should not be reserved like that.
Left one comment, but it's not a blocker. You can get that while renaming the option if you'd like, but not critical. I'd also like to mention this in the rendered manual, a quick entry (as a note/important level admonition) would be perfectly okay in the "Custom keymaps" section I think.
Thank you for your good work, and your patience so far.
builtin is a bit ambiguous imo - builtin to neovim or builtin to nvf? |
|
Unfortunately, since Honestly, all the nvf-specific one-off options might be better placed in a specific attrset so there aren't conflicts like this, but that would be annoying migration given most of them work fine as they are. For now, I just updated the option to remove |
You mention a (presumably separate) comment here but I can't seem to find it. Do you remember what it was that you preferred changed (other than the option name and a doc hint)? |
mkMappingOption wants to read a setting set in config without passing it every time, so it should be defined in config.
Generated using:
- `sd -F "inherit (lib.nvim.binds) mkMappingOption;" "inherit (config.vim.lib) mkMappingOption;" $(find . -type f)`
- `sd -F "{lib, ...}: let" "{config, lib, ...}: let" $(find . -type f)`
Tweaked manually (placement in inherit list, fixing todo-comments and toggleterm).
Ran `nix run nixpkgs#deadnix -- -e` to clean up.
Next commit includes unrelated dead code.
Mostly involves filtering keybinds that are null in cases where the keybind is the attrname, and optionalString for manual lua keybind registration.
|
Also, I've added a couple lines to the |
e8073c0 to
0b87693
Compare
This approach to the problem sources
mkMappingOptionfromconfig, since it should reference an option for whether to use the provided default ornull.This change would be completely transparent to any current users, but requires enforcing that new plugin contributions use
config.vim.lib.mkMappingOptioninstead of thelib.nvim.bindsversion.If people are using the original
mkMappingOptionin outside projects, it will continue working as before, which is probably the desired behaviour.mkMappingOptionwith ones to the config-aware one.mkMappingOptionfor options that should have used it but used to usemkOption.Related discussion: #1043
Feedback Wanted
mkMappingOptionbe named separately to reduce confusion?useNvfKeymapsbe named something else?Remaining work
surround-nvimvendored keymaps option default depend on the global setting?copilot-luamkLuaKeymapuselib.binds.mkLuaBinding?.#nixand.#maximalbuild withuseNvfKeymapsdisabled.Sanity Checking
This is probably worth testing a bit more thoroughly, if it gets accepted.
nix fmt).#nix(default package).#maximal.#docs-html(manual, must build).#docs-linkcheck(optional, please build if adding links)x86_64-linuxaarch64-linuxx86_64-darwinaarch64-darwinAdd a 👍 reaction to pull requests you find important.