2023-04-06 16:04:29 +02:00
|
|
|
{
|
|
|
|
lib,
|
2023-11-06 15:04:08 +01:00
|
|
|
helpers,
|
2023-04-06 16:04:29 +02:00
|
|
|
config,
|
2023-11-06 15:04:08 +01:00
|
|
|
pkgs,
|
2023-04-06 16:04:29 +02:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
cfg = config.plugins.lastplace;
|
|
|
|
in
|
|
|
|
with lib;
|
|
|
|
{
|
2024-01-25 16:15:55 +01:00
|
|
|
options.plugins.lastplace = helpers.neovim-plugin.extraOptionsOptions // {
|
2023-04-06 16:04:29 +02:00
|
|
|
enable = mkEnableOption "lastplace";
|
|
|
|
|
2024-05-17 14:09:20 +02:00
|
|
|
package = helpers.mkPluginPackageOption "lastplace" pkgs.vimPlugins.nvim-lastplace;
|
2023-04-06 16:04:29 +02:00
|
|
|
|
|
|
|
ignoreBuftype =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["quickfix" "nofix" "help"]''
|
|
|
|
"The list of buffer types to ignore by lastplace.";
|
|
|
|
|
|
|
|
ignoreFiletype =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.listOf 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})
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|