# HG changeset patch # User Steve Losh # Date 1307737106 14400 # Node ID b6df208fa0d1c54c4d3d9d31dfa9aff5356aff5b # Parent 9851cd10c5eb08b9640a450174f1f63c86dbf303 lol diff -r 9851cd10c5eb -r b6df208fa0d1 vim/.vimrc --- a/vim/.vimrc Thu Jun 09 15:50:30 2011 -0400 +++ b/vim/.vimrc Fri Jun 10 16:18:26 2011 -0400 @@ -236,12 +236,9 @@ " }}} " Various filetype-specific stuff --------------------------------------------- {{{ -" Cram {{{ +" C {{{ -au BufNewFile,BufRead *.t set filetype=cram - -let cram_fold=1 -autocmd Syntax cram setlocal foldlevel=1 +au FileType c setlocal foldmethod=syntax " }}} " Clojure {{{ @@ -252,47 +249,20 @@ au FileType clojure nmap ee 0;\et " }}} -" C {{{ +" Confluence {{{ -au FileType c setlocal foldmethod=syntax +au BufRead,BufNewFile *.confluencewiki setlocal filetype=confluencewiki + +" Wiki pages should be soft-wrapped. +au FileType confluencewiki setlocal wrap linebreak nolist " }}} -" HTML and HTMLDjango {{{ - -au BufNewFile,BufRead *.html setlocal filetype=htmldjango -au BufNewFile,BufRead *.html setlocal foldmethod=manual - -" Use f to fold the current tag. -au BufNewFile,BufRead *.html nnoremap f Vatzf -au BufNewFile,BufRead *.html nnoremap VV vatV +" Cram {{{ -" Use Shift-Return to turn this: -" | -" -" into this: -" -" | -" -au BufNewFile,BufRead *.html inoremap kA -au BufNewFile,BufRead *.html nnoremap vitavitoi +au BufNewFile,BufRead *.t set filetype=cram -" Sparkup mappings: -" -" to expand sparkup normally: -"

|

-" -" to force an expanded sparkup. -"

-" | -"

-au BufNewFile,BufRead *.html imap -au BufNewFile,BufRead *.html imap . - -" Django tags -au FileType jinja,htmldjango inoremap {%%} - -" Django variables -au FileType jinja,htmldjango inoremap {{}} +let cram_fold=1 +autocmd Syntax cram setlocal foldlevel=1 " }}} " CSS and LessCSS {{{ @@ -338,49 +308,6 @@ au BufNewFile,BufRead *.less inoremap { {}.kA " }}} -" Javascript {{{ - -au FileType javascript setlocal foldmethod=marker -au FileType javascript setlocal foldmarker={,} - -" }}} -" Confluence {{{ - -au BufRead,BufNewFile *.confluencewiki setlocal filetype=confluencewiki - -" Wiki pages should be soft-wrapped. -au FileType confluencewiki setlocal wrap linebreak nolist - -" }}} -" Fish {{{ - -au BufNewFile,BufRead *.fish setlocal filetype=fish - -" }}} -" Markdown {{{ - -au BufNewFile,BufRead *.m*down setlocal filetype=markdown - -" Use 1/2/3 to add headings. -au Filetype markdown nnoremap 1 yypVr= -au Filetype markdown nnoremap 2 yypVr- -au Filetype markdown nnoremap 3 I### - -" }}} -" Vim {{{ - -au FileType vim setlocal foldmethod=marker -au FileType help setlocal textwidth=78 - -" }}} -" Python {{{ - -au Filetype python noremap rr :RopeRename -au Filetype python vnoremap rm :RopeExtractMethod -au Filetype python noremap ri :RopeOrganizeImports -au FileType python setlocal omnifunc=pythoncomplete#Complete - -" }}} " Django {{{ au BufNewFile,BufRead urls.py setlocal nowrap @@ -398,6 +325,75 @@ au BufNewFile,BufRead common_settings.py setlocal foldmethod=marker " }}} +" Firefox {{{ + +au BufRead,BufNewFile ~/Library/Caches/* setlocal buftype=nofile + +" }}} +" Fish {{{ + +au BufNewFile,BufRead *.fish setlocal filetype=fish + +" }}} +" HTML and HTMLDjango {{{ + +au BufNewFile,BufRead *.html setlocal filetype=htmldjango +au BufNewFile,BufRead *.html setlocal foldmethod=manual + +" Use f to fold the current tag. +au BufNewFile,BufRead *.html nnoremap f Vatzf +au BufNewFile,BufRead *.html nnoremap VV vatV + +" Use Shift-Return to turn this: +" | +" +" into this: +" +" | +" +au BufNewFile,BufRead *.html inoremap kA +au BufNewFile,BufRead *.html nnoremap vitavitoi + +" Sparkup mappings: +" +" to expand sparkup normally: +"

|

+" +" to force an expanded sparkup. +"

+" | +"

+au BufNewFile,BufRead *.html imap +au BufNewFile,BufRead *.html imap . + +" Django tags +au FileType jinja,htmldjango inoremap {%%} + +" Django variables +au FileType jinja,htmldjango inoremap {{}} + +" }}} +" Javascript {{{ + +au FileType javascript setlocal foldmethod=marker +au FileType javascript setlocal foldmarker={,} + +" }}} +" Lisp {{{ + +au FileType lisp call TurnOnLispFolding() + +" }}} +" Markdown {{{ + +au BufNewFile,BufRead *.m*down setlocal filetype=markdown + +" Use 1/2/3 to add headings. +au Filetype markdown nnoremap 1 yypVr= +au Filetype markdown nnoremap 2 yypVr- +au Filetype markdown nnoremap 3 I### + +" }}} " Nginx {{{ au BufRead,BufNewFile /etc/nginx/conf/* set ft=nginx @@ -410,20 +406,18 @@ au BufNewFile,BufRead .pentadactylrc set filetype=pentadactyl " }}} -" Vagrant {{{ - -au BufRead,BufNewFile Vagrantfile set ft=ruby - -" }}} " Puppet {{{ au Filetype puppet setlocal foldmethod=marker au Filetype puppet setlocal foldmarker={,} " }}} -" Firefox {{{ +" Python {{{ -au BufRead,BufNewFile ~/Library/Caches/* setlocal buftype=nofile +au Filetype python noremap rr :RopeRename +au Filetype python vnoremap rm :RopeExtractMethod +au Filetype python noremap ri :RopeOrganizeImports +au FileType python setlocal omnifunc=pythoncomplete#Complete " }}} " ReStructuredText {{{ @@ -434,6 +428,17 @@ au Filetype rst nnoremap 4 yypVr` " }}} +" Vagrant {{{ + +au BufRead,BufNewFile Vagrantfile set ft=ruby + +" }}} +" Vim {{{ + +au FileType vim setlocal foldmethod=marker +au FileType help setlocal textwidth=78 + +" }}} " }}} " Quick editing --------------------------------------------------------------- {{{ @@ -645,6 +650,7 @@ if len( swanks ) != 0 let g:slimv_swank_cmd = '! dtach -n /tmp/swank.socket sbcl --load "' . swanks[0] . '"' + let g:slimv_swank_cmd = '! dtach -n /tmp/swank.socket clisp -i "' . swanks[0] . '"' endif diff -r 9851cd10c5eb -r b6df208fa0d1 vim/ftplugin/lisp/lispfolding.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/ftplugin/lisp/lispfolding.vim Fri Jun 10 16:18:26 2011 -0400 @@ -0,0 +1,43 @@ +if exists('loaded_lispfolding') || &cp + finish +endif +let loaded_lispfolding=1 + +" --------------------------------------------------------------------------- +" Automagic Lisp folding on defn's and defmacro's +" +function GetLispFold() + if getline(v:lnum) =~ '^\s*(defun.*\s' + return ">1" + elseif getline(v:lnum) =~ '^\s*(defmacro.*\s' + return ">1" + elseif getline(v:lnum) =~ '^\s*(defparameter.*\s' + return ">1" + elseif getline(v:lnum) =~ '^\s*$' + let my_lispnum = v:lnum + let my_lispmax = line("$") + + while (1) + let my_lispnum = my_lispnum + 1 + if my_lispnum > my_lispmax + return "<1" + endif + + let my_lispdata = getline(my_lispnum) + + " If we match an empty line, stop folding + if my_lispdata =~ '^$' + return "<1" + else + return "=" + endif + endwhile + else + return "=" + endif +endfunction + +function TurnOnLispFolding() + setlocal foldexpr=GetLispFold() + setlocal foldmethod=expr +endfunction diff -r 9851cd10c5eb -r b6df208fa0d1 zsh/misc.zsh --- a/zsh/misc.zsh Thu Jun 09 15:50:30 2011 -0400 +++ b/zsh/misc.zsh Fri Jun 10 16:18:26 2011 -0400 @@ -10,6 +10,9 @@ alias spotlight-on='sudo mdutil -a -i on && sudo mv /System/Library/CoreServices/SearchOff.bundle/ /System/Library/CoreServices/Search.bundle/ && killall SystemUIServer' alias mutt='cd ~/Desktop; mutt' +alias hi='pygmentize' + +function gimmeurjson() { curl "$*" | python -mjson.tool | pygmentize -l javascript; } function mdown () { (echo '