mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
plugins/guess-indent: init
This commit is contained in:
parent
230f95eae0
commit
30ab203d56
3 changed files with 117 additions and 0 deletions
|
@ -170,6 +170,7 @@
|
||||||
./utils/floaterm.nix
|
./utils/floaterm.nix
|
||||||
./utils/fzf-lua.nix
|
./utils/fzf-lua.nix
|
||||||
./utils/goyo.nix
|
./utils/goyo.nix
|
||||||
|
./utils/guess-indent.nix
|
||||||
./utils/hardtime.nix
|
./utils/hardtime.nix
|
||||||
./utils/harpoon.nix
|
./utils/harpoon.nix
|
||||||
./utils/hop.nix
|
./utils/hop.nix
|
||||||
|
|
69
plugins/utils/guess-indent.nix
Normal file
69
plugins/utils/guess-indent.nix
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
helpers,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||||
|
name = "guess-indent";
|
||||||
|
originalName = "guess-indent.nvim";
|
||||||
|
defaultPackage = pkgs.vimPlugins.guess-indent-nvim;
|
||||||
|
|
||||||
|
maintainers = [ helpers.maintainers.GGORG ];
|
||||||
|
|
||||||
|
settingsOptions = {
|
||||||
|
auto_cmd = helpers.defaultNullOpts.mkBool true ''
|
||||||
|
Whether to create autocommand to automatically detect indentation
|
||||||
|
'';
|
||||||
|
|
||||||
|
override_editorconfig = helpers.defaultNullOpts.mkBool false ''
|
||||||
|
Whether or not to override indentation set by Editorconfig
|
||||||
|
'';
|
||||||
|
|
||||||
|
filetype_exclude =
|
||||||
|
helpers.defaultNullOpts.mkListOf types.str
|
||||||
|
[
|
||||||
|
"netrw"
|
||||||
|
"tutor"
|
||||||
|
]
|
||||||
|
''
|
||||||
|
Filetypes to ignore indentation detection in
|
||||||
|
'';
|
||||||
|
|
||||||
|
buftype_exclude =
|
||||||
|
helpers.defaultNullOpts.mkListOf types.str
|
||||||
|
[
|
||||||
|
"help"
|
||||||
|
"nofile"
|
||||||
|
"terminal"
|
||||||
|
"prompt"
|
||||||
|
]
|
||||||
|
''
|
||||||
|
Buffer types to ignore indentation detection in
|
||||||
|
'';
|
||||||
|
|
||||||
|
on_tab_options = helpers.defaultNullOpts.mkAttrsOf types.anything { expandtab = false; } ''
|
||||||
|
A table of vim options when tabs are detected
|
||||||
|
'';
|
||||||
|
|
||||||
|
on_space_options =
|
||||||
|
helpers.defaultNullOpts.mkAttrsOf types.anything
|
||||||
|
{
|
||||||
|
expandtab = true;
|
||||||
|
tabstop = "detected";
|
||||||
|
softtabstop = "detected";
|
||||||
|
shiftwidth = "detected";
|
||||||
|
}
|
||||||
|
''
|
||||||
|
A table of vim options when spaces are detected
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
auto_cmd = false;
|
||||||
|
override_editorconfig = true;
|
||||||
|
filetype_exclude = [ "markdown" ];
|
||||||
|
};
|
||||||
|
}
|
47
tests/test-sources/plugins/utils/guess-indent.nix
Normal file
47
tests/test-sources/plugins/utils/guess-indent.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins.guess-indent.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
plugins.guess-indent = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
auto_cmd = true;
|
||||||
|
override_editorconfig = false;
|
||||||
|
filetype_exclude = [
|
||||||
|
"netrw"
|
||||||
|
"tutor"
|
||||||
|
];
|
||||||
|
buftype_exclude = [
|
||||||
|
"help"
|
||||||
|
"nofile"
|
||||||
|
"terminal"
|
||||||
|
"prompt"
|
||||||
|
];
|
||||||
|
on_tab_options = {
|
||||||
|
"expandtab" = false;
|
||||||
|
};
|
||||||
|
on_space_options = {
|
||||||
|
"expandtab" = true;
|
||||||
|
"tabstop" = "detected";
|
||||||
|
"softtabstop" = "detected";
|
||||||
|
"shiftwidth" = "detected";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
example = {
|
||||||
|
plugins.guess-indent = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
auto_cmd = false;
|
||||||
|
override_editorconfig = true;
|
||||||
|
filetype_exclude = [ "markdown" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue