Commit Graph
38 Commits
Author SHA1 Message Date
Matt SturgeonandAustin Horstman f2029d9a26 lib/keymaps: remove lua submodule option
Co-authored-by: Austin Horstman <khaneliman12@gmail.com>
2026-06-12 18:04:20 +00:00
Gaetan LepageandAustin Horstman 1d333fc92e treewide: apply linter suggestions 2025-12-28 04:26:49 +00:00
Matt Sturgeon a635b56894 plugins/barbar: add nullOr workaround for keymaps lua warning
Currently, `types.either` has support for the new valueMeta attribute
added by v2 check and merge, while `types.nullOr` does not.

The `lua` option deprecation warning implemented in
`modules/keymaps.nix` requires `valueMeta`, so re-implement `nullOr`
using `types.either` as a workaround.
2025-11-21 09:27:16 +00:00
Matt SturgeonandGaétan Lepage d0b0b75a13 modules/keymaps: fix lua option deprecation warning
The deprecation warning for the keymap-submocule `lua` option relied on
`getSubOptions`, however this is fundamentally flawed because that
function returns uses a different module eval from the one that merges
submodule definitions.

Since definitions are not used by `getSubOptions`,
`options.lua.isDefined` will never be true.

Instead, we have two choices:

1. Add a `luaIsDefined` option to the keymap submodule
2. Use the new v2 merge's `valueMeta` to access the actual module eval
2025-11-21 08:21:29 +00:00
Matt Sturgeon dad19c1238 treewide: remove internal use of helpers module arg 2025-11-19 15:22:27 +00:00
Gaetan Lepage c660702482 plugins/wtf: migrate to mkNeovimPlugin 2025-10-11 16:54:26 +00:00
Gaetan LepageandGaétan Lepage 8529f1c86b treewide: format with new treefmt 2025-07-25 16:18:00 +00:00
Jeremy Fleischman f3ef2721ab modules/keymap: quickfix, use "keep" rather than "error"
There are some codepaths out there in the wild that seem to be
explicitly setting a buffer at build time. I'm not convinced that's a
sane thing to do, but I don't have time to dig any further right now.

See the discussion starting here:
https://github.com/nix-community/nixvim/pull/2712#issuecomment-2556330101
for more context.
2024-12-20 01:54:02 -08:00
Jeremy Fleischmanandnix-infra-bot 79a637d196 modules/keymap: include buffer when registering keymapsOnEvents
This feels more correct to me: I believe we were registering a keymap
for all buffers, even if only some of them have experienced the relevant
autocmd.

I don't know if it's guaranteed here that `args.buf` always exists
(but maybe it's not a problem if it doesn't exist, because we'll still
register a keymap for all buffers?).

This fixes https://github.com/nix-community/nixvim/issues/2711
2024-12-18 23:04:09 +00:00
Gaetan Lepageandnix-infra-bot ec24d496d5 treewide (cleaning): helpers.toLuaObject -> lib.nixvim.toLuaObject 2024-12-15 21:55:51 +00:00
Austin Horstman 1c9ba58aef modules: cleanup with lib 2024-09-03 22:12:33 -05:00
Matt Sturgeon 7fb1f9dd9d modules/keymap: improve lua deprecation
- Replace nullable lua option with a no-default option.
- Made it so the deprecated option is only declared when `lua = true` is passed.
- Replace `normalizeMappings` with a `removeDeprecatedMapAttrs` helper.
- Added warnings for all options that historically had `lua` support.
2024-08-18 22:11:11 +01:00
Stanislav AsunkinandGaétan Lepage 9317537848 modules: avoid setting empty strings to extraConfig* options
Problem:  Some modules are setting empty strings to extraConfig* options
          with the intention to not generate any config. But empty
          strings are also values, so they are still concatenated in the
          final value of extraConfig* options. This results in a
          multiple empty strings in extraConfigs.

Solution: Avoid using optionalString when setting values to extraConfig*
          options. Use mkIf instead.

          This commit also fixes mkIf condition in autocmd module.

          `mkNeovimPlugin` is a special case. To avoid evaluating
          caller's arguments mkMerge/optionalAttrs pattern is used
          instead.
2024-07-22 23:18:53 +02:00
Gaetan LepageandGaétan Lepage 7a2d065cce misc: ensure all options have a description 2024-06-11 11:34:10 +02:00
Matt Sturgeon 29922e13f7 modules/keymaps: fix false-positive lua warning 2024-05-31 20:38:53 +01:00
Matt Sturgeon 9b340f8bab modules/keymaps: more verbose lua deprecation
Include the offending definition(s) in the warning.
2024-05-29 09:21:45 +01:00
Matt Sturgeon 8212bf1cd2 modules/keymaps: deprecate lua option 2024-05-26 15:26:06 +01:00
traxys 62f32bfc71 treewide: Reformat with nixfmt 2024-05-05 22:00:40 +02:00
BodleumandGitHub 303b9ca2c0 Keymaps: Add keymapsOnEvent to load keymap on specified events (#1260) 2024-03-18 20:41:12 +01:00
Gaetan LepageandGaétan Lepage 5eae22d14e modules/keymaps: remove deprecation warning 2024-03-02 22:12:58 +01:00
Gaetan LepageandGaétan Lepage 2294a12b0b keymaps: use 'action.__raw' instead of 'lua = true' internally 2024-02-03 18:12:25 +01:00
Gaetan LepageandGaétan Lepage 48dd8d28cf modules/keymaps: deprecate maps option 2023-12-02 20:29:07 +01:00
Gaetan LepageandGaétan Lepage b6724702b4 misc: refactor imports, prefer adding helpers to args rather than importing it 2023-11-06 16:33:39 +01:00
Gaetan LepageandGaétan Lepage a9698ea2b0 module/keymaps: no need to set options = {} 2023-10-16 14:54:31 +02:00
Gaetan LepageandGaétan Lepage 7f29aade86 modules/keymaps: remove possibility to add a keymap without an action 2023-10-16 11:08:28 +02:00
Gaetan LepageandGaétan Lepage 418bf5da17 modules/keymaps: factor out helper functions for use in plugins 2023-10-03 14:18:33 +02:00
Gaetan LepageandGaétan Lepage 05b77732e3 plugins/which-key: remove which-key logic from keymap module 2023-10-02 15:23:54 +02:00
Gaetan LepageandGaétan Lepage 574fb73258 modules/keymaps: refactor + new syntax 2023-10-02 15:23:54 +02:00
Tanish2002andGaétan Lepage efdcbe225f perform some statix linting and fixes 2023-05-22 23:00:53 +02:00
Tanish2002andGaétan Lepage 5fa54c6d39 feat: register mapping with no actions in which-key when enabled 2023-05-21 23:22:10 +02:00
Gaétan LepageandGitHub bd81037c5f modules/keymaps: fix bug in keymaps generation (#300) 2023-04-04 18:34:05 +02:00
traxysandGitHub b3ca52110f maps: Add the remap option (#256) 2023-03-14 23:44:14 +01:00
Gaétan LepageandGitHub a15c0543a4 modules/keymaps: bind lua function calls (#178) 2023-02-22 23:01:27 +01:00
Gaétan LepageandGitHub 264de8cefb added formatter + reformat existing codebase (#175) 2023-02-20 10:42:13 +00:00
Gaétan LepageandGitHub c73bef16ab helpers: add mkPackageOption + refactoring (#144) (#150) 2023-01-25 18:46:49 +00:00
5c6ba55f8a keymaps: switch to lua API vim.keymap.set (#115)
* modules/keymaps: switch to lua API vim.keymap.set

* add test for keymaps

Co-authored-by: Pedro Alves <pta2002@pta2002.com>
2023-01-12 19:13:47 +00:00
Pedro Alves dd9ec124a2 docs: fix documentation generation 2022-12-29 17:34:54 +00:00
Pedro AlvesandGitHub 4ddd3969e5 nixvim: support standalone nixvim
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition.

The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix.

For module development, the main change is that you should no longer prefix your modules with programs.nixvim..
2022-09-18 11:19:23 +01:00