diff --git a/FAQ.md b/FAQ.md index d72c6f1..b54d53b 100644 --- a/FAQ.md +++ b/FAQ.md @@ -41,11 +41,11 @@ There are roughly 3 kinds of packages: + Autoload installed packages and themes under `$OMF_PATH/`. -+ Autoload your custom path. `$OMF_PATH/custom` by default, but configurable via `$OMF_CUSTOM`. ++ Autoload your config path. `~/.config/omf` by default, but configurable via `$OMF_CONFIG`. -+ Autoload any `functions` directory under `$OMF_PATH` and `$OMF_CUSTOM` ++ Autoload any `functions` directory under `$OMF_PATH` and `$OMF_CONFIG` -+ Run `$OMF_CUSTOM/init.fish` if available. ++ Run `$OMF_CONFIG/init.fish` if available. ## How can I upgrade from an existing Oh My Fish installation? diff --git a/README.md b/README.md index 05b4194..cea35b6 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Remove a theme or package. Scaffold out a new package or theme. -> This creates a new directory under `$OMF_CUSTOM/{pkg | themes}/` with a template. +> This creates a new directory under `$OMF_CONFIG/{pkg | themes}/` with a template. ## `omf submit` _`pkg/`_ _`[]`_ @@ -135,9 +135,9 @@ Uninstall Oh My Fish. See [uninstall](#uninstall) for more information. ## Startup -This script runs each time a new session begins, autoloading packages, themes and your _custom_ path (dotfiles) in that order. +This script runs each time a new session begins, autoloading packages, themes and your _config_ path in that order. -The _custom_ path (`$HOME/.dotfiles` by default) is defined by `$OMF_CUSTOM` in `$HOME/.config/fish/config.fish`. Modify this to load your own dotfiles if you have any. +The _config_ path (`~/.config/omf` by default) is defined by `$OMF_CONFIG` in `~/.config/fish/config.fish`. Modify this to load your own configuration if you have any. ## Core Library diff --git a/bin/install b/bin/install index ea45b13..016be07 100755 --- a/bin/install +++ b/bin/install @@ -3,7 +3,7 @@ # USAGE # #1: curl -L git.io/omf | sh # #2: curl -L git.io/omf > install && chmod +x install && ./install -# #3: OMF_CUSTOM=~/.dotfiles curl -L git.io/omf | sh +# #3: OMF_CONFIG=~/.omf curl -L git.io/omf | sh # # ENV # XDG_DATA_HOME Base directory (~/.local/share) @@ -14,7 +14,6 @@ # # OMF_PATH Oh My Fish directory # OMF_CONFIG Oh My Fish configuration -# OMF_CUSTOM Custom dotfiles directory # # OMF_REPO_URI Source git repository # OMF_REPO_BRANCH Source repository default branch (master) @@ -25,11 +24,10 @@ # omf_create_fish_config # omf_install -test -z ${XDG_DATA_HOME+_} && XDG_DATA_HOME="${HOME}/.local/share" -test -z ${XDG_CONFIG_HOME+_} && XDG_CONFIG_HOME="${HOME}/.config" +test -z ${XDG_DATA_HOME+_} && XDG_DATA_HOME="${HOME}/.local/share" +test -z ${XDG_CONFIG_HOME+_} && XDG_CONFIG_HOME="${HOME}/.config" test -z ${OMF_PATH+_} && OMF_PATH="${XDG_DATA_HOME}/omf" -test -z ${OMF_CUSTOM+_} && OMF_CUSTOM="${HOME}/.dotfiles" test -z ${OMF_CONFIG+_} && OMF_CONFIG="${XDG_CONFIG_HOME}/omf" test -z ${OMF_REPO_URI+_} && OMF_REPO_URI="https://github.com/fish-shell/omf" @@ -96,7 +94,6 @@ omf_install() { echo "set -g OMF_PATH $(echo "${OMF_PATH}" | sed -e "s|$HOME|\$HOME|")" > ${fish_config_file} - echo "set -g OMF_CUSTOM $(echo "${OMF_CUSTOM}" | sed -e "s|$HOME|\$HOME|")" >> ${fish_config_file} echo "set -g OMF_CONFIG $(echo "${OMF_CONFIG}" | sed -e "s|$HOME|\$HOME|")" >> ${fish_config_file} echo "source \$OMF_PATH/init.fish" >> ${fish_config_file} diff --git a/init.fish b/init.fish index 28017c2..119cb39 100644 --- a/init.fish +++ b/init.fish @@ -6,18 +6,18 @@ # RESET_PATH Original $PATH preseved across Oh My Fish refreshes. # OMF_PATH Set in ~/.config/fish/config.fish # OMF_IGNORE List of packages to ignore. -# OMF_CUSTOM Same as OMF_PATH. ~/.dotfiles by default. +# OMF_CONFIG Same as OMF_PATH. ~/.config/omf by default. # # OVERVIEW -# + Autoload Oh My Fish packages, themes and custom path -# + For each inside {$OMF_PATH,$OMF_CUSTOM} +# + Autoload Oh My Fish packages, themes and config path +# + For each inside {$OMF_PATH,$OMF_CONFIG} # + Autoload directory # + Source .fish # + Emit init_ event # -# + Autoload {$OMF_PATH,$OMF_CUSTOM}/functions -# + Source {$OMF_PATH,$OMF_CUSTOM} → fish-shell/fish-shell/issues/845 -# + Source $OMF_CUSTOM/init.fish +# + Autoload {$OMF_PATH,$OMF_CONFIG}/functions +# + Source {$OMF_PATH,$OMF_CONFIG} → fish-shell/fish-shell/issues/845 +# + Source $OMF_CONFIG/init.fish if set -q RESET_PATH set PATH $RESET_PATH @@ -31,24 +31,24 @@ set -q OSTYPE; or set -g OSTYPE (uname) set -l user_function_path $fish_function_path[1] set fish_function_path[1] $OMF_PATH/lib -set -l theme {$OMF_PATH,$OMF_CUSTOM}/themes/(cat $OMF_CONFIG/theme) +set -l theme {$OMF_PATH,$OMF_CONFIG}/themes/(cat $OMF_CONFIG/theme) set -l paths $OMF_PATH/pkg/* -set -l custom $OMF_CUSTOM/pkg/* +set -l config $OMF_CONFIG/pkg/* set -l ignore $OMF_IGNORE for path in $paths - set custom $OMF_CUSTOM/(basename $path) $custom + set config $OMF_CONFIG/(basename $path) $config end -for path in $OMF_PATH/lib $OMF_PATH/lib/git $paths $theme $custom +for path in $OMF_PATH/lib $OMF_PATH/lib/git $paths $theme $config contains -- (basename $path) $ignore; and continue autoload $path $path/completions source $path/(basename $path).fish and emit init_(basename $path) $path end -autoload $OMF_CUSTOM/functions +autoload $OMF_CONFIG/functions autoload $user_function_path -source {$OMF_PATH,$OMF_CUSTOM}/events.fish -source $OMF_CUSTOM/init.fish +source {$OMF_PATH,$OMF_CONFIG}/events.fish +source $OMF_CONFIG/init.fish diff --git a/pkg/omf/cli/omf_destroy.fish b/pkg/omf/cli/omf_destroy.fish index 9b40e1b..f33f207 100644 --- a/pkg/omf/cli/omf_destroy.fish +++ b/pkg/omf/cli/omf_destroy.fish @@ -7,10 +7,6 @@ function omf_destroy -d "Remove Oh My Fish" mv "$HOME/.config/fish/config".{copy,fish} end - if test (basename "$OMF_CONFIG") = "omf" - rm -rf "$OMF_CONFIG" - end - if test "$OMF_PATH" != "$HOME" rm -rf "$OMF_PATH" end diff --git a/pkg/omf/cli/omf_list_db_packages.fish b/pkg/omf/cli/omf_list_db_packages.fish index c60905d..d4c8aba 100644 --- a/pkg/omf/cli/omf_list_db_packages.fish +++ b/pkg/omf/cli/omf_list_db_packages.fish @@ -1,6 +1,6 @@ # List all packages available to install from the registry. function omf_list_db_packages for item in (basename $OMF_PATH/db/pkg/*) - contains $item (basename {$OMF_PATH,$OMF_CUSTOM}/pkg/*); or echo $item + contains $item (basename {$OMF_PATH,$OMF_CONFIG}/pkg/*); or echo $item end end diff --git a/pkg/omf/cli/omf_list_local_packages.fish b/pkg/omf/cli/omf_list_local_packages.fish index 9e352fe..6d4c6b7 100644 --- a/pkg/omf/cli/omf_list_local_packages.fish +++ b/pkg/omf/cli/omf_list_local_packages.fish @@ -1,6 +1,6 @@ # List all custom packages and packages installed from the registry. function omf_list_local_packages - for item in (basename {$OMF_PATH,$OMF_CUSTOM}/pkg/*) + for item in (basename {$OMF_PATH,$OMF_CONFIG}/pkg/*) test $item = omf; or echo $item end end diff --git a/pkg/omf/cli/omf_list_themes.fish b/pkg/omf/cli/omf_list_themes.fish index 9aaeb09..3294bf0 100644 --- a/pkg/omf/cli/omf_list_themes.fish +++ b/pkg/omf/cli/omf_list_themes.fish @@ -1,7 +1,7 @@ function omf_list_themes set -l seen "" for theme in (basename $OMF_PATH/db/themes/*) \ - (basename {$OMF_PATH,$OMF_CUSTOM}/themes/*) + (basename {$OMF_PATH,$OMF_CONFIG}/themes/*) contains $theme $seen; or echo $theme set seen $seen $theme end diff --git a/pkg/omf/cli/omf_new.fish b/pkg/omf/cli/omf_new.fish index 4a54019..5f90e5e 100644 --- a/pkg/omf/cli/omf_new.fish +++ b/pkg/omf/cli/omf_new.fish @@ -28,7 +28,7 @@ function omf_new -a option name echo (omf::em)"Switched to $dir"(omf::off) else - echo (omf::err)"\$OMF_CUSTOM and/or \$OMF_PATH undefined."(omf::off) 1^&2 + echo (omf::err)"\$OMF_CONFIG and/or \$OMF_PATH undefined."(omf::off) 1^&2 exit $OMF_UNKNOWN_ERR end end diff --git a/pkg/omf/cli/omf_theme.fish b/pkg/omf/cli/omf_theme.fish index 3a59428..8458ba5 100644 --- a/pkg/omf/cli/omf_theme.fish +++ b/pkg/omf/cli/omf_theme.fish @@ -1,5 +1,5 @@ function omf_theme - if not test -e $OMF_CUSTOM/themes/$argv[1] + if not test -e $OMF_CONFIG/themes/$argv[1] if not test -e $OMF_PATH/themes/$argv[1] set -l theme $OMF_PATH/db/themes/$argv[1] if test -e $theme diff --git a/pkg/omf/util/omf_util_mkdir.fish b/pkg/omf/util/omf_util_mkdir.fish index 2c0e300..c136441 100644 --- a/pkg/omf/util/omf_util_mkdir.fish +++ b/pkg/omf/util/omf_util_mkdir.fish @@ -1,10 +1,10 @@ function omf_util_mkdir -a name set -l name "$argv[1]" - if test -d "$OMF_CUSTOM" - set name "$OMF_CUSTOM/$name" + if test -d "$OMF_CONFIG" + set name "$OMF_CONFIG/$name" else if test -d "$OMF_PATH" set name "$OMF_PATH/$name" end mkdir -p "$name" echo $name -end \ No newline at end of file +end