Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rakefile: Add a task to remove whitespace errors, I hate whitespace e…

…rrors.
  • Loading branch information...
commit 11e3585e6ddcceb6c83ef8c358bd4258572301f7 1 parent 2316fe6
@kalbasit kalbasit authored
Showing with 16 additions and 2 deletions.
  1. +15 −1 Rakefile
  2. +1 −1  vimius/vim/core/before/plugin/settings.vim
View
16 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."
View
2  vimius/vim/core/before/plugin/settings.vim
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.