From 11e3585e6ddcceb6c83ef8c358bd4258572301f7 Mon Sep 17 00:00:00 2001 From: Wael Nasreddine Date: Wed, 9 Nov 2011 15:00:38 +0100 Subject: [PATCH] Rakefile: Add a task to remove whitespace errors, I hate whitespace errors. --- Rakefile | 16 +++++++++++++++- vimius/vim/core/before/plugin/settings.vim | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 7d87f3e9..cb6d8267 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__))) $: << File.join(ROOT_PATH, 'vimius', 'ruby') -require 'Vimius' +require 'vimius' include Vimius desc "link ViM configuration files." @@ -21,6 +21,20 @@ namespace :dev do update_submodule(submodule) end end + + # Taken from RefineryCMD + # https://github.com/resolve/refinerycms/blob/master/core/lib/tasks/refinery.rake + desc 'Removes trailing whitespace across the entire application.' + task :whitespace do + require 'rbconfig' + if RbConfig::CONFIG['host_os'] =~ /linux/ + sh %{find . -name '*.*rb' -o -name '*.*vim' -exec sed -i 's/\t/ /g' {} \\; -exec sed -i 's/ *$//g' {} \\; } + elsif RbConfig::CONFIG['host_os'] =~ /darwin/ + sh %{find . -name '*.*rb' -o -name '*.*vim' -exec sed -i '' 's/\t/ /g' {} \\; -exec sed -i '' 's/ *$//g' {} \\; } + else + puts "This doesn't work on systems other than OSX or Linux. Please use a custom whitespace tool for your platform '#{RbConfig::CONFIG["host_os"]}'." + end + end end desc "Create necessary folders." diff --git a/vimius/vim/core/before/plugin/settings.vim b/vimius/vim/core/before/plugin/settings.vim index be452964..9da4f316 100644 --- a/vimius/vim/core/before/plugin/settings.vim +++ b/vimius/vim/core/before/plugin/settings.vim @@ -235,7 +235,7 @@ else " Make shift-insert work like in Xterm map map! - + " Map Control-# to switch tabs map 0gt imap 0gt