vim: fix boolean option handling
Vim doesn't have `unset` function. To turn off an option vim uses "no" prefix.
This commit is contained in:
parent
e4deffcbe8
commit
8e54cc6a8a
|
@ -19,7 +19,6 @@ in
|
||||||
default = null;
|
default = null;
|
||||||
description = "Whether to show line numbers.";
|
description = "Whether to show line numbers.";
|
||||||
};
|
};
|
||||||
|
|
||||||
tabSize = mkOption {
|
tabSize = mkOption {
|
||||||
type = types.nullOr types.int;
|
type = types.nullOr types.int;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -57,7 +56,7 @@ in
|
||||||
|
|
||||||
config = (
|
config = (
|
||||||
let
|
let
|
||||||
optionalBoolean = name: val: optionalString (val != null) (if val then "set ${name}" else "unset ${name}");
|
optionalBoolean = name: val: optionalString (val != null) (if val then "set ${name}" else "set no${name}");
|
||||||
optionalInteger = name: val: optionalString (val != null) "set ${name}=${toString val}";
|
optionalInteger = name: val: optionalString (val != null) "set ${name}=${toString val}";
|
||||||
customRC = ''
|
customRC = ''
|
||||||
${optionalBoolean "number" cfg.lineNumbers}
|
${optionalBoolean "number" cfg.lineNumbers}
|
||||||
|
|
Loading…
Reference in a new issue