Auto-raise existing Vim window on attempt to re-edit?
- Hello, Steve!
Tuesday, November 4, 2003, 6:43:56 PM, you wrote:
SH> You should find that the autocmds I included accomplish the same task
SH> without having to pass the function call on startup.
Sorry, it seems I can't find no autocommands in the function that you
post. There is the entire function:
" always merge a new instance of Vim into a (single) existing one
" don't use in terminal!
" if this isn't the primary server
if v:servername !=? "GVIM"
" compose command to re-open this file if real
" get file name/path
let myfile = expand("%:p")
" reverse backslashes (Windows and Unix compatibility)
let myfile = substitute(myfile, '\\', '/', 'g')
" escape spaces
let myfile = escape(myfile, ' ')
" command to edit current file and maintain position
let mycmd = '<C-o>:edit +' . line('.') . ' ' . myfile . '<CR>'
" compose command to open a new buffer
let mycmd = '<C-o>:enew<CR>'
" pass file open/position command to primary server
call remote_send('GVIM', mycmd)
" call primary server to foreground
" quit this server
>>SH> I've not been able to find a way, other than turning off swap files
>> If there is a way to eliminate 'Swap already exists' message?
SH> with :set noswapfile. You could probably derive some very nasty hack
SH> where it is only momentarily turned off as the two servers are merged,
SH> passing the file info back and forth a few times, but it seems like
SH> too much overhead for me.
Yes, thank you for an explanation.
SH> Besides Vim never crashes, so who needs swap files? :)
PGP key: mailto:pgp-public-keys@...?subject=GET%20strauss@...
np: 01 - Горький Ангел [stopped]
- From: Valery Kondakoff, Nov 5, 2003 10:37 AM
> Tuesday, November 4, 2003, 6:43:56 PM, you wrote:Please refer to my first post:
> > You should find that the autocmds I included accomplish the same
> > task without having to pass the function call on startup.
> Sorry, it seems I can't find no autocommands in the function that
> you post.
Steve Hall [ digitect@... ]