Skip to content

Commit

Permalink
Rakefile: Add a task to remove whitespace errors, I hate whitespace e…
Browse files Browse the repository at this point in the history
…rrors.
  • Loading branch information
kalbasit committed Nov 9, 2011
1 parent 2316fe6 commit 11e3585
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -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."
Expand All @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion vimius/vim/core/before/plugin/settings.vim
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ else
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
" Map Control-# to switch tabs
map <C-0> 0gt
imap <C-0> <Esc>0gt
Expand Down

0 comments on commit 11e3585

Please sign in to comment.