b6df208fa0d1

lol
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 10 Jun 2011 16:18:26 -0400
parents 9851cd10c5eb
children 47bf5a91934d
branches/tags (none)
files vim/.vimrc vim/ftplugin/lisp/lispfolding.vim zsh/misc.zsh

Changes

--- 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 <localleader>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 <localleader>f to fold the current tag.
-au BufNewFile,BufRead *.html nnoremap <buffer> <localleader>f Vatzf
-au BufNewFile,BufRead *.html nnoremap <buffer> VV vatV
+" Cram {{{
 
-" Use Shift-Return to turn this:
-"     <tag>|</tag>
-"
-" into this:
-"     <tag>
-"         |
-"     </tag>
-au BufNewFile,BufRead *.html inoremap <buffer> <s-cr> <cr><esc>kA<cr>
-au BufNewFile,BufRead *.html nnoremap <buffer> <s-cr> vit<esc>a<cr><esc>vito<esc>i<cr><esc>
+au BufNewFile,BufRead *.t set filetype=cram
 
-" Sparkup mappings:
-"
-" <c-e><space> to expand sparkup normally:
-"     <p>|</p>
-"
-" <c-e><return> to force an expanded sparkup.
-"     <p>
-"         |
-"     </p>
-au BufNewFile,BufRead *.html imap <buffer> <c-s><cr> <c-s><s-cr>
-au BufNewFile,BufRead *.html imap <buffer> <c-s><space> <c-s>.<bs>
-
-" Django tags
-au FileType jinja,htmldjango inoremap <buffer> <c-t> {%<space><space>%}<left><left><left>
-
-" Django variables
-au FileType jinja,htmldjango inoremap <buffer> <c-f> {{<space><space>}}<left><left><left>
+let cram_fold=1
+autocmd Syntax cram setlocal foldlevel=1
 
 " }}}
 " CSS and LessCSS {{{
@@ -338,49 +308,6 @@
 au BufNewFile,BufRead *.less inoremap <buffer> {<cr> {}<left><cr>.<cr><esc>kA<bs><space><space><space><space>
 
 " }}}
-" 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 <localleader>1/2/3 to add headings.
-au Filetype markdown nnoremap <buffer> <localleader>1 yypVr=
-au Filetype markdown nnoremap <buffer> <localleader>2 yypVr-
-au Filetype markdown nnoremap <buffer> <localleader>3 I### <ESC>
-
-" }}}
-" Vim {{{
-
-au FileType vim setlocal foldmethod=marker
-au FileType help setlocal textwidth=78
-
-" }}}
-" Python {{{
-
-au Filetype python noremap  <localleader>rr :RopeRename<CR>
-au Filetype python vnoremap <localleader>rm :RopeExtractMethod<CR>
-au Filetype python noremap  <localleader>ri :RopeOrganizeImports<CR>
-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 <localleader>f to fold the current tag.
+au BufNewFile,BufRead *.html nnoremap <buffer> <localleader>f Vatzf
+au BufNewFile,BufRead *.html nnoremap <buffer> VV vatV
+
+" Use Shift-Return to turn this:
+"     <tag>|</tag>
+"
+" into this:
+"     <tag>
+"         |
+"     </tag>
+au BufNewFile,BufRead *.html inoremap <buffer> <s-cr> <cr><esc>kA<cr>
+au BufNewFile,BufRead *.html nnoremap <buffer> <s-cr> vit<esc>a<cr><esc>vito<esc>i<cr><esc>
+
+" Sparkup mappings:
+"
+" <c-e><space> to expand sparkup normally:
+"     <p>|</p>
+"
+" <c-e><return> to force an expanded sparkup.
+"     <p>
+"         |
+"     </p>
+au BufNewFile,BufRead *.html imap <buffer> <c-s><cr> <c-s><s-cr>
+au BufNewFile,BufRead *.html imap <buffer> <c-s><space> <c-s>.<bs>
+
+" Django tags
+au FileType jinja,htmldjango inoremap <buffer> <c-t> {%<space><space>%}<left><left><left>
+
+" Django variables
+au FileType jinja,htmldjango inoremap <buffer> <c-f> {{<space><space>}}<left><left><left>
+
+" }}}
+" 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 <localleader>1/2/3 to add headings.
+au Filetype markdown nnoremap <buffer> <localleader>1 yypVr=
+au Filetype markdown nnoremap <buffer> <localleader>2 yypVr-
+au Filetype markdown nnoremap <buffer> <localleader>3 I### <ESC>
+
+" }}}
 " 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  <localleader>rr :RopeRename<CR>
+au Filetype python vnoremap <localleader>rm :RopeExtractMethod<CR>
+au Filetype python noremap  <localleader>ri :RopeOrganizeImports<CR>
+au FileType python setlocal omnifunc=pythoncomplete#Complete
 
 " }}}
 " ReStructuredText {{{
@@ -434,6 +428,17 @@
 au Filetype rst nnoremap <buffer> <localleader>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
 
 
--- /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
--- 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 '