Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created November 5, 2009 20:45
Show Gist options
  • Select an option

  • Save defunkt/227361 to your computer and use it in GitHub Desktop.

Select an option

Save defunkt/227361 to your computer and use it in GitHub Desktop.

Revisions

  1. defunkt revised this gist Nov 5, 2009. 1 changed file with 8 additions and 4 deletions.
    12 changes: 8 additions & 4 deletions carbon.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,15 @@
    Vim
    ### Vim

    `autocmd BufWritePre * :%s/\s\+$//e`

    Emacs
    ### Emacs

    `(add-hook 'before-save-hook 'delete-trailing-whitespace)`

    Textmate
    ### Textmate

    <http://blogobaggins.com/2009/03/31/waging-war-on-whitespace.html>

    In your existing codebase
    ### In your existing codebase

    `find . -name '*.rb' | xargs perl -pi -e 's/ +$//'`
  2. defunkt revised this gist Nov 5, 2009. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions carbon.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    ### Reduce your carbon footprint

    Vim
    `autocmd BufWritePre * :%s/\s\+$//e`

  3. defunkt renamed this gist Nov 5, 2009. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. defunkt created this gist Nov 5, 2009.
    13 changes: 13 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    ### Reduce your carbon footprint

    Vim
    `autocmd BufWritePre * :%s/\s\+$//e`

    Emacs
    `(add-hook 'before-save-hook 'delete-trailing-whitespace)`

    Textmate
    <http://blogobaggins.com/2009/03/31/waging-war-on-whitespace.html>

    In your existing codebase
    `find . -name '*.rb' | xargs perl -pi -e 's/ +$//'`