 <p>Check if your version of Vim has support for client-server functionality: <code>:echo has('clientserver')</code></p> <p>If so, you can write an alias to tell Vim to change its cwd:</p> <p>In your .bashrc:</p> <pre><code>alias fg="$VIM --remote-send ':cd $PWD&lt;CR&gt;'; fg" </code></pre> <p>Where $VIM is <code>vim</code> or <code>gvim</code> or <code>macvim</code>.</p> <p>You need the colon and the <code>&lt;CR&gt;</code> because you're sending Vim keystrokes rather than commands (<code>&lt;CR&gt;</code> is a special notation for "Enter")</p> <p>I'm not sure whether <code>--remote-send</code> works when Vim is suspended - this approach might be better if you use something like screen or tmux to run vim and your shell at the same time.</p> <p>Otherwise, it's a bit trickier.</p> <p>There's a :shell command that is similar to suspending and resuming, but I'm assuming it forks a child process instead of returning you to Vim's parent process. If you're ok with that, there's a ShellCmdPost autocmd you can attach to to load information. You can use that in association with an alias that writes the $CWD to a file to load the required directory and change to it.</p> <p>In your .bashrc:</p> <pre><code>alias fgv="echo $PWD &gt; ~/.cwd; exit" </code></pre> <p>In your .vimrc:</p> <pre><code>autocmd ShellCmdPost * call LoadCWD() function! LoadCWD() let lines = readfile('~/.cwd') if len(lines) &gt; 0 let cwd = lines[0] execute 'cd' cwd endif endfunction </code></pre> <p>Looking through the list of autocommands, I was not able to find any that detect when Vim has been suspended and has just been resumed. You could remap ctrl-z to first set a flag variable then do an unmapped ctrl-z. Then write a shell script like before that writes its $CWD to a specific file. Then you can set up an autocmd to watch that file for modification and in the handler, check the flag variable, and if it's set, reset it, read the file, and change to that directory. A bit complex, but it would work.</p> <p>That would look like this. You'll have to load the file when you start Vim so that it can monitor it for changes. You may want to <code>set hidden</code> so that you can keep the buffer open but hide it.</p> <p>In your .bashrc:</p> <pre><code>alias fg="echo $PWD &gt; ~/.cwd; fg" </code></pre> <p>In your .vimrc:</p> <pre><code>set hidden edit ~/.cwd enew nnoremap &lt;C-Z&gt; :let g:load_cwd = 1&lt;CR&gt;&lt;C-Z&gt; autocmd FileChangedShell ~/.cwd call LoadCWD() function! LoadCWD() if g:load_cwd let g:load_cwd = 0 let lines = readfile('~/.cwd') if len(lines) &gt; 0 let cwd = lines[0] execute 'cd' cwd endif endif endfunction </code></pre>