I'm trying to switch to a workflow of mainly using less when I just want to read code and then using v to switch into an editor when I want to edit the document. This is GNU less on OS X, but I think it generalizes to other systems.
If I set VISUAL to vim -u NONE so that vim doesn't read any of its initialization files, or use another editor that starts instantly like nano or joe or ne, then there's no perceptible pause between pressing v and having the file appear in the editor.
For instance, this works fine:
$ previous-command > foo.txt
$ VISUAL='vim -u NONE' less foo.txt
view file in less, scroll to interesting line and press v, file is instantly visible inside vim.
Just to illustrate the point, here's what happens if we set VISUAL to sleep 1; vim .
$ another-previous-command > foo.txt
$ VISUAL='sleep 1; vim -u NONE' less foo.txt
we're now viewing the file, then we press v to edit it.
The shell session is now visible again for one second and so we see:
$ another-previous-command > foo.txt
$ VISUAL='sleep 1; vim -u NONE' less foo.txt
After the second has passed we see the contents of foo.txt inside vim.
Just using vim by itself, without additional command line arguments, reads files and does some initialization work. This takes a fraction of a second, but long enough that the underlying shell session is visible, as in the case with sleep 1; <VIM COMMAND>.
Is there a way to transfer control from less to vim in such a way that the underlying shell session is not visible, even partially?