<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,19 +1,17 @@
 h1. Usage
 
-In your home directory, run:
-&lt;pre&gt;&lt;code&gt;
-git clone git://github.com/scrooloose/vimfiles.git .vim
-ln -s Projects/vimfiles .vim
+Clone this repo into your home directory either as .vim (linux) or vimfiles (MF
+Windows).
 
-&lt;/code&gt;&lt;/pre&gt;
+Then cd into the repo and run this to get the snippets submodule:
 
-Put this stuff in your ~/.vimrc
 &lt;pre&gt;&lt;code&gt;
-source ~/.vim/vimrc
+git submodule init
+git submodule update
+&lt;/code&gt;&lt;/pre&gt;
 
-colorscheme vibrantink
-set nu
-set sts=2
-set sw=2
-let g:fuzzy_ignore = &quot;gems/*&quot;
+Put this in your vimrc along with your personal hacks:
+&lt;pre&gt;&lt;code&gt;
+source ~/.vim/vimrc      &quot;linux
+source ~/vimfiles/vimrc  &quot;windows
 &lt;/code&gt;&lt;/pre&gt;</diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -33,8 +33,8 @@ fun! MakeSnip(scope, trigger, content, ...)
 		let {var}[a:scope][a:trigger] = multisnip ? [[a:1, a:content]] : a:content
 	elseif multisnip | let {var}[a:scope][a:trigger] += [[a:1, a:content]]
 	else
-		echom 'Warning in snipMate.vim: Snippet '.a:trigger.' is already defined.'
-				\ .' See :h multi_snip for help on snippets with multiple matches.'
+		&quot;echom 'Warning in snipMate.vim: Snippet '.a:trigger.' is already defined.'
+		&quot;		\ .' See :h multi_snip for help on snippets with multiple matches.'
 	endif
 endf
 </diff>
      <filename>plugin/snipMate.vim</filename>
    </modified>
    <modified>
      <diff>@@ -41,6 +41,11 @@ set statusline+=%{StatuslineTabWarning()}
 set statusline+=%*
 
 set statusline+=%{StatuslineTrailingSpaceWarning()}
+set statusline+=%{StatuslineLongLineWarning()}
+
+set statusline+=%#warningmsg#
+set statusline+=%{StatuslineSyntaxWarning()}
+set statusline+=%*
 
 &quot;display a warning if &amp;paste is set
 set statusline+=%#error#
@@ -103,6 +108,88 @@ function! StatuslineTabWarning()
     return b:statusline_tab_warning
 endfunction
 
+&quot;load all the syntax checkers
+runtime! syntax_checkers/*.vim
+
+&quot;recalculate the syntax warning when saving and changing filetype
+autocmd bufwritepost,filetype * unlet! b:statusline_syntax_warning
+
+&quot;return [syntax:X] if syntax errors are detected in the buffer, where X is the
+&quot;line number of the first error.
+&quot;return '' if no errors or if no syntax checker exists for the current filetype
+function! StatuslineSyntaxWarning()
+    if !exists(&quot;b:statusline_syntax_warning&quot;)
+        let b:statusline_syntax_warning =  ''
+
+        if exists(&quot;*CheckSyntax_&quot; . &amp;ft) &amp;&amp; filereadable(expand(&quot;%&quot;))
+            let first_err_line = CheckSyntax_{&amp;ft}()
+            if first_err_line != 0
+                let b:statusline_syntax_warning =  '[syntax:' . first_err_line . ']'
+            endif
+        endif
+    endif
+    return b:statusline_syntax_warning
+endfunction
+
+
+&quot;recalculate the long line warning when idle and after saving
+autocmd cursorhold,bufwritepost * unlet! b:statusline_long_line_warning
+
+&quot;return a warning for &quot;long lines&quot; where &quot;long&quot; is either &amp;textwidth or 80 (if
+&quot;no &amp;textwidth is set)
+&quot;
+&quot;return '' if no long lines
+&quot;return '[#x,my,$z] if long lines are found, were x is the number of long
+&quot;lines, y is the median length of the long lines and z is the length of the
+&quot;longest line
+function! StatuslineLongLineWarning()
+    if !exists(&quot;b:statusline_long_line_warning&quot;)
+        let long_line_lens = s:LongLines()
+
+        if len(long_line_lens) &gt; 0
+            let b:statusline_long_line_warning = &quot;[&quot; .
+                        \ '#' . len(long_line_lens) . &quot;,&quot; .
+                        \ 'm' . s:Median(long_line_lens) . &quot;,&quot; .
+                        \ '$' . max(long_line_lens) . &quot;]&quot;
+        else
+            let b:statusline_long_line_warning = &quot;&quot;
+        endif
+    endif
+    return b:statusline_long_line_warning
+endfunction
+
+&quot;return a list containing the lengths of the long lines in this buffer
+function! s:LongLines()
+    let threshold = (&amp;tw ? &amp;tw : 80)
+    let spaces = repeat(&quot; &quot;, &amp;ts)
+
+    let long_line_lens = []
+
+    let i = 1
+    while i &lt;= line(&quot;$&quot;)
+        let len = strlen(substitute(getline(i), '\t', spaces, 'g'))
+        if len &gt; threshold
+            call add(long_line_lens, len)
+        endif
+        let i += 1
+    endwhile
+
+    return long_line_lens
+endfunction
+
+&quot;find the median of the given array of numbers
+function! s:Median(nums)
+    let nums = sort(a:nums)
+    let l = len(nums)
+
+    if l % 2 == 1
+        let i = (l-1) / 2
+        return nums[i]
+    else
+        return (nums[l/2] + nums[(l/2)-1]) / 2
+    endif
+endfunction
+
 &quot;indent settings
 set shiftwidth=4
 set softtabstop=4
@@ -167,11 +254,20 @@ noremap Q gq
 nnoremap Y y$
 
 &quot;snipmate setup
-&quot;source ~/.vim/snippets/support_functions.vim
-&quot;autocmd vimenter * call ExtractSnips(&quot;~/.vim/snippets/ruby-rails&quot;, &quot;ruby&quot;)
-&quot;autocmd vimenter * call ExtractSnips(&quot;~/.vim/snippets/html&quot;, &quot;eruby&quot;)
-&quot;autocmd vimenter * call ExtractSnips(&quot;~/.vim/snippets/html&quot;, &quot;xhtml&quot;)
-&quot;autocmd vimenter * call ExtractSnips(&quot;~/.vim/snippets/html&quot;, &quot;php&quot;)
+source ~/.vim/snippets/support_functions.vim
+autocmd vimenter * call s:SetupSnippets()
+function! s:SetupSnippets()
+
+    &quot;if we're in a rails env then read in the rails snippets
+    if filereadable(&quot;./config/environment.rb&quot;)
+        call ExtractSnips(&quot;~/.vim/snippets/ruby-rails&quot;, &quot;ruby&quot;)
+        call ExtractSnips(&quot;~/.vim/snippets/eruby-rails&quot;, &quot;eruby&quot;)
+    endif
+
+    call ExtractSnips(&quot;~/.vim/snippets/html&quot;, &quot;eruby&quot;)
+    call ExtractSnips(&quot;~/.vim/snippets/html&quot;, &quot;xhtml&quot;)
+    call ExtractSnips(&quot;~/.vim/snippets/html&quot;, &quot;php&quot;)
+endfunction
 
 &quot;visual search mappings
 function! s:VSetSearch()
@@ -196,16 +292,15 @@ function! SetCursorPosition()
     end
 endfunction
 
-&quot;define :HighlightExcessColumns command to highlight the offending parts of
-&quot;lines that are &quot;too long&quot;. where &quot;too long&quot; is defined by &amp;textwidth or an
-&quot;arg passed to the command
-command! -nargs=? HighlightExcessColumns call s:HighlightExcessColumns('&lt;args&gt;')
-function! s:HighlightExcessColumns(width)
-    let targetWidth = a:width != '' ? a:width : &amp;textwidth
+&quot;define :HighlightLongLines command to highlight the offending parts of
+&quot;lines that are longer than the specified length (defaulting to 80)
+command! -nargs=? HighlightLongLines call s:HighlightLongLines('&lt;args&gt;')
+function! s:HighlightLongLines(width)
+    let targetWidth = a:width != '' ? a:width : 79
     if targetWidth &gt; 0
-        exec 'match Todo /\%&gt;' . (targetWidth+1) . 'v/'
+        exec 'match Todo /\%&gt;' . (targetWidth) . 'v/'
     else
-        echomsg &quot;HighlightExcessColumns: set a &amp;textwidth, or pass one in&quot;
+        echomsg &quot;Usage: HighlightLongLines [natural number]&quot;
     endif
 endfunction
 </diff>
      <filename>vimrc</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f571ba53732c338d99039883b0d937a1dd4d757a</id>
    </parent>
  </parents>
  <author>
    <name>Leon Li</name>
    <email>scorpio_leon@hotmail.com</email>
  </author>
  <url>http://github.com/scrooloose/vimfiles/commit/fc47f38ed944e08ae12af767f1d893e3c56dc0ee</url>
  <id>fc47f38ed944e08ae12af767f1d893e3c56dc0ee</id>
  <committed-date>2009-06-28T20:16:11-07:00</committed-date>
  <authored-date>2009-06-28T20:16:11-07:00</authored-date>
  <message>merge lastest changes from scrooloose</message>
  <tree>fc3d937b69a8f3feb50aa3b6be3a689be60ad676</tree>
  <committer>
    <name>Leon Li</name>
    <email>scorpio_leon@hotmail.com</email>
  </committer>
</commit>
