Vim Tips Wiki
No edit summary
 
(Remove html character entities)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{review}}
 
{{review}}
  +
{{TipImported
{{Tip
 
 
|id=762
 
|id=762
  +
|previous=761
|title=Power FTP coming to Mac!
 
  +
|next=763
|created=July 19, 2004 9:12
+
|created=July 19, 2004
 
|complexity=basic
 
|complexity=basic
 
|author=Amir Salihefendic
 
|author=Amir Salihefendic
 
|version=5.7
 
|version=5.7
 
|rating=3/13
 
|rating=3/13
  +
|category1=Mac OS X
|text=
 
  +
|category2=
I was really pissed by the lack of VIM support by the FTP applications found on Mac OS X. None of them support VIM as an external editor.
 
 
}}
 
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:
 
# Define a local folder as a site root.
 
# Define a remote server as the mirror.
 
# 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.
But it's all over!
 
   
 
FTPeel had a bug, but I have manually fixed it.
   
 
Here is what you need to add to your vimrc:
   
  +
<pre>
First off. Download FTPeel (http://freshlysqueezedsoftware.com/products/ftpeel/). It's a great FTP app that has a feature called MagicMirror.
 
 
" FTPeel MagicMirror support
 
 
fun! MagicMirrorIt()
Here is it how it works:
 
 
let path = substitute(expand("%:p"), '/', ":", "g")
 
 
let nice_path = substitute(path, "^:", "", "")
1. Define a local folder as a site root.
 
 
execute('!osascript -e "tell application \"FTPeel\" to open \"' . nice_path . '\""')
 
 
endfun
2. Define a remote server as the mirror.
 
 
map <C-S> :call MagicMirrorIt()<CR>
 
  +
</pre>
3. Drag any files you want mirrored to FTPeel's dock icon!
 
 
 
 
Well - This features also works from VIM . .! I.e. you open a local file, edit it and press some shortcuts to paste the file to FTPeel - - And FTPeel does it work!
 
 
 
 
Well, FTPeel had a bug, but I have manually fixed it.
 
 
 
 
Anyway, to come to the point - 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 &lt;C-S&gt; :call MagicMirrorIt()&lt;CR&gt;
 
 
 
 
Now. First set up FTPeel. Then open your local file and when you want to upload it on the big world wide web - - just hit Control and s!
 
 
 
 
I think it's pretty smart :-)!
 
 
 
 
Also as you see it works by doing some Applescript. This is actually a pretty damn smart way of using AppleScript. Maybe there can be made more ways of using Applescript.
 
 
 
 
Ok, I hope you like my tip!
 
 
 
 
Kind regards,
 
 
Amir
 
 
http://amix.dk
 
}}
 
   
 
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 ==
 
And this has what to do with vim?
 
   
 
==Comments==
'''Anonymous'''
 
, July 22, 2004 6:51
 
----
 
<!-- parsed by vimtips.py in 0.521006 seconds-->
 

Revision as of 09:21, 29 September 2008

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