diff options
author | 2014-09-29 19:39:36 +0800 | |
---|---|---|
committer | 2014-09-29 19:39:36 +0800 | |
commit | a186f04f15773b4595d0e359d1e27a903a68d3f7 (patch) | |
tree | 293c07e41b13732ce3c97069a440af851d0d3f2e /share/functions | |
parent | 15ca3b426fc9db4b6e650e1aa09f6227199c58e6 (diff) |
Manpage completions: store in $XDG_DATA_HOME
Closes #1343, works towards #1257.
Diffstat (limited to 'share/functions')
-rw-r--r-- | share/functions/__fish_config_interactive.fish | 7 | ||||
-rw-r--r-- | share/functions/fish_update_completions.fish | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 45b2e710..f98a9e6f 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -19,6 +19,11 @@ function __fish_config_interactive -d "Initializations that should be performed if set -q XDG_CONFIG_HOME set configdir $XDG_CONFIG_HOME end + # Set the correct user data directory + set -l userdatadir ~/.local/share + if set -q XDG_DATA_HOME + set userdatadir $XDG_DATA_HOME + end # Migrate old (pre 1.22.0) init scripts if they exist if not set -q __fish_init_1_22_0 @@ -144,7 +149,7 @@ function __fish_config_interactive -d "Initializations that should be performed # Generate man page completions if not present # - if not test -d $configdir/fish/generated_completions + if not test -d $userdatadir/fish/generated_completions #fish_update_completions is a function, so it can not be directly run in background. eval "$__fish_bin_dir/fish -c 'fish_update_completions > /dev/null ^/dev/null' &" end diff --git a/share/functions/fish_update_completions.fish b/share/functions/fish_update_completions.fish index 714ae6ef..2a65441d 100644 --- a/share/functions/fish_update_completions.fish +++ b/share/functions/fish_update_completions.fish @@ -1,3 +1,4 @@ function fish_update_completions --description "Update man-page based completions" - eval \"$__fish_datadir/tools/create_manpage_completions.py\" --manpath --progress --cleanup-in '~/.config/fish/completions' + # Clean up old paths + eval \"$__fish_datadir/tools/create_manpage_completions.py\" --manpath --progress --cleanup-in '~/.config/fish/completions' --cleanup-in '~/.config/fish/generated_completions' end |