From f696095aefc68d0c0196d8c723705ff28bff6648 Mon Sep 17 00:00:00 2001 From: Bilal Syed Hussain Date: Sun, 8 Mar 2015 02:52:11 +0000 Subject: [PATCH] settings --- .ackrc | 62 +++++++----- .bash_profile | 15 +-- .bashrc | 2 + .gitconfig | 122 +++++++++++++---------- .hgrc | 10 +- .screenrc | 9 +- .slate | 3 +- .vimrc.local | 265 ++++++++++++++++++++++++++++++++++++++++++++++++++ .zshrc | 75 +++++++++----- paths.sh | 41 ++++++-- 10 files changed, 476 insertions(+), 128 deletions(-) create mode 100644 .vimrc.local diff --git a/.ackrc b/.ackrc index 10610ce..625e350 100644 --- a/.ackrc +++ b/.ackrc @@ -1,31 +1,39 @@ -#--type-set=music=.mp3,.m4a,.flac,.ac3,.ogg,.aiff,.m4b,.aac,.wav,.wmv,.ape,.mka -#--type-set=manga=.cbz,.cbr,.cba,cb7 ---type-set=juck=.xcodeproj ---type-set=txt=.txt ---type-set=eprime=.eprime, ---type-set=essence=.essence ---type-set=e=.eprime,.essence,.solution ---type-set=gen-ess=.eprime,.logs,.minion,.log,.eprime.solution ---type-set=bak=.bak ---type-set=markdown=.md,.markdown,mdown ---type-add=java=.pde ---type-add=ruby=.haml,.rake,.rsel,.builder +--color +--follow +--group +--ignore-dir=.cabal +--ignore-dir=.cabal-sandbox +--ignore-dir=.git +--ignore-dir=.hg +--ignore-dir=.svn +--ignore-dir=__ +--ignore-dir=__bugs +--ignore-dir=_compiled +--ignore-dir=_site +--ignore-dir=bin +--ignore-dir=coverage +--ignore-dir=dist +--ignore-dir=docs +--ignore-dir=log +--ignore-dir=tmp +--ignore-dir=vendor +--sort-files +--type-add=css=.sass,.scss,.less --type-add=html=.html.erb,.html.haml +--type-add=java=.pde --type-add=js=.js.erb ---type-add=css=.sass,.scss,.less ---type-set=jasmin=.j +--type-add=ruby=.haml,.rake,.rsel,.builder +--type-set=bak=.bak --type-set=cucumber=.feature ---type-set=tex-temp=.pdfsync,.log,.bbl,.aux,.blg,.synctex,.fdb,.out,.toc,.fdb_latexmk +--type-set=e=.eprime,.essence,.solution +--type-set=eprime=.eprime, +--type-set=essence=.essence +--type-set=gen_ess=.eprime,.logs,.minion,.log,.eprime.solution +--type-set=ignoredd=.tags,.tmtags +--type-set=jasmin=.j +--type-set=markdown=.md,.markdown,mdown +--type-set=solution=.solution --type-set=tex=.tex,.bib ---type-set=epub=.opf,.xhtml,.ncx,.css,.xml ---ignore-dir=vendor ---ignore-dir=log ---ignore-dir=tmp ---ignore-dir=docs ---ignore-dir=coverage ---ignore-dir=_site ---ignore-dir=_compiled ---sort-files ---color ---follow ---group +--type-set=tex_temp=.pdfsync,.log,.bbl,.aux,.blg,.synctex,.fdb,.out,.toc,.fdb_latexmk +--type-set=txt=.txt +--ignore-file=is:codex.tags diff --git a/.bash_profile b/.bash_profile index a8e104a..d82f8bd 100644 --- a/.bash_profile +++ b/.bash_profile @@ -15,19 +15,19 @@ export LANG=en_GB.UTF-8 export HISTFILESIZE=15000 # the bash history should save 15000 commands export HISTCONTROL=erasedups # remove duplicate from history -# don't store history entries that match this pattern +# don't store history entries that match this pattern declare -x HISTIGNORE='cs:jr*:gitx:hista:aes*:srm*: *' alias hist='history | less ' -#allow colour in less +#allow colour in less export LESS='-R' -### Bash options -shopt -s histappend # all sessions are saved +### Bash options +shopt -s histappend # all sessions are saved shopt -s cdspell # fix minor error in cd paths shopt -s histreedit # allows re-edit on C-R -export EDITOR='vim' # default editor +export EDITOR='vim' # default editor # Ignores files in tab completion export FIGNORE=$FIGNORE:.o:.out:.pyc:.pdfsync:.log:.bbl:.aux:.blg:.out:.toc: @@ -55,13 +55,14 @@ export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline] # bashmarks export BASHMARKS_k=true export BASHMARKS_ITERM_SESSION="B ZSH" -[ -f ~/Projects/_forks/bashmarks/bashmarks.sh ] && source ~/Projects/_forks/bashmarks/bashmarks.sh +[ -f ~/Projects/_forks/bashmarks/bashmarks.sh ] && source ~/Projects/_forks/bashmarks/bashmarks.sh if [ -f ~/CS/instancegen/scripts/misc/convenience.sh ]; then - source ~/CS/instancegen/scripts/misc/convenience.sh + source ~/CS/instancegen/scripts/misc/convenience.sh fi source ~/.settings/paths.sh ### aliases and other functions [ -f ~/.bashrc ] && source ~/.bashrc + diff --git a/.bashrc b/.bashrc index 880edf8..4a3f65b 100644 --- a/.bashrc +++ b/.bashrc @@ -2,3 +2,5 @@ [ -d ~/.bash/ ] && for i in ~/.bash/*.sh; do source $i; done [ -d ~/.pbash/ ] && for i in ~/.pbash/*.sh; do source $i; done + + diff --git a/.gitconfig b/.gitconfig index 5e8ace7..34b815f 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,36 +1,41 @@ [user] name = Bilal Syed Hussain - semail = bh246@st-andrews.ac.uk - email = bilalshussain@gmail.com + semail = bh246@st-andrews.ac.uk + bemail = bilalshussain@gmail.com + email = bh246@st-andrews.ac.uk + [color] - ui = auto + ui = auto + [core] excludesfile = /Users/bilalh/.gitignore + [alias] - b = branch - c = commit - d = describe - p = push - s = status - st = status - w = whatchanged - ca = commit -am - cam = commit --amend -am - ch = checkout - pom = push origin master - ldiff = difftool -t latex + b = branch + c = commit + d = describe + p = push + st = status + ca = commit -am + cam = commit --amend -am + ch = checkout + pom = push origin master + ldiff = difftool -t latex rmdel = !git ls-files -dz | xargs -0 git rm - # Logs - lg = log --graph --pretty=format:'%Cred%an%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --date=relative - ld = log --graph --pretty=format:'%Cred%an%Creset -%C(yellow)%d%Creset %s %Cgreen(%ai)%Creset' - lo = log --graph --pretty=format:'%Cred%h%Creset - %Cgreen(%cr) %C(bold blue)<%an>%Creset %s %C(yellow)%d%Creset ' --abbrev-commit --date=relative - - # One line per commit - loa = log --graph --decorate --pretty=oneline --abbrev-commit --all - - # commits not pushed to $1 + snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}" + snapshots = !git stash list --grep snapshot + + # Logs + lg = log --graph --pretty=format:'%Cred%an%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --date=relative + ld = log --graph --pretty=format:'%Cred%an%Creset -%C(yellow)%d%Creset %s %Cgreen(%ai)%Creset' + lo = log --graph --pretty=format:'%Cred%h%Creset - %Cgreen(%cr) %C(bold blue)<%an>%Creset %s %C(yellow)%d%Creset ' --abbrev-commit --date=relative + + # One line per commit + loa = log --graph --decorate --pretty=oneline --abbrev-commit --all + + # commits not pushed to $1 unpushed = cherry -v # what tag contains the sha @@ -38,11 +43,11 @@ # what branch contains the sha contains = branch --contains - - # lost commits - lost = !"git fsck | awk '/dangling commit/ {print $3}' | git show --format='SHA1: %C(yellow)%h%Creset %f' --stdin | awk '/SHA1/ {sub(\"SHA1: \", \"\"); print}'" - - # show a list of branches sorted by time of last commit + + # lost commits + lost = !"git fsck | awk '/dangling commit/ {print $3}' | git show --format='SHA1: %C(yellow)%h%Creset %f' --stdin | awk '/SHA1/ {sub(\"SHA1: \", \"\"); print}'" + + # show a list of branches sorted by time of last commit brage = "!f() { git for-each-ref --sort=committerdate refs/heads $1 --format=\"%(refname:short)\" ; }; g() { for C in $(f $1) ; do git show -s --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset $C\" \"$C\" -- ; done; }; g " # show remote branches as well @@ -52,39 +57,54 @@ tagage = "!sh -c 'git for-each-ref --sort=taggerdate refs/tags --format=\"%(refname:short)\"'" # show a list of every branch and show there latests commit, sorted by last commit - brlog = "!sh -c 'for C in $(git for-each-ref --sort=committerdate refs/heads --format=\"%(refname:short)\") ; do git show -s --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset $C\" \"$C\" -- ; git show -s $C ; echo; done'" - # url of origin, about 99% of what I use git config --list for + brlog = "!sh -c 'for C in $(git for-each-ref --sort=committerdate refs/heads --format=\"%(refname:short)\") ; do git show -s --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset $C\" \"$C\" -- ; git show -s $C ; echo; done'" + # url of origin, about 99% of what I use git config --list for cloneurl = config --get remote.origin.url - - shorten = "!sh -c 'curl -i http://git.io -F url=$1' -" + + shorten = "!sh -c 'curl -i http://git.io -F url=$1' -" + create-gitignore = "!gi() { curl http://www.gitignore.io/api/$@ ;}; gi" [core] - pager = less -FRSX - quotepath = false + pager = less -FRSX + quotepath = false + editor = /Users/bilalh/bin/vim + [apply] - whitespace = fix + whitespace = fix + [gist] - private = yes - browse = yes - + private = yes + browse = yes + +[diff] + tool = icdiff + +[difftool] + prompt = no + [difftool.latex] - cmd = latexdiff \"$LOCAL\" \"$REMOTE\" + cmd = latexdiff \"$LOCAL\" \"$REMOTE\" + +[difftool.icdiff] + cmd = icdiff --line-numbers \"$LOCAL\" \"$REMOTE\" + [difftool "Kaleidoscope"] - cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" -[difftool] - prompt = false -[diff] - tool = Kaleidoscope + cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" + [difftool "sourcetree"] - cmd = opendiff \"$LOCAL\" \"$REMOTE\" + cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge --nosplash \"$LOCAL\" \"$REMOTE\" path = + [mergetool "sourcetree"] - cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" + cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" trustExitCode = true + [mergetool "Kaleidoscope"] - cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot - trustExitCode = true + cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot + trustExitCode = true + [credential] - helper = osxkeychain + helper = osxkeychain + [push] - default = simple + default = simple diff --git a/.hgrc b/.hgrc index ddca81c..6b6e34a 100644 --- a/.hgrc +++ b/.hgrc @@ -2,8 +2,10 @@ username=Bilal Syed Hussain ignore=/Users/bilalh/.hgignore_global + [web] -cacerts =/Users/bilalh/CS/its.crt +cacerts =/Users/bilalh/CS/its.crt + [merge-tools] sourcetreemerge.gui=False sourcetreebulkmerge.gui=False @@ -15,10 +17,16 @@ sourcetreemerge.premerge=True sourcetreemerge.executable=/Applications/SourceTree.app/Contents/Resources/opendiff-w.sh sourcetreebulkmerge.premerge=False sourcetreebulkmerge.binary=True + [alias] c = commit [extensions] +color = hgext.bookmarks = hgext.extdiff = hgext.purge= + +[extdiff] +cmd.icdiff = /Users/bilalh/bin/icdiff-hg-wrapper.sh + diff --git a/.screenrc b/.screenrc index fe782a6..f8b6f1c 100644 --- a/.screenrc +++ b/.screenrc @@ -5,7 +5,7 @@ # Turn off start message: startup_message off -# Set messages timeout to one second: +# Set messages timeout to one second: msgwait 1 hardstatus alwayslastline "%{=b}%{G} %{b}%w" # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # @@ -26,11 +26,8 @@ hardstatus alwayslastline "%{=b}%{G} %{b}%w" #bindkey -k F1 prev #bindkey -k k3 next -bindkey -k k13 prev -bindkey -k k14 next - # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -defscrollback 1000 +defscrollback 10000 # Make the output buffer large for (fast) xterms. termcapinfo xterm* OL=1000 -shell bash +shell zsh diff --git a/.slate b/.slate index 759b47e..e575b10 100644 --- a/.slate +++ b/.slate @@ -32,7 +32,6 @@ 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} @@ -64,6 +63,7 @@ bind h:${hyper} focus left bind k:${hyper} focus up bind j:${hyper} focus down + bind b:${hyper} focus behind # Other bindings @@ -78,4 +78,3 @@ bind m:${hyper} throw right #bind i:${hyper} hint afqrplzvm - diff --git a/.vimrc.local b/.vimrc.local new file mode 100644 index 0000000..3b304ee --- /dev/null +++ b/.vimrc.local @@ -0,0 +1,265 @@ +let g:jedi#completions_enabled = 0 + +set exrc " enable per-directory .vimrc files +set secure " disable unsafe commands in local .vimrc files + +set listchars=tab:‣\ ,trail:¸ " Use Cedilla ¸ as the trailing whitespace char +set shiftwidth=4 +set tabstop=4 + +set guifont=Monaco:h13 +set backupcopy=yes " for hdevtools +set cursorline +set noshowmode " Don't show mode + +let g:no_haskell_conceal=1 + +let g:session_autoload='no' +let g:session_autosave='yes' + +let g:hdevtools_options=' -g -isrc -g -isrc/exec -g -Wall ' + +let g:neocomplcache_enable_at_startup=1 +let g:neocomplcache_enable_smart_case=1 + +let g:jedi#popup_select_first = 0 + +" file settings +autocmd BufRead,BufNewFile *.cpp,*.c,*.h,*.java,*.sh,*.bash,*.tex set noic cin noexpandtab +autocmd BufRead,BufNewFile *.rb set noexpandtab tabstop=2 shiftwidth=2 +au BufRead,BufNewFile *.go set filetype=go + + +" let NERDTreeIgnore += ['\.tmproj$', '^tags$', '\.hi$', '\.o$'] +let g:ctrlp_custom_ignore={ + \ 'dir': '\v[\/]\.(git|hg|svn)$|old$|savilerow$|dist$', + \ 'file': '\v\.(exe|so|dll|hi)$' + \ } + + +" buffers to tabs +noremap ,bt :bufdo tab split + +" jump to tag in new tab +noremap ,ct T + +" Show syntax highlighting for current scope +map zh :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' + \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" + \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" + +" make p in Visual mode replace the selected text with the yank register +vnoremap p :let current_reg = @"gvdi=current_reg" + +" +" haskell bindings +noremap ,v :HdevtoolsType +noremap ,V :HdevtoolsClear +noremap ,y :HdevtoolsClear + +let g:hlint_args='--ignore=\"Unused\ LANGUAGE\ pragma\"' +let g:syntastic_haskell_checkers=['hdevtools'] +let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': [] } + + + +command Stree silent !stree +command NI :%s/; \?int(.\{-})\(]\)\@=//g + +command G execute ":silent ! open_terminal.sh \"%:p:h\"" +command Gh execute ":silent ! echo 'ghci -isrc %' | pbcopy" +command O execute ":silent ! open -R \"%:p\"" +command R execute ":silent ! reload_ghci.applescript" +command A execute ":silent ! echo '%:p' | pbcopy" +command D execute ":silent ! echo '%:p:h' | pbcopy" + + +if has("gui_running") + " for wombat256 colorscheme too make essence numbers look better + " Blue + " highlight PreProc term=underline ctermfg=5 guifg=DodgerBlue3 + " orange + " highlight PreProc term=underline ctermfg=4 guifg=DarkOrange + + nmap :tabprevious + nmap :tabnext + " not F11 and F12 Strangely + nmap gT + nmap gt + + nnoremap ¡ 1gt + nnoremap € 2gt + " nnoremap # 3gt + nnoremap ¢ 4gt + nnoremap ∞ 5gt + nnoremap § 6gt + nnoremap ¶ 7gt + nnoremap • 8gt + nnoremap ª 9gt + +else + inoremap 3 # + inoremap £ # + + noremap b b + noremap f e + + set mouse=a + + " not F11 and F12 Strangely + nmap 0;133 gT + nmap 0;134 gt + + nnoremap 1 1gt + nnoremap 2 2gt + " nnoremap 3 3gt + nnoremap 4 4gt + nnoremap 5 5gt + nnoremap 6 6gt + nnoremap 7 7gt + nnoremap 8 8gt + nnoremap 9 9gt + +endif + +function! Haskell_gf_import() +" Get the import declaration under the cursor +let l:module_name = matchstr(getline("."), '^import\s\+\(qualified\s\+\)\=\zs\(\w\|\.\)\+\ze') +if l:module_name ==# '' + echo "Not Found" + return +endif + +let l:module_path = substitute(l:module_name,"\\.", "/", "g") . ".hs" + +exe "find " . l:module_path +endfunction + +function! Haskell_gf_import_tab() + execute ":tab split" + call Haskell_gf_import() +endfunction + +augroup HaskellGF + au! + au FileType haskell nnoremap gf :call Haskell_gf_import() + au FileType haskell nnoremap gf :call Haskell_gf_import_tab() +augroup END + +augroup sourcinglocal + autocmd! + autocmd bufwritepost .vimrc.local source .vimrc.local +augroup END + +"sane sys paste +set pastetoggle= +function! WrapForTmux(s) + if !exists('$TMUX') + return a:s + endif + + let tmux_start = "\Ptmux;" + let tmux_end = "\\\" + + return tmux_start . substitute(a:s, "\", "\\", 'g') . tmux_end +endfunction + +let &t_SI .= WrapForTmux("\[?2004h") +let &t_EI .= WrapForTmux("\[?2004l") + +function! XTermPasteBegin() + set pastetoggle=[201~ + set paste + return "" +endfunction + +inoremap [200~ XTermPasteBegin() +"" + +" yank to sys board +vmap ,p "*y + +if exists(':Tabularize') + AddTabularPattern! colon /^[^:]*\zs:/ + AddTabularPattern! haskell_bindings /^[^=]*\zs=\ze[^[:punct:]]/ + AddTabularPattern! haskell_comments /--.*/l2 + AddTabularPattern! haskell_do_arrows / \(<-\|←\) /l0r0 + AddTabularPattern! haskell_imports /^[^(]*\zs(.*\|\.*/ + AddTabularPattern! haskell_pattern_arrows / \(->\|→\) /l0r0 + AddTabularPattern! haskell_types / \(::\|∷\) /l0r0 +endif + +let g:ctrlp_user_command = { + \ 'types': { + \ 1: ['.git', 'cd %s && git ls-files --cached --exclude-standard --others'], + \ 2: ['.hg', 'hg --cwd %s locate -I .'], + \ }, + \ 'fallback': 'find %s -type f', + \ } + +" Ignore some folders and files for CtrlP indexing +let g:ctrlp_custom_ignore = { + \ 'dir': '\.git$\|\.sass-cache$|\.hg$\|\.svn$\|\.yardoc\|public$|log\|tmp$|smac*', + \ 'file': '\.so$\|\.dat$|\.DS_Store$' + \ } + +" fix macvim moving left on opening nerdtree +set guioptions-=L +let g:nerdtree_tabs_open_on_gui_startup=1 +let g:NERDTreeWinSize=20 +noremap ,m :NERDTreeTabsToggle + + +if !exists('g:airline_symbols') +let g:airline_symbols = {} +endif + + + +" unicode symbols +let g:airline_left_sep = '»' +let g:airline_left_sep = '▶' +let g:airline_right_sep = '«' +let g:airline_right_sep = '◀' +let g:airline_symbols.linenr = '␊' +let g:airline_symbols.linenr = '␤' +let g:airline_symbols.linenr = '¶' +let g:airline_symbols.branch = '⎇' +let g:airline_symbols.paste = 'ρ' +let g:airline_symbols.paste = 'Þ' +let g:airline_symbols.paste = '∥' +let g:airline_symbols.whitespace = 'Ξ' + +" powerline symbols +let g:airline_left_sep = '' +let g:airline_left_alt_sep = '' +let g:airline_right_sep = '' +let g:airline_right_alt_sep = '' +let g:airline_symbols.branch = '' +let g:airline_symbols.readonly = '' +let g:airline_symbols.linenr = '' + + +let g:ackpreview = 1 + +function DeleteHiddenBuffers() + let tpbl=[] + call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))') + for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1') + silent execute 'bwipeout' buf + endfor +endfunction + +aug QFClose + au! + au WinEnter * if winnr('$') == 1 && getbufvar(winbufnr(winnr()), "&buftype") == "quickfix"|q|endif +aug END + +" set colorcolumn=94 +highlight ColorColumn ctermbg=lightgrey guibg=lightgrey + +autocmd Syntax c,cpp,vim,xml,html,xhtml,perl,python,haskell normal zR + +:autocmd BufReadPost * let PreFoldPosition = getpos('.') | silent! %foldopen! | call setpos('.', PreFoldPosition) + + diff --git a/.zshrc b/.zshrc index ddd76fb..4ab1b65 100644 --- a/.zshrc +++ b/.zshrc @@ -6,20 +6,23 @@ setopt interactivecomments plugins=(funcs todo) plugins+=( osx ruby autojump encode64 gem git-extras - pip battery brew pygmentize python vagrant + pip battery pygmentize python vagrant #auto-fu - history-substring-search + history-substring-search zsh-git-escape-magic anaconda forklift gnu-utils + percol ) -ANACONDA=~/.local/anaconda/ +ANACONDA=~/.local/miniconda3/ DISABLE_CORRECTION=true ZSH_THEME="pure" source $ZSH/oh-my-zsh.sh fpath+=~/.oh-my-zsh/fpath +autoload -U url-quote-magic +zle -N self-insert url-quote-magic autoload -Uz git-escape-magic git-escape-magic zstyle '*' single-ignored complete @@ -28,10 +31,13 @@ unsetopt menu_complete export BASHMARKS_NO_PWD=True #export PROMPT='[%28<...<%4(~:...:)%3~/] %# ' +bindkey "\e[1~" beginning-of-line +bindkey "\e[4~" end-of-line + # History HISTFILE=${HISTFILE:-$HOME/.zsh_history} -HISTSIZE=50000 -SAVEHIST=10000 +HISTSIZE=25500000 +SAVEHIST=25300000 setopt APPEND_HISTORY # append rather than overwrite history file. setopt EXTENDED_HISTORY # save timestamp and runtime information setopt HIST_EXPIRE_DUPS_FIRST # allow dups, but expire old ones when I hit HISTSIZE @@ -45,13 +51,13 @@ setopt HIST_SAVE_NO_DUPS # don't save duplicates setopt INC_APPEND_HISTORY # write after each command setopt SHARE_HISTORY # share history between sessions -#setopt null_glob # Allow null globs +#setopt null_glob # Allow null globs setopt nonullglob setopt RM_STAR_WAIT # first wait ten seconds when doing rm * unsetopt cdablevars -export EDITOR='vim' # default editor -export LESS='-R' # Less colour +export EDITOR='vim' # default editor +export LESS='-R' # Less colour export FIGNORE=$FIGNORE:.o:.out:.pyc:.pdfsync:.log:.bbl:.aux:.blg:.out:.toc: @@ -90,10 +96,12 @@ bashcompinit export BASHMARKS_k=true export BASHMARKS_ITERM_SESSION="B ZSH" -[ -f ~/Projects/_forks/bashmarks/bashmarks.sh ] && source ~/Projects/_forks/bashmarks/bashmarks.sh +[ -f ~/Projects/_forks/bashmarks/bashmarks.sh ] && source ~/Projects/_forks/bashmarks/bashmarks.sh #Bindings -insert_sudo () { zle beginning-of-line; zle -U "sudo " } +function insert_sudo () { + zle beginning-of-line; zle -U "sudo " +} zle -N insert-sudo insert_sudo bindkey '^[s' insert-sudo @@ -129,7 +137,7 @@ tcsh-backward-delete-word () { zle -N tcsh-backward-delete-word bindkey "^W" tcsh-backward-delete-word -# for trying # +# for trying # bindkey -s '^[3' \# bindkey -s '£' \# @@ -144,20 +152,20 @@ 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 +#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() { @@ -190,7 +198,7 @@ function avgBitRate(){ 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\ - }' + }' } #vim tags completion for vim -t @@ -204,7 +212,7 @@ compctl -x 'C[-1,-t]' -K _get_tags -- vim autoload -U compinit && compinit -u if [ -f ~/CS/instancegen/scripts/misc/convenience.sh ]; then - source ~/CS/instancegen/scripts/misc/convenience.sh + source ~/CS/instancegen/scripts/misc/convenience.sh fi hr(){printf '=%.0s' $(seq $COLUMNS)} @@ -221,3 +229,16 @@ osascript -e '#!/usr/bin/env osascript' \ -e 'end tell' } +setopt HIST_IGNORE_SPACE + +if [ -n "$INSIDE_EMACS" ]; then + chpwd() { print -P "\033AnSiTc %d" } + print -P "\033AnSiTu %n" + print -P "\033AnSiTc %d" +fi + +autoload -U +X compinit && compinit +autoload -U +X bashcompinit && bashcompinit + + +[ -f /Users/bilalh/CS/gen/hs/scripts/_gen.sh ] && source /Users/bilalh/CS/gen/hs/scripts/_gen.sh diff --git a/paths.sh b/paths.sh index 5fa4e68..f46e048 100755 --- a/paths.sh +++ b/paths.sh @@ -1,20 +1,47 @@ -# Path settings(bin before current $PATH to override default version) -PATH=$HOME/bin:$HOME/bin/haskell_stuff:$PATH -PATH=$PATH:$HOME/.cabal/bin -PATH=$PATH:/Users/bilalh/Projects/Shell-Tunes/extra +unset PATH +eval `/usr/libexec/path_helper -s` + +#PATH=$HOME/.tools/ghc/7.6.3/bin:$PATH +PATH=$HOME/.tools/ghc/7.8.3/bin:$PATH +PATH=$HOME/.cabal/bin:$PATH + +PATH=$HOME/bin:$PATH +# PATH=$HOME/bin:/usr/local/bin:$PATH + +PATH=$PATH:$HOME/Projects/media2/.cabal-sandbox/bin +PATH=$PATH:$HOME/Programming/hdevtools/.cabal-sandbox/bin +#PATH=$HOME/Programming/hs_sandbox/.cabal-sandbox/bin:$PATH + [ -d ~/.pscripts/ ] && PATH=$PATH:~/.pscripts [ -d ~/.Utilities/ ] && for i in ~/.Utilities/*; do PATH=$PATH:$i; done + +PATH=$PATH:/Users/bilalh/CS/_zsmall/bibtex_sente + + PATH=$PATH:/Users/bilalh/CS/minion/build PATH=$PATH:/Users/bilalh/CS/savilerow + #PATH=$PATH:/Applications/Mkvtoolnix.app/Contents/MacOS -PATH=$PATH:/Users/bilalh/Projects/media2/.cabal-sandbox/bin +PATH=$PATH:/Users/bilalh/Projects/Shell-Tunes/extra + +PATH=$PATH:~/binEnd + export PATH -#export ANDROID_SDK=$HOME/Programming/Java/android-sdk-mac_x86 +export CONJURE_REPO="/Users/bilalh/CS/conjure/" +export REPO_CONJURE="/Users/bilalh/CS/conjure-private" +export CONJURE_LIB="/Users/bilalh/CS/conjure-lib" + + export RUBY_PLATFORM="darwin" export R_HOME=/Library/Frameworks/R.framework/Resources +export GOPATH="/Users/bilalh/Programming/go" -export CONJURE_REPO="/Users/bilalh/CS/conjure/" +export BYOBU_PREFIX=$(brew --prefix) +export DEVELOPMENT_MODE=yes + + +export SAVED_BINARIES="/Users/bilalh/Desktop/Results/binaries"