This commit is contained in:
William Carroll 2016-08-23 14:14:14 -04:00
commit c836c55081
44 changed files with 350 additions and 358 deletions

View file

@ -1,17 +0,0 @@
export PATH=$HOME/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH
echo "Welcome back, $USER"
# use vi bindings for terminal input
set -o vi
# aliases
source $HOME/pc_settings/.w_aliases.sh
# functions
source $HOME/pc_settings/.w_functions.sh
# syntax highlighting for CLI; if not installed, run the following command
# brew install zsh-syntax-highlighting

View file

@ -1,38 +0,0 @@
#!/usr/bin/python
"""
Forward and Backward lookups for Bash escape sequences
"""
import sys, re
literal_to_bash = {
'ESC': '^[',
'UP-ARROW': '^[OA',
'RIGHT-ARROW': '^[OC',
'DOWN-ARROW': '^[OB',
'LEFT-ARROW': '^[OD',
'F1': '^[OP',
'F2': '^[OQ',
'F3': '^[OR',
'F4': '^[OS',
'F5': '^[15~',
'F6': '^[17~',
'F7': '^[18~',
'F8': '^[19~',
'F9': '^[20~',
'F10': '^[21~',
'F11': None,
'F12': '^[24~'
}
bash_to_literal = {
v: k for k, v in literal_to_bash.items()
}
el = sys.argv[1]
print '{0}: "{1}"'.format(el, literal_to_bash[el])

View file

@ -1,56 +0,0 @@
#!/usr/bin/python
"""
Forward and Backward lookups for URL escape sequences
"""
import sys, re
literal_to_esccode = {
' ': '%20',
'<': '%3C',
'>': '%3E',
'#': '%23',
'%': '%25',
'{': '%7B',
'}': '%7D',
'|': '%7C',
'\\': '%5C',
'^': '%5E',
'~': '%7E',
'[': '%5B',
']': '%5D',
'`': '%60',
';': '%3B',
'/': '%2F',
'?': '%3F',
':': '%3A',
'@': '%40',
'=': '%3D',
'&': '%26',
'$': '%24',
}
esccode_to_literal = {
v: k for k, v in literal_to_esccode.items()
}
def is_esccode(string):
p = re.compile(r'^%\w\w$')
m = p.match(string)
return bool(p.match(string))
try:
el = sys.argv[1]
except:
el = None
if not el:
print literal_to_esccode
else:
msg = esccode_to_literal[el] if is_esccode(el) else literal_to_esccode[el]
print '"{0}": "{1}"'.format(el, msg)

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.vim

7
.vimrc
View file

@ -1,7 +0,0 @@
syntax on
set number
set tabstop=2
set expandtab
set shiftwidth=2
colorscheme murphy

View file

@ -1,9 +1,6 @@
# My Mac Configuration
I'm documenting this for personal use. Shell settings, vim settings, commonly used applications, et cetera...
### to do
* migrate Google Chrome bookmarks to new machine
### Commonly used applications
* homebrew - necessary for procuring shell applications
* karabiner - `key-repeat: 50ms delay-until-repeat: 300ms` increase your Mac's key repeat settings beyond the default range

7
configs/.tmux.conf Normal file
View file

@ -0,0 +1,7 @@
set -g default-terminal "screen-256color"
bind-key -r -T prefix k select-pane -U
bind-key -r -T prefix j select-pane -D
bind-key -r -T prefix h select-pane -L
bind-key -r -T prefix l select-pane -R

View file

@ -1,4 +1,7 @@
export PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:$PATH
export PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:/usr/local/go/bin:$PATH
# make vim the default editor for commit messages etc
export EDITOR=$(which vim)
echo "Welcome back, $USER"
@ -6,10 +9,15 @@ echo "Welcome back, $USER"
set -o vi
# aliases
source $HOME/pc_settings/.w_aliases.sh
source $HOME/pc_settings/aliases.sh
# functions
source $HOME/pc_settings/.w_functions.sh
source $HOME/pc_settings/functions/index.sh
# setup keybindings for history functions
source $HOME/pc_settings/scripts/setup_keybindings.sh
# BEGIN: bindkeys
bindkey "^R" history-incremental-search-backward

39
configs/setup_configs.sh Executable file
View file

@ -0,0 +1,39 @@
#!/usr/bin/env bash
# .zsh_profile
if [ -f "$HOME"/.zsh_profile ] && [ ! -L "$HOME"/.zsh_profile ]; then
# backup .zsh_profile
echo -n "Backing up .zsh_profile ... " && \
mv "$HOME"/.zsh_profile "$HOME"/.zsh_profile.bak && \
echo "Done."
fi
if [ -L "$HOME"/.zsh_profile ]; then
# TODO: make sure that .zsh_profile is symlinked to the correct location.
echo ".zsh_profile is already symlinked."
else
# create symlink to pc_settings .zsh_profile
echo -n "Symlinking to pc_settings/configs/.zsh_profile ... " && \
ln -s "$HOME"/pc_settings/configs/.zsh_profile "$HOME"/.zsh_profile && \
echo "Done."
fi
# backup .tmux.conf
if [ -f "$HOME"/.tmux.conf ] && [ ! -L "$HOME"/.tmux.conf ]; then
echo -n "Backing up .tmux.conf ... " && \
mv "$HOME"/.tmux.conf "$HOME"/.tmux.conf.bak && \
echo "Done."
fi
if [ -L "$HOME"/.tmux.conf ]; then
# TODO: make sure that .tmux.conf is symlinked to the correct location.
echo ".tmux.conf is already symlinked."
else
# create symlink to pc_settings .tmux.conf
echo -n "Symlinking to pc_settings/configs/.tmux.conf ... " && \
ln -s "$HOME"/pc_settings/configs/.tmux.conf "$HOME"/.tmux.conf && \
echo "Done."
fi

View file

@ -49,26 +49,30 @@ function wgcheckout {
}
# combine fetch and rebase (git frebase)
function wgfreebase {
if [ -z $1 ]; then
branchname="$(git symbolic-ref HEAD 2> /dev/null | cut -f3 -d'/')"
else
branchname="$1"
fi
# opens the current ticket-branch in web browser
function wgjira {
base_url="https://jira.hugeinc.com/browse"
ticket=$(wgtix)
git fetch origin "$branchname" && git rebase origin/"$branchname"
open "${base_url}/${ticket}"
}
# push to current branch
function wgpush {
if [ -z $1 ]; then
branchname="$(git symbolic-ref HEAD 2> /dev/null | cut -f3 -d'/')"
else
branchname="$1"
fi
# wgcheckout combined with a fuzzy search
function wgfcheckout {
branchname=$(trim $(git branch | fzf))
git push origin $branchname
[ ! -z "$branchname" ] && wgcheckout "$branchname" || return
}
# View an author's work within a specified date range.
function wgviewcommits {
author=$([ -z "$1" ] && echo "William Carroll" || echo "$1")
todays_date=$(date +'%Y-%m-%d')
date=$([ -z "$2" ] && echo "${todays_date}" || echo "$2")
git log --all --author="${author}" --after="${date} 00:00" \
--before="${date} 23:59"
}

View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
HISTFILE=~/.zsh_history
function wh_two_back {
command=$(history | tail -n 2 | head -n 1 | cut -c 8-)
echo -n $command
}
function wh_three_back {
command=$(history | tail -n 3 | head -n 1 | cut -c 8-)
echo -n "$command"
}
function wh_four_back {
command=$(history | tail -n 4 | head -n 1 | cut -c 8-)
echo -n "$command"
}
function wh_five_back {
command=$(history | tail -n 5 | head -n 1 | cut -c 8-)
echo -n "$command"
}

View file

@ -3,14 +3,21 @@ npms() {
npm start;
}
# custom js functions
source $HOME/pc_settings/.js_to_bash.sh
source $HOME/pc_settings/functions/js_to_bash.sh
# custom git functions
source $HOME/pc_settings/.git_functions.sh
source $HOME/pc_settings/functions/git_functions.sh
# custom bash helpers functions
# source $HOME/pc_settings/.misc_functions.sh
source $HOME/pc_settings/functions/misc_functions.sh
# custom history functions for zle bindkey
source $HOME/pc_settings/functions/history_functions.sh
# custom functions to work with vim
source $HOME/pc_settings/functions/vim_functions.sh
# generates placeholder content for FE work
function lorem {

View file

@ -0,0 +1,40 @@
# download files to /tmp directory
function wdownload {
URL="$1"
FILENAME="$(basename $URL)"
wget -O /tmp/"$FILENAME" $URL >/dev/null && open /tmp && echo "Downloaded to: /tmp/$FILENAME" || echo "Error ..."
}
# spell checker
function wspcheck {
if [ $# -ge 1 -a -f "$1" ] && input="$1" || input="-"
cat "$input" | tr '[:upper:]' '[:lower:]' | tr -cd '[:alpha:]_ \n' | tr -s ' ' '\n' | sort | comm -23 - ~/english_words.txt
}
# fuzzily search through dirs stack
function wfd {
dir=$(dirname $(fzf)) && pushd "$dir" >/dev/null
}
# pushd into a directory on your dirs stack
function wpushd {
dir="$(dirs | tr ' ' '\n' | fzf)" && pushd "$dir"
}
# trims leading and trailing whitespace
function trim {
input="$1"
echo "${input//[[:blank:]]/}"
}
function wgreviewers {
echo "BJ Warshaw\nDaniel Wasilewski\nSean Sullivan\nCharles Morrissey\nRyan Balch\nZach Goldstein\nWilliam Anderson"
}

View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Easily search for strings within the files within the current directory.
# Specify file extensions and directories to exclude to improve accuracy.
# The file selected from fzf will be opened in vim.
function vfzopen() {
echo -n "Search Term: "
read search_query
echo -n "Filename: "
read filetype
echo -n "Exclude Directory: "
read exclude_dir
if [ ! -z "$exclude_dirs" ]; then
filename=$(find . -type f -name "$filetype" | \
xargs grep -l "$search_query" | fzf)
else
filename=$(find . -type f -name "$filetype" -not -path "./${exclude_dir}/*" \
| xargs grep -l "$search_query" | fzf)
fi
if [ ! -z "$filename" ]; then
vim "$filename"
return 0
else
return 1
fi
}

View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
if [ -d /Volumes/usb_vim ] && \ # usb has mounted
[ ! -L "$HOME/.vimrc" ] && \ # .vimrc is a symlink
[ ! -L "$HOME/.vim" ]; then # .vim dir is a symlink
. "/Volumes/usb_vim/vim/vim_point_to_usb.sh"
. "$HOME/pc_settings/launchd_scripts/notice.sh"
else
. "$HOME/pc_settings/launchd_scripts/notice_2.sh"
fi

34
launchd_scripts/bootstrap.sh Executable file
View file

@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Unload scripts in case there have been changes since it was last loaded.
echo -n "Unloading personal *.plist files... " &&
launchctl unload ~/Library/LaunchAgents/watch_volumes.plist &&
echo "Done." || echo "Error."
# Remove *.plist symlinks created last time.
echo -n "Removing *.plist symlinks... " &&
rm ~/Library/LaunchAgents/watch_volumes.plist &&
echo "Done." || echo "Error."
# Process the *.tpl files, replacing global identifiers with the values
# from vars.json.
echo -n "Processing *.tpl files... " &&
. ./process_files.sh &&
echo "Done." || echo "Error."
# Recreate those symlinks.
echo -n "Recreating *.plist symlinks to ~/Library/LaunchAgents ... " &&
ln -s ~/pc_settings/launchd_scripts/watch_volumes.plist \
~/Library/LaunchAgents/watch_volumes.plist &&
echo "Done." || echo "Error."
# Reload scripts in case there have been changes since it was last loaded.
echo -n "Reloading personal *.plist files... " &&
launchctl load ~/Library/LaunchAgents/watch_volumes.plist &&
echo "Done." || echo "Error."

5
launchd_scripts/notice.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
osascript -e "tell Application \"System Events\" to display alert\
\"New volume mounted.\""

5
launchd_scripts/notice_2.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
osascript -e "tell Application \"System Events\" to display alert\
\"Not going to switch!\""

View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# This script processes certain files and replaces
# {{<IDENTIFIER>}} with the entries in vars.json
output_path="./watch_volumes.plist"
template_file="watch_volumes.plist.tpl"
usb_drive_path=$(jq < ./vars.json '.USB_DRIVE_PATH' | \
sed 's/\//\\\//g' | sed 's/"//g')
cat "$template_file" | perl -p -e 's/(\{\{[^}]+\}\})/'$usb_drive_path'/g' \
>"$output_path"
echo "Done."

View file

@ -0,0 +1,3 @@
{
"USB_DRIVE_PATH": "/Volumes/usb_vim/"
}

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>WatchVolumes</string>
<key>ProgramArguments</key>
<array>
<string>/Users/wcarroll/pc_settings/launchd_scripts/attempt_vim_switch.sh</string>
</array>
<key>WatchPaths</key>
<array>
<string>/Volumes/usb_vim/</string>
</array>
</dict>
</plist>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>WatchVolumes</string>
<key>ProgramArguments</key>
<array>
<string>/Users/wcarroll/pc_settings/launchd_scripts/attempt_vim_switch.sh</string>
</array>
<key>WatchPaths</key>
<array>
<string>{{USB_DRIVE_PATH}}</string>
</array>
</dict>
</plist>

BIN
scripts/.swp Normal file

Binary file not shown.

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# This file is run after history_functions.sh have been sourced.
# It converts the defined functions into zsh widgets that are
# thereafter bound to keys for expedience.
zle -N wh_two_back_widget wh_two_back &&
bindkey '^@' wh_two_back_widget

View file

@ -1,6 +1,6 @@
# USBify
This folder contains packages to make applications into USB portable.
This folder contains packages to make applications USB portable.
## vim
Run the `vim_to_usb.sh` script to point your $HOME/.vim folder to an external USB

Binary file not shown.

View file

@ -1,11 +0,0 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhist_cnt =9
let g:netrw_dirhist_1='/Users/wcarroll/huge/projects/google/cerebro/static/js'
let g:netrw_dirhist_2='/Users/wcarroll/huge/projects/google/cerebro/static'
let g:netrw_dirhist_3='/Users/wcarroll/huge/projects/google/cerebro'
let g:netrw_dirhist_4='/Users/wcarroll'
let g:netrw_dirhist_5='/Users'
let g:netrw_dirhist_6='/'
let g:netrw_dirhist_7='/Users/wcarroll/huge/projects/google/cerebro'
let g:netrw_dirhist_8='/Users/wcarroll'
let g:netrw_dirhist_9='/Users/wcarroll/huge/projects/google/cerebro'

@ -1 +0,0 @@
Subproject commit c822b05ee0886f9a9703227dc85a6d47612c4bf1

@ -1 +0,0 @@
Subproject commit 4984767509e3d05ca051e253c8a8b37de784be45

@ -1 +0,0 @@
Subproject commit 354c429dad34f7d163663943c948f819588b53d3

@ -1 +0,0 @@
Subproject commit b9fa920b4abbb54799927a3bc57869fdd556321a

@ -1 +0,0 @@
Subproject commit 2e2b649232d6ae4d02d74793e5da0ee08480ad8d

@ -1 +0,0 @@
Subproject commit a78607c9f63f270137e472126ee1b2c3ae52a845

@ -1 +0,0 @@
Subproject commit d400a570bf64b0c216aa7c8e1795820b911a7404

@ -1 +0,0 @@
Subproject commit 6014bdc57f161f5ae5140e4247b144ae149bf894

@ -1 +0,0 @@
Subproject commit c00ebd75ac23f4080c0d0bf9453b16304a3fb316

@ -1 +0,0 @@
Subproject commit e5d4bfb5dab8c4f122b97fe9c3ed2f2d1e8b3bdc

@ -1 +0,0 @@
Subproject commit 5cb4b369cac5b29dd7f2e688b23a2b57263972ab

View file

@ -1 +0,0 @@
au BufRead,BufNewFile *.soy set filetype=soy

View file

@ -1,46 +0,0 @@
"============================================================================
"File: gjslint.vim
"Description: Javascript syntax checker - using gjslint
"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists('g:loaded_syntastic_javascript_gjslint_checker')
finish
endif
let g:loaded_syntastic_javascript_gjslint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_gjslint_GetLocList() dict
call syntastic#log#deprecationWarn('javascript_gjslint_conf', 'javascript_gjslint_args')
let makeprg = self.makeprgBuild({
\ 'args': '--nodebug_indentation',
\ 'args_after': '--check_html --nosummary --unix_mode --nobeep' })
let errorformat =
\ "%f:%l:(New Error -%\\?\%n) %m," .
\ "%f:%l:(-%\\?%n) %m," .
\ "%-G1 files checked," .
\ " no errors found.," .
\ "%-G%.%#"
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'javascript',
\ 'name': 'gjslint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:

View file

@ -1,145 +0,0 @@
" Google Closure templates syntax file.
" Language: Soy
" Maintainer: Dugan Chen (https://github.com/duganchen)
"
if exists("b:current_syntax")
finish
endif
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syntax clear
syntax case match
syntax keyword soyConstant contained null
syntax keyword soyConstant contained false
syntax keyword soyConstant contained true
syntax keyword soyFunction contained isFirst
syntax keyword soyFunction contained isLast
syntax keyword soyFunction contained index
syntax keyword soyFunction contained hasData
syntax keyword soyFunction contained length
syntax keyword soyFunction contained round
syntax keyword soyFunction contained floor
syntax keyword soyFunction contained ceiling
syntax keyword soyFunction contained min
syntax keyword soyFunction contained max
syntax keyword soyFunction contained randomInt
syntax keyword soyFunction contained bidiGlobalDir
syntax keyword soyFunction contained bidiDirAttr
syntax keyword soyFunction contained bidiMark
syntax keyword soyFunction contained bidiMarkAfter
syntax keyword soyFunction contained bidiStartEdge
syntax keyword soyFunction contained bidiEndEdge
syntax keyword soyFunction contained bidiTextDir
syntax keyword soyStatement contained namespace
syntax keyword soyStatement contained template
syntax keyword soyStatement contained delpackage
syntax keyword soyStatement contained deltemplate
syntax keyword soyKeyword contained literal
syntax keyword soyKeyword contained print
syntax keyword soyKeyword contained msg
syntax keyword soyKeyword contained call
syntax keyword soyKeyword contained delcall
syntax keyword soyKeyword contained param
syntax keyword soyKeyword contained let
syntax keyword soyKeyword contained css
syntax keyword soyConditional contained if
syntax keyword soyConditional contained elseif
syntax keyword soyConditional contained else
syntax keyword soyConditional contained switch
syntax keyword soyConditional contained case
syntax keyword soyConditional contained default
syntax keyword soyConditional contained ifempty
syntax keyword soyRepeat contained foreach
syntax keyword soyRepeat contained for
syntax keyword soyRepeat contained in
syntax keyword soyRepeat contained range
syntax keyword soyCharacter contained sp
syntax keyword soyCharacter contained nil
syntax keyword soyCharacter contained r
syntax keyword soyCharacter contained n
syntax keyword soyCharacter contained t
syntax keyword soyCharacter contained lb
syntax keyword soyCharacter contained rb
syntax keyword soyDirective contained private
syntax keyword soyDirective contained autoescape
syntax keyword soyDirective contained noAutoescape
syntax keyword soyDirective contained id
syntax keyword soyDirective contained escapeCssString
syntax keyword soyDirective contained escapeHtml
syntax keyword soyDirective contained escapeHtmlRcdata
syntax keyword soyDirective contained escapeHtmlAttribute
syntax keyword soyDirective contained escapeHtmlAttributeNospace
syntax keyword soyDirective contained escapeUri
syntax keyword soyDirective contained escapeJs
syntax keyword soyDirective contained escapeJsRegex
syntax keyword soyDirective contained escapeJsString
syntax keyword soyDirective contained escapeJsValue
syntax keyword soyDirective contained truncate
syntax keyword soyDirective contained insertWordBreaks
syntax keyword soyDirective contained changeNewlineToBr
syntax keyword soyDirective contained desc
syntax keyword soyDirective contained meaning
syntax keyword soyDirective contained data
syntax keyword soyDirective contained kind
syntax keyword soyDirective contained variant
syntax keyword soyDirective contained bidiSpanWrap
syntax keyword soyDirective contained bidiUnicodeWrap
syntax match soySpecialComment /@param?\?/ contained
syntax region soyCommand start="{" end="}" contains=soyKeyword, soyDirective, soyIdentifier, soyString, soyTemplate, soyConstant, soyInteger, soyCharacter, soyFloat, soySci, soyOperator, soyFunction, soyRepeat, soyConditional, soyStatement, soyLabel
syntax region soyString contained start="\'" end="\'"
syntax region soyString contained start="\"" end="\""
syntax match soyIdentifier /\$[a-zA-Z0-9._]*\>/ contained
syntax region soyComment start=/\/\*/ end='\\*\/' contains=soySpecialComment
syntax match soyComment /\/\/.*$/
syntax match soyTemplate /\s\+\.\w\+\>/ contained
syntax match soyInteger /\-\?\(0x\)\?[A-F0-9]\+\>/ contained
syntax match soyNumber /\-\?\d\+\(e\-\?\d\+\)\?\>/ contained
syntax match soyFloat /\-\?\d\+\.\d\+\>/ contained
syntax match soySci /\-\?\d\+e\-\?\d\+\>/ contained
syntax match soyOperator /\<\(not\|and\|or\)\>/ contained
syntax match soyLabel /\<\w\+:/ contained
" Yes, this causes the - in -1 to show as an operator. This is a bug.
syntax match soyOperator /[-*/%+<>=!?:]/ contained
highlight def link soyOperator Operator
highlight def link soyKeyword Statement
highlight def link soyDirective Type
highlight def link soyIdentifier Identifier
highlight def link soyString String
highlight def link soyComment Comment
highlight def link soyTemplate Identifier
highlight def link soyInteger Number
highlight def link soyFloat Float
highlight def link soySci Float
highlight def link soyConstant Constant
highlight def link soyCharacter Character
highlight def link soyFunction Function
highlight def link soyRepeat Repeat
highlight def link soyConditional Conditional
highlight def link soyStatement Statement
highlight def link soySpecialComment SpecialComment
highlight def link soyLabel Identifier

View file

@ -21,6 +21,8 @@ Plugin 'othree/yajs.vim'
Plugin 'crusoexia/vim-monokai'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdtree'
Plugin 'mileszs/ack.vim'
Plugin 'sjl/clam.vim'
call vundle#end() " required
filetype plugin indent on " required
@ -50,6 +52,7 @@ let g:syntastic_check_on_wq = 1
let g:syntastic_javascript_checkers = ['gjslint']
" Basic settings
syntax on
set number
set tabstop=2
@ -59,6 +62,32 @@ colorscheme monokai
set t_Co=255
" Ensure that <header> is "," character
let mapleader = ","
" Define highlighting groups
highlight InterestingWord1 ctermbg=Cyan ctermfg=Black
highlight InterestingWord2 ctermbg=Yellow ctermfg=Black
highlight InterestingWord3 ctermbg=Magenta ctermfg=Black
" h1 highlighting
nnoremap <silent> <leader>h1 :execute 'match InterestingWord1 /\<<c-r><c-w>\>/'<CR>
nnoremap <silent> <leader>xh1 :execute 'match none'<CR>
" h2 highlighting
nnoremap <silent> <leader>h2 :execute '2match InterestingWord2 /\<<c-r><c-w>\>/'<CR>
nnoremap <silent> <leader>xh2 :execute '2match none'<CR>
" h3 highlighting
nnoremap <silent> <leader>h3 :execute '3match InterestingWord3 /\<<c-r><c-w>\>/'<CR>
nnoremap <silent> <leader>xh3 :execute '3match none'<CR>
"clear all highlighted groups
nnoremap <silent> <leader>xhh :execute 'match none'<CR> :execute '2match none'<CR> :execute '3match none'<CR>
" add 80 character wrap line
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%81v.\+/
@ -71,10 +100,20 @@ imap jj <Esc>
map <C-n> :NERDTreeToggle<CR>
" BOL and EOL
nnoremap H ^
nnoremap L $
" set -o emacs line-editor defaults
inoremap <C-a> <Esc>I
inoremap <C-e> <Esc>A
" trim trailing whitespace on save
autocmd BufWritePre *.{js,py,tpl,html} :%s/\s\+$//e
" set default font and size
set guifont=Operator\ Mono:h16