Skip to content

Commit

Permalink
Adding support for Mvim!
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt committed Feb 14, 2012
1 parent a16397f commit d27aaf5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions vimrc
Expand Up @@ -143,14 +143,17 @@ autocmd vimrc BufNewFile,BufRead,BufFilePost donotstriponfilesmatchingthisexpres


" Open MacVim with current buffer
function! Mvim()
if (getbufvar(@%, "&mod"))
echo 'Please save first!'
function! Mvim(bang)
if (a:bang != '!' && getbufvar(@%, "&mod"))
echohl ErrorMsg
echo 'No write since last change (add ! to override)'
echohl None
else
execute ":silent !mvim " . @% | q
execute ":silent !mvim " . @% | q!
endif
endfun
command! Mvim :call Mvim()

command! -bang Mvim :call Mvim('<bang>')


" Plugins *********************************************************************
Expand Down

0 comments on commit d27aaf5

Please sign in to comment.