 gulp.task 'watch', ['install'], ->
   $.watch ['./*.vim', './plugin/**/*.vim'], (file) ->
     if file.event is 'unlink' then del(file.path, {force: true})
-    if file.relative is 'plugins.vim' then gulp.src('').pipe installBundle()
+    if file.relative is 'plugins.vim' then gulp.src('').pipe pluginInstall()
   .pipe gulp.dest(pluginPath)

  .pipe gulp.dest(homePath)

  gulp.src('')
  .pipe installBundle()
  .pipe installBundle()
  .pipe cleanBundle()

gulp.task 'nodev', ->
  del(pluginPath, {force: true})

remotePluginPath = 'razor-x/vimrc'
pluginPath = "#{homePath}/.vim/bundle/vimrc"

pluginInstall = () -> $.shell('vim -c PluginInstall -c quitall')
pluginUpdate = () -> $.shell('vim -c PluginUpdate -c quitall')
pluginClean = () -> $.shell('vim -c PluginClean -c quitall')

gulp.task 'default', ['watch']

