diff --git a/.bash_profile b/.bash_profile new file mode 100755 index 0000000..549c608 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,179 @@ +export PATH=$HOME/local/node/bin:$PATH +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +alias ll='ls -lasG' + +# Git shortcuts +alias g='git' +alias ga='git add' +alias gp='git push' +alias gpa='gp --all' +alias gu='git pull' +alias gl='git log' +alias gg='gl --decorate --oneline --graph --date-order --all' +alias gs='git status' +alias gst='gs' +alias gd='git diff' +alias gdc='gd --cached' +alias gm='git commit -m' +alias gma='git commit -am' +alias gb='git branch' +alias gba='git branch -a' +function gc() { git checkout "${@:-master}"; } # Checkout master by default +alias gco='gc' +alias gcb='gc -b' +alias gr='git remote' +alias grv='gr -v' +#alias gra='git remote add' +alias grr='git remote rm' +alias gcl='git clone' + +# add a github remote by github username +function gra() { + if (( "${#@}" != 1 )); then + echo "Usage: gra githubuser" + return 1; + fi + local repo=$(gr show -n origin | perl -ne '/Fetch URL: .*github\.com[:\/].*\/(.*)/ && print $1') + gr add "$1" "git://github.com/$1/$repo" +} + +# git log with per-commit cmd-clickable GitHub URLs (iTerm) +function gf() { + local remote="$(git remote -v | awk '/^origin.*\(push\)$/ {print $2}')" + [[ "$remote" ]] || return + local user_repo="$(echo "$remote" | perl -pe 's/.*://;s/\.git$//')" + git log $* --name-status --color | awk "$(cat <%Creset' --abbrev-commit diff --git a/.vim/autoload/pathogen.vim b/.vim/autoload/pathogen.vim new file mode 100644 index 0000000..df4f22d --- /dev/null +++ b/.vim/autoload/pathogen.vim @@ -0,0 +1,245 @@ +" pathogen.vim - path option manipulation +" Maintainer: Tim Pope +" Version: 2.0 + +" Install in ~/.vim/autoload (or ~\vimfiles\autoload). +" +" For management of individually installed plugins in ~/.vim/bundle (or +" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc +" prior to `filetype plugin indent on` is the only other setup necessary. +" +" The API is documented inline below. For maximum ease of reading, +" :set foldmethod=marker + +if exists("g:loaded_pathogen") || &cp + finish +endif +let g:loaded_pathogen = 1 + +" Point of entry for basic default usage. Give a directory name to invoke +" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path +" to invoke pathogen#runtime_prepend_subdirectories(). Afterwards, +" pathogen#cycle_filetype() is invoked. +function! pathogen#infect(...) abort " {{{1 + let source_path = a:0 ? a:1 : 'bundle' + if source_path =~# '[\\/]' + call pathogen#runtime_prepend_subdirectories(source_path) + else + call pathogen#runtime_append_all_bundles(source_path) + endif + call pathogen#cycle_filetype() +endfunction " }}}1 + +" Split a path into a list. +function! pathogen#split(path) abort " {{{1 + if type(a:path) == type([]) | return a:path | endif + let split = split(a:path,'\\\@]','\\&','') + endif +endfunction " }}}1 + +function! s:find(count,cmd,file,lcd) " {{{1 + let rtp = pathogen#join(1,pathogen#split(&runtimepath)) + let file = pathogen#runtime_findfile(a:file,a:count) + if file ==# '' + return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" + elseif a:lcd + let path = file[0:-strlen(a:file)-2] + execute 'lcd `=path`' + return a:cmd.' '.pathogen#fnameescape(a:file) + else + return a:cmd.' '.pathogen#fnameescape(file) + endif +endfunction " }}}1 + +function! s:Findcomplete(A,L,P) " {{{1 + let sep = pathogen#separator() + let cheats = { + \'a': 'autoload', + \'d': 'doc', + \'f': 'ftplugin', + \'i': 'indent', + \'p': 'plugin', + \'s': 'syntax'} + if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) + let request = cheats[a:A[0]].a:A[1:-1] + else + let request = a:A + endif + let pattern = substitute(request,'\'.sep,'*'.sep,'g').'*' + let found = {} + for path in pathogen#split(&runtimepath) + let path = expand(path, ':p') + let matches = split(glob(path.sep.pattern),"\n") + call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') + call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') + for match in matches + let found[match] = 1 + endfor + endfor + return sort(keys(found)) +endfunction " }}}1 + +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(,'edit',,0) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',,0) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(,'edit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(,'split',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(,'vsplit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(,'tabedit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',,1) + +" vim:set ft=vim ts=8 sw=2 sts=2: diff --git a/.vim/bundle/nerdtree b/.vim/bundle/nerdtree new file mode 160000 index 0000000..eced5f9 --- /dev/null +++ b/.vim/bundle/nerdtree @@ -0,0 +1 @@ +Subproject commit eced5f98a0724cd6498b70024b3edec1e7b29b2e diff --git a/.vim/colors/obsidian2.vim b/.vim/colors/obsidian2.vim new file mode 100644 index 0000000..423eac9 --- /dev/null +++ b/.vim/colors/obsidian2.vim @@ -0,0 +1,94 @@ +" Vim color file +" Name: Obsidian2 +" Maintainer: Aydar Khabibullin +" Version: 0.5 +" Date: 01/30/2011 12:35:30 AM + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name="obsidian2" + +let s:Colors = [ +\'#a082bd','#e0e2e4','#93c763', +\'#ffcd22','#ec7600','#ff8409', +\'#e8e2b7','#d39745','#66747b', +\'#678cb1','#5899c0','#5ab9be', +\'#1A252A','#2f393c','#f3db2e'] + +" Syntax +execute "hi Normal guifg=" . s:Colors[1] . " guibg=" . s:Colors[12] +hi Normal ctermfg=253 +execute "hi Comment guifg=" . s:Colors[8] . " guibg=" . s:Colors[12] . " gui=italic" +hi Comment ctermfg=66 +execute "hi Conditional guifg=" . s:Colors[2] . " guibg=" . s:Colors[12] +hi Conditional ctermfg=113 +execute "hi Constant guifg=" . s:Colors[1] . " guibg=" . s:Colors[12] +hi Constant ctermfg=188 +execute "hi Error guifg=" . s:Colors[7] . " guibg=" . s:Colors[12] +hi Error ctermfg=173 ctermbg=none +execute "hi Identifier guifg=" . s:Colors[9] . " guibg=" . s:Colors[12] +hi Identifier ctermfg=67 +execute "hi Ignore guifg=" . s:Colors[1] +hi Ignore ctermfg=188 +execute "hi Operator guifg=" . s:Colors[6] . " guibg=" . s:Colors[12] +hi Operator ctermfg=187 +execute "hi PreProc guifg=" . s:Colors[0] . " guibg=" . s:Colors[12] +hi PreProc ctermfg=139 +execute "hi Repeat guifg=" . s:Colors[2] . " guibg=" . s:Colors[12] +hi Repeat ctermfg=113 +execute "hi Special guifg=" . s:Colors[2] . " guibg=" . s:Colors[12] +hi Special ctermfg=113 +execute "hi Statement guifg=" . s:Colors[2] . " guibg=" . s:Colors[12] +hi Statement ctermfg=113 +execute "hi Number guifg=" . s:Colors[3] . " guibg=" . s:Colors[12] +hi Number ctermfg=220 +execute "hi Boolean guifg=" . s:Colors[11] . " guibg=" . s:Colors[12] +hi Boolean ctermfg=73 +execute "hi String guifg=" . s:Colors[5] . " guibg=" . s:Colors[12] +hi String ctermfg=208 +execute "hi Character guifg=" . s:Colors[5] . " guibg=" . s:Colors[12] +hi Character ctermfg=208 +execute "hi Title guifg=" . s:Colors[1] . " guibg=" . s:Colors[12] +hi Title ctermfg=253 +execute "hi Todo guifg=" . s:Colors[12] . " guibg=" . s:Colors[0] . " gui=bold guisp=NONE" +hi Todo ctermfg=16 ctermbg=139 +execute "hi Type guifg=" . s:Colors[9] . " guibg=" . s:Colors[12] +hi Type ctermfg=67 +execute "hi Underline guifg=" . s:Colors[10] . " guibg=" . s:Colors[12] +hi Underline ctermfg=67 + +" Groups +execute "hi Cursor guifg=" . s:Colors[12] . " guibg=" . s:Colors[5] +execute "hi CursorIM guifg=" . s:Colors[7] . " guibg=" . s:Colors[5] +execute "hi CursorLine guifg=NONE guibg=" . s:Colors[13] +execute "hi CursorColumn guifg=". s:Colors[1] . " guibg=" . s:Colors[13] +execute "hi Directory guifg=" . s:Colors[10] . " guibg=" . s:Colors[12] +execute "hi ErrorMsg guifg=" . s:Colors[13] . " guibg=" . s:Colors[7] +execute "hi FoldColumn guifg=" . s:Colors[13] . " guibg=" . s:Colors[12] +execute "hi Folded guifg=" . s:Colors[12] . " guibg=" . s:Colors[11] +execute "hi IncSearch guifg=" . s:Colors[1] . " guibg=" . s:Colors[12] . " gui=none" +execute "hi LineNr guifg=" . s:Colors[8] . " guibg=" . s:Colors[12] . " gui=none" +execute "hi MatchParen guifg=" . s:Colors[12] . " guibg=" . s:Colors[11] . " gui=bold" +execute "hi ModeMsg guifg=" . s:Colors[5] . " guibg=" . s:Colors[12] +execute "hi MoreMsg guifg=" . s:Colors[5] . " guibg=" . s:Colors[12] +execute "hi NonText guifg=" . s:Colors[1] . " guibg=" . s:Colors[12] +execute "hi Pmenu guifg=" . s:Colors[1] . " guibg=" . s:Colors[8] +execute "hi PmenuSel guifg=" . s:Colors[13] . " guibg=" . s:Colors[9] +execute "hi Question guifg=" . s:Colors[0] . " guibg=" . s:Colors[12] +execute "hi Search guifg=" . s:Colors[0] . " guibg=" . s:Colors[12] +execute "hi SpecialKey guifg=" . s:Colors[10] . " guibg=" . s:Colors[12] +execute "hi StatusLine guifg=" . s:Colors[1] . " guibg=" . s:Colors[9] . " gui=none" +execute "hi StatusLineNC guifg=" . s:Colors[1] . " guibg=" . s:Colors[8] . " gui=none" +execute "hi TabLine guifg=" . s:Colors[8] . " guibg=" . s:Colors[12] . " gui=none" +execute "hi TabLineFill guifg=" . s:Colors[12] . " guibg=" . s:Colors[13] . " gui=none" +execute "hi TabLineSel guifg=" . s:Colors[1] . " guibg=" . s:Colors[13] . " gui=none" +execute "hi Tooltip guifg=" . s:Colors[9] . " guibg=" . s:Colors[8] . " gui=none" +execute "hi VertSplit guifg=" . s:Colors[0] . " guibg=" . s:Colors[13] . " gui=none" +execute "hi Visual guifg=" . s:Colors[1] . " guibg=" . s:Colors[0] . " gui=none" +hi VisualNOS gui=none guibg=black +execute "hi WarningMsg guifg=" . s:Colors[5] . " guibg=" . s:Colors[12] . " gui=none" +execute "hi WildMenu guifg=" . s:Colors[14] . " guibg=" . s:Colors[5] . " gui=none" + diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..ede5b11 --- /dev/null +++ b/.vimrc @@ -0,0 +1,6 @@ +call pathogen#infect() +syntax enable +filetype plugin indent on +set t_Co=256 +set number +colors obsidian2