Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: StanAngeloff/dotfiles
base: 89ef929b52
...
head fork: StanAngeloff/dotfiles
compare: 2cb2d55a90
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 45 additions and 55 deletions.
  1. +16 −38 .aliases
  2. +1 −0  .localrc_stan-inspiron_gnu_linux
  3. +28 −17 .zshrc
View
54 .aliases
@@ -1,50 +1,28 @@
#!/bin/zsh
-alias :q='exit'
+# Vim-like exit operation.
+alias Q='exit'
+# Quick commands access.
alias g='git'
-alias '?'='screen -ls'
-alias '!'='screen -dR'
+alias md='mkdir -p'
+alias rd=rmdir
-alias ll='ls -hal --color=tty'
alias pu='pushd'
alias po='popd'
-alias .='pwd'
+
+# `screen` operations for starting and attaching to a session.
+alias '!'='screen -dR'
+alias '?'='screen -ls'
+
+# Directory listing.
+alias ll='ls -hal --color=tty'
+
+# Basic directory operations.
alias ..='cd ..'
alias ...='cd ../..'
alias -- -='cd -'
-alias cd..='cd ..'
-alias cd...='cd ../..'
-alias cd....='cd ../../..'
-alias cd.....='cd ../../../..'
-alias cd/='cd /'
-
-alias 1='cd -'
-alias 2='cd +2'
-alias 3='cd +3'
-alias 4='cd +4'
-alias 5='cd +5'
-alias 6='cd +6'
-alias 7='cd +7'
-alias 8='cd +8'
-alias 9='cd +9'
-
-alias md='mkdir -p'
-alias rd=rmdir
-alias d='dirs -v'
-
-cd () {
- if [[ "x$*" == "x..." ]]; then
- cd ../..
- elif [[ "x$*" == "x...." ]]; then
- cd ../../..
- elif [[ "x$*" == "x....." ]]; then
- cd ../../..
- elif [[ "x$*" == "x......" ]]; then
- cd ../../../..
- else
- builtin cd "$@"
- fi
-}
+# Super-User operation.
+alias _='sudo'
View
1  .localrc_stan-inspiron_gnu_linux
@@ -2,3 +2,4 @@
export GEM_HOME=~/.gem
export PATH="$HOME/.gem/bin:$HOME/bin/android-sdk-linux_x86/tools:$PATH"
+export NODE_PATH="/usr/local/lib/node_modules:$NODE_PATH"
View
45 .zshrc
@@ -33,8 +33,12 @@ export ACK_OPTIONS=--type-set=php=.php,.php3,.php4,.php5,.module,.inc,.install #
# Enable colour terminal and prompt.
autoload colors; colors;
+function _prompt_type() {
+ if [ $UID -eq 0 ]; then echo '#'; else echo '$'; fi
+}
+
export LSCOLORS="Gxfxcxdxbxegedabagacad"
-export PROMPT="%{$fg[green]%}(%m)%{$reset_color%} %{$fg[yellow]%}[%1~]%{$reset_color%} %# " # format is (machine-name) [cwd] %
+export PROMPT="%{%F{250}%}%n@%{%f%}%{%F{green}%}%m:%{%f%}%{%F{yellow}%}%(!.%1~.%~)%{%f%}%{%F{250}%}$(_prompt_type)%{%f%} " # format is 'login-name@machine-name:cwd %'
# Use a separate file to configure command aliases.
[[ -s "$HOME/.aliases" ]] && source "$HOME/.aliases"
@@ -66,14 +70,19 @@ autoload -U compinit
compinit -i
zmodload -i zsh/complist
+zstyle ':completion:*' list-colors ''
+zstyle ':completion:*' use-cache on
+zstyle ':completion:*' cache-path $ZSH/cache
+
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
-zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
+zstyle ':completion:*:warnings' format '%Bno matches for:%b %d'
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
-zstyle ':completion:*' list-colors ''
-zstyle ':completion:*' use-cache on
-zstyle ':completion:*' cache-path $ZSH/cache
+
+# Disable named-directories autocompletion.
+zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
+cdpath=(.)
# Enable advanced prompt and themes.
autoload -U promptinit
@@ -166,31 +175,33 @@ bindkey ' ' magic-space
bindkey "^[m" copy-prev-shell-word
# Fancy terminal title
-function title {
+function _terminal_title {
if [[ "$TERM" == screen* ]] || [[ "$ALTTERM" == screen* ]]; then
- print -nR $'\ek'$*$'\e\\'
+ print -Pn "\ek$1:q\e\\" # Set `screen` hardstatus.
elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]]; then
- print -nR $'\033]0;'$*$'\a'
+ print -Pn "\e]2;$2:q\a" # Set window name.
+ print -Pn "\e]1;$1:q\a" # Set icon (=tab) name (will override window name on broken terminal).
fi
}
-function chpwd {
- echo "$( pwd -P )" > "$ZSH/.last_directory"
-}
-
-function precmd {
- title zsh "$PWD"
+function _before_directory_change {
+ _terminal_title "%15<..<%~%<<" "%n@%m: %~"
if declare -f _z > /dev/null; then
_z --add "$( pwd -P )"
fi
}
-function preexec {
+function _before_command_execute {
emulate -L zsh
- local -a cmd; cmd=(${(z)1})
- title $cmd[1]:t "$cmd[2,-1]"
+ setopt extended_glob
+ local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} # Command name only, or if this is `sudo` or `ssh`, the next command.
+ _terminal_title "$CMD" "%100>...>$2%<<"
}
+autoload -U add-zsh-hook
+add-zsh-hook precmd _before_directory_change
+add-zsh-hook preexec _before_command_execute
+
# set PATH so it includes user's private bin if it exists.
[ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH"

No commit comments for this range

Something went wrong with that request. Please try again.