Skip to content

Instantly share code, notes, and snippets.

@yan12125 yan12125/PKGBUILD Secret
Created Jul 6, 2016

Embed
What would you like to do?
aur/neovim-symlinks with xxd
# Maintainer: Doug Newgard <scimmia at archlinux dot info>
# Contributor: Tomas Storck <storcktomas@gmail.com>
# Contributor: Tom Richards <tom@tomrichards.net>
pkgname=neovim-symlinks
pkgver=2
pkgrel=1
pkgdesc='Runs neovim if vi or vim is called'
arch=('i686' 'x86_64')
depends=('neovim' 'sh')
provides=('vim' 'vi' 'xxd')
conflicts=('vim' 'vi' 'vi-vim-symlink')
source=('https://raw.githubusercontent.com/vim/vim/master/src/xxd/xxd.c')
sha256sums=('SKIP')
# https://github.com/vim/vim/blob/master/src/xxd/xxd.c#L58-L59
license=('MIT' 'GPL2')
build() {
# https://github.com/vim/vim/blob/master/src/xxd/Makefile
gcc -DUNIX -o xxd xxd.c
}
package() {
install -dm755 "$pkgdir/usr/bin/"
install -Dm755 xxd "$pkgdir/usr/bin/xxd"
for _link in edit ex rview rvim vedit vi view vim; do
ln -s nvim "$pkgdir/usr/bin/$_link"
done
# vimdiff --> nvim -d
echo -e '#!/bin/sh\nexec vim -d "$@"' > "$pkgdir/usr/bin/vimdiff"
chmod 755 "$pkgdir/usr/bin/vimdiff"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.