mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
Make skeleton dir/config file create a one-time initialization thing
This moves the stuff that creates skeleton/boilerplate files to the same place we initialize uvars for the first time or on upgrade. Being a bit less aggresssive here theoretically makes launch a little lighter but really I personally just found it weird I couldn't just delete my empty config.fish file without it getting recreated and sourced every launch.
This commit is contained in:
parent
ce55114e38
commit
8416a52255
1 changed files with 10 additions and 10 deletions
|
@ -26,6 +26,16 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
|
|
||||||
# If we are starting up for the first time, set various defaults.
|
# If we are starting up for the first time, set various defaults.
|
||||||
if test $__fish_initialized -lt 3400
|
if test $__fish_initialized -lt 3400
|
||||||
|
# Create empty configuration directores if they do not already exist
|
||||||
|
test -e $__fish_config_dir/completions/ -a -e $__fish_config_dir/conf.d/ -a -e $__fish_config_dir/functions/ ||
|
||||||
|
mkdir -p $__fish_config_dir/{completions, conf.d, functions}
|
||||||
|
|
||||||
|
# Create config.fish with some boilerplate if it does not exist
|
||||||
|
test -e $__fish_config_dir/config.fish || echo "\
|
||||||
|
if status is-interactive
|
||||||
|
# Commands to run in interactive sessions can go here
|
||||||
|
end" >$__fish_config_dir/config.fish
|
||||||
|
|
||||||
# Regular syntax highlighting colors
|
# Regular syntax highlighting colors
|
||||||
__init_uvar fish_color_normal normal
|
__init_uvar fish_color_normal normal
|
||||||
__init_uvar fish_color_command blue
|
__init_uvar fish_color_command blue
|
||||||
|
@ -271,16 +281,6 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
|
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
|
||||||
end
|
end
|
||||||
|
|
||||||
# Create empty configuration directores if they do not already exist
|
|
||||||
test -e $__fish_config_dir/completions/ -a -e $__fish_config_dir/conf.d/ -a -e $__fish_config_dir/functions/ ||
|
|
||||||
mkdir -p $__fish_config_dir/{completions, conf.d, functions}
|
|
||||||
|
|
||||||
# Create config.fish with some boilerplate if it does not exist
|
|
||||||
test -e $__fish_config_dir/config.fish || echo "\
|
|
||||||
if status is-interactive
|
|
||||||
# Commands to run in interactive sessions can go here
|
|
||||||
end" >$__fish_config_dir/config.fish
|
|
||||||
|
|
||||||
# Bump this whenever some code below needs to run once when upgrading to a new version.
|
# Bump this whenever some code below needs to run once when upgrading to a new version.
|
||||||
# The universal variable __fish_initialized is initialized in share/config.fish.
|
# The universal variable __fish_initialized is initialized in share/config.fish.
|
||||||
set __fish_initialized 3400
|
set __fish_initialized 3400
|
||||||
|
|
Loading…
Reference in a new issue