Skip to content

Commit

Permalink
Increase heading readability
Browse files Browse the repository at this point in the history
  • Loading branch information
sorin-ionescu committed Aug 4, 2012
1 parent c15fd30 commit e16ed29
Show file tree
Hide file tree
Showing 20 changed files with 152 additions and 5 deletions.
8 changes: 8 additions & 0 deletions modules/completion/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ fi
# Load and initialize the completion system ignoring insecure directories.
autoload -Uz compinit && compinit -i

#
# Options
#

setopt COMPLETE_IN_WORD # Complete from both ends of a word.
setopt ALWAYS_TO_END # Move cursor to the end of a completed word.
setopt PATH_DIRS # Perform path search even on command names with slashes.
Expand All @@ -26,6 +30,10 @@ unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor.
# Treat these characters as part of a word.
WORDCHARS='*?_-.[]~&;!#$%^(){}<>'

#
# Styles
#

# Use caching to make completion for cammands such as dpkg and apt usable.
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path "$HOME/.zcache"
Expand Down
7 changes: 7 additions & 0 deletions modules/directory/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
# Sorin Ionescu <[email protected]>
#

#
# Options
#

setopt AUTO_CD # Auto changes to a directory without typing cd.
setopt AUTO_PUSHD # Push the old directory onto the stack on cd.
setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack.
Expand All @@ -18,7 +22,10 @@ setopt EXTENDED_GLOB # Use extended globbing syntax.
unsetopt CLOBBER # Do not overwrite existing files with > and >>.
# Use >! and >>! to bypass.

#
# Aliases
#

alias d='dirs -v'
for index ({1..9}) alias "$index"="cd +${index}"; unset index

2 changes: 2 additions & 0 deletions modules/dpkg/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ if (( ! $+commands[dpkg] && ! $+commands[apt-get] )); then
return 1
fi

#
# Aliases
#

# Cleans the cache.
alias debc='sudo apt-get clean && sudo apt-get autoclean'
Expand Down
30 changes: 27 additions & 3 deletions modules/editor/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,21 @@ if [[ "$TERM" == 'dumb' ]]; then
return 1
fi

#
# Options
#

# Beep on error in line editor.
setopt BEEP

# Allow command line editing in an external editor.
autoload -Uz edit-command-line
zle -N edit-command-line

#
# Variables
#

# Use human-friendly identifiers.
zmodload zsh/terminfo
typeset -gA key_info
Expand Down Expand Up @@ -93,6 +101,10 @@ for key in "$key_info[@]"; do
fi
done

#
# Functions
#

# Displays editor information.
function editor-info {
# Clean up previous $editor_info.
Expand Down Expand Up @@ -191,7 +203,10 @@ zle -N prepend-sudo
# Reset to default key bindings.
bindkey -d

# Emacs key bindings.
#
# Emacs Key Bindings
#

for key ("$key_info[Escape]"{B,b}) bindkey -M emacs "$key" emacs-backward-word
for key ("$key_info[Escape]"{F,f}) bindkey -M emacs "$key" emacs-forward-word
bindkey -M emacs "$key_info[Escape]$key_info[Left]" emacs-backward-word
Expand Down Expand Up @@ -220,7 +235,9 @@ if (( $+widgets[history-incremental-pattern-search-backward] )); then
history-incremental-pattern-search-forward
fi

# Vi key bindings.
#
# Vi Key Bindings
#

# Edit command in an external editor.
bindkey -M vicmd "v" edit-command-line
Expand All @@ -241,7 +258,10 @@ else
bindkey -M vicmd "/" history-incremental-search-forward
fi

# Emacs and Vi key bindings.
#
# Emacs and Vi Key Bindings
#

for keymap in 'emacs' 'viins'; do
bindkey -M "$keymap" "$key_info[Home]" beginning-of-line
bindkey -M "$keymap" "$key_info[End]" end-of-line
Expand Down Expand Up @@ -295,6 +315,10 @@ if zstyle -t ':omz:module:editor' dot-expansion; then
bindkey -M isearch . self-insert 2> /dev/null
fi

#
# Layout
#

# Set the key layout.
zstyle -s ':omz:module:editor' keymap 'keymap'
if [[ "$keymap" == (emacs|) ]]; then
Expand Down
15 changes: 15 additions & 0 deletions modules/environment/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,45 @@
# Sorin Ionescu <[email protected]>
#

#
# Smart URLs
#

autoload -Uz url-quote-magic
zle -N self-insert url-quote-magic

#
# General
#

setopt BRACE_CCL # Allow brace character class list expansion.
setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'.
unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed.

#
# Jobs
#

setopt LONG_LIST_JOBS # List jobs in the long format by default.
setopt AUTO_RESUME # Attempt to resume existing job before creating a new process.
setopt NOTIFY # Report status of background jobs immediately.
unsetopt BG_NICE # Don't run all background jobs at a lower priority.
unsetopt HUP # Don't kill jobs on shell exit.
unsetopt CHECK_JOBS # Don't report on jobs when shell exit.

#
# Grep
#

if zstyle -t ':omz:environment:grep' color; then
export GREP_COLOR='37;45'
export GREP_OPTIONS='--color=auto'
fi

#
# Termcap
#

if zstyle -t ':omz:environment:termcap' color; then
export LESS_TERMCAP_mb=$'\E[01;31m' # Begins blinking.
export LESS_TERMCAP_md=$'\E[01;31m' # Begins bold.
Expand Down
8 changes: 8 additions & 0 deletions modules/history-substring-search/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

source "${0:h}/external/zsh-history-substring-search.zsh"

#
# Styles
#

if zstyle -t ':omz:module:history-substring-search' case-sensitive; then
unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS
fi
Expand All @@ -16,6 +20,10 @@ if ! zstyle -t ':omz:module:history-substring-search' color; then
unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_{FOUND,NOT_FOUND}
fi

#
# Key Bindings
#

bindkey -M emacs "$key_info[Control]P" history-substring-search-up
bindkey -M emacs "$key_info[Control]N" history-substring-search-down
bindkey -M vicmd "k" history-substring-search-up
Expand Down
10 changes: 10 additions & 0 deletions modules/history/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
# Sorin Ionescu <[email protected]>
#

#
# Variables
#

HISTFILE="$HOME/.zhistory" # The path to the history file.
HISTSIZE=10000 # The maximum number of events to save in the internal history.
SAVEHIST=10000 # The maximum number of events to save in the history file.

#
# Options
#

setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
Expand All @@ -23,7 +31,9 @@ setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
setopt HIST_BEEP # Beep when accessing non-existent history.

#
# Aliases
#

# Lists the ten most used commands.
alias history-stat="history . | awk '{print \$2}' | sort | uniq -c | sort -n -r | head"
Expand Down
5 changes: 5 additions & 0 deletions modules/macports/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ if [[ "$OSTYPE" != darwin* ]]; then
return 1
fi

#
# Paths
#

# Set the list of directories that info searches for manuals.
infopath=(
Expand All @@ -31,7 +33,10 @@ path=(
$path
)

#
# Aliases
#

alias portc='sudo port clean --all installed'
alias porti='sudo port install'
alias ports='port search'
Expand Down
8 changes: 8 additions & 0 deletions modules/osx/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ if [[ "$OSTYPE" != darwin* ]]; then
return 1
fi

#
# Aliases
#

# Change directory to the current Finder directory.
alias cdf='cd "$(pfd)"'

# Push directory to the current Finder directory.
alias pushdf='pushd "$(pfd)"'

#
# Functions
#

# Open files in Quick Look.
function ql {
(( $# > 0 )) && qlmanage -p "$@" &> /dev/null
Expand Down
6 changes: 6 additions & 0 deletions modules/pacman/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ if (( ! $+commands[pacman] )); then
return 1
fi

#
# Frontend
#

# Get the Pacman frontend.
zstyle -s ':omz:module:pacman' frontend '_pacman_frontend'

Expand All @@ -25,7 +29,9 @@ if (( $+commands[$_pacman_frontend] )); then
fi
fi

#
# Aliases
#

# Installs packages from repositories.
alias paci='sudo pacman --sync'
Expand Down
4 changes: 4 additions & 0 deletions modules/pacman/yaourt.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
# Sorin Ionescu <[email protected]>
#

#
# Aliases
#

# Disable color.
if ! zstyle -t ':omz:module:pacman:yaourt' color; then
alias pacman='pacman --nocolor'
Expand Down
6 changes: 6 additions & 0 deletions modules/perl/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ if (( ! $+commands[perl] )); then
return 1
fi

#
# Local Module Installation
#

if [[ "$OSTYPE" == darwin* ]]; then
# Perl is slow; cache its output.
cache_file="${0:h}/cache.zsh"
Expand All @@ -35,7 +39,9 @@ if [[ "$OSTYPE" == darwin* ]]; then
unset env_var
fi

#
# Aliases
#

# General
alias pd='perldoc'
Expand Down
6 changes: 6 additions & 0 deletions modules/rails/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ if (( ! $+commands[rails] )); then
return 1
fi

#
# Aliases (Compatible with Rails 2)
#

alias rc='_rails-command console'
alias rdc='_rails-command dbconsole'
alias rdm='rake db:migrate'
Expand All @@ -27,7 +30,10 @@ alias rs='_rails-command server'
alias rsd='_rails-command server --debugger'
alias rx='_rails-command destroy'

#
# Functions
#

function _rails-command {
if [[ -e "script/server" ]]; then
ruby script/"$@"
Expand Down
3 changes: 3 additions & 0 deletions modules/rsync/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ if (( ! $+commands[rsync] )); then
return 1
fi

#
# Aliases
#

_rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system'

# Mac OS X and HFS+ Enhancements
Expand Down
2 changes: 2 additions & 0 deletions modules/ruby/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ else
fi
fi

#
# Aliases
#

# Bundler
if (( $+commands[bundle] )); then
Expand Down
7 changes: 7 additions & 0 deletions modules/screen/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ if (( ! $+commands[screen] )); then
return 1
fi

#
# Auto Start
#

if [[ -z "$STY" ]] && zstyle -t ':omz:module:screen' auto-start; then
session="$(
screen -list 2> /dev/null \
Expand All @@ -25,7 +28,11 @@ if [[ -z "$STY" ]] && zstyle -t ':omz:module:screen' auto-start; then
fi
fi

#
# Aliases
#

alias sl="screen -list"
alias sn="screen -U -S"
alias sr="screen -a -A -U -D -R"

Loading

0 comments on commit e16ed29

Please sign in to comment.