The question is best given by examples:
vim example.txt #Opens Vim on new or existing file
Ctrl+Z
vim someother.txt
Ctrl+Z
vim example.txt #Auto-runs `fg 1` since example.txt is already open
Is this possible?
|
The question is best given by examples:
Ctrl+Z
Ctrl+Z
Is this possible? |
||||
|
I don't think there is such a generic way to reuse jobs. For your editing workflow, you might want to switch to emacs. Instead of hitting ctrl-z to return to the shell, you can run a child shell in an emacs buffer with You can also start the emacs server and run |
|||
|
|
|
An example solution, works under bash (requires paste, grep, sed). It is specific to Vim but can be adapted to another editor.
Enjoy! |
|||
|
|
|
You may want consider using vim buffers to edit multiple files. Edit both files: See also the easier buffer switching tip and the Vim buffer FAQ. |
|||||||
|
|
No. vim (or any other application for that matter) has no way of communicating to bash that it should take another action instead. |
|||||||||
|
screenor switching virtual terminals. – ultrasawblade May 14 '12 at 3:50