Merge branch 'main' into remove-trailing-whitespaces

This commit is contained in:
Pedro Alves 2023-01-21 17:11:56 +00:00 committed by GitHub
commit e686e31bd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 695 additions and 234 deletions

View file

@ -8,6 +8,13 @@ in
options = {
plugins.comment-nvim = {
enable = mkEnableOption "Enable comment-nvim";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.comment-nvim;
description = "Plugin to use for comment-nvim";
};
padding = mkOption {
type = types.nullOr types.bool;
description = "Add a space b/w comment and the line";
@ -97,7 +104,7 @@ in
};
in
mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.comment-nvim ];
extraPlugins = [ cfg.package ];
extraConfigLua =
''require("Comment").setup${helpers.toLuaObject setupOptions}'';
};

View file

@ -9,10 +9,16 @@ in
options = {
plugins.commentary = {
enable = mkEnableOption "Enable commentary";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-commentary;
description = "Plugin to use for vim-commentary";
};
};
};
config = mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.vim-commentary ];
extraPlugins = [ cfg.package ];
};
}

View file

@ -10,6 +10,12 @@ in
plugins.dashboard = {
enable = mkEnableOption "Enable dashboard";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.dashboard-nvim;
description = "Plugin to use for dashboard-nvim";
};
header = mkOption {
description = "Header text";
type = types.nullOr (types.listOf types.str);
@ -126,7 +132,7 @@ in
filteredOptions = filterAttrs (_: v: !isNull v) options;
in
mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.dashboard-nvim ];
extraPlugins = [ cfg.package ];
extraConfigLua = ''
local dashboard = require("dashboard")

View file

@ -8,11 +8,17 @@ in
options = {
plugins.easyescape = {
enable = mkEnableOption "Enable easyescape";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-easyescape;
description = "Plugin to use for easyescape";
};
};
};
config = mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [
vim-easyescape
extraPlugins = [
cfg.package
];
};
}

View file

@ -10,7 +10,7 @@ in with helpers;
mkPlugin attrs {
name = "emmet";
description = "Enable emmet";
extraPlugins = [ pkgs.vimPlugins.emmet-vim ];
package = pkgs.vimPlugins.emmet-vim;
options = {
mode = mkDefaultOpt {

View file

@ -5,7 +5,7 @@ in with helpers; with lib;
mkPlugin attrs {
name = "endwise";
description = "Enable vim-endwise";
extraPlugins = [ pkgs.vimPlugins.vim-endwise ];
package = pkgs.vimPlugins.vim-endwise;
# Yes it's really not configurable
options = {};

View file

@ -8,6 +8,13 @@ in
options = {
plugins.floaterm = {
enable = mkEnableOption "Enable floaterm";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-floaterm;
description = "Plugin to use for floatterm";
};
shell = mkOption {
type = types.nullOr types.str;
default = null;
@ -64,8 +71,8 @@ in
};
};
config = mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [
vim-floaterm
extraPlugins = [
cfg.package
];
globals = {
floaterm_shell = mkIf (!isNull cfg.shell) cfg.shell;

View file

@ -5,7 +5,7 @@ in with helpers; with lib;
mkPlugin attrs {
name = "goyo";
description = "Enable goyo.vim";
extraPlugins = [ pkgs.vimPlugins.goyo-vim ];
package = pkgs.vimPlugins.goyo-vim;
options = {
width = mkDefaultOpt {

View file

@ -1,18 +1,24 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.plugins.comment-nvim;
cfg = config.plugins.intellitab;
defs = import ../plugin-defs.nix { inherit pkgs; };
in
{
options = {
plugins.intellitab = {
enable = mkEnableOption "intellitab.nvim";
package = mkOption {
type = types.package;
default = defs.intellitab-nvim;
description = "Plugin to use for intellitab.nvim";
};
};
};
config = mkIf cfg.enable {
extraPlugins = [ defs.intellitab-nvim ];
extraPlugins = [ cfg.package ];
maps.insert."<Tab>" = "<CMD>lua require([[intellitab]]).indent()<CR>";
plugins.treesitter = {

View file

@ -10,6 +10,12 @@ in
options.plugins.mark-radar = {
enable = mkEnableOption "Enable mark-radar";
package = mkOption {
type = types.package;
default = defs.mark-radar;
description = "Plugin to use for mark-radar";
};
highlight_background = mkOption {
type = with types; nullOr bool;
default = null;
@ -40,7 +46,7 @@ in
};
in
mkIf cfg.enable {
extraPlugins = [ defs.mark-radar ];
extraPlugins = [ cfg.package ];
extraConfigLua = ''
require("mark-radar").setup(${opts})

View file

@ -12,6 +12,12 @@ in
options.plugins.notify = {
enable = mkEnableOption "Enable notify";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-notify;
description = "Plugin to use for notify";
};
stages = mkOption {
type = types.nullOr (types.enum [ "fade_in_slide_out" "fade" "slide" "static" ]);
description = "Animation style";
@ -64,7 +70,7 @@ in
};
in
mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.nvim-notify ];
extraPlugins = [ cfg.package ];
extraConfigLua = ''
vim.notify = require('notify');
require('notify').setup(${helpers.toLuaObject setupOptions})

View file

@ -8,6 +8,12 @@ in
options.plugins.nvim-autopairs = {
enable = mkEnableOption "Enable nvim-autopairs";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-autopairs;
description = "Plugin to use for nvim-autopairs";
};
pairs = mkOption {
type = types.nullOr (types.attrsOf types.str);
default = null;
@ -50,7 +56,7 @@ in
};
in
mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.nvim-autopairs ];
extraPlugins = [ cfg.package ];
extraConfigLua = ''
require('nvim-autopairs').setup(${helpers.toLuaObject options})

View file

@ -8,6 +8,12 @@ in
options.plugins.nvim-tree = {
enable = mkEnableOption "Enable nvim-tree";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-tree-lua;
description = "Plugin to use for nvim-tree";
};
disableNetrw = mkOption {
type = types.nullOr types.bool;
default = null;
@ -217,7 +223,6 @@ in
hijack_netrw = cfg.hijackNetrw;
open_on_setup = cfg.openOnSetup;
ignore_ft_on_setup = cfg.ignoreFtOnSetup;
auto_close = cfg.autoClose;
open_on_tab = cfg.openOnTab;
hijack_cursor = cfg.hijackCursor;
update_cwd = cfg.updateCwd;
@ -257,10 +262,18 @@ in
in
mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [
nvim-tree-lua
cfg.package
nvim-web-devicons
];
autoCmd = mkIf cfg.autoClose [
{
event = "BufEnter";
command = "if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif";
nested = true;
}
];
extraConfigLua = ''
require('nvim-tree').setup(${helpers.toLuaObject options})
'';

View file

@ -8,6 +8,12 @@ in
options.plugins.project-nvim = helpers.extraOptionsOptions // {
enable = mkEnableOption "Enable project.nvim";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.project-nvim;
description = "Plugin to use for project-nvim";
};
manualMode = mkOption {
type = types.nullOr types.bool;
default = null;
@ -70,7 +76,7 @@ in
} // cfg.extraOptions;
in
mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.project-nvim ];
extraPlugins = [ cfg.package ];
extraConfigLua = ''
require('project_nvim').setup(${helpers.toLuaObject options})

View file

@ -8,6 +8,12 @@ in
options.plugins.specs = {
enable = mkEnableOption "Enable specs-nvim";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.specs-nvim;
description = "Plugin to use for specs-nvim";
};
show_jumps = mkOption {
type = types.bool;
default = true;
@ -137,7 +143,7 @@ in
};
in
mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.specs-nvim ];
extraPlugins = [ cfg.package ];
highlight.SpecsPopColor.bg = mkIf (!isNull cfg.color) cfg.color;

View file

@ -5,7 +5,7 @@ in with lib; with helpers;
mkPlugin args {
name = "startify";
description = "Enable startify";
extraPlugins = [ pkgs.vimPlugins.vim-startify ];
package = pkgs.vimPlugins.vim-startify;
options = {
sessionDir = mkDefaultOpt {

View file

@ -5,7 +5,7 @@ in with helpers; with lib;
mkPlugin attrs {
name = "surround";
description = "Enable surround.vim";
extraPlugins = [ pkgs.vimPlugins.surround ];
package = pkgs.vimPlugins.surround;
options = {};
}

View file

@ -9,6 +9,12 @@ in
plugins.undotree = {
enable = mkEnableOption "Enable undotree";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.undotree;
description = "Plugin to use for undotree";
};
windowLayout = mkOption {
type = types.nullOr types.int;
default = null;
@ -108,7 +114,7 @@ in
};
config = mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.undotree ];
extraPlugins = [ cfg.package ];
globals = {
undotree_WindowLayout = mkIf (cfg.windowLayout != null) cfg.windowLayout;