Commit graph

31 commits

Author SHA1 Message Date
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 Fleischman
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 Lepage
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 Asunkin
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 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
Bodleum
303b9ca2c0
Keymaps: Add keymapsOnEvent to load keymap on specified events (#1260) 2024-03-18 20:41:12 +01:00
Gaetan Lepage
5eae22d14e modules/keymaps: remove deprecation warning 2024-03-02 22:12:58 +01:00
Gaetan Lepage
2294a12b0b keymaps: use 'action.__raw' instead of 'lua = true' internally 2024-02-03 18:12:25 +01:00
Gaetan Lepage
48dd8d28cf modules/keymaps: deprecate maps option 2023-12-02 20:29:07 +01:00
Gaetan Lepage
b6724702b4 misc: refactor imports, prefer adding helpers to args rather than importing it 2023-11-06 16:33:39 +01:00
Gaetan Lepage
a9698ea2b0 module/keymaps: no need to set options = {} 2023-10-16 14:54:31 +02:00
Gaetan Lepage
7f29aade86 modules/keymaps: remove possibility to add a keymap without an action 2023-10-16 11:08:28 +02:00
Gaetan Lepage
418bf5da17 modules/keymaps: factor out helper functions for use in plugins 2023-10-03 14:18:33 +02:00
Gaetan Lepage
05b77732e3 plugins/which-key: remove which-key logic from keymap module 2023-10-02 15:23:54 +02:00
Gaetan Lepage
574fb73258 modules/keymaps: refactor + new syntax 2023-10-02 15:23:54 +02:00
Tanish2002
efdcbe225f perform some statix linting and fixes 2023-05-22 23:00:53 +02:00
Tanish2002
5fa54c6d39 feat: register mapping with no actions in which-key when enabled 2023-05-21 23:22:10 +02:00
Gaétan Lepage
bd81037c5f
modules/keymaps: fix bug in keymaps generation (#300) 2023-04-04 18:34:05 +02:00
traxys
b3ca52110f
maps: Add the remap option (#256) 2023-03-14 23:44:14 +01:00
Gaétan Lepage
a15c0543a4
modules/keymaps: bind lua function calls (#178) 2023-02-22 23:01:27 +01:00
Gaétan Lepage
264de8cefb
added formatter + reformat existing codebase (#175) 2023-02-20 10:42:13 +00:00
Gaétan Lepage
c73bef16ab
helpers: add mkPackageOption + refactoring (#144) (#150) 2023-01-25 18:46:49 +00:00
Gaétan Lepage
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 Alves
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