Skip to content

Commit

Permalink
settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilalh committed Jun 16, 2013
1 parent ae9e810 commit 18073b0
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[user]
name = Bilal Syed Hussain
email = [email protected]
bemail = [email protected]
semail = [email protected]
email = [email protected]
[color]
ui = auto
[core]
Expand Down
4 changes: 4 additions & 0 deletions .inputrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ set output-meta on
set convert-meta off

set match-hidden-files off

"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
73 changes: 60 additions & 13 deletions .slate
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,74 @@ config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
config windowHintsShowIcons true


# Cmd+G brings up grid like Divvy (for each monitor)
bind g:cmd grid padding:5 0:8,8 1:8,5



# Abstract positions
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY

alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY

alias tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2
alias bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2

alias topleft corner top-left resize:screenSizeX/2;screenSizeY/2
alias topright corner top-right resize:screenSizeX/2;screenSizeY/2
alias bottomleft corner bottom-left resize:screenSizeX/2;screenSizeY/2
alias bottomright corner bottom-right resize:screenSizeX/2;screenSizeY/2

# Numpad location Bindings

bind 1:ctrl;alt;cmd ${lefthalf}
bind 2:ctrl;alt;cmd ${righthalf}
alias rightLot move screenOriginX+(screenSizeX/9*4);screenOriginY (screenSizeX/9*5);screenSizeY
alias rightMost move screenOriginX+(screenSizeX/9*3)-50;screenOriginY (screenSizeX/9*6)+50;screenSizeY
alias leftLess move screenOriginX;screenOriginY (screenSizeX/9*4);screenSizeY

# The hyper key
alias hyper ctrl;alt;cmd;shift

# Hyper+G brings up grid (for each monitor)
bind g:${hyper} grid padding:5 0:8,8 1:8,5

# To Resize windows
bind 1:${hyper} ${lefthalf}
bind 1:${hyper} ${lefthalf}
bind 2:${hyper} ${righthalf}

bind 3:${hyper} ${topleft}
bind 4:${hyper} ${topright}

bind 5:${hyper} ${bottomleft}
bind 6:${hyper} ${bottomright}

bind 7:${hyper} ${tophalf}
bind 8:${hyper} ${bottomhalf}

bind q:${hyper} ${leftLess}
bind w:${hyper} ${rightLot}
bind e:${hyper} ${rightMost}
bind f:${hyper} ${full}


# Focus Bindings
bind right:${hyper} focus right
bind left:${hyper} focus left
bind up:${hyper} focus up
bind down:${hyper} focus down

bind l:${hyper} focus right
bind h:${hyper} focus left
bind k:${hyper} focus up
bind j:${hyper} focus down

bind b:${hyper} focus behind

# Other bindings

bind ;:${hyper} relaunch
bind u:${hyper} undo

# Screen bindings
bind n:${hyper} throw left
bind m:${hyper} throw right


bind 3:ctrl;alt;cmd ${topleft}
bind 4:ctrl;alt;cmd ${topright}
bind i:${hyper} hint hint

bind 5:ctrl;alt;cmd ${bottomleft}
bind 6:ctrl;alt;cmd ${bottomright}
81 changes: 70 additions & 11 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@ export PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
#export ZSH_THEME=avery


export ZSH_THEME="powerline"
export POWERLINE_RIGHT_A="exit-code"
export POWERLINE_HIDE_USER_NAME="true"
export POWERLINE_HIDE_HOST_NAME="true"
export POWERLINE_DISABLE_RPROMPT="true"
export POWERLINE_RIGHT_B=""
export POWERLINE_RIGHT_A=""
#export ZSH_THEME="powerline"
#export POWERLINE_RIGHT_A="exit-code"
#export POWERLINE_HIDE_USER_NAME="true"
#export POWERLINE_HIDE_HOST_NAME="true"
#export POWERLINE_DISABLE_RPROMPT="true"
#export POWERLINE_RIGHT_B=""
#export POWERLINE_RIGHT_A=""


export DEFAULT_USER=Bilalh

plugins=(funcs todo)
plugins+=(osx ruby autojump encode64 gem git-extras pip battery brew pygmentize python zsh-syntax-highlighting history-substring-search )
plugins+=(osx ruby autojump encode64 gem git-extras
pip battery brew pygmentize python
zsh-syntax-highlighting history-substring-search )

DISABLE_CORRECTION=true
source $ZSH/oh-my-zsh.sh

zstyle '*' single-ignored complete
#setopt menu_complete

export PROMPT='[%28<...<%4(~:...:)%3~/] %# '

# History
HISTFILE=$HOME/.zsh_history
HISTSIZE=40000
Expand All @@ -38,9 +45,10 @@ setopt HIST_IGNORE_SPACE # Don't save command starting with a space
unsetopt cdablevars

export EDITOR='vim' # default editor
export LESS='-R'
export LESS='-R' # Less colour
export FIGNORE=$FIGNORE:.o:.out:.pyc:.pdfsync:.log:.bbl:.aux:.blg:.out:.toc:
export CLICOLOR=1

export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -k 2,2 -k 1,1n'

#
# light colours
Expand Down Expand Up @@ -89,12 +97,14 @@ PATH=$HOME/.rvm/bin:$PATH # Add RVM to PATH for scripting
alias tl='todo list'

function t(){
todo ${@:-list}
todo ${@:-pv}
}

alias f='dirs -v'
#Autoload
autoload -U zcalc
autoload -U zmv
autoload -U zrecompile
[ -f ~/.local/bin/bashmarks.sh ] && source ~/.local/bin/bashmarks.sh

#Bindings
Expand All @@ -109,10 +119,47 @@ bindkey 'C' forward-word
bindkey 'OD' beginning-of-line
bindkey 'OC' end-of-line

bindkey '' backward-kill-line

# for trying #
bindkey -s '^[3' \#
bindkey -s '£' \#

# Press C-x a to ++ the the last number in the command (e.g for playing videos)
_increase_number() {
local -a match mbegin mend
[[ $LBUFFER =~ '([0-9]+)[^0-9]*$' ]] &&
LBUFFER[mbegin,mend]=$(printf %0${#match[1]}d $((10#$match+${NUMERIC:-1})))
}
zle -N increase-number _increase_number
bindkey '^Xa' increase-number
bindkey -s '^Xx' '^[-^Xa'

#recursive C-R -- http://chneukirchen.org/blog/archive/2013/03/10-fresh-zsh-tricks-you-may-not-know.html
autoload -Uz narrow-to-region
function _history-incremental-preserving-pattern-search-backward
{
local state
MARK=CURSOR # magick, else multiple ^R don't work
narrow-to-region -p "$LBUFFER${BUFFER:+>>}" -P "${BUFFER:+<<}$RBUFFER" -S state
zle end-of-history
zle history-incremental-pattern-search-backward
narrow-to-region -R state
}
zle -N _history-incremental-preserving-pattern-search-backward
bindkey "^R" _history-incremental-preserving-pattern-search-backward
bindkey -M isearch "^R" history-incremental-pattern-search-backward
bindkey "^S" history-incremental-pattern-search-forward

# find zsh info
function zman() {
PAGER="less -g -s '+/^ "$1"'" man zshall
}

# Force file name completion on C-x TAB, Shift-TAB.
zle -C complete-files complete-word _generic
zstyle ':completion:complete-files:*' completer _files
bindkey "^X^I" complete-files

# man pages IN COLOUR!
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
Expand All @@ -125,3 +172,15 @@ export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline]


ZSH_HIGHLIGHT_STYLES[path]='none'


function avgBitRate(){
parallel 'afinfo {} | grep "bit rate" ' ::: **/*.(mp3|m4a) |awk '\
{sum+=$3; if(min==""){min=max=$3}; if($3>max) {max=$3} else if($3< min) {min=$3}; \
if($3>325000){lossless++} else if($3>256000){n320++} else if($3>192000){n256++} else if($3 >160000){n192++} else if($3 > 128000){n160++} else{nless++ } }\
END {printf " Total: %d\n Bitrates: \033[0m\033[32mAverage\033[0m %.0f kbps \033[0m\033[32mMax\033[0m %0.f kbps \033[0m\033[32mMin\033[0m %0.f kbps\
Types: 320+: %d 320: %d 256: %d 192: %d 160: %d 160-: %d \n",\
NR, sum/NR/1000,max/1000, min/1000,\
lossless, n320, n256, n192, n160, nless\
}'
}

0 comments on commit 18073b0

Please sign in to comment.