Switch Python Version for Vim & Syntastic

后端 未结 8 1155
忘了有多久
忘了有多久 2020-12-24 05:15

Is it possible to change the python version used by syntastic for syntax checking?

As the Issue https://github.com/scrooloose/syntastic/issues/385 indicates I could

8条回答
  •  被撕碎了的回忆
    2020-12-24 05:51

    Just to iterate on Zaar Hai's script a bit, something like this should work and be a bit more robust.

    #!/usr/bin/env bash
    
    _python=$(command -v python)
    
    [[ "$(uname -s)" =~ Darwin ]] && IS_OSX=true
    
    if [[ "$IS_OSX" ]]; then
        if command -v 'greadlink' >/dev/null 2>&1; then
            greadlink -f "$_python"
        else
            echo 'Install coreutils!' >&2
        fi
    else
        readlink -f "$_python"
    fi
    

提交回复
热议问题