diff --git a/vimrcs/google.vim b/vimrcs/google.vim index 47e08d41..908742d9 100644 --- a/vimrcs/google.vim +++ b/vimrcs/google.vim @@ -109,14 +109,20 @@ endfunction " The filepath is relative the google3/ " eg. you can go to //ads/video.txt wherever you are inside " citc by :e //ads/video/.txt. -function GoogleE(filepath) - let l:citc = GetCitCPath() - let l:dst_filepath = GetGoogle3Path(a:filepath, l:citc) - execute 'e '. l:dst_filepath +function GoogleE(...) + if a:0 + let l:filepath = a:0 + let l:citc = GetCitCPath() + let l:dst_filepath = GetGoogle3Path(l:filepath, l:citc) + execute 'e '. l:dst_filepath + else + execute 'e' + endif endfunction " command -nargs=+ -complete=customlist,GoogleECompletion GoogleE call GoogleE() -command -nargs=+ -complete=file GoogleE call GoogleE() +" help command-complete +command -nargs=* -complete=file GoogleE call GoogleE() " Function to defind a built-in (lowercase) command. function! CommandCabbr(abbreviation, expansion)