From c4e839289cf1e6beff91344aeb535986818e20c0 Mon Sep 17 00:00:00 2001 From: Thomas Gideon Date: Fri, 17 Apr 2015 14:52:17 -0400 Subject: [PATCH] Nice function to open external tools. --- vimrc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vimrc b/vimrc index 68a8391..bd9c107 100644 --- a/vimrc +++ b/vimrc @@ -99,4 +99,18 @@ nmap :TagbarToggle " quickly toggle a left, vsplit for an insanely powerful file explorer nmap :NERDTreeToggle +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Open current file with app given +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +function! s:OpenWith(appname) + noautocmd silent execute "!open -a \"" . a:appname . "\" " . expand("%:p") + if v:shell_error + echohl Error + echon "Problem opening the file." + echohl Normal + endif +endfunction + +command! -bar -nargs=1 OpenWith call s:OpenWith() + colorscheme solarized