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 :) |
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)? |
|
Also, I've added a couple lines to the |
e8073c0 to
0b87693
Compare
0b87693 to
2e2ba64
Compare
2e2ba64 to
3860063
Compare
3860063 to
57023dd
Compare
There was a problem hiding this comment.
Thanks a lot for your patience.
One last change I'm requesting to avoid more headache down the line. Otherwise, I think this is ready to be merged with @Soliprem, @snoweuph and @horriblename's approvals.
c489060 to
5e6638d
Compare
5e6638d to
dfa3d58
Compare
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.
dfa3d58 to
de765b9
Compare
|
Noticed that I hadn't set the |
snoweuph
left a comment
There was a problem hiding this comment.
LGTM, though I'm not a fan of the term "vendored" for the builtin/default provided keybindings.
though I understand that builtin and default aren't great terms either, as it could be confused with neovim builtins and defaults.
no better term comes to my mind, so I guess vendored is fine.
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.