From 5d33444519ec2bcef96fef03b9efb3ad75fa6409 Mon Sep 17 00:00:00 2001 From: Tomasz Rybarczyk Date: Tue, 19 Sep 2017 18:11:30 +0200 Subject: [PATCH] vim: add relativeNumber option Beside absolute numbering vim can display additional column with line numbering relative to current cursor postion. --- modules/programs/vim.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/programs/vim.nix b/modules/programs/vim.nix index 5c1a02e7..3a30bd15 100644 --- a/modules/programs/vim.nix +++ b/modules/programs/vim.nix @@ -19,11 +19,19 @@ in default = null; description = "Whether to show line numbers."; }; + + relativeNumber = mkOption { + type = types.nullOr types.bool; + default = null; + description = "Whether to show relative line numbers column."; + }; + expandTab = mkOption { type = types.nullOr types.bool; default = null; description = "Whether to convert tabs into spaces."; }; + tabSize = mkOption { type = types.nullOr types.int; default = null; @@ -65,6 +73,7 @@ in optionalInteger = name: val: optionalString (val != null) "set ${name}=${toString val}"; customRC = '' ${optionalBoolean "number" cfg.lineNumbers} + ${optionalBoolean "relativenumber" cfg.relativeNumber} ${optionalBoolean "expandtab" cfg.expandTab} ${optionalInteger "tabstop" cfg.tabSize} ${optionalInteger "shiftwidth" cfg.tabSize}