Skip to content

Instantly share code, notes, and snippets.

@kennyp
kennyp / .tmux.conf
Created March 8, 2012 19:41
My Tmux Config
# Use C-a for the prefix
set -g prefix C-a
bind C-a send-prefix
unbind C-b
# Make the delay a little shorter
set -sg escape-time 1
# Number windows starting with one
set -g base-index 1
function! s:JSLint ()
cclose
let out = system('jslint', join(getline(1, '$'), "\n"))
if out != "jslint: No problems found.\n"
let errors = split(out, '[^\n]\n[^\n]\zs')
let error_list = []
for e in errors
let thise = split(e, '|||')
let error_list += [{'filename': expand("%"), 'lnum': thise[0], 'col': thise[1], 'text': thise[2]}]
endfor
@kennyp
kennyp / todo.vim
Created March 29, 2011 06:08
Find todos under current directory.
function! s:ToDoList ()
cclose
let task_list = []
for row in split(system('ack --column "(TODO|CHANGED|FIXME)"'), '\n')
let t = split(row, ':')
let task_dict = {'filename': t[0], 'lnum': t[1], 'col': t[2]}
let task_dict.text = substitute(join(t[3:-1]), '\s\+', ' ', '')
let task_list += [task_dict]
endfor
call setqflist(task_list, 'r')
# Prompt Setup
function minutes_since_last_commit {
now=`date +%s`
last_commit=`git log --pretty=format:'%at' -1`
seconds_since_last_commit=$((now-last_commit))
minutes_since_last_commit=$((seconds_since_last_commit/60))
echo $minutes_since_last_commit
}