1
0
Fork 0

Customizing zprezto to my tastes

- Removing logout and login signatures/messages
- Sets zprezto to run under my dotfiles
- Adds zsh completion script
pull/1235/head
Mike Cravey 10 years ago
parent 085aef56d1
commit 74b654e769

@ -1,3 +1,4 @@
#!/usr/bin/env zsh
# #
# Initializes Prezto. # Initializes Prezto.
# #
@ -31,7 +32,7 @@ function pmodload {
pmodules=("$argv[@]") pmodules=("$argv[@]")
# Add functions to $fpath. # Add functions to $fpath.
fpath=(${pmodules:+${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions(/FN)} $fpath) fpath=(${pmodules:+$DOTFILES/zprezto/modules/${^pmodules}/functions(/FN)} $fpath)
function { function {
local pfunction local pfunction
@ -40,7 +41,7 @@ function pmodload {
setopt LOCAL_OPTIONS EXTENDED_GLOB setopt LOCAL_OPTIONS EXTENDED_GLOB
# Load Prezto functions. # Load Prezto functions.
for pfunction in ${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions/$~pfunction_glob; do for pfunction in $DOTFILES/zprezto/modules/${^pmodules}/functions/$~pfunction_glob; do
autoload -Uz "$pfunction" autoload -Uz "$pfunction"
done done
} }
@ -49,19 +50,19 @@ function pmodload {
for pmodule in "$pmodules[@]"; do for pmodule in "$pmodules[@]"; do
if zstyle -t ":prezto:module:$pmodule" loaded 'yes' 'no'; then if zstyle -t ":prezto:module:$pmodule" loaded 'yes' 'no'; then
continue continue
elif [[ ! -d "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule" ]]; then elif [[ ! -d "$DOTFILES/zprezto/modules/$pmodule" ]]; then
print "$0: no such module: $pmodule" >&2 print "$0: no such module: $pmodule" >&2
continue continue
else else
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh" ]]; then if [[ -s "$DOTFILES/zprezto/modules/$pmodule/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh" source "$DOTFILES/zprezto/modules/$pmodule/init.zsh"
fi fi
if (( $? == 0 )); then if (( $? == 0 )); then
zstyle ":prezto:module:$pmodule" loaded 'yes' zstyle ":prezto:module:$pmodule" loaded 'yes'
else else
# Remove the $fpath entry. # Remove the $fpath entry.
fpath[(r)${ZDOTDIR:-$HOME}/.zprezto/modules/${pmodule}/functions]=() fpath[(r)$DOTFILES/zprezto/modules/${pmodule}/functions]=()
function { function {
local pfunction local pfunction
@ -71,7 +72,7 @@ function pmodload {
setopt LOCAL_OPTIONS EXTENDED_GLOB setopt LOCAL_OPTIONS EXTENDED_GLOB
# Unload Prezto functions. # Unload Prezto functions.
for pfunction in ${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/functions/$~pfunction_glob; do for pfunction in $DOTFILES/zprezto/modules/$pmodule/functions/$~pfunction_glob; do
unfunction "$pfunction" unfunction "$pfunction"
done done
} }

@ -1,3 +1,5 @@
#!/usr/bin/env zsh
# #
# Executes commands at login post-zshrc. # Executes commands at login post-zshrc.
# #
@ -13,11 +15,3 @@
zcompile "$zcompdump" zcompile "$zcompdump"
fi fi
} &! } &!
# Print a random, hopefully interesting, adage.
if (( $+commands[fortune] )); then
if [[ -t 0 || -t 1 ]]; then
fortune -s
print
fi
fi

@ -1,13 +0,0 @@
#
# Executes commands at logout.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Print the message.
cat <<-EOF
Thank you. Come again!
-- Dr. Apu Nahasapeemapetilon
EOF

@ -1,3 +1,5 @@
#!/usr/bin/env zsh
# #
# Sets Prezto options. # Sets Prezto options.
# #
@ -27,13 +29,23 @@ zstyle ':prezto:load' pmodule \
'environment' \ 'environment' \
'terminal' \ 'terminal' \
'editor' \ 'editor' \
'archive' \
'history' \ 'history' \
'directory' \ 'directory' \
'spectrum' \ 'spectrum' \
'utility' \ 'utility' \
'completion' \ 'completion' \
'python' \
'ruby' \
'node' \
'rsync' \
'syntax-highlighting' \
'history-substring-search' \
'git' \
'spectrum' \
'prompt' 'prompt'
# #
# Autosuggestions # Autosuggestions
# #
@ -49,7 +61,7 @@ zstyle ':prezto:load' pmodule \
zstyle ':prezto:module:editor' key-bindings 'emacs' zstyle ':prezto:module:editor' key-bindings 'emacs'
# Auto convert .... to ../.. # Auto convert .... to ../..
# zstyle ':prezto:module:editor' dot-expansion 'yes' zstyle ':prezto:module:editor' dot-expansion 'yes'
# #
# Git # Git
@ -70,13 +82,13 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# #
# Set the query found color. # Set the query found color.
# zstyle ':prezto:module:history-substring-search:color' found '' zstyle ':prezto:module:history-substring-search:color' found ''
# Set the query not found color. # Set the query not found color.
# zstyle ':prezto:module:history-substring-search:color' not-found '' zstyle ':prezto:module:history-substring-search:color' not-found ''
# Set the search globbing flags. # Set the search globbing flags.
# zstyle ':prezto:module:history-substring-search' globbing-flags '' zstyle ':prezto:module:history-substring-search' globbing-flags ''
# #
# Pacman # Pacman
@ -92,7 +104,7 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# Set the prompt theme to load. # Set the prompt theme to load.
# Setting it to 'random' loads a random theme. # Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals. # Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme 'sorin' zstyle ':prezto:module:prompt' theme 'craveytrain'
# #
# Ruby # Ruby

@ -1,3 +1,5 @@
#!/usr/bin/env zsh
# #
# Executes commands at login pre-zshrc. # Executes commands at login pre-zshrc.
# #
@ -13,14 +15,6 @@ if [[ "$OSTYPE" == darwin* ]]; then
export BROWSER='open' export BROWSER='open'
fi fi
#
# Editors
#
export EDITOR='nano'
export VISUAL='nano'
export PAGER='less'
# #
# Language # Language
# #

@ -1,3 +1,5 @@
#!/usr/bin/env zsh
# #
# Defines environment variables. # Defines environment variables.
# #
@ -5,6 +7,8 @@
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# #
export DOTFILES="$(cd "$(dirname "$(readlink ~/.bashrc)")" && cd .. && pwd)"
# Ensure that a non-login, non-interactive shell has a defined environment. # Ensure that a non-login, non-interactive shell has a defined environment.
if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
source "${ZDOTDIR:-$HOME}/.zprofile" source "${ZDOTDIR:-$HOME}/.zprofile"

@ -1,3 +1,5 @@
#!/usr/bin/env zsh
# #
# Executes commands at the start of an interactive session. # Executes commands at the start of an interactive session.
# #
@ -6,8 +8,25 @@
# #
# Source Prezto. # Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then if [[ -s "$DOTFILES/zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" source "$DOTFILES/zprezto/init.zsh"
fi fi
# Customize to your needs... # Customize to your needs...
source_if_present() {
if [ -f "$1" ]; then
. "$1"
fi
}
# Reload profile
alias reload!=". $HOME/.zshrc"
path=(
$HOME/bin
$DOTFILES/bin
/usr/local/opt/coreutils
$path
)
source_if_present "$DOTFILES/system/load.sh"

Loading…
Cancel
Save