settings

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 731a655783f93cf61b4ca8c83d3fc36812eeeebc
parent a9d1bd12e3f09546a432b4e58a12e6f3ee686ca8
Author: Paul Longtine <paul@nanner.co>
Date:   Mon Feb 16 22:28:57 2015

I now zsh.

Diffstat:
 bash/.bash_aliases |  26 +----------
 bash/.bashrc       | 143 +------------------------------------------------------
 bash/.inputrc      |   1 +-
 zsh/.zsh_aliases   |  26 ++++++++++-
 zsh/.zshrc         |  36 ++++++++++++++-
 5 files changed, 62 insertions(+), 170 deletions(-)

diff --git a/bash/.bash_aliases b/bash/.bash_aliases @@ -1,26 +0,0 @@ -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls -CF --color=auto' - alias dir='dir --color=auto' - alias vdir='vdir --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - -# Add an "alert" alias for long running commands. Use like so: -# sleep 10; alert -alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' - -# Make emacs more less shitty -alias e='emacs -nw' - -#heuh, smacs -alias smacs='sudo emacs -nw' diff --git a/bash/.bashrc b/bash/.bashrc @@ -1,143 +0,0 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples - -# If not running interactively, don't do anything -[ -z "$PS1" ] && return - -# don't put duplicate lines in the history. See bash(1) for more options -# ... or force ignoredups and ignorespace -HISTCONTROL=ignoredups:ignorespace - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -export TERM='screen' - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if [ -f /etc/bash_completion ] && ! shopt -oq posix; then - . /etc/bash_completion -fi - -# interface - -# ANSI CODES - SEPARATE MULTIPLE VALUES WITH ; -# -# 0 reset 4 underline -# 1 bold 7 inverse -# -# FG BG COLOR FG BG COLOR -# 30 40 black 34 44 blue -# 31 41 red 35 45 magenta -# 32 42 green 36 46 cyan -# 33 43 yellow 37 47 white - -if [[ ! "${prompt_colors[@]}" ]]; then - prompt_colors=( - "0;37" # information color - "0;32" # user color - "0;31" # error color - "0;34" # git color - "0;33" # git bracket color - "0;32" # git + color - "0;31" # git ! color - "0;37" # git ? color - "0;33" # $ color - ) - - if [[ "$SSH_TTY" ]]; then - # connected via ssh - prompt_colors[1]="1;32" - elif [[ "$USER" == "root" ]]; then - # logged in as root - prompt_colors[1]="1;31" - fi -fi - -# Inside a prompt function, run this alias to setup local $c0-$c9 color vars. -alias prompt_getcolors='prompt_colors[9]=; local i; for i in ${!prompt_colors[@]}; do local c$i="\[\e[0;${prompt_colors[$i]}m\]"; done' - -# Git status. -function prompt_git() { - prompt_getcolors - local status output flags - status="$(git status 2>/dev/null)" - [[ $? != 0 ]] && return; - output="$(echo "$status" | awk '/# Initial commit/ {print "(init)"}')" - [[ "$output" ]] || output="$(echo "$status" | awk '/# On branch/ {print $4}')" - [[ "$output" ]] || output="$(git branch | perl -ne '/^\* (.*)/ && print $1')" - flags="$( - echo "$status" | awk 'BEGIN {r=""} \ - /Changes to be committed:/ {r=r "\\[\\e[0;1;32m\\]+"}\ - /Changes not staged for commit:/ {r=r "\\[\\e[0;1;31m\\]!"}\ - /Untracked files:/ {r=r "\\[\\e[0;1;37m\\]?"}\ - END {print r}' - )" - if [[ "$flags" ]]; then - output="$output$c4:$c3$flags" - fi - echo "$c1-$c3$output$c1$c9" -} - -function prompt_command() { - local exit_code=$? - local pad=`printf "%03d" $exit_code` - # If the first command in the stack is prompt_command, no command was run. - # Set exit_code to 0 and reset the stack. - [[ "${prompt_stack[0]}" == "prompt_command" ]] && exit_code=0 - prompt_stack=() - - # Manually load z here, after $? is checked, to keep $? from being clobbered. - [[ "$(type -t _z)" ]] && _z --add "$(pwd -P 2>/dev/null)" 2>/dev/null - - # While the simple_prompt environment var is set, disable the awesome prompt. - [[ "$simple_prompt" ]] && PS1='\n$ ' && return - prompt_getcolors - - PS1="\n$c0" - - # name: 000 user pwd - PS1="$PS1$pad $c1\u $c0\w$c1$c9" - - # git: name-branch:flags - PS1="$PS1$(prompt_git)" - - # end: git $/# - if [[ "$USER" == "root" ]]; then - PS1="$PS1$c8 #\[\033[0;37m\] " - else - PS1="$PS1$c8 \$\[\033[0;37m\] " - fi - - # Update the title with location - echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007" -} - -PROMPT_COMMAND='prompt_command' diff --git a/bash/.inputrc b/bash/.inputrc @@ -1 +0,0 @@ -set colored-stats on diff --git a/zsh/.zsh_aliases b/zsh/.zsh_aliases @@ -0,0 +1,26 @@ +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls -CF --color=auto' + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# Make emacs more less shitty +alias e='emacs -nw' + +#heuh, smacs +alias smacs='sudo emacs -nw' diff --git a/zsh/.zshrc b/zsh/.zshrc @@ -0,0 +1,36 @@ +# Set up the prompt + +PS1=$'%{\e[1;37m%}λ %{\e[0m%}' + +setopt histignorealldups sharehistory + +# Use emacs keybindings even if our EDITOR is set to vi +bindkey -e + +# Keep 1000 lines of history within the shell and save it to ~/.zsh_history: +HISTSIZE=1000 +SAVEHIST=1000 +HISTFILE=~/.zsh_history + +# Use modern completion system +autoload -Uz compinit +compinit + +zstyle ':completion:*' auto-description 'specify: %d' +zstyle ':completion:*' completer _expand _complete _correct _approximate +zstyle ':completion:*' format 'Completing %d' +zstyle ':completion:*' group-name '' +zstyle ':completion:*' menu select=2 +eval "$(dircolors -b)" +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*' list-colors '' +zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s +zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' +zstyle ':completion:*' menu select=long +zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s +zstyle ':completion:*' use-compctl false +zstyle ':completion:*' verbose true +zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' +zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' + +source ~/.zsh_aliases