mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-09 16:54:36 +02:00
plugins/utils: move to by-name
This commit is contained in:
parent
faff32b9f1
commit
52f125679f
195 changed files with 2 additions and 102 deletions
54
plugins/by-name/lastplace/default.nix
Normal file
54
plugins/by-name/lastplace/default.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.plugins.lastplace;
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
options.plugins.lastplace = helpers.neovim-plugin.extraOptionsOptions // {
|
||||
enable = mkEnableOption "lastplace";
|
||||
|
||||
package = lib.mkPackageOption pkgs "lastplace" {
|
||||
default = [
|
||||
"vimPlugins"
|
||||
"nvim-lastplace"
|
||||
];
|
||||
};
|
||||
|
||||
ignoreBuftype = helpers.defaultNullOpts.mkListOf types.str [
|
||||
"quickfix"
|
||||
"nofix"
|
||||
"help"
|
||||
] "The list of buffer types to ignore by lastplace.";
|
||||
|
||||
ignoreFiletype = helpers.defaultNullOpts.mkListOf types.str [
|
||||
"gitcommit"
|
||||
"gitrebase"
|
||||
"svn"
|
||||
"hgcommit"
|
||||
] "The list of file types to ignore by lastplace.";
|
||||
|
||||
openFolds = helpers.defaultNullOpts.mkBool true "Whether closed folds are automatically opened when jumping to the last edit position.";
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
options = {
|
||||
lastplace_ignore_buftype = cfg.ignoreBuftype;
|
||||
lastplace_ignore_filetype = cfg.ignoreFiletype;
|
||||
lastplace_open_folds = cfg.openFolds;
|
||||
} // cfg.extraOptions;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [ cfg.package ];
|
||||
|
||||
extraConfigLua = ''
|
||||
require('nvim-lastplace').setup(${helpers.toLuaObject options})
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue