From 0586bed5adc3ddb5f9579c98c6a830c46475d03a Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 5 Jan 2021 16:11:56 +0000 Subject: [PATCH] Add support for mappings --- .gitignore | 2 +- .tmp | 1 - example.nix | 6 +- flake.nix | 2 + nixvim.nix | 107 +++++++++++++++++++++++++++++++- plugins/helpers.nix | 24 +++++++ plugins/statuslines/airline.nix | 14 ++--- 7 files changed, 142 insertions(+), 14 deletions(-) delete mode 120000 .tmp diff --git a/.gitignore b/.gitignore index 3018b3a6..d36977dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -.tmp/ +.tmp diff --git a/.tmp b/.tmp deleted file mode 120000 index 40b0361a..00000000 --- a/.tmp +++ /dev/null @@ -1 +0,0 @@ -/nix/store/r2p2qi63zznjdf0gjif7v8qmsm5g72d7-nixos-system-nixos-21.03.20201227.2f47650 \ No newline at end of file diff --git a/example.nix b/example.nix index 319178de..0b451061 100644 --- a/example.nix +++ b/example.nix @@ -10,7 +10,7 @@ # Equivalent to nnoremap ; : ";" = ":"; # Equivalent to nmap gg Man - "gg" = { silent = true; buffer = true; remap = false; action = "Man" + "gg" = { silent = true; remap = false; action = "Man" # Etc... }; @@ -25,12 +25,12 @@ options = { tabstop = 4; shiftwidth = 4; - noexpandtab = true; + expandtab = false; mouse = "a"; # etc... - } + }; # Of course, we can still use comfy vimscript: extraConfigVim = builtins.readFile ./init.vim; diff --git a/flake.nix b/flake.nix index 170ff892..d136b55b 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,8 @@ options.number = true; + maps.normalVisualOp."รง" = ":"; + plugins.airline = { enable = true; powerline = true; diff --git a/nixvim.nix b/nixvim.nix index bba63534..a9b81979 100644 --- a/nixvim.nix +++ b/nixvim.nix @@ -22,6 +22,55 @@ let }; }; + mapOption = types.oneOf [ types.str (types.submodule { + silent = mkOption { + type = types.bool; + description = "Whether this mapping should be silent. Equivalent to adding to a map."; + default = false; + }; + + nowait = mkOption { + type = types.bool; + description = "Whether to wait for extra input on ambiguous mappings. Equivalent to adding to a map."; + default = false; + }; + + script = mkOption { + type = types.bool; + description = "Equivalent to adding