Customizing zprezto to my tastes
- Removing logout and login signatures/messages - Sets zprezto to run under my dotfiles - Adds zsh completion script
This commit is contained in:
parent
085aef56d1
commit
74b654e769
7 changed files with 54 additions and 43 deletions
15
init.zsh
Normal file → Executable file
15
init.zsh
Normal file → Executable file
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env zsh
|
||||
#
|
||||
# Initializes Prezto.
|
||||
#
|
||||
|
@ -31,7 +32,7 @@ function pmodload {
|
|||
pmodules=("$argv[@]")
|
||||
|
||||
# Add functions to $fpath.
|
||||
fpath=(${pmodules:+${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions(/FN)} $fpath)
|
||||
fpath=(${pmodules:+$DOTFILES/zprezto/modules/${^pmodules}/functions(/FN)} $fpath)
|
||||
|
||||
function {
|
||||
local pfunction
|
||||
|
@ -40,7 +41,7 @@ function pmodload {
|
|||
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
||||
|
||||
# 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"
|
||||
done
|
||||
}
|
||||
|
@ -49,19 +50,19 @@ function pmodload {
|
|||
for pmodule in "$pmodules[@]"; do
|
||||
if zstyle -t ":prezto:module:$pmodule" loaded 'yes' 'no'; then
|
||||
continue
|
||||
elif [[ ! -d "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule" ]]; then
|
||||
elif [[ ! -d "$DOTFILES/zprezto/modules/$pmodule" ]]; then
|
||||
print "$0: no such module: $pmodule" >&2
|
||||
continue
|
||||
else
|
||||
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh" ]]; then
|
||||
source "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh"
|
||||
if [[ -s "$DOTFILES/zprezto/modules/$pmodule/init.zsh" ]]; then
|
||||
source "$DOTFILES/zprezto/modules/$pmodule/init.zsh"
|
||||
fi
|
||||
|
||||
if (( $? == 0 )); then
|
||||
zstyle ":prezto:module:$pmodule" loaded 'yes'
|
||||
else
|
||||
# Remove the $fpath entry.
|
||||
fpath[(r)${ZDOTDIR:-$HOME}/.zprezto/modules/${pmodule}/functions]=()
|
||||
fpath[(r)$DOTFILES/zprezto/modules/${pmodule}/functions]=()
|
||||
|
||||
function {
|
||||
local pfunction
|
||||
|
@ -71,7 +72,7 @@ function pmodload {
|
|||
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
||||
|
||||
# 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"
|
||||
done
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
#
|
||||
# Executes commands at login post-zshrc.
|
||||
#
|
||||
|
@ -13,11 +15,3 @@
|
|||
zcompile "$zcompdump"
|
||||
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.
|
||||
#
|
||||
|
@ -27,13 +29,23 @@ zstyle ':prezto:load' pmodule \
|
|||
'environment' \
|
||||
'terminal' \
|
||||
'editor' \
|
||||
'archive' \
|
||||
'history' \
|
||||
'directory' \
|
||||
'spectrum' \
|
||||
'utility' \
|
||||
'completion' \
|
||||
'python' \
|
||||
'ruby' \
|
||||
'node' \
|
||||
'rsync' \
|
||||
'syntax-highlighting' \
|
||||
'history-substring-search' \
|
||||
'git' \
|
||||
'spectrum' \
|
||||
'prompt'
|
||||
|
||||
|
||||
#
|
||||
# Autosuggestions
|
||||
#
|
||||
|
@ -49,7 +61,7 @@ zstyle ':prezto:load' pmodule \
|
|||
zstyle ':prezto:module:editor' key-bindings 'emacs'
|
||||
|
||||
# Auto convert .... to ../..
|
||||
# zstyle ':prezto:module:editor' dot-expansion 'yes'
|
||||
zstyle ':prezto:module:editor' dot-expansion 'yes'
|
||||
|
||||
#
|
||||
# Git
|
||||
|
@ -70,13 +82,13 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
|
|||
#
|
||||
|
||||
# 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.
|
||||
# zstyle ':prezto:module:history-substring-search:color' not-found ''
|
||||
zstyle ':prezto:module:history-substring-search:color' not-found ''
|
||||
|
||||
# Set the search globbing flags.
|
||||
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
|
||||
zstyle ':prezto:module:history-substring-search' globbing-flags ''
|
||||
|
||||
#
|
||||
# Pacman
|
||||
|
@ -92,7 +104,7 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
|
|||
# Set the prompt theme to load.
|
||||
# Setting it to 'random' loads a random theme.
|
||||
# Auto set to 'off' on dumb terminals.
|
||||
zstyle ':prezto:module:prompt' theme 'sorin'
|
||||
zstyle ':prezto:module:prompt' theme 'craveytrain'
|
||||
|
||||
#
|
||||
# Ruby
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
#
|
||||
# Executes commands at login pre-zshrc.
|
||||
#
|
||||
|
@ -13,14 +15,6 @@ if [[ "$OSTYPE" == darwin* ]]; then
|
|||
export BROWSER='open'
|
||||
fi
|
||||
|
||||
#
|
||||
# Editors
|
||||
#
|
||||
|
||||
export EDITOR='nano'
|
||||
export VISUAL='nano'
|
||||
export PAGER='less'
|
||||
|
||||
#
|
||||
# Language
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
#
|
||||
# Defines environment variables.
|
||||
#
|
||||
|
@ -5,6 +7,8 @@
|
|||
# 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.
|
||||
if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
|
||||
source "${ZDOTDIR:-$HOME}/.zprofile"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
#
|
||||
# Executes commands at the start of an interactive session.
|
||||
#
|
||||
|
@ -6,8 +8,25 @@
|
|||
#
|
||||
|
||||
# Source Prezto.
|
||||
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
|
||||
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
|
||||
if [[ -s "$DOTFILES/zprezto/init.zsh" ]]; then
|
||||
source "$DOTFILES/zprezto/init.zsh"
|
||||
fi
|
||||
|
||||
# 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…
Add table
Reference in a new issue