# HG changeset patch # User Steve Losh # Date 1294755875 18000 # Node ID 1d88d4630cf7ffd3ea7976160c3c9ea1310fbc67 # Parent bb44f2206b1c1f1499ba77fd596c776bbf77a189 Lots. diff -r bb44f2206b1c -r 1d88d4630cf7 .gitconfig --- a/.gitconfig Mon Dec 27 16:10:25 2010 -0500 +++ b/.gitconfig Tue Jan 11 09:24:35 2011 -0500 @@ -10,6 +10,8 @@ gl = log -10 --color=always --all --graph --topo-order --pretty='format: %Cgreen%h%Creset %s%Cred%d%Creset%n' gll = log --color=always --all --graph --topo-order --pretty='format: %Cgreen%h%Creset %s%Cred%d%Creset%n' +pull = pull --ff-only + com = commit cm = commit -m diff -r bb44f2206b1c -r 1d88d4630cf7 .hgrc --- a/.hgrc Mon Dec 27 16:10:25 2010 -0500 +++ b/.hgrc Tue Jan 11 09:24:35 2011 -0500 @@ -54,10 +54,6 @@ opts.dd = [merge-tools] -diffuse.priority=-3 -diffuse.args=$local $base $other -diffuse.gui=True -diffuse.diffargs=$parent $child [email] method = smtp diff -r bb44f2206b1c -r 1d88d4630cf7 vim/.vimrc --- a/vim/.vimrc Mon Dec 27 16:10:25 2010 -0500 +++ b/vim/.vimrc Tue Jan 11 09:24:35 2011 -0500 @@ -42,6 +42,7 @@ " Leader let mapleader = "," +let maplocalleader = "\\" " Make Y not dumb nnoremap Y y$ @@ -112,7 +113,6 @@ set foldlevelstart=0 nnoremap za vnoremap za -noremap ft Vatzf function! MyFoldText() let line = getline(v:foldstart) @@ -134,27 +134,42 @@ " Fuck you, help key. set fuoptions=maxvert,maxhorz inoremap :set invfullscreena -nnoremap :set invfullscreen -vnoremap :set invfullscreen +noremap :set invfullscreen " Fuck you too, manual key nnoremap K -" Various syntax stuff -au BufNewFile,BufRead *.less set filetype=less -au BufRead,BufNewFile *.scss set filetype=scss +" Various filetype-specific stuff + +au BufNewFile,BufRead *.html setlocal filetype=htmldjango +au BufNewFile,BufRead *.html setlocal foldmethod=manual +au BufNewFile,BufRead *.html nnoremap f Vatzf -au BufRead,BufNewFile *.confluencewiki set filetype=confluencewiki -au BufRead,BufNewFile *.confluencewiki set wrap linebreak nolist +au BufNewFile,BufRead *.less setlocal filetype=less +au BufNewFile,BufRead *.less setlocal foldmethod=marker +au BufNewFile,BufRead *.less setlocal foldmarker={,} +au BufNewFile,BufRead *.less setlocal nocursorline + +au BufNewFile,BufRead *.js setlocal foldmethod=marker +au BufNewFile,BufRead *.js setlocal foldmarker={,} + +au BufRead,BufNewFile *.confluencewiki setlocal filetype=confluencewiki +au BufRead,BufNewFile *.confluencewiki setlocal wrap linebreak nolist au BufNewFile,BufRead *.m*down set filetype=markdown -au BufNewFile,BufRead *.m*down nnoremap 1 yypVr= -au BufNewFile,BufRead *.m*down nnoremap 2 yypVr- -au BufNewFile,BufRead *.m*down nnoremap 3 I### +au BufNewFile,BufRead *.m*down nnoremap 1 yypVr= +au BufNewFile,BufRead *.m*down nnoremap 2 yypVr- +au BufNewFile,BufRead *.m*down nnoremap 3 I### + +au BufNewFile,BufRead *.vim setlocal foldmethod=marker -au BufNewFile,BufRead *.vim set foldmethod=marker +au BufNewFile,BufRead urls.py setlocal nowrap +au BufNewFile,BufRead settings.py normal! zR +au BufNewFile,BufRead dashboard.py normal! zR -au BufNewFile,BufRead urls.py set nowrap +au BufRead,BufNewFile /etc/nginx/conf/* set ft=nginx +au BufRead,BufNewFile /etc/nginx/sites-available/* set ft=nginx +au BufRead,BufNewFile /usr/local/etc/nginx/sites-available/* set ft=nginx " Sort CSS map S ?{jV/^\s*\}?$k:sort:noh @@ -178,23 +193,9 @@ au BufNewFile,BufRead *.js set errorformat=%-P-----\ FILE\ \ :\ \ %f\ -----,Line\ %l\\,\ E:%n:\ %m,%-Q,%-GFound\ %s,%-GSome\ %s,%-Gfixjsstyle%s,%-Gscript\ can\ %s,%-G " TESTING GOAT APPROVES OF THESE LINES -au BufNewFile,BufRead test_*.py set makeprg=nosetests\ --machine-out\ --nocapture -au BufNewFile,BufRead test_*.py set shellpipe=2>&1\ >/dev/null\ \|\ tee -au BufNewFile,BufRead test_*.py set errorformat=%f:%l:\ %m -au BufNewFile,BufRead test_*.py nmap N :make nmap fn :cn nmap fp :cp -" TODO: Put this in filetype-specific files -au BufNewFile,BufRead *.less set foldmethod=marker -au BufNewFile,BufRead *.less set foldmarker={,} -au BufNewFile,BufRead *.less set nocursorline -au BufRead,BufNewFile /etc/nginx/conf/* set ft=nginx -au BufRead,BufNewFile /etc/nginx/sites-available/* set ft=nginx -au BufRead,BufNewFile /usr/local/etc/nginx/sites-available/* set ft=nginx -au BufNewFile,BufRead *.js set foldmethod=marker -au BufNewFile,BufRead *.js set foldmarker={,} - " Easier linewise reselection map v V`] @@ -216,9 +217,6 @@ nnoremap Vit vitVkoj nnoremap Vat vatV -" Diff -nmap d :!hg diff % - " Rainbows! nmap R :RainbowParenthesesToggle @@ -377,6 +375,56 @@ omap i∑ CamelCaseMotion_iw xmap i∑ CamelCaseMotion_iw +" Diff +let g:HgDiffing = 0 +function! s:HgDiffCurrentFile() + if g:HgDiffing == 1 + if bufwinnr(bufnr('__HGDIFF__')) != -1 + exe bufwinnr(bufnr('__HGDIFF__')) . "wincmd w" + bdelete + endif + + diffoff! + + let g:HgDiffing = 0 + + return + endif + + let fname = bufname('%') + let ftype = &ft + diffthis + + vnew __HGDIFF__ + + setlocal buftype=nofile + setlocal bufhidden=hide + setlocal noswapfile + setlocal nobuflisted + exec 'setlocal filetype='.ftype + + setlocal modifiable + + silent normal! ggdG + silent exec ':r!hg cat ' . fname + silent normal! ggdd + + setlocal nomodifiable + + diffthis + + wincmd l + + let g:HgDiffing = 1 + + return +endfunction + +command! HgDiffCurrent call s:HgDiffCurrentFile() + +nmap d :HgDiffCurrent + +" MacVim if has('gui_running') set guifont=Menlo:h12 @@ -394,6 +442,9 @@ let g:sparkupExecuteMapping = '' highlight SpellBad term=underline gui=undercurl guisp=Orange + + inoremenu &Plugin.QuickCursor.CloseBuffer :w:BufClose + nnoremenu &Plugin.QuickCursor.CloseBuffer :w:BufClose else set nocursorline endif diff -r bb44f2206b1c -r 1d88d4630cf7 vim/plugin/BufClose.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/plugin/BufClose.vim Tue Jan 11 09:24:35 2011 -0500 @@ -0,0 +1,98 @@ +" BufClose.vim - Close a buffer without closing the window it's in. +" +" Copyright February 2003 by Christian J. Robinson +" +" Distributed under the terms of the Vim license. See ":help license". + +" Usage: +" +" :BufClose[!] [buffer] +" +" Without any arguments the current buffer in the current window is closed. +" With an argument that buffer is closed if it exists and is currently being +" displayed in a window. +" +" The buffer argument can be a buffer name or number. +" +" In both cases if the buffer is modified you have to use ! or an error will +" be issued and the buffer will be left loaded. +" +" Configuration: +" +" g:BufClose_AltBuffer +" +" Set this variable if you don't want a blank buffer to be loaded in place of +" the buffer being closed. Examples: +" +" :let g:BufClose_AltBuffer = '#' +" +" This will cause :BufClose to load the alternate buffer. See ":help :_#". +" +" :let g:BufClose_AltBuffer = '.' +" +" This will cause :BufClose to load the current directory in the file +" explorer. + +command! -nargs=? -complete=buffer -bang BufClose + \ :call BufClose(expand(''), expand('')) + +function! BufClose(buffer, bang) + if a:buffer == '' + " No buffer provided, use current buffer in the current window. + let buffer = bufnr('%') + elseif (a:buffer + 0) > 0 + " A buffer number was provided. + let buffer = bufnr(a:buffer + 0) + else + " A buffer name was provided. + let buffer = bufnr(a:buffer) + endif + + if buffer == -1 + echohl ErrorMsg + echomsg "No matching buffer for" a:buffer + echohl None + return + endif + + let current_window = winnr() + let buffer_window = bufwinnr(buffer) + + if buffer_window == -1 + echohl ErrorMsg + echomsg "Buffer" buffer "isn't open in any windows." + echohl None + return + endif + + if a:bang == '' && getbufvar(buffer, '&modified') + echohl ErrorMsg + echomsg 'No write since last change for buffer' + \ buffer '(add ! to override)' + echohl None + return + endif + + " Move to the proper window if necessary, open a blank buffer, + " then move back to the original window... + if buffer_window >= 0 + if current_window == buffer_window + if exists('g:BufClose_AltBuffer') + exe 'e' . a:bang . ' ' . g:BufClose_AltBuffer + else + exe 'enew' . a:bang + endif + else + exe 'norm ' . buffer_window . "\w" + if exists('g:BufClose_AltBuffer') + exe 'e' . a:bang . ' ' . g:BufClose_AltBuffer + else + exe 'enew' . a:bang + endif + exe 'norm ' . current_window . "\w" + endif + endif + + " ...and delete the specified buffer. + silent exe 'bdel' . a:bang . ' ' . buffer +endfunction diff -r bb44f2206b1c -r 1d88d4630cf7 vim/snippets/javascript.snippets --- a/vim/snippets/javascript.snippets Mon Dec 27 16:10:25 2010 -0500 +++ b/vim/snippets/javascript.snippets Tue Jan 11 09:24:35 2011 -0500 @@ -72,3 +72,5 @@ # Get Element snippet gett getElementBy${1:Id}('${2}')${3} +snippet log + console.log(${1});${2}