Steve McKinney
Steve McKinney

Reputation: 3361

Terminal vim executes open command and doesn't return back

I'm using terminal Vim 7.3 on Mac OS X Lion and have the following mapping:

map <silent> <leader>p :<C-u>silent !open -a Marked.app '%:p'<CR><C-l>

and have also tried:

command! Marked silent !open -a "Marked.app" "%:p" as given in Opening current file in Marked with a Vim command

This works in MacVim by opening the current file in Marked.app, but in terminal vim it opens the file and doesn't return Vim to a usable state. I have to C-z then fg to get it back up.

Upvotes: 1

Views: 360

Answers (1)

Steve McKinney
Steve McKinney

Reputation: 3361

It appears terminal Vim being in an "unusable state" was actually Vim not redrawing the screen. This fixed the issue:

command! Marked silent !open -a "Marked.app" "%:p"
nmap <silent> <leader>p :Marked<CR>\|:redraw!<CR>

On a side note: MacVim doesn't have this issue. I'm sure MacVim has many other niceties that I'll miss. But running Vim in terminal has been a huge productivity boost.

Upvotes: 1

Related Questions