f47fa6183dd6

A ton.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 04 Feb 2012 14:26:38 -0500
parents 7847c50e6b6e
children 1287b23ee8c3
branches/tags (none)
files .gitconfig .hgsubstate .pentadactylrc .zshrc dotcss/google.com.css vim/.vimrc vim/colors/molokai.vim vim/ftplugin/clojure/clojurefolding.vim vim/ftplugin/clojurescript/clojurefolding.vim vim/syntax/less.vim

Changes

--- a/.gitconfig	Tue Jan 31 19:35:33 2012 -0500
+++ b/.gitconfig	Sat Feb 04 14:26:38 2012 -0500
@@ -1,6 +1,6 @@
 [user]
-	name = Steve Losh
-	email = steve@stevelosh.com
+    name = Steve Losh
+    email = steve@stevelosh.com
 
 [core]
     pager = cat
@@ -32,7 +32,7 @@
     unstage = reset HEAD
     uns = reset HEAD
 
-    currentbranch = !git branch --contains HEAD | tr -s ' ' | cut -d ' ' -f2
+    currentbranch = !git branch --contains HEAD | grep '*' | tr -s ' ' | cut -d ' ' -f2
     fo = fetch origin
     fu = fetch upstream
     po = push origin
@@ -41,7 +41,7 @@
     uo = !git merge --ff-only origin/`git currentbranch`
 
 [push]
-	default = current
+    default = current
 
 [color]
     branch = auto
@@ -65,4 +65,4 @@
     cmd = "mvim -f $BASE $LOCAL $REMOTE $MERGED -c 'ThreesomeInit'"
     trustExitCode = true
 [web]
-	browser = open
+    browser = open
--- a/.hgsubstate	Tue Jan 31 19:35:33 2012 -0500
+++ b/.hgsubstate	Sat Feb 04 14:26:38 2012 -0500
@@ -1,5 +1,5 @@
 c711681883f3419b85494e3b285b988e8e2dcbca keymando/Plugins/abbrev
-c060c94622e92e091b2c67499fdda16d91b68c01 mercurial/templates
+4d95cb18a3b420154ef978c53de1d2e692f8343d mercurial/templates
 d2bb7878622e4c16203acf1c92a0f4bc7ac58003 vim/bundle/AnsiEsc.vim
 a41d5d52c39a31128e969e69acf800b198cb07f9 vim/bundle/ack
 420174fc537ba986a716964db7af0bd189252944 vim/bundle/ctrlp
@@ -15,7 +15,7 @@
 4df0cdc009e590c1d6ec32a2a3c12ff8deeb6f25 vim/bundle/powerline
 67033ee4b9ee6d4916752da5e360b65ddf2fb525 vim/bundle/python-mode
 fa3563dda862c1dc46ddac32d8a9f939e9077379 vim/bundle/rainbow-parentheses
-94be465cea8433908caaeea74422e1d28322a43e vim/bundle/slimv
+f5b2b1945dd65b0a3a6d75f9e8cdfe32011a180d vim/bundle/slimv
 c6197a10ace82e0fe0c08e5cf5c017b7069a978e vim/bundle/sparkup
 6eec2c131213850ed65fd6da494dfd1a0d620a4e vim/bundle/strftimedammit
 ac395b57fec47f034cba151d01669d134ac7041b vim/bundle/supertab
--- a/.pentadactylrc	Tue Jan 31 19:35:33 2012 -0500
+++ b/.pentadactylrc	Sat Feb 04 14:26:38 2012 -0500
@@ -26,8 +26,14 @@
 nnoremap K :tp<CR>
 
 " Finally I can overwrite the stupid fucking Firebug toggling correctly.
-nnoremap <c-f> <f12>
-nnoremap <c-g> <s-f12>
+" nnoremap <c-f> <f12>
+" nnoremap <c-g> <s-f12>
+
+nnoremap <c-g> <m-a-k>
+inoremap <c-g> <esc><m-a-k>
+
+nnoremap <c-f> <m-a-i>
+inoremap <c-f> <esc><m-a-i>
 
 " Shift is hard.
 nnoremap ; :
--- a/.zshrc	Tue Jan 31 19:35:33 2012 -0500
+++ b/.zshrc	Sat Feb 04 14:26:38 2012 -0500
@@ -23,6 +23,8 @@
 # Environment variables ------------------------------------------------------
 export EDITOR='vim'
 export PATH="$HOME/.gem/ruby/1.8/bin:${PATH}"
+export PATH="$HOME/bin:${PATH}"
+export PATH="$HOME/lib/dotfiles/bin:${PATH}"
 export PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:$PATH"
 export PATH="/opt/subversion/bin:${PATH}"
 export PATH="/usr/local/Cellar/ruby/1.9.2-p290/bin:${PATH}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dotcss/google.com.css	Sat Feb 04 14:26:38 2012 -0500
@@ -0,0 +1,3 @@
+button.gbil {
+    display: none;
+}
--- a/vim/.vimrc	Tue Jan 31 19:35:33 2012 -0500
+++ b/vim/.vimrc	Sat Feb 04 14:26:38 2012 -0500
@@ -139,7 +139,8 @@
 
 syntax on
 set background=dark
-colorscheme molokai
+" colorscheme molokai
+colorscheme badwolf
 
 " Highlight VCS conflict markers
 match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
@@ -360,23 +361,33 @@
     au FileType clojure call TurnOnClojureFolding()
     au FileType clojure compiler clojure
     au FileType clojure setlocal report=100000
-    au FileType clojure nnoremap <buffer> o jI<cr><esc>kA
-    au FileType clojure nnoremap <buffer> O I<cr><esc>kA
 
-    au BufWinEnter        Slimv.REPL.clj setlocal winfixwidth
-    au BufNewFile,BufRead Slimv.REPL.clj setlocal nowrap
-    au BufNewFile,BufRead Slimv.REPL.clj setlocal foldlevel=99
-    au BufNewFile,BufRead Slimv.REPL.clj nnoremap <buffer> A GA
-    au BufNewFile,BufRead Slimv.REPL.clj nnoremap <buffer> <localleader>R :emenu REPL.<Tab>
+    au BufWinEnter            SLIMV.REPL setlocal winfixwidth nolist
+    au BufNewFile,BufReadPost SLIMV.REPL setlocal nowrap foldlevel=99
+    au BufNewFile,BufReadPost SLIMV.REPL nnoremap <buffer> A GA
+    au BufNewFile,BufReadPost SLIMV.REPL nnoremap <buffer> <localleader>R :emenu REPL.<Tab>
 
     " Fix the eval mapping.
     au FileType clojure nmap <buffer> \ee \ed
 
+    " And the inspect mapping.
+    au FileType clojure nmap <buffer> \i \di
+
     " Indent top-level form.
     au FileType clojure nmap <buffer> <localleader>= v((((((((((((=%
+augroup END
 
-    " Use a swank command that works, and doesn't require new app windows.
-    au FileType clojure let g:slimv_swank_cmd='!dtach -n /tmp/dtach-swank.sock -r winch lein swank'
+" }}}
+" Clojurescript {{{
+
+augroup ft_clojurescript
+    au!
+
+    au BufNewFile,BufRead *.cljs set filetype=clojurescript
+    au FileType clojurescript call TurnOnClojureFolding()
+
+    " Send current toplevel form to dtach.
+    au FileType clojurescript nnoremap <buffer> \ee mz:call SelectToplevelForm()<cr>:call SendToDtach(1)<cr>`z
 augroup END
 
 " }}}
@@ -691,6 +702,7 @@
 nnoremap <leader>es <C-w>v<C-w>j:e ~/.vim/snippets/<cr>
 nnoremap <leader>eo <C-w>v<C-w>j:e ~/Dropbox/Org<cr>4j
 nnoremap <leader>eh <C-w>v<C-w>j:e ~/.hgrc<cr>
+nnoremap <leader>ep <C-w>v<C-w>j:e ~/.pentadactylrc<cr>
 nnoremap <leader>em <C-w>v<C-w>j:e ~/.mutt/muttrc<cr>
 nnoremap <leader>ez <C-w>v<C-w>j:e ~/lib/dotfiles/zsh<cr>4j
 nnoremap <leader>ek <C-w>v<C-w>j:e ~/lib/dotfiles/keymando/keymandorc.rb<cr>
@@ -833,6 +845,9 @@
 inoremap <c-cr> <esc>A<cr>
 inoremap <s-cr> <esc>A:<cr>
 
+" Toggle [I]nvisible Characters
+nnoremap <leader>I :set list!<cr>
+
 " Indent Guides {{{
 
 let g:indentguides_state = 0
@@ -1131,9 +1146,13 @@
 " }}}
 " SLIMV {{{
 
-"let g:slimv_lisp = '"java -cp `lein classpath` clojure.main"'
+let g:slimv_repl_name = 'SLIMV.REPL'
 let g:slimv_repl_split = 4
 let g:slimv_repl_syntax = 1
+let g:slimv_repl_wrap = 0
+
+" Use a swank command that works, and doesn't require new app windows.
+let g:slimv_swank_clojure = '!dtach -n /tmp/dtach-swank.sock -r winch lein swank'
 
 " }}}}
 " Sparkup {{{
@@ -1559,7 +1578,24 @@
 " }}}
 " Dtach ------------------------------------------------------------------- {{{
 
-vnoremap <localleader>e :<c-u>silent '<,'>w !dtach -s /tmp/target<cr>:silent !echo \| dtach -s /tmp/target<cr>
-nnoremap <localleader>e ^vg_:<c-u>silent '<,'>w !dtach -s /tmp/target<cr>
+function! SendToDtach(visual)
+    if a:visual
+        silent '<,'>w !dtach -s /tmp/target
+        silent !echo \| dtach -s /tmp/target
+    else
+        normal! ^vg_
+        silent '<,'>w !dtach -s /tmp/target
+        execute "normal! <esc>"
+    endif
+endfunction
+
+function! SelectToplevelForm()
+    " lol
+    silent! normal vabababababababababababababababababababababababababab
+endfunction
+
+
+nnoremap <localleader>e :call SendToDtach(0)
+vnoremap <localleader>e :call SendToDtach(1)
 
 " }}}
--- a/vim/colors/molokai.vim	Tue Jan 31 19:35:33 2012 -0500
+++ b/vim/colors/molokai.vim	Sat Feb 04 14:26:38 2012 -0500
@@ -8,8 +8,6 @@
 " by Hamish Stuart Macpherson
 "
 
-hi clear
-
 set background=dark
 let g:colors_name="molokai"
 
--- a/vim/ftplugin/clojure/clojurefolding.vim	Tue Jan 31 19:35:33 2012 -0500
+++ b/vim/ftplugin/clojure/clojurefolding.vim	Sat Feb 04 14:26:38 2012 -0500
@@ -3,51 +3,103 @@
 endif
 let loaded_clojurefolding=1
 
-" ---------------------------------------------------------------------------
-"  Automagic Clojure folding on defn's and defmacro's
-"
-function GetClojureFold()
-      if getline(v:lnum) =~ '^\s*(defn.*\s'
-            return ">1"
-      elseif getline(v:lnum) =~ '^\s*(def .*\s'
-            return ">1"
-      elseif getline(v:lnum) =~ '^\s*(defmacro.*\s'
-            return ">1"
-      elseif getline(v:lnum) =~ '^\s*(ns.*\s'
-            return ">1"
-      elseif getline(v:lnum) =~ '^\s*(defmethod.*\s'
-            return ">1"
-      elseif getline(v:lnum) =~ '^\s*(defpage.*\s'
-            return ">1"
-      elseif getline(v:lnum) =~ '^\s*(defpartial.*\s'
-            return ">1"
-      elseif getline(v:lnum) =~ '^\s*(deftest.*\s'
-            return ">1"
-      elseif getline(v:lnum) =~ '^\s*$'
-            let my_cljnum = v:lnum
-            let my_cljmax = line("$")
+let folded_forms = [
+            \ 'def',
+            \ 'defn',
+            \ 'defn-',
+            \ 'defprotocol',
+            \ 'defparser',
+            \ 'defmacro',
+            \ 'defmethod',
+            \ 'defmulti',
+            \ 'defonce',
+            \ 'defpage',
+            \ 'defpartial',
+            \ 'deftest',
+            \ 'defroutes',
+            \ 'ns'
+            \ ]
+let s:form_re      = '\v^\((' . join(folded_forms, '|') . ')\s'
+let s:form_re_bare = '\v^\((' . join(folded_forms, '|') . ')$'
 
-            while (1)
-                  let my_cljnum = my_cljnum + 1
-                  if my_cljnum > my_cljmax
-                        return "<1"
-                  endif
+function! s:NextNonBlankLineContents(start)
+    let lnum = a:start
+    let max = line("$")
 
-                  let my_cljdata = getline(my_cljnum)
+    while 1
+        let lnum += 1
 
-                  " If we match an empty line, stop folding
-                  if my_cljdata =~ '^$'
-                        return "<1"
-                  else
-                        return "="
-                  endif
-            endwhile
-      else
-            return "="
-      endif
+        " If we've run off the end of the file, return a blank string as
+        " a sentinel.
+        if lnum > max
+            return ""
+        endif
+
+        " Otherwise, get the contents.
+        let contents = getline(lnum)
+
+        " If they're non-blank, return it.  Otherwise we'll loop to the next
+        " line.
+        if contents =~ '\v\S'
+            return contents
+        endif
+    endwhile
 endfunction
 
-function TurnOnClojureFolding()
-      setlocal foldexpr=GetClojureFold()
-      setlocal foldmethod=expr
+function! GetClojureFold()
+    let line = getline(v:lnum)
+
+    if line =~ s:form_re || line =~ s:form_re_bare
+        " We're on one of the forms we want to fold.
+
+        let nextline = s:NextNonBlankLineContents(v:lnum)
+
+        " If we've run off the end of the file, this means we're on a top-level
+        " form with no later nonblank lines in the file.  This has to be a one
+        " liner, because there's no content left that could be closing parens!
+        if nextline == ""
+            return 0
+        elseif nextline =~ '\v^\s+'
+            " If it's indented, this almost certainly isn't a one-liner.  Fold
+            " away!
+            return ">1"
+        else
+            " Otherwise, the next non-blank line after this one is not
+            " indented.  This means we're on a one-liner, so we don't want to
+            " fold.
+            return 0
+        endif
+    elseif line =~ '^\s*$'
+        " We need to look at the next non-blank line to determine how to fold
+        " blank lines.
+        let nextline = s:NextNonBlankLineContents(v:lnum)
+
+        " If we've run off the end of the file, this means we're on one of
+        " a series of blank lines ending the file.  They shouldn't be folded
+        " with anything.
+        if nextline == ""
+            return 0
+        elseif nextline =~ '\v^\s+'
+            " If it's indented, we're in the middle of an existing form.
+            " Just fold with that.
+            return "="
+        else
+            " Otherwise, the next non-blank line after this one is not
+            " indented.  That means we need to close any existing folds
+            " here.
+            return "<1"
+        endif
+    elseif line =~ '\v^\s+\S'
+        " Indented content, fold it into any existing folds.
+        return "="
+    else
+        " We are sitting on a non-blank, non-indented line, but it's not one of
+        " our special top-level forms, so we'll just leave it alone.
+        return 0
+    endif
 endfunction
+
+function! TurnOnClojureFolding()
+    setlocal foldexpr=GetClojureFold()
+    setlocal foldmethod=expr
+endfunction
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/ftplugin/clojurescript/clojurefolding.vim	Sat Feb 04 14:26:38 2012 -0500
@@ -0,0 +1,1 @@
+../clojure/clojurefolding.vim
\ No newline at end of file
--- a/vim/syntax/less.vim	Tue Jan 31 19:35:33 2012 -0500
+++ b/vim/syntax/less.vim	Sat Feb 04 14:26:38 2012 -0500
@@ -42,6 +42,7 @@
 syn keyword cssTagName figcaption mark summary command datalist details output
 syn keyword cssTagName progress meter time embed keygen wbr audio video canvas
 
+
 syn match cssTagName "@page\>" nextgroup=cssDefinition
 
 syn match cssSelectorOp "[+>.]"
@@ -49,7 +50,7 @@
 syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" transparent contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
 
 try
-syn match cssIdentifier "#[A-Za-zÀ-ÿ_@][A-Za-zÀ-ÿ0-9_@-]*"
+syn match cssIdentifier "#[A-Za-zÀ-ÿ_@][A-Za-zÀ-ÿ0-9_@-]*"
 catch /^.*/
 syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*"
 endtry
@@ -187,7 +188,7 @@
 
 
 syn match lessComment "//.*$" contains=@Spell
-syn match lessVariable "@[A-Za-z_-][A-Za-z0-9_-]*" contained
+syn match lessVariable "@[A-Za-z_-][A-Za-z0-9_-]*"
 syn region lessVariableDefinition start="^@" end=";" contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssDefinition,cssClassName,cssTagName,cssIdentifier,lessComment,lessVariable,lessFunction
 
 " captures both the definition and the call
@@ -308,3 +309,4 @@
 
 " vim: ts=8
 
+