diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-05-13 23:14:03 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-05-13 23:14:03 +0900 |
commit | f41de932d602b60a4ea31304601af6b7705581a3 (patch) | |
tree | 6d733005d450bfa91b65cdc16eeaaa96b632282f | |
parent | b4a05ff27ed8b1371dc3745ce02f48430345761b (diff) |
[vim] Refocus MacVim window
-rw-r--r-- | plugin/fzf.vim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 68c9c9e3..d2da893f 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -193,9 +193,11 @@ function! s:popd(dict) endfunction function! s:xterm_launcher() - return printf('xterm -T [fzf]' - \ .' -bg "\%s" -fg "\%s"' - \ .' -geometry %dx%d+%d+%d -e bash -ic %%s', + let fmt = 'xterm -T "[fzf]" -bg "\%s" -fg "\%s" -geometry %dx%d+%d+%d -e bash -ic %%s' + if has('gui_macvim') + let fmt .= '; osascript -e "tell application \"MacVim\" to activate"' + endif + return printf(fmt, \ synIDattr(hlID("Normal"), "bg"), synIDattr(hlID("Normal"), "fg"), \ &columns, &lines/2, getwinposx(), getwinposy()) endfunction |