Last active
August 12, 2025 08:26
-
-
Save haruue/21ab8b4e76c33eb10ad7355e55a4fdf6 to your computer and use it in GitHub Desktop.
https://aur.archlinux.org/packages/neovim-symlinks for non-archlinux system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -e | |
| has_command() { | |
| local _command=$1 | |
| type -P "$_command" > /dev/null 2>&1 | |
| } | |
| make_vim() { | |
| cat <<- "EOF" | |
| #!/bin/sh | |
| exec nvim "$@" | |
| EOF | |
| } | |
| make_ex() { | |
| cat <<- "EOF" | |
| #!/bin/sh | |
| exec nvim -e "$@" | |
| EOF | |
| } | |
| make_view() { | |
| cat <<- "EOF" | |
| #!/bin/sh | |
| exec nvim -R "$@" | |
| EOF | |
| } | |
| make_vimdiff() { | |
| cat <<- "EOF" | |
| #!/bin/sh | |
| exec nvim -d "$@" | |
| EOF | |
| } | |
| create_script() { | |
| local _cmd="$1" | |
| local _func="$2" | |
| local _path="/usr/local/bin/$_cmd" | |
| echo -n "info: installing $_path ... " | |
| rm -f "$_path" | |
| "$_func" > "$_path" | |
| chmod 0755 "$_path" | |
| echo "ok" | |
| } | |
| if ! has_command nvim; then | |
| echo "fatal: nvim is not installed, exit" >&2 | |
| exit 1 | |
| fi | |
| for i in edit vedit vi vim; do | |
| create_script "$i" make_vim | |
| done | |
| create_script ex make_ex | |
| create_script view make_view | |
| create_script vimdiff make_vimdiff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment