1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/bin/sh _implementations=" vim vi " for _implementation in ${_implementations}; do # shellcheck disable=SC2139 command -v "${_implementation}" >/dev/null 2>&1 && alias vim="${_implementation}" && alias vi="${_implementation}" && alias v="${_implementation}" && break done unset _implementation _implementations
Consider giving Nix/NixOS a try! <3