" Chrome Cli bindings "-------------------- function! s:HasFile() return expand("%") != "" endfunction function! s:OpenTab(reload, detached) let open_tab_command = "open-tab" if s:HasFile() update endif if a:reload let open_tab_command .= " --reload" endif if a:detached let open_tab_command .= " --detached" endif if exists("g:app_url") let open_tab_command .= " " . g:app_url endif call system(open_tab_command) endfunction command! OpenAndReloadTab call OpenTab(1, 0) command! OpenTab call OpenTab(0, 0) command! OpenTabDetached call OpenTab(0, 1) nnoremap gl :OpenAndReloadTab nnoremap gL :OpenTabDetached " vim:ft=vim