Limit the open function to Mac.
This commit is contained in:
parent
c4e839289c
commit
8a32329873
1 changed files with 16 additions and 12 deletions
28
vimrc
28
vimrc
|
@ -99,18 +99,22 @@ nmap <F9> :TagbarToggle<CR>
|
||||||
" quickly toggle a left, vsplit for an insanely powerful file explorer
|
" quickly toggle a left, vsplit for an insanely powerful file explorer
|
||||||
nmap <F8> :NERDTreeToggle<CR>
|
nmap <F8> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
" open is OS X only, the closest equiv in line, xdg-open, doesn't allow an
|
||||||
" Open current file with app given
|
" argument for speciying a particular app
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
if has('gui_macvim')
|
||||||
function! s:OpenWith(appname)
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
noautocmd silent execute "!open -a \"" . a:appname . "\" " . expand("%:p")
|
" Open current file with app given
|
||||||
if v:shell_error
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
echohl Error
|
function! s:OpenWith(appname)
|
||||||
echon "Problem opening the file."
|
noautocmd silent execute "!open -a \"" . a:appname . "\" " . expand("%:p")
|
||||||
echohl Normal
|
if v:shell_error
|
||||||
endif
|
echohl Error
|
||||||
endfunction
|
echon "Problem opening the file."
|
||||||
|
echohl Normal
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
command! -bar -nargs=1 OpenWith call s:OpenWith(<f-args>)
|
command! -bar -nargs=1 OpenWith call s:OpenWith(<f-args>)
|
||||||
|
endif
|
||||||
|
|
||||||
colorscheme solarized
|
colorscheme solarized
|
||||||
|
|
Loading…
Reference in a new issue