Vim Tips Wiki
Advertisement
Tip 762 Printable Monobook Previous Next

created July 19, 2004 · complexity basic · author Amir Salihefendic · version 5.7


I was really annoyed by the lack of Vim support by the FTP applications found on Mac OS X. None of them support Vim as an external editor. But there is a solution.

Download FTPeel (http://freshlysqueezedsoftware.com/products/ftpeel/). It's a great FTP app that has a feature called MagicMirror.

Here is it how it works:

  1. Define a local folder as a site root.
  2. Define a remote server as the mirror.
  3. Drag any files you want mirrored to FTPeel's dock icon!

Well - This features also works from Vim. That is, you open a local file, edit it and press some shortcuts to paste the file to FTPeel -- and FTPeel does its work.

FTPeel had a bug, but I have manually fixed it.

Here is what you need to add to your vimrc:

" FTPeel MagicMirror support
fun! MagicMirrorIt()
  let path = substitute(expand("%:p"), '/', ":", "g")
  let nice_path = substitute(path, "^:", "", "")
  execute('!osascript -e "tell application \"FTPeel\" to open \"' . nice_path . '\""')
endfun
map <C-S> :call MagicMirrorIt()<CR>

First set up FTPeel. Then open your local file and when you want to upload it on the world wide web -- just hit Control-s

Comments

Advertisement