modules/vim: init vim options #2

Merged
pleshevskiy merged 1 commit from vim-options into main 2024-05-17 01:18:41 +03:00
4 changed files with 4236 additions and 13 deletions
Showing only changes of commit b2fa93c305 - Show all commits

View file

@ -38,7 +38,7 @@ in
# Global Opts
(flip mapAttrsToList config.vim.g (k: set "vim.g.${k}"))
# Opts
(flip mapAttrsToList config.vim.opt (k: set "vim.opt.${k}"))
(flip mapAttrsToList config.vim.opt (k: v: if v == null then null else set "vim.opt.${k}" v))
# Plugins
(map (v: v.genConfig) (filter (v: v.enable) (attrValues config.plugin)))
# Cmd

View file

@ -7,7 +7,7 @@ in
vim.opt = {
# Better Unix support
viewoptions = lib.mkDefault [ "folds" "options" "cursor" "unix" "slash" ];
encoding = lib.mkDefault "utf-8";
fileencoding = lib.mkDefault "utf-8";
# Enable 24-bit color
termguicolors = lib.mkDefault true;

4232
modules/vim/options.nix Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,22 +1,13 @@
{ config, lib, ... }:
let options = import ./options.nix { inherit lib; }; in
{
options.vim = with lib; with types; {
g = mkOption {
type = attrsOf (oneOf [ str bool number ]);
default = { };
};
opt = mkOption {
type = attrsOf anything;
default = { };
description = ''
A special interface |vim.opt| exists for conveniently interacting with list-
and map-style option from Lua: It allows accessing them as Lua tables and
offers object-oriented method for adding and removing entries.
`:help vim.opt`
'';
};
opt = options.all;
# TODO: think more about vim.cmd
namedCmd = mkOption {