Monday, September 13, 2010

Re: How to make saveas default to original file's directory?

On Sep 10, 12:54 pm, lessthanideal <geoffrey.w...@thomsonreuters.com>
wrote:
> Thanks for all replies.  The solution I've settled on is to create a
> custom command with %:p:h and map it to a function key so
> I don't accidentally type :sav instead of :Sav.

Oops, missed out final /. I throught I'd specifically checked that
as well :( Anyway for anyone interested it should be

"SaveasSamePath saves with new name to same path (all one line)
command! -nargs=1 SaveasSamePath exe "saveas " . expand("%:p:h") .
"/" .expand("<args>")

"F7 calls SaveasSamePath.  Note space at end of line
map <F7> :SaveasSamePath

regards,
Geoff

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment