<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -112,6 +112,7 @@ ctrl-]:: Jump to definitio (requires exuberant ctags[http://blog.tobiascrawley.n
 ,s:: Show/hide hidden characters
 ,h:: Hide search highlighting
 ,w:: Toggle word wrapping
+,sw:: Strip trailing whitespace
 
 = Commands
 </diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,7 @@ set number &quot; line numbers
 set scrolloff=3 &quot; More context around cursor
 set hlsearch  &quot; highlight search matches...
 set incsearch &quot; ...as you type
-set ignorecase 
+set ignorecase
 set smartcase
 set hidden &quot; Allow buffer switching without saving
 set history=1000
@@ -82,7 +82,7 @@ nmap &lt;silent&gt; &lt;unique&gt; &lt;Leader&gt;. :BufExplorer&lt;CR&gt;
 set foldmethod=indent &quot;fold based on indent
 set foldnestmax=3     &quot;deepest fold is 3 levels
 set nofoldenable      &quot;dont fold by default
-&quot;
+
 &quot; Jump to last cursor position when opening a file
 &quot; Don't do it when writing a commit log entry
 autocmd BufReadPost * call SetCursorPosition()
@@ -94,9 +94,20 @@ function! SetCursorPosition()
   end
 endfunction
 
-&quot; make Y consistent with C and D                                                                                                 
+&quot; make Y consistent with C and D
 nnoremap Y y$
 
+&quot; strip trailing whitespace
+&quot;autocmd BufWritePre,FileWritePre * call StripTrailingWhitespace()
+function! StripTrailingWhitespace()
+	normal mz
+	normal Hmy
+	exec '%s/\s*$//g'
+	normal 'yz&lt;cr&gt;
+	normal `z
+endfunction
+nmap &lt;silent&gt; &lt;Leader&gt;sw :call StripTrailingWhitespace()&lt;CR&gt;
+
 &quot;define :Lorem command to dump in a paragraph of lorem ipsum
 command! -nargs=0 Lorem :normal iLorem ipsum dolor sit amet, consectetur
       \ adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
@@ -119,7 +130,7 @@ endfunction
 function! OpenRubyDoc(keyword)
   let url = 'http://apidock.com/ruby/'.a:keyword
   call OpenInBrowser(url)
-endfunction           
+endfunction
 noremap RB :call OpenRubyDoc(expand('&lt;cword&gt;'))&lt;CR&gt;
 
 &quot; Open the Rails ApiDock page for the word under cursor</diff>
      <filename>vimrc</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9c52117f9fa8d58b42c799e8eea5845330d84d30</id>
    </parent>
  </parents>
  <author>
    <name>Kerry Buckley</name>
    <email>kerryjbuckley@gmail.com</email>
  </author>
  <url>http://github.com/kerryb/vim-config/commit/b4cceb8575a67238b70ede86afb5064a05554351</url>
  <id>b4cceb8575a67238b70ede86afb5064a05554351</id>
  <committed-date>2009-11-09T03:19:29-08:00</committed-date>
  <authored-date>2009-11-09T03:18:43-08:00</authored-date>
  <message>,sw to strip trailing whitespace</message>
  <tree>b1b633dd2548ea26bf11b0e4ca323093be81286b</tree>
  <committer>
    <name>Kerry Buckley</name>
    <email>kerryjbuckley@gmail.com</email>
  </committer>
</commit>
