2018-08-14 09:39:22 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.fish;
|
|
|
|
|
2019-09-24 10:16:49 +02:00
|
|
|
pluginModule = types.submodule ({ config, ... }: {
|
|
|
|
options = {
|
|
|
|
src = mkOption {
|
|
|
|
type = types.path;
|
|
|
|
description = ''
|
|
|
|
Path to the plugin folder.
|
|
|
|
</para><para>
|
|
|
|
Relevant pieces will be added to the fish function path and
|
|
|
|
the completion path. The <filename>init.fish</filename> and
|
|
|
|
<filename>key_binding.fish</filename> files are sourced if
|
|
|
|
they exist.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
name = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
description = ''
|
|
|
|
The name of the plugin.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2020-03-01 22:20:44 +01:00
|
|
|
functionModule = types.submodule {
|
|
|
|
options = {
|
|
|
|
body = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
description = ''
|
|
|
|
The function body.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
argumentNames = mkOption {
|
|
|
|
type = with types; nullOr (either str (listOf str));
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Assigns the value of successive command line arguments to the names
|
|
|
|
given.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
description = mkOption {
|
|
|
|
type = with types; nullOr str;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
A description of what the function does, suitable as a completion
|
|
|
|
description.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
wraps = mkOption {
|
|
|
|
type = with types; nullOr str;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Causes the function to inherit completions from the given wrapped
|
|
|
|
command.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
onEvent = mkOption {
|
|
|
|
type = with types; nullOr str;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Tells fish to run this function when the specified named event is
|
|
|
|
emitted. Fish internally generates named events e.g. when showing the
|
|
|
|
prompt.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
onVariable = mkOption {
|
|
|
|
type = with types; nullOr str;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Tells fish to run this function when the specified variable changes
|
|
|
|
value.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
onJobExit = mkOption {
|
|
|
|
type = with types; nullOr (either str int);
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Tells fish to run this function when the job with the specified group
|
|
|
|
ID exits. Instead of a PID, the stringer <literal>caller</literal> can
|
|
|
|
be specified. This is only legal when in a command substitution, and
|
|
|
|
will result in the handler being triggered by the exit of the job
|
|
|
|
which created this command substitution.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
onProcessExit = mkOption {
|
|
|
|
type = with types; nullOr (either str int);
|
|
|
|
default = null;
|
|
|
|
example = "$fish_pid";
|
|
|
|
description = ''
|
|
|
|
Tells fish to run this function when the fish child process with the
|
|
|
|
specified process ID exits. Instead of a PID, for backwards
|
|
|
|
compatibility, <literal>%self</literal> can be specified as an alias
|
|
|
|
for <literal>$fish_pid</literal>, and the function will be run when
|
|
|
|
the current fish instance exits.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
onSignal = mkOption {
|
|
|
|
type = with types; nullOr (either str int);
|
|
|
|
default = null;
|
|
|
|
example = [ "SIGHUP" "HUP" 1 ];
|
|
|
|
description = ''
|
|
|
|
Tells fish to run this function when the specified signal is
|
|
|
|
delievered. The signal can be a signal number or signal name.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
noScopeShadowing = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Allows the function to access the variables of calling functions.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
inheritVariable = mkOption {
|
|
|
|
type = with types; nullOr str;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Snapshots the value of the specified variable and defines a local
|
|
|
|
variable with that same name and value when the function is defined.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-02-14 22:36:44 +01:00
|
|
|
abbrsStr = concatStringsSep "\n"
|
|
|
|
(mapAttrsToList (k: v: "abbr --add --global -- ${k} ${escapeShellArg v}")
|
|
|
|
cfg.shellAbbrs);
|
2018-08-14 09:39:22 +02:00
|
|
|
|
2020-02-14 22:36:44 +01:00
|
|
|
aliasesStr = concatStringsSep "\n"
|
|
|
|
(mapAttrsToList (k: v: "alias ${k} ${escapeShellArg v}") cfg.shellAliases);
|
2018-08-14 09:39:22 +02:00
|
|
|
|
2022-11-29 05:29:34 +01:00
|
|
|
fishIndent = name: text:
|
2022-12-05 02:51:03 +01:00
|
|
|
pkgs.runCommand name {
|
|
|
|
nativeBuildInputs = [ cfg.package ];
|
|
|
|
inherit text;
|
|
|
|
passAsFile = [ "text" ];
|
2022-12-22 00:02:53 +01:00
|
|
|
} "env HOME=$(mktemp -d) fish_indent < $textPath > $out";
|
2022-11-29 05:29:34 +01:00
|
|
|
|
2020-02-20 00:16:01 +01:00
|
|
|
in {
|
2021-10-28 00:40:39 +02:00
|
|
|
imports = [
|
|
|
|
(mkRemovedOptionModule [ "programs" "fish" "promptInit" ] ''
|
|
|
|
Prompt is now configured through the
|
|
|
|
|
|
|
|
programs.fish.interactiveShellInit
|
|
|
|
|
|
|
|
option. Please change to use that instead.
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
|
2018-08-14 09:39:22 +02:00
|
|
|
options = {
|
|
|
|
programs.fish = {
|
2019-09-24 07:13:02 +02:00
|
|
|
enable = mkEnableOption "fish, the friendly interactive shell";
|
2018-08-14 09:39:22 +02:00
|
|
|
|
2018-12-17 12:57:30 +01:00
|
|
|
package = mkOption {
|
2019-09-23 08:53:08 +02:00
|
|
|
type = types.package;
|
2018-12-17 12:57:30 +01:00
|
|
|
default = pkgs.fish;
|
2021-10-09 11:14:08 +02:00
|
|
|
defaultText = literalExpression "pkgs.fish";
|
2018-12-17 12:57:30 +01:00
|
|
|
description = ''
|
|
|
|
The fish package to install. May be used to change the version.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2018-08-14 09:39:22 +02:00
|
|
|
shellAliases = mkOption {
|
2019-09-24 07:05:21 +02:00
|
|
|
type = with types; attrsOf str;
|
2020-02-15 18:10:11 +01:00
|
|
|
default = { };
|
2021-10-09 11:14:08 +02:00
|
|
|
example = literalExpression ''
|
2020-02-26 22:44:54 +01:00
|
|
|
{
|
2021-07-28 13:26:40 +02:00
|
|
|
g = "git";
|
|
|
|
"..." = "cd ../..";
|
2020-02-26 22:44:54 +01:00
|
|
|
}
|
|
|
|
'';
|
2018-08-14 09:39:22 +02:00
|
|
|
description = ''
|
2019-09-23 09:01:09 +02:00
|
|
|
An attribute set that maps aliases (the top level attribute names
|
|
|
|
in this option) to command strings or directly to build outputs.
|
2018-08-14 09:39:22 +02:00
|
|
|
'';
|
|
|
|
};
|
2018-09-09 21:17:49 +02:00
|
|
|
|
2018-08-14 09:39:22 +02:00
|
|
|
shellAbbrs = mkOption {
|
2019-09-24 07:05:21 +02:00
|
|
|
type = with types; attrsOf str;
|
2020-02-15 18:10:11 +01:00
|
|
|
default = { };
|
|
|
|
example = {
|
|
|
|
l = "less";
|
|
|
|
gco = "git checkout";
|
|
|
|
};
|
2018-08-14 09:39:22 +02:00
|
|
|
description = ''
|
2019-09-23 09:01:09 +02:00
|
|
|
An attribute set that maps aliases (the top level attribute names
|
|
|
|
in this option) to abbreviations. Abbreviations are expanded with
|
|
|
|
the longer phrase after they are entered.
|
2018-08-14 09:39:22 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
shellInit = mkOption {
|
2019-09-23 08:53:08 +02:00
|
|
|
type = types.lines;
|
2018-08-14 09:39:22 +02:00
|
|
|
default = "";
|
|
|
|
description = ''
|
2019-09-23 09:01:09 +02:00
|
|
|
Shell script code called during fish shell
|
|
|
|
initialisation.
|
2018-08-14 09:39:22 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
loginShellInit = mkOption {
|
2019-09-23 08:53:08 +02:00
|
|
|
type = types.lines;
|
2018-08-14 09:39:22 +02:00
|
|
|
default = "";
|
|
|
|
description = ''
|
2019-09-23 09:01:09 +02:00
|
|
|
Shell script code called during fish login shell
|
|
|
|
initialisation.
|
2018-08-14 09:39:22 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
interactiveShellInit = mkOption {
|
2019-09-23 08:53:08 +02:00
|
|
|
type = types.lines;
|
2018-08-14 09:39:22 +02:00
|
|
|
default = "";
|
|
|
|
description = ''
|
2019-09-23 09:01:09 +02:00
|
|
|
Shell script code called during interactive fish shell
|
|
|
|
initialisation.
|
2018-08-14 09:39:22 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2019-03-23 21:09:03 +01:00
|
|
|
|
|
|
|
programs.fish.plugins = mkOption {
|
2019-09-24 10:19:35 +02:00
|
|
|
type = types.listOf pluginModule;
|
2020-02-15 18:10:11 +01:00
|
|
|
default = [ ];
|
2021-10-09 11:14:08 +02:00
|
|
|
example = literalExpression ''
|
2019-09-24 10:19:35 +02:00
|
|
|
[
|
|
|
|
{
|
|
|
|
name = "z";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "jethrokuan";
|
|
|
|
repo = "z";
|
|
|
|
rev = "ddeb28a7b6a1f0ec6dae40c636e5ca4908ad160a";
|
|
|
|
sha256 = "0c5i7sdrsp0q3vbziqzdyqn4fmp235ax4mn4zslrswvn8g3fvdyh";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
# oh-my-fish plugins are stored in their own repositories, which
|
|
|
|
# makes them simple to import into home-manager.
|
|
|
|
{
|
|
|
|
name = "fasd";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "oh-my-fish";
|
|
|
|
repo = "plugin-fasd";
|
|
|
|
rev = "38a5b6b6011106092009549e52249c6d6f501fba";
|
|
|
|
sha256 = "06v37hqy5yrv5a6ssd1p3cjd9y3hnp19d3ab7dag56fs1qmgyhbs";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'';
|
2019-03-23 21:09:03 +01:00
|
|
|
description = ''
|
2019-09-24 10:19:35 +02:00
|
|
|
The plugins to source in
|
|
|
|
<filename>conf.d/99plugins.fish</filename>.
|
2019-03-23 21:09:03 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.fish.functions = mkOption {
|
2020-03-01 22:20:44 +01:00
|
|
|
type = with types; attrsOf (either lines functionModule);
|
2020-02-15 18:10:11 +01:00
|
|
|
default = { };
|
2021-10-09 11:14:08 +02:00
|
|
|
example = literalExpression ''
|
2020-03-01 22:20:44 +01:00
|
|
|
{
|
|
|
|
__fish_command_not_found_handler = {
|
|
|
|
body = "__fish_default_command_not_found_handler $argv[1]";
|
|
|
|
onEvent = "fish_command_not_found";
|
|
|
|
};
|
|
|
|
|
|
|
|
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
|
|
|
|
}
|
|
|
|
'';
|
2019-03-23 21:09:03 +01:00
|
|
|
description = ''
|
2019-09-24 07:00:23 +02:00
|
|
|
Basic functions to add to fish. For more information see
|
2020-03-01 22:20:44 +01:00
|
|
|
<link xlink:href="https://fishshell.com/docs/current/cmds/function.html"/>.
|
2019-03-23 21:09:03 +01:00
|
|
|
'';
|
|
|
|
};
|
2018-08-14 09:39:22 +02:00
|
|
|
};
|
|
|
|
|
2020-02-20 00:16:01 +01:00
|
|
|
config = mkIf cfg.enable (mkMerge [
|
|
|
|
{
|
|
|
|
home.packages = [ cfg.package ];
|
2019-09-24 10:20:44 +02:00
|
|
|
|
2022-05-29 07:08:21 +02:00
|
|
|
# Support completion for `man` by building a cache for `apropos`.
|
|
|
|
programs.man.generateCaches = mkDefault true;
|
|
|
|
|
2020-02-20 00:16:01 +01:00
|
|
|
xdg.dataFile."fish/home-manager_generated_completions".source = let
|
2018-12-17 12:57:30 +01:00
|
|
|
# paths later in the list will overwrite those already linked
|
2020-02-20 00:16:01 +01:00
|
|
|
destructiveSymlinkJoin = args_@{ name, paths, preferLocalBuild ? true
|
|
|
|
, allowSubstitutes ? false, postBuild ? "", ... }:
|
2018-12-17 12:57:30 +01:00
|
|
|
let
|
2020-02-20 00:16:01 +01:00
|
|
|
args = removeAttrs args_ [ "name" "postBuild" ] // {
|
|
|
|
# pass the defaults
|
|
|
|
inherit preferLocalBuild allowSubstitutes;
|
|
|
|
};
|
|
|
|
in pkgs.runCommand name args ''
|
|
|
|
mkdir -p $out
|
|
|
|
for i in $paths; do
|
|
|
|
if [ -z "$(find $i -prune -empty)" ]; then
|
|
|
|
cp -srf $i/* $out
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
${postBuild}
|
|
|
|
'';
|
|
|
|
|
|
|
|
generateCompletions = package:
|
|
|
|
pkgs.runCommand "${package.name}-fish-completions" {
|
2018-12-17 12:57:30 +01:00
|
|
|
src = package;
|
2022-04-29 08:47:51 +02:00
|
|
|
nativeBuildInputs = [ pkgs.python3 ];
|
2018-12-17 12:57:30 +01:00
|
|
|
buildInputs = [ cfg.package ];
|
|
|
|
preferLocalBuild = true;
|
2020-02-20 00:16:01 +01:00
|
|
|
} ''
|
2018-12-17 12:57:30 +01:00
|
|
|
mkdir -p $out
|
|
|
|
if [ -d $src/share/man ]; then
|
|
|
|
find $src/share/man -type f \
|
|
|
|
| xargs python ${cfg.package}/share/fish/tools/create_manpage_completions.py --directory $out \
|
|
|
|
> /dev/null
|
|
|
|
fi
|
|
|
|
'';
|
2020-02-20 00:16:01 +01:00
|
|
|
in destructiveSymlinkJoin {
|
|
|
|
name = "${config.home.username}-fish-completions";
|
|
|
|
paths =
|
|
|
|
let cmp = (a: b: (a.meta.priority or 0) > (b.meta.priority or 0));
|
|
|
|
in map generateCompletions (sort cmp config.home.packages);
|
|
|
|
};
|
2019-09-24 07:11:58 +02:00
|
|
|
|
2020-02-20 00:16:01 +01:00
|
|
|
programs.fish.interactiveShellInit = ''
|
|
|
|
# add completions generated by Home Manager to $fish_complete_path
|
|
|
|
begin
|
|
|
|
set -l joined (string join " " $fish_complete_path)
|
|
|
|
set -l prev_joined (string replace --regex "[^\s]*generated_completions.*" "" $joined)
|
|
|
|
set -l post_joined (string replace $prev_joined "" $joined)
|
|
|
|
set -l prev (string split " " (string trim $prev_joined))
|
|
|
|
set -l post (string split " " (string trim $post_joined))
|
|
|
|
set fish_complete_path $prev "${config.xdg.dataHome}/fish/home-manager_generated_completions" $post
|
|
|
|
end
|
|
|
|
'';
|
2019-09-24 07:11:58 +02:00
|
|
|
|
2022-11-29 05:29:34 +01:00
|
|
|
xdg.configFile."fish/config.fish".source = fishIndent "config.fish" ''
|
2020-02-20 00:16:01 +01:00
|
|
|
# ~/.config/fish/config.fish: DO NOT EDIT -- this file has been generated
|
|
|
|
# automatically by home-manager.
|
2018-09-09 14:41:36 +02:00
|
|
|
|
2021-07-29 13:37:16 +02:00
|
|
|
# Only execute this file once per shell.
|
|
|
|
set -q __fish_home_manager_config_sourced; and exit
|
|
|
|
set -g __fish_home_manager_config_sourced 1
|
2019-09-24 07:11:58 +02:00
|
|
|
|
2021-07-29 13:37:16 +02:00
|
|
|
set --prepend fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d
|
|
|
|
fenv source ${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh > /dev/null
|
|
|
|
set -e fish_function_path[1]
|
2018-08-14 09:39:22 +02:00
|
|
|
|
2021-07-29 13:37:16 +02:00
|
|
|
${cfg.shellInit}
|
2019-09-24 07:11:58 +02:00
|
|
|
|
2021-07-29 13:37:16 +02:00
|
|
|
status --is-login; and begin
|
2019-09-24 07:11:58 +02:00
|
|
|
|
2020-02-20 00:16:01 +01:00
|
|
|
# Login shell initialisation
|
|
|
|
${cfg.loginShellInit}
|
2019-09-24 07:11:58 +02:00
|
|
|
|
2020-02-20 00:16:01 +01:00
|
|
|
end
|
2018-09-09 21:17:49 +02:00
|
|
|
|
2021-07-29 13:37:16 +02:00
|
|
|
status --is-interactive; and begin
|
2018-09-09 21:17:49 +02:00
|
|
|
|
2020-02-20 00:16:01 +01:00
|
|
|
# Abbreviations
|
|
|
|
${abbrsStr}
|
2019-09-24 07:11:58 +02:00
|
|
|
|
2020-02-20 00:16:01 +01:00
|
|
|
# Aliases
|
|
|
|
${aliasesStr}
|
2019-09-24 07:11:58 +02:00
|
|
|
|
2023-01-24 11:30:04 +01:00
|
|
|
# Interactive shell initialisation
|
2020-02-20 00:16:01 +01:00
|
|
|
${cfg.interactiveShellInit}
|
2019-09-24 10:20:44 +02:00
|
|
|
|
2020-02-20 00:16:01 +01:00
|
|
|
end
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
2020-03-01 22:20:44 +01:00
|
|
|
xdg.configFile = mapAttrs' (name: def: {
|
|
|
|
name = "fish/functions/${name}.fish";
|
2020-02-20 00:16:01 +01:00
|
|
|
value = {
|
2022-11-29 05:29:34 +01:00
|
|
|
source = let
|
2020-03-01 22:20:44 +01:00
|
|
|
modifierStr = n: v: optional (v != null) ''--${n}="${toString v}"'';
|
|
|
|
modifierStrs = n: v: optional (v != null) "--${n}=${toString v}";
|
|
|
|
modifierBool = n: v: optional (v != null && v) "--${n}";
|
|
|
|
|
|
|
|
mods = with def;
|
|
|
|
modifierStr "description" description ++ modifierStr "wraps" wraps
|
|
|
|
++ modifierStr "on-event" onEvent
|
|
|
|
++ modifierStr "on-variable" onVariable
|
|
|
|
++ modifierStr "on-job-exit" onJobExit
|
|
|
|
++ modifierStr "on-process-exit" onProcessExit
|
|
|
|
++ modifierStr "on-signal" onSignal
|
|
|
|
++ modifierBool "no-scope-shadowing" noScopeShadowing
|
|
|
|
++ modifierStr "inherit-variable" inheritVariable
|
|
|
|
++ modifierStrs "argument-names" argumentNames;
|
|
|
|
|
|
|
|
modifiers = if isAttrs def then " ${toString mods}" else "";
|
|
|
|
body = if isAttrs def then def.body else def;
|
2022-11-29 05:29:34 +01:00
|
|
|
in fishIndent "${name}.fish" ''
|
2020-03-01 22:20:44 +01:00
|
|
|
function ${name}${modifiers}
|
2022-11-29 05:29:34 +01:00
|
|
|
${lib.strings.removeSuffix "\n" body}
|
2020-02-20 00:16:01 +01:00
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
2019-09-24 07:00:23 +02:00
|
|
|
}) cfg.functions;
|
2020-02-20 00:16:01 +01:00
|
|
|
}
|
2019-09-24 10:21:34 +02:00
|
|
|
|
2019-09-25 08:20:53 +02:00
|
|
|
# Each plugin gets a corresponding conf.d/plugin-NAME.fish file to load
|
|
|
|
# in the paths and any initialization scripts.
|
2019-09-24 10:21:34 +02:00
|
|
|
(mkIf (length cfg.plugins > 0) {
|
2020-02-20 00:16:01 +01:00
|
|
|
xdg.configFile = mkMerge ((map (plugin: {
|
2022-11-29 05:29:34 +01:00
|
|
|
"fish/conf.d/plugin-${plugin.name}.fish".source =
|
|
|
|
fishIndent "${plugin.name}.fish" ''
|
|
|
|
# Plugin ${plugin.name}
|
|
|
|
set -l plugin_dir ${plugin.src}
|
|
|
|
|
|
|
|
# Set paths to import plugin components
|
|
|
|
if test -d $plugin_dir/functions
|
|
|
|
set fish_function_path $fish_function_path[1] $plugin_dir/functions $fish_function_path[2..-1]
|
2020-04-29 17:41:30 +02:00
|
|
|
end
|
2019-09-24 10:21:34 +02:00
|
|
|
|
2022-11-29 05:29:34 +01:00
|
|
|
if test -d $plugin_dir/completions
|
|
|
|
set fish_complete_path $fish_complete_path[1] $plugin_dir/completions $fish_complete_path[2..-1]
|
|
|
|
end
|
2019-09-24 10:21:34 +02:00
|
|
|
|
2022-11-29 05:29:34 +01:00
|
|
|
# Source initialization code if it exists.
|
|
|
|
if test -d $plugin_dir/conf.d
|
|
|
|
for f in $plugin_dir/conf.d/*.fish
|
|
|
|
source $f
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if test -f $plugin_dir/key_bindings.fish
|
|
|
|
source $plugin_dir/key_bindings.fish
|
|
|
|
end
|
|
|
|
|
|
|
|
if test -f $plugin_dir/init.fish
|
|
|
|
source $plugin_dir/init.fish
|
|
|
|
end
|
|
|
|
'';
|
2020-02-20 00:16:01 +01:00
|
|
|
}) cfg.plugins));
|
2019-09-24 10:21:34 +02:00
|
|
|
})
|
|
|
|
]);
|
2018-08-14 09:39:22 +02:00
|
|
|
}
|