898c186130c5

Merge.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 26 Feb 2014 12:13:24 -0500
parents 4811a2814b49 (diff) 0a515c6eb4c4 (current diff)
children e0224a489d52 efcd701f7122
branches/tags (none)
files vim/vimrc

Changes

--- a/.hgsub	Wed Feb 26 12:12:26 2014 -0500
+++ b/.hgsub	Wed Feb 26 12:13:24 2014 -0500
@@ -34,7 +34,7 @@
 vim/bundle/scaladoc              = [git]git://github.com/sjl/vim-scaladoc.git
 vim/bundle/securemodelines       = [git]git://github.com/ciaranm/securemodelines.git
 vim/bundle/smartinput            = [git]git://github.com/kana/vim-smartinput.git
-vim/bundle/sparkup               = [git]git://github.com/sjl/vim-sparkup.git
+vim/bundle/sparkup               = [git]git://github.com/tristen/vim-sparkup.git
 vim/bundle/splice                = [hg]https://bitbucket.org/sjl/splice.vim
 vim/bundle/strftimedammit        = [hg]https://bitbucket.org/sjl/strftimedammit.vim/
 vim/bundle/surround              = [git]git://github.com/tpope/vim-surround.git
--- a/.hgsubstate	Wed Feb 26 12:12:26 2014 -0500
+++ b/.hgsubstate	Wed Feb 26 12:13:24 2014 -0500
@@ -34,7 +34,7 @@
 1f797fda2c457202cf62d9a082a3fccd4278e3bf vim/bundle/scaladoc
 10d6c6b52fcdd12f3ba457126f66fee4ccceec04 vim/bundle/securemodelines
 78ab4b3df24fa2753d3dfc1be75ed5a3df1565b8 vim/bundle/smartinput
-c6197a10ace82e0fe0c08e5cf5c017b7069a978e vim/bundle/sparkup
+0377b100382c19295b42018289fe8d42a7d57e80 vim/bundle/sparkup
 8e1c1dc358de2132b7fbc1adaf94f528e3238e4d vim/bundle/splice
 26fbdd7d1f1aa5600d2ebf39bbdd292c38aac16e vim/bundle/strftimedammit
 1a73f607f8f5477d6942df2eb6e7245c4864f4d3 vim/bundle/surround
--- a/bin/lein	Wed Feb 26 12:12:26 2014 -0500
+++ b/bin/lein	Wed Feb 26 12:13:24 2014 -0500
@@ -4,7 +4,7 @@
 # somewhere on your $PATH, like ~/bin. The rest of Leiningen will be
 # installed upon first run into the ~/.lein/self-installs directory.
 
-export LEIN_VERSION="2.1.2"
+export LEIN_VERSION="2.3.4"
 
 case $LEIN_VERSION in
     *SNAPSHOT) SNAPSHOT="YES" ;;
@@ -17,9 +17,15 @@
     delimiter=":"
 fi
 
+if [[ "$OSTYPE" == "cygwin" ]]; then
+  cygwin=true
+else
+  cygwin=false
+fi
+
 function make_native_path {
     # ensure we have native paths
-    if [[ "$OSTYPE" == "cygwin" && "$1"  == /* ]]; then
+    if $cygwin && [[ "$1"  == /* ]]; then
     echo -n "$(cygpath -wp "$1")"
     elif [[ "$OSTYPE" == "msys" && "$1"  == /* ]]; then
     echo -n "$(sh -c "(cd $1 2</dev/null && pwd -W) || echo $1 | sed 's/^\\/\([a-z]\)/\\1:/g'")"
@@ -39,6 +45,38 @@
     done
 }
 
+function download_failed_message {
+    echo "Failed to download $1"
+    echo "It's possible your HTTP client's certificate store does not have the"
+    echo "correct certificate authority needed. This is often caused by an"
+    echo "out-of-date version of libssl. Either upgrade it or set HTTP_CLIENT"
+    echo "to turn off certificate checks:"
+    echo "  export HTTP_CLIENT=\"wget --no-check-certificate -O\" # or"
+    echo "  export HTTP_CLIENT=\"curl --insecure -f -L -o\""
+    echo "It's also possible that you're behind a firewall haven't yet"
+    echo "set HTTP_PROXY and HTTPS_PROXY."
+}
+
+function self_install {
+  if [ -r "$LEIN_JAR" ]; then
+    echo "The self-install jar already exists at $LEIN_JAR."
+    echo "If you wish to re-download, delete it and rerun \"$0 self-install\"."
+    exit 1
+  fi
+  echo "Downloading Leiningen to $LEIN_JAR now..."
+  mkdir -p "$(dirname "$LEIN_JAR")"
+  LEIN_URL="https://leiningen.s3.amazonaws.com/downloads/leiningen-$LEIN_VERSION-standalone.jar"
+  $HTTP_CLIENT "$LEIN_JAR.pending" "$LEIN_URL"
+  if [ $? == 0 ]; then
+      # TODO: checksum
+      mv -f "$LEIN_JAR.pending" "$LEIN_JAR"
+  else
+      rm "$LEIN_JAR.pending" 2> /dev/null
+      download_failed_message "$LEIN_URL"
+      exit 1
+  fi
+}
+
 if [ `id -u` -eq 0 ] && [ "$LEIN_ROOT" = "" ]; then
     echo "WARNING: You're currently running as root; probably by accident."
     echo "Press control-C to abort or Enter to continue as root."
@@ -65,7 +103,7 @@
   fi
 done
 
-if [ "$OSTYPE" = "cygwin" ]; then
+if $cygwin; then
     export LEIN_HOME=`cygpath -w "$LEIN_HOME"`
 fi
 
@@ -93,6 +131,19 @@
 
 export LEIN_JVM_OPTS="${LEIN_JVM_OPTS-"-XX:+TieredCompilation -XX:TieredStopAtLevel=1"}"
 
+# This needs to be defined before we call HTTP_CLIENT below
+if [ "$HTTP_CLIENT" = "" ]; then
+    if type -p curl >/dev/null 2>&1; then
+        if [ "$https_proxy" != "" ]; then
+            CURL_PROXY="-x $https_proxy"
+        fi
+        HTTP_CLIENT="curl $CURL_PROXY -f -L -o"
+    else
+        HTTP_CLIENT="wget -O"
+    fi
+fi
+
+
 # When :eval-in :classloader we need more memory
 grep -E -q '^\s*:eval-in\s+:classloader\s*$' project.clj 2> /dev/null && \
     export LEIN_JVM_OPTS="$LEIN_JVM_OPTS -Xms64m -Xmx512m"
@@ -146,33 +197,10 @@
     BOOTCLASSPATH="-Xbootclasspath/a:$LEIN_JAR"
 
     if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
-        "$0" self-install
+        self_install
     fi
 fi
 
-if [ "$HTTP_CLIENT" = "" ]; then
-    if type -p curl >/dev/null 2>&1; then
-        if [ "$https_proxy" != "" ]; then
-            CURL_PROXY="-x $https_proxy"
-        fi
-        HTTP_CLIENT="curl $CURL_PROXY -f -L -o"
-    else
-        HTTP_CLIENT="wget -O"
-    fi
-fi
-
-function download_failed_message {
-    echo "Failed to download $1"
-    echo "It's possible your HTTP client's certificate store does not have the"
-    echo "correct certificate authority needed. This is often caused by an"
-    echo "out-of-date version of libssl. Either upgrade it or set HTTP_CLIENT"
-    echo "to turn off certificate checks:"
-    echo "  export HTTP_CLIENT=\"wget --no-check-certificate -O\" # or"
-    echo "  export HTTP_CLIENT=\"curl --insecure -f -L -o\""
-    echo "It's also possible that you're behind a firewall haven't yet"
-    echo "set HTTP_PROXY and HTTPS_PROXY."
-}
-
 # TODO: explain what to do when Java is missing
 export JAVA_CMD="${JAVA_CMD:-"java"}"
 export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-$JAVA_CMD}"
@@ -184,6 +212,19 @@
 # Support $JAVA_OPTS for backwards-compatibility.
 export JVM_OPTS="${JVM_OPTS:-"$JAVA_OPTS"}"
 
+# Handle jline issue with cygwin not propagating OSTYPE through java subprocesses: https://github.com/jline/jline2/issues/62
+cygterm=false
+if $cygwin; then
+  case "$TERM" in
+    rxvt* | xterm* | vt*) cygterm=true ;;
+  esac
+fi
+
+if $cygterm; then
+  LEIN_JVM_OPTS="$LEIN_JVM_OPTS -Djline.terminal=jline.UnixTerminal"
+  stty -icanon min 1 -echo > /dev/null 2>&1
+fi
+
 # TODO: investigate http://skife.org/java/unix/2011/06/20/really_executable_jars.html
 # If you're packaging this for a package manager (.deb, homebrew, etc)
 # you need to remove the self-install and upgrade functionality or see lein-pkg.
@@ -192,24 +233,10 @@
         echo "Running self-install from a checkout is not supported."
         echo "See CONTRIBUTING.md for SNAPSHOT-specific build instructions."
         exit 1
-    elif [ -r "$LEIN_JAR" ]; then
-      echo "The self-install jar already exists at $LEIN_JAR."
-      echo "If you wish to re-download, delete it and rerun \"$0 self-install\"."
-      exit 1
     fi
-    echo "Downloading Leiningen to $LEIN_JAR now..."
-    mkdir -p "$(dirname "$LEIN_JAR")"
-    LEIN_URL="https://leiningen.s3.amazonaws.com/downloads/leiningen-$LEIN_VERSION-standalone.jar"
-    $HTTP_CLIENT "$LEIN_JAR.pending" "$LEIN_URL"
-    if [ $? == 0 ]; then
-        # TODO: checksum
-        mv -f "$LEIN_JAR.pending" "$LEIN_JAR"
-    else
-        rm "$LEIN_JAR.pending" 2> /dev/null
-        download_failed_message "$LEIN_URL"
-        exit 1
-    fi
-elif [ "$1" = "upgrade" ]; then
+    echo "Manual self-install is deprecated; it will run automatically when necessary."
+    self_install
+elif [ "$1" = "upgrade" ] || [ "$1" = "downgrade" ]; then
     if [ "$LEIN_DIR" != "" ]; then
         echo "The upgrade task is not meant to be run from a checkout."
         exit 1
@@ -232,17 +259,14 @@
                 echo
                 echo "Upgrading..."
                 TARGET="/tmp/lein-$$-upgrade"
-                if [ "$OSTYPE" = "cygwin" ]; then
+                if $cygwin; then
                     TARGET=`cygpath -w $TARGET`
                 fi
                 LEIN_SCRIPT_URL="https://github.com/technomancy/leiningen/raw/$TARGET_VERSION/bin/lein"
                 $HTTP_CLIENT "$TARGET" "$LEIN_SCRIPT_URL"
                 if [ $? == 0 ]; then
-                    mv "$TARGET" "$SCRIPT" \
-                        && chmod +x "$SCRIPT" \
-                        && echo && "$SCRIPT" self-install \
-                        && echo && echo "Now running" `$SCRIPT version`
-                    exit $?
+                    mv "$TARGET" "$SCRIPT" && chmod +x "$SCRIPT"
+                    exec "$SCRIPT" version
                 else
                     download_failed_message "$LEIN_SCRIPT_URL"
                 fi;;
@@ -252,7 +276,7 @@
         esac
     fi
 else
-    if [ "$OSTYPE" = "cygwin" ]; then
+    if $cygwin; then
         # When running on Cygwin, use Windows-style paths for java
         ORIGINAL_PWD=`cygpath -w "$ORIGINAL_PWD"`
     fi
@@ -268,16 +292,16 @@
 
     if ([ "$LEIN_FAST_TRAMPOLINE" != "" ] || [ -r .lein-fast-trampoline ]) &&
         [ -r project.clj ]; then
-        INPUTS="$@ $(cat project.clj) $LEIN_VERSION $(cat "$LEIN_HOME/profiles.clj")"
+        INPUTS="$@ $(cat project.clj) $LEIN_VERSION $(test -f "$LEIN_HOME/profiles.clj" && cat "$LEIN_HOME/profiles.clj")"
         INPUT_CHECKSUM=$(echo $INPUTS | shasum - | cut -f 1 -d " ")
         # Just don't change :target-path in project.clj, mkay?
         TRAMPOLINE_FILE="target/trampolines/$INPUT_CHECKSUM"
     else
-        TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
+        TRAMPOLINE_FILE="$(mktemp /tmp/lein-trampoline-XXXXXXXXXXXXX)"
         trap "rm -f $TRAMPOLINE_FILE" EXIT
     fi
 
-    if [ "$OSTYPE" = "cygwin" ]; then
+    if $cygwin; then
         TRAMPOLINE_FILE=`cygpath -w $TRAMPOLINE_FILE`
     fi
 
@@ -300,14 +324,25 @@
 
         EXIT_CODE=$?
 
+        if $cygterm ; then
+          stty icanon echo > /dev/null 2>&1
+        fi
+
+        ## TODO: [ -r "$TRAMPOLINE_FILE" ] may be redundant? A trampoline file
+        ## is always generated these days.
         if [ -r "$TRAMPOLINE_FILE" ] && [ "$LEIN_TRAMPOLINE_WARMUP" = "" ]; then
             TRAMPOLINE="$(cat $TRAMPOLINE_FILE)"
             if [ "$INPUT_CHECKSUM" = "" ]; then
                 rm $TRAMPOLINE_FILE
             fi
-            exec sh -c "exec $TRAMPOLINE"
+            if [ "$TRAMPOLINE" = "" ]; then
+                exit $EXIT_CODE
+            else
+                exec sh -c "exec $TRAMPOLINE"
+            fi
         else
             exit $EXIT_CODE
         fi
     fi
 fi
+
--- a/pentadactylrc	Wed Feb 26 12:12:26 2014 -0500
+++ b/pentadactylrc	Wed Feb 26 12:13:24 2014 -0500
@@ -12,7 +12,7 @@
 
 set runtimepath=/Users/sjl/.pentadactyl
 set editor='/usr/local/bin/mvim -f +<line> <file>'
-set followhints=1
+" "set followhints=1
 set showtabline=multitab
 set showstatuslinks=command
 
--- a/vim/vimrc	Wed Feb 26 12:12:26 2014 -0500
+++ b/vim/vimrc	Wed Feb 26 12:13:24 2014 -0500
@@ -2217,6 +2217,32 @@
 " }}}
 
 " }}}
+" MarkChanged {{{
+
+sign define line_changed text=+ texthl=DiffAdded
+
+function! MarkChanged(s, e)
+    for i in range(a:s, a:e)
+        exe ":sign place " . i . " line=" . i . " name=line_changed file=" . expand("%:p")
+    endfor
+endfunction
+
+function! MarkUnchanged(s, e)
+    for i in range(a:s, a:e)
+        call cursor(i, 0)
+        silent! sign unplace
+    endfor
+endfunction
+
+command! -range MarkChanged call MarkChanged(<line1>, <line2>)
+command! -range MarkUnchanged call MarkUnchanged(<line1>, <line2>)
+
+" nnoremap <leader>m :MarkChanged<cr>
+" vnoremap <leader>m :MarkChanged<cr>
+" nnoremap <leader>M :MarkUnchanged<cr>
+" vnoremap <leader>M :MarkUnchanged<cr>
+
+" }}}
 
 " }}}
 " Environments (GUI/Console) ---------------------------------------------- {{{