7eae993ccc65

Merge.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 17 Jun 2011 10:41:38 -0400
parents e93c240fe42c (diff) f1808d07caa0 (current diff)
children 517ccbe9799e
branches/tags (none)
files .hgsubstate

Changes

--- a/.hgrc	Tue Jun 14 22:27:55 2011 -0400
+++ b/.hgrc	Fri Jun 17 10:41:38 2011 -0400
@@ -2,6 +2,7 @@
 username = Steve Losh <steve@stevelosh.com>
 editor = vim
 commitsubrepos = False
+ignore = ~/.hgignore
 
 [extensions]
 transplant = 
--- a/.hgsubstate	Tue Jun 14 22:27:55 2011 -0400
+++ b/.hgsubstate	Fri Jun 17 10:41:38 2011 -0400
@@ -17,4 +17,4 @@
 4995b244e11d5aaa9956bba061c32140e6af8705 vim/bundle/threesome
 b9b4407a19acc4eb344cca0cc5beea75e9ff5491 vim/bundle/vim-coffee-script
 c2df2e430d7d5fe645aa40e36079ab51f082e06b vim/bundle/vim-javascript
-3d1692f635579e718b85dd8f24ac7fbd52a444f6 vim/bundle/vim-orgmode
+24c00fcb00145bd283fc6d2b4494ab02a46941f6 vim/bundle/vim-orgmode
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hgignore	Fri Jun 17 10:41:38 2011 -0400
@@ -0,0 +1,5 @@
+syntax: glob
+
+.DS_Store
+*.pyc
+tags
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/keyremap4macbook/private.xml	Fri Jun 17 10:41:38 2011 -0400
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+<root>
+  <list>
+    <item>
+      <name>Shift_R to Backspace</name>
+      <identifier>private.shift_r_to_backspace</identifier>
+      <autogen>--KeyToKey-- KeyCode::SHIFT_R, KeyCode::DELETE</autogen>
+    </item>
+  </list>
+  <list>
+    <item>
+      <name>Option+CR to something that actually works</name>
+      <identifier>private.alt_cr</identifier>
+      <autogen>--KeyToKey-- KeyCode::RETURN, VK_OPTION, KeyCode::DOT, ModifierFlag::OPTION_L</autogen>
+    </item>
+  </list>
+  <list>
+    <item>
+      <name>Ctrl+; to something that actually works (Ctrl+G)</name>
+      <identifier>private.ctrl_semicolon_to_ctrl_g</identifier>
+      <autogen>--KeyToKey-- KeyCode::SEMICOLON, VK_CONTROL, KeyCode::G, ModifierFlag::CONTROL_L</autogen>
+    </item>
+  </list>
+
+  <list>
+    <item>
+      <name>Swap parens and brackets</name>
+      <identifier>private.swap_parens_and_brackets</identifier>
+      <autogen>--KeyToKey-- KeyCode::BRACKET_LEFT,  ModifierFlag::NONE, KeyCode::KEY_9, ModifierFlag::SHIFT_R</autogen>
+      <autogen>--KeyToKey-- KeyCode::BRACKET_RIGHT, ModifierFlag::NONE, KeyCode::KEY_0, ModifierFlag::SHIFT_R</autogen>
+      <autogen>--KeyToKey-- KeyCode::KEY_9,         ModifierFlag::SHIFT_L, KeyCode::BRACKET_LEFT</autogen>
+      <autogen>--KeyToKey-- KeyCode::KEY_0,         ModifierFlag::SHIFT_L, KeyCode::BRACKET_RIGHT</autogen>
+    </item>
+  </list>
+
+  <list>
+    <item>
+      <name>Use the correct goddamed shift keys.</name>
+      <identifier>private.fucking_shift_keys_how_do_they_work</identifier>
+
+      <autogen>--KeyToKey-- KeyCode::Q, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::W, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::E, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::R, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::T, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::A, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::S, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::D, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::F, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::G, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::Z, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::X, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::C, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::V, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
+
+      <autogen>--KeyToKey-- KeyCode::Y,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::U,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::I,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::O,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::P,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::H,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::J,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::K,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::L,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::SEMICOLON, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::N,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::M,         ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::COMMA,     ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::DOT,       ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+      <autogen>--KeyToKey-- KeyCode::QUOTE,     ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
+    </item>
+  </list>
+</root>
+
--- a/vim/.vimrc	Tue Jun 14 22:27:55 2011 -0400
+++ b/vim/.vimrc	Fri Jun 17 10:41:38 2011 -0400
@@ -641,10 +641,12 @@
 
 if len( swanks ) == 0
     " Try to find SWANK in the standard SLIME installation locations
-    if g:slimv_windows || g:slimv_cygwin
-        let swanks = split( globpath( 'c:/slime/,c:/*lisp*/slime/,c:/*lisp*/site/lisp/slime/,c:/Program Files/*lisp*/site/lisp/slime/', 'start-swank.lisp' ), '\n' )
-    else
-        let swanks = split( globpath( '/usr/share/common-lisp/source/slime/', 'start-swank.lisp' ), '\n' )
+    if exists('g:slimv_windows')
+        if g:slimv_windows || g:slimv_cygwin
+            let swanks = split( globpath( 'c:/slime/,c:/*lisp*/slime/,c:/*lisp*/site/lisp/slime/,c:/Program Files/*lisp*/site/lisp/slime/', 'start-swank.lisp' ), '\n' )
+        else
+            let swanks = split( globpath( '/usr/share/common-lisp/source/slime/', 'start-swank.lisp' ), '\n' )
+        endif
     endif
 endif
 
--- a/vim/ftplugin/python/folding.vim	Tue Jun 14 22:27:55 2011 -0400
+++ b/vim/ftplugin/python/folding.vim	Fri Jun 17 10:41:38 2011 -0400
@@ -47,6 +47,8 @@
 setlocal foldmethod=expr
 setlocal foldexpr=GetPythonFold(v:lnum)
 setlocal foldtext=PythonFoldText()
+nnoremap <buffer> <localleader>D :setlocal foldtext=PythonFoldTextDocstrings()<cr>
+nnoremap <buffer> <localleader>d :setlocal foldtext=PythonFoldText()<cr>
 
 function! PythonFoldText()
     " ignore decorators
@@ -68,6 +70,33 @@
     return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
 endfunction
 
+function! PythonFoldTextDocstrings()
+    " ignore decorators
+    let fs = v:foldstart
+    while getline(fs) =~ '^\s*@' | let fs = nextnonblank(fs + 1)
+    endwhile
+
+    " add docstrings
+    let line = getline(fs)
+    if getline(fs + 1) =~ '^\s*"""'
+        let line = line . "  (" . getline(fs + 1) . ")"
+        let line = substitute(line, '\s*"""', '', 'g')
+        let line = substitute(line, '"""', '', 'g')
+    endif
+
+    let nucolwidth = &fdc + &number * &numberwidth
+    let windowwidth = winwidth(0) - nucolwidth - 3
+    let foldedlinecount = v:foldend - v:foldstart
+
+    " expand tabs into spaces
+    let onetab = strpart('          ', 0, &tabstop)
+    let line = substitute(line, '\t', onetab, 'g')
+
+    let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
+    let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
+    return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
+endfunction
+
 function! GetBlockIndent(lnum)
     " Auxiliary function; determines the indent level of the surrounding def/class
     " "global" lines are level 0, first def &shiftwidth, and so on