diff --git a/README.md b/README.md index 680a780..705c95e 100644 --- a/README.md +++ b/README.md @@ -152,10 +152,7 @@ After a lifetime of bash, I am now using ZSH as my default shell because of its and autocomplete features (the spelling fixer autocomplete is worth the money alone). Migrating from bash to zsh is essentially pain free. The zshrc provided here -restores the only feature that I felt was 'broken' which is the Ctrl-R reverse history search. - -While I am not going to support bash out of the box here, YADR _should_ work with bash if -you just source the _aliases_ file. However, you soul will sing if you install zsh. I promise. +restores a few features that I felt was 'broken' including Ctrl-R reverse history search. Lots of things I do every day are done with two or three character mnemonic aliases. Please feel free to edit them: @@ -163,17 +160,31 @@ mnemonic aliases. Please feel free to edit them: ae # alias edit ar # alias reload -### [ZSH Customizations & Prezto](https://github.com/sorin-ionescu/prezto) +### [Prezto](https://github.com/sorin-ionescu/prezto) For a more complete Zsh experience we use **[Prezto](http://github.com/sorin-ionescu/prezto)**. Prezto is included as a submodule. +### Adding your own ZSH theme + +If you want to add your own zsh theme, you can place it into ~/.zsh.prompts and it will automatically be picked up by the prompt loader. + +Make sure you follow the naming convention of `prompt_[name]_setup` + +``` +touch ~/.zsh.prompts/prompt_mytheme_setup +``` + +Check out ~/.yadr/zsh/prezto-themes/prompt_skwp_setup for an example of how to write a prompt. +See also the [Prezto](https://github.com/sorin-ionescu/prezto) project for more info on themes. + +### Customizing ZSH & Picking a theme + If you want to customize your zsh experience, yadr provides two hooks via ~/.zsh.after/ and ~/.zsh.before/ directories. In these directories, you can place files to customize things that load before and after other zsh customizations that come from ~/.yadr/zsh/* For example, to override the theme, you can do something like this: ``` -mkdir ~/.zsh.after echo "prompt skwp" > ~/.zsh.after/prompt.zsh ``` diff --git a/Rakefile b/Rakefile index f06f320..d69edf0 100644 --- a/Rakefile +++ b/Rakefile @@ -50,6 +50,11 @@ def install_prezto puts "Installing YADR themes for Prezto..." run %{ ln -nfs $HOME/.yadr/zsh/prezto-themes/modules/prompt/functions/* $HOME/.zprezto/modules/prompt/functions} + + puts "Creating directories for your customizations" + run %{ mkdir -p $HOME/.zsh.before } + run %{ mkdir -p $HOME/.zsh.after } + run %{ mkdir -p $HOME/.zsh.prompts } end def want_to_install? (section) diff --git a/zsh/0000_before.zsh b/zsh/0000_before.zsh index c529a46..8dd1b94 100644 --- a/zsh/0000_before.zsh +++ b/zsh/0000_before.zsh @@ -1,4 +1,7 @@ # Load any user customizations prior to load +# if [ -d $HOME/.zsh.before/ ]; then - for config_file ($HOME/.zsh.before/*.zsh) source $config_file + if [ "$(ls -A $HOME/.zsh.before/)" ]; then + for config_file ($HOME/.zsh.before/*.zsh) source $config_file + fi fi diff --git a/zsh/custom_prompt_path.zsh b/zsh/custom_prompt_path.zsh new file mode 100644 index 0000000..eed7b61 --- /dev/null +++ b/zsh/custom_prompt_path.zsh @@ -0,0 +1,3 @@ +#Load themes from yadr and from user's custom prompts (themes) in ~/.zsh.prompts +fpath=($HOME/.yadr/zsh/prezto-themes $HOME/.zsh.prompts $fpath) +promptinit diff --git a/zsh/prezto-themes/README.md b/zsh/prezto-themes/README.md deleted file mode 100644 index a416749..0000000 --- a/zsh/prezto-themes/README.md +++ /dev/null @@ -1,4 +0,0 @@ -modules/prompt/functions contains custom prompts for Prezto -These themes can be submitted to Prezto to be official. Until they are accepted, they can live here. - -Learn more at: https://github.com/sorin-ionescu/prezto diff --git a/zsh/prezto-themes/modules/prompt/functions/prompt_skwp_setup b/zsh/prezto-themes/prompt_skwp_setup similarity index 100% rename from zsh/prezto-themes/modules/prompt/functions/prompt_skwp_setup rename to zsh/prezto-themes/prompt_skwp_setup diff --git a/zsh/zzzz_after.zsh b/zsh/zzzz_after.zsh index 0149a1d..8e2404b 100644 --- a/zsh/zzzz_after.zsh +++ b/zsh/zzzz_after.zsh @@ -1,4 +1,6 @@ # Load any custom after code if [ -d $HOME/.zsh.after/ ]; then - for config_file ($HOME/.zsh.after/*.zsh) source $config_file + if [ "$(ls -A $HOME/.zsh.after/)" ]; then + for config_file ($HOME/.zsh.after/*.zsh) source $config_file + fi fi