From fcd74e51e3ce1a7a21011497d3f857a8d416a901 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Sun, 30 Nov 2014 19:18:25 -0500 Subject: [PATCH] Updates to vim themes and zsh aliases --- vim/bundle/jellybeans.vim | 1 + vim/bundle/vim-airline | 1 + vim/bundle/vim-colors-pencil | 1 + vim/colors/hemisu.vim | 215 +++++++++++++++++++++++++++++++++++ vim/ftplugin/crontab.vim | 1 + vimrc | 20 +++- zsh/aliases | 45 ++++---- zsh/functions | 6 + 8 files changed, 263 insertions(+), 27 deletions(-) create mode 160000 vim/bundle/jellybeans.vim create mode 160000 vim/bundle/vim-airline create mode 160000 vim/bundle/vim-colors-pencil create mode 100644 vim/colors/hemisu.vim create mode 100644 vim/ftplugin/crontab.vim diff --git a/vim/bundle/jellybeans.vim b/vim/bundle/jellybeans.vim new file mode 160000 index 0000000..0761708 --- /dev/null +++ b/vim/bundle/jellybeans.vim @@ -0,0 +1 @@ +Subproject commit 0761708c890becd3e027551068e0ae272da003e0 diff --git a/vim/bundle/vim-airline b/vim/bundle/vim-airline new file mode 160000 index 0000000..616dace --- /dev/null +++ b/vim/bundle/vim-airline @@ -0,0 +1 @@ +Subproject commit 616daceb735771ed27535abe8a6e4907320f1e82 diff --git a/vim/bundle/vim-colors-pencil b/vim/bundle/vim-colors-pencil new file mode 160000 index 0000000..b79c517 --- /dev/null +++ b/vim/bundle/vim-colors-pencil @@ -0,0 +1 @@ +Subproject commit b79c5177caac6810af07cb15e4f6db9324f1f42f diff --git a/vim/colors/hemisu.vim b/vim/colors/hemisu.vim new file mode 100644 index 0000000..7757401 --- /dev/null +++ b/vim/colors/hemisu.vim @@ -0,0 +1,215 @@ +" hemisu.vim - Vim color scheme +" ---------------------------------------------------------- +" Author: Noah Frederick (http://noahfrederick.com/) +" Version: 3.4 +" License: Creative Commons Attribution-NonCommercial +" 3.0 Unported License (see README.md) +" ---------------------------------------------------------- + +" Setup ----------------------------------------------------{{{ +" Reset syntax highlighting +hi clear +if exists("syntax_on") + syntax reset +endif + +" Declare theme name +let g:colors_name = "hemisu" + +"}}} +" The Colors -----------------------------------------------{{{ +" Define reusable colors +let s:black = { "gui": "#000000", "cterm": "16" } +let s:white = { "gui": "#FFFFFF", "cterm": "231" } +let s:almostWhite = { "gui": "#EEEEEE", "cterm": "255" } +let s:almostBlack = { "gui": "#111111", "cterm": "233" } +let s:middleDarkGrey = { "gui": "#777777", "cterm": "241" } +let s:middleLightGrey = { "gui": "#999999", "cterm": "246" } +let s:lightGrey = { "gui": "#BBBBBB", "cterm": "249" } +let s:darkGrey = { "gui": "#444444", "cterm": "238" } + +let s:darkPink = { "gui": "#63001C", "cterm": "88" } +let s:middleDarkPink = { "gui": "#FF0055", "cterm": "197" } +let s:middleLightPink = { "gui": "#D65E76", "cterm": "167" } +let s:lightPink = { "gui": "#FFAFAF", "cterm": "217" } + +let s:darkBlue = { "gui": "#005F87", "cterm": "24" } +let s:middleDarkBlue = { "gui": "#538192", "cterm": "24" } +let s:middleLightBlue = { "gui": "#9FD3E6", "cterm": "116" } +let s:lightBlue = { "gui": "#CBE4EE", "cterm": "195" } + +let s:darkGreen = { "gui": "#5F5F00", "cterm": "58" } +let s:middleDarkGreen = { "gui": "#739200", "cterm": "64" } +let s:middleLightGreen = { "gui": "#B1D631", "cterm": "149" } +let s:lightGreen = { "gui": "#BBFFAA", "cterm": "157" } + +let s:darkTan = { "gui": "#503D15", "cterm": "52" } +let s:lightTan = { "gui": "#ECE1C8", "cterm": "230" } + +" Assign to semantic categories based on background color +if &background == "dark" + " Dark theme + let s:bg = s:black + let s:norm = s:almostWhite + let s:comment = s:middleDarkGrey + let s:dimmed = s:middleLightGrey + let s:subtle = s:darkGrey + let s:faint = s:almostBlack + let s:accent1 = s:middleLightBlue + let s:accent2 = s:middleLightGreen + let s:accent3 = s:lightGreen + let s:accent4 = s:lightTan + let s:normRed = s:middleLightPink + let s:normGreen = s:middleLightGreen + let s:normBlue = s:middleLightBlue + let s:faintRed = s:darkPink + let s:faintGreen = s:darkGreen + let s:faintBlue = s:darkBlue +else + " Light theme + let s:bg = s:white + let s:norm = s:almostBlack + let s:comment = s:middleLightGrey + let s:dimmed = s:middleDarkGrey + let s:subtle = s:lightGrey + let s:faint = s:almostWhite + let s:accent1 = s:middleDarkBlue + let s:accent2 = s:middleDarkGreen + let s:accent3 = s:middleDarkPink + let s:accent4 = s:darkTan + let s:normRed = s:middleDarkPink + let s:normGreen = s:middleDarkGreen + let s:normBlue = s:middleDarkBlue + let s:faintRed = s:lightPink + let s:faintGreen = s:lightGreen + let s:faintBlue = s:lightBlue +endif + +"}}} +" Utility Function -----------------------------------------{{{ +function! s:h(group, style) + execute "highlight" a:group + \ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE") + \ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE") + \ "guisp=" (has_key(a:style, "sp") ? a:style.sp.gui : "NONE") + \ "gui=" (has_key(a:style, "gui") ? a:style.gui : "NONE") + \ "ctermfg=" (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE") + \ "ctermbg=" (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE") + \ "cterm=" (has_key(a:style, "cterm") ? a:style.cterm : "NONE") +endfunction + +"}}} +" Highlights - Vim >= 7 ------------------------------------{{{ +if version >= 700 + call s:h("CursorLine", { "bg": s:faint }) + call s:h("MatchParen", { "fg": s:accent1, "bg": s:faint, "gui": "bold" }) + call s:h("Pmenu", { "bg": s:faint }) + call s:h("PmenuThumb", { "bg": s:norm }) + call s:h("PmenuSBar", { "bg": s:subtle }) + call s:h("PmenuSel", { "bg": s:faintBlue }) + call s:h("ColorColumn", { "bg": s:faintRed }) + call s:h("SpellBad", { "sp": s:normRed, "gui": "undercurl" }) + call s:h("SpellCap", { "sp": s:accent1, "gui": "undercurl" }) + call s:h("SpellRare", { "sp": s:normGreen, "gui": "undercurl" }) + call s:h("SpellLocal", { "sp": s:accent4, "gui": "undercurl" }) + hi! link CursorColumn CursorLine + + " Use background for cterm Spell*, which does not support undercurl + execute "hi! SpellBad ctermbg=" s:faintRed.cterm + execute "hi! SpellCap ctermbg=" s:faintBlue.cterm + execute "hi! SpellRare ctermbg=" s:faintGreen.cterm + execute "hi! SpellLocal ctermbg=" s:faint.cterm +endif + +"}}} +" Highlights - UI ------------------------------------------{{{ +call s:h("Normal", { "fg": s:norm, "bg": s:bg }) +call s:h("NonText", { "fg": s:subtle }) +call s:h("Cursor", { "fg": s:bg, "bg": s:accent3 }) +call s:h("Visual", { "bg": s:faintBlue }) +call s:h("IncSearch", { "bg": s:faintBlue }) +call s:h("Search", { "bg": s:faintGreen }) +call s:h("StatusLine", { "fg": s:norm, "bg": s:faint, "gui": "bold", "cterm": "bold" }) +call s:h("StatusLineNC", { "fg": s:dimmed, "bg": s:faint }) +call s:h("SignColumn", { "fg": s:norm }) +call s:h("VertSplit", { "fg": s:subtle, "bg": s:faint }) +call s:h("TabLine", { "fg": s:dimmed, "bg": s:faint }) +call s:h("TabLineSel", { "gui": "bold", "cterm": "bold" }) +call s:h("Folded", { "fg": s:comment, "bg": s:faint }) +call s:h("Directory", { "fg": s:accent1 }) +call s:h("Title", { "fg": s:accent4, "gui": "bold", "cterm": "bold" }) +call s:h("ErrorMsg", { "bg": s:faintRed }) +call s:h("DiffAdd", { "bg": s:faintGreen }) +call s:h("DiffChange", { "bg": s:faintRed }) +call s:h("DiffDelete", { "fg": s:normRed, "bg": s:faintRed }) +call s:h("DiffText", { "bg": s:faintRed, "gui": "bold", "cterm": "bold" }) +call s:h("User1", { "fg": s:bg, "bg": s:normGreen }) +call s:h("User2", { "fg": s:bg, "bg": s:normRed }) +call s:h("User3", { "fg": s:bg, "bg": s:normBlue }) +hi! link WildMenu IncSearch +hi! link FoldColumn SignColumn +hi! link WarningMsg ErrorMsg +hi! link MoreMsg Title +hi! link Question MoreMsg +hi! link ModeMsg MoreMsg +hi! link TabLineFill StatusLineNC +hi! link LineNr NonText +hi! link SpecialKey NonText + +"}}} +" Highlights - Generic Syntax ------------------------------{{{ +call s:h("Delimiter", { "fg": s:dimmed }) +call s:h("Comment", { "fg": s:comment, "gui": "italic" }) +call s:h("Underlined", { "fg": s:accent1, "gui": "underline", "cterm": "underline" }) +call s:h("Type", { "fg": s:accent3 }) +call s:h("String", { "fg": s:accent2 }) +call s:h("Keyword", { "fg": s:accent2, "gui": "bold", "cterm": "bold" }) +call s:h("Todo", { "fg": s:normRed, "gui": "bold", "cterm": "bold" }) +call s:h("Function", { "gui": "bold", "cterm": "bold" }) +hi! link Identifier Function +hi! link Statement Type +hi! link Constant Directory +hi! link Number Constant +hi! link Special Constant +hi! link PreProc Constant +hi! link Error ErrorMsg + +"}}} +" Highlights - HTML ----------------------------------------{{{ +hi! link htmlLink Underlined +hi! link htmlTag Type +hi! link htmlEndTag htmlTag + +"}}} +" Highlights - CSS -----------------------------------------{{{ +hi! link cssBraces Delimiter +hi! link cssSelectorOp cssBraces +hi! link cssClassName Normal + +"}}} +" Highlights - Markdown ------------------------------------{{{ +hi! link mkdListItem mkdDelimiter + +"}}} +" Highlights - Shell ---------------------------------------{{{ +hi! link shOperator Delimiter +hi! link shCaseBar Delimiter + +"}}} +" Highlights - JavaScript ----------------------------------{{{ +hi! link javaScriptValue Constant +hi! link javaScriptNull Constant +hi! link javaScriptBraces Normal + +"}}} +" Highlights - Help ----------------------------------------{{{ +hi! link helpExample String +hi! link helpHeadline Title +hi! link helpSectionDelim Comment +hi! link helpHyperTextEntry Statement +hi! link helpHyperTextJump Underlined +hi! link helpURL Underlined + +"}}} + +" vim: fdm=marker:sw=2:sts=2:et diff --git a/vim/ftplugin/crontab.vim b/vim/ftplugin/crontab.vim new file mode 100644 index 0000000..ecfea82 --- /dev/null +++ b/vim/ftplugin/crontab.vim @@ -0,0 +1 @@ +set backupcopy=yes diff --git a/vimrc b/vimrc index d650f71..c06eb54 100644 --- a/vimrc +++ b/vimrc @@ -89,7 +89,6 @@ filetype plugin indent on " use emacs-style tab completion when selecting files, etc set wildmenu set wildmode=longest,list,full -colorscheme Monokai set wildignore+=*/tmp/*,*/log/*,*.so,*.swp,*.zip,*/rdoc/* set colorcolumn=90 " Show trailing whitespace @@ -131,11 +130,24 @@ imap map bb :!bundle install map gs :Gstatus map gw :!git add . && git commit -m 'WIP' -map pn :sp ~/Dropbox/notes/project-notes +map pn :sp ~/jelly/documents/Notes/stack.txt +map sn :sp ~/jelly/documents/software-notes/pcg-dive.md +map rn :sp ~/work/pcg/files/notes/refactoring-notes.md " Remove trailing whitespace on save all files. au BufWritePre * :%s/\s\+$//e +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" COLORS +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +colorscheme pencil +set background=light +let g:airline_theme = 'pencil' + +" Switch between light and dark +map l :set background=dark +map ll :set background=light + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " CUSTOM AUTOCMDS """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -164,8 +176,8 @@ augroup END " insert an end tag with imap end -" insert a hash rocket with -imap => +" insert a clojure lambda +imap (fn [x] " Mapping ESC in insert mode and command mode to double i "imap ii diff --git a/zsh/aliases b/zsh/aliases index 2ade8b8..3807d35 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -66,7 +66,7 @@ alias mi='mvn install' alias mci='mvn clean install' alias mp='mvn package' alias mcp='mvn clean package' -alias opensource='cd ~/code/open-source' +alias opensource='cd ~/jelly/open-source' alias patch='git format-patch HEAD^ --stdout > patch.diff' alias reguard='killall -9 ruby ; guard' alias r='rails' @@ -92,11 +92,6 @@ alias vh='vagrant halt' alias vs='vagrant ssh' alias vu='vagrant up' alias vimrc='vim ~/.vimrc' -alias q='quirk' -alias qe='quirk -e' -alias qc='quirk -c' -alias qm='quirk -m' -alias qq='quirk -t' alias zsh='vim ~/.zshrc' @@ -121,6 +116,8 @@ alias gco='git checkout' alias gcob='git checkout -b' alias gcon='vi .git/config' alias gcp='git cherry-pick' +alias gcpa='git cherry-pick --abort' +alias gcpc='git cherry-pick --continue' alias gcps='git cherry-pick -n' alias gd='git diff' alias gdc='git diff --cached' @@ -128,8 +125,8 @@ alias gdm='git diff master' alias gds='git diff --stat=160,120' alias gdw='git diff --color-words' alias gf='git fetch' -alias gfix="ga && git commit -a --amend -C HEAD" -alias gfixs="ga && git commit -S -a --amend -C HEAD" # signed +alias gfix="git commit --amend -C HEAD" +alias gfixs="git commit -S -a --amend -C HEAD" # signed alias gfo='git fetch origin' alias gfm='git fetch origin master' alias gh="source ~/.githelpers && show_git_head" @@ -140,6 +137,7 @@ alias gla='gll --all' alias glog='git log' alias glogf='git log --follow' alias gm='git merge' +alias gmnoff='git merge --no-ff' alias gmff='git merge --ff-only' alias gmffs='git merge --ff-only --squash' alias gmtheirs='git merge -Xtheirs' @@ -189,35 +187,33 @@ alias gtd='git tag -d' alias gtl='git tag -l' alias gx='git reset --hard' alias gxx='git reset --hard HEAD~1 && git pull --ff-only' +# git stats +alias gstats="echo 'Total commits: $(git rev-list HEAD --count)'; echo '\nAuthor breakdown:'; git shortlog | grep -E '^[^ ]'" # Notes alias art='cd ~/Dropbox/notes/art' -alias notes='cd ~/Dropbox/notes' +alias notes='cd ~/jelly/documents' alias bucket='cd ~/Dropbox/notes/buckets' -alias pn='vim ~/Dropbox/notes/stack.txt' +alias pn='vim ~/jelly/documents/Notes/stack.txt' alias sharp='vim ~/Dropbox/notes/sharpening-notes' alias writing='cd ~/brain/writing' alias what='cd ~/brain/writing/2014/what-happened' # Projects -alias projects='cd ~/code/projects' -alias web='cd ~/code/projects/websites/michael.is' -alias weba='cd ~/code/projects/websites/michael.is/angular' +alias projects='cd ~/jelly/projects' +alias web='cd ~/jelly/projects/websites/michael.is' +alias weba='cd ~/jelly/projects/websites/michael.is/angular' +alias dot='cd ~/jelly/projects/dotfiles' alias work='cd ~/work' alias brain='cd ~/brain' alias school='cd ~/brain/school' - -if [[ $platform == 'Linux' ]]; then - alias pcg='cd ~/code/pcg' - alias dive='cd ~/code/pcg/dive' -elif [[ $platform == 'Darwin' ]]; then - alias pcg='cd ~/work/pcg' - alias dive='cd ~/work/pcg/dive-network/dive' -fi +alias pcg='cd ~/work/pcg' +alias dive='cd ~/work/pcg/dive-network/dive' +alias di='cd ~/work/pcg/dive-network/dive/src-cljs/dive' # Work -alias pcgn='vim ~/work/pcg/files/notes/personal-notes.txt' -alias pcgr='vim ~/work/pcg/files/notes/refactoring-notes.txt' +alias pcgn='vim ~/work/pcg/files/notes/personal-notes.md' +alias pcgr='vim ~/work/pcg/files/notes/refactoring-notes.md' alias pcgf='cd ~/work/pcg/files' alias bastion='ssh 54.86.79.26 -l pcg-user -i ~/.ssh/pcg-ec2-pcg-user' alias sigma='cd ~/pcg/pcg-ansible && ssh -vF files/ssh/config pcg-user@sigma' @@ -225,3 +221,6 @@ alias qonos='cd ~/pcg/pcg-ansible && ssh -vF files/ssh/config pcg-user@qonos' alias samza1='cd ~/pcg/pcg-ansible && ssh -vF files/ssh/config pcg-user@samza1' alias samza2='cd ~/pcg/pcg-ansible && ssh -vF files/ssh/config pcg-user@samza2' alias samza3='cd ~/pcg/pcg-ansible && ssh -vF files/ssh/config pcg-user@samza3' +alias dstaging='ssh pcg-user@192.168.2.20 -i ~/.ssh/dive_20140923_rsa' +alias dclear='ssh pcg-user@192.168.2.90 -i ~/.ssh/dive_20140923_rsa' +alias dh='git push heroku-staging master -f' diff --git a/zsh/functions b/zsh/functions index d067c79..ded50f7 100644 --- a/zsh/functions +++ b/zsh/functions @@ -64,6 +64,12 @@ function chrome () { open -a /Applications/Google\ Chrome.app/ "$1" } +# Open a file in chrome +function chrome-kiosk () { + open -a /Applications/Google\ Chrome.app/ --args --kiosk --no-first-run --no-default-browser-check --noerrdialogs --no-message-box --disable-desktop-notifications --allow-running-insecure-content --always-authorize-plugins --allow-outdated-plugins "$1" +} + + # See top 10 bash commands function hist() { cat ~/.history|cut -d ';' -f 2- 2>/dev/null| awk '{a[$1]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head