Skip to content

Latest commit

 

History

History

20220603012937

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Exit code of external command in vim

To get the exit code of an external command, use v:shell_error:

execute("!which git")
if v:shell_error == 0
  echo "git command exists"
else
  echo "git command does not exist. exit code: " . v:shell_error
fi
#vim #tips #scripts