From 2d856cc9c28b1d1e79ca2d7e909722580d9ad564 Mon Sep 17 00:00:00 2001 From: diviocity Date: Sun, 29 Nov 2026 23:09:37 +0100 Subject: [PATCH] vim: package the terminal editor and its runtime --- vim/PKGBUILD.vile | 33 +++++++++++++++++++++++++++++++++ vim/vimrc | 18 ++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 vim/PKGBUILD.vile create mode 100644 vim/vimrc diff --git a/vim/PKGBUILD.vile b/vim/PKGBUILD.vile new file mode 100644 index 0000000..79209b3 --- /dev/null +++ b/vim/PKGBUILD.vile @@ -0,0 +1,33 @@ +defpkgbuild(vim, + #:pkgname, "vim", + #:pkgver, "9.2.1352", + #:pkgrel, 1, + #:pkgdesc, "Terminal Vim with its runtime, documentation and xxd", + #:arch, [#:x86-64], + #:license, "Vim", + #:url, "https://www.vim.org/", + #:depends, ["musl", "ncurses"], + #:backup, ["etc/vim/vimrc"], + #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.24/vim-9.2.1352.tar.gz", "vimrc"], + #:sha256sums, ["f491db14f8ef04f474e57dd7759347601442843163a57604dacd9132475b34e2", + "8343cafcfc089392ffb5ac262a234663aaa5dfb650927313780644b47313eac2"], + #:build, fn() { + root := get-environment-variable("VINIX_SYSROOT") + run("test", "-e", string-append(root, "/usr/lib/libncursesw.so")) + run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", + "-C", "vim-9.2.1352", "PKG_CONFIG_PATH=", string-append("PKG_CONFIG_SYSROOT_DIR=", root), + string-append("PKG_CONFIG_LIBDIR=", root, "/usr/lib/pkgconfig"), + string-append("CC=gcc --sysroot=", root, " -specs=", root, "/usr/lib/musl-gcc-sysroot.specs"), + "CFLAGS=-O2", "./configure", "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", + "--prefix=/usr", "--with-features=huge", "--with-tlib=ncursesw", "--without-x", + "--enable-gui=no", "--disable-nls", "--enable-multibyte", "--enable-terminal", + "--disable-pythoninterp", "--disable-python3interp", "--disable-rubyinterp", + "--disable-luainterp", "--disable-perlinterp", "--with-compiledby=Vinix") + run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", "make", "-C", "vim-9.2.1352") + }, + #:package, fn() { + run("make", "-j1", "-C", "vim-9.2.1352", "CROSS_COMPILING=yes", string-append("DESTDIR=", pkgdir()), "install") + run("install", "-Dm644", "vimrc", string-append(pkgdir(), "/etc/vim/vimrc")) + run("ln", "-sf", "../../../etc/vim/vimrc", string-append(pkgdir(), "/usr/share/vim/vimrc")) + run("install", "-Dm644", "vim-9.2.1352/runtime/doc/uganda.txt", string-append(pkgdir(), "/usr/share/licenses/vim/LICENSE")) + }) diff --git a/vim/vimrc b/vim/vimrc new file mode 100644 index 0000000..0c2ebe3 --- /dev/null +++ b/vim/vimrc @@ -0,0 +1,18 @@ +set nocompatible " Use Vim defaults (much better!) +set bs=2 " Allow backspacing over everything in insert mode +set ai " Always set auto-indenting on +set history=50 " keep 50 lines of command history +set ruler " Show the cursor position all the time + +" Don't use Ex mode, use Q for formatting +map Q gq + +" When doing tab completion, give the following files lower priority. +set suffixes+=.info,.aux,.log,.dvi,.bbl,.out,.o,.lo + +set nomodeline +syntax on + +if filereadable("/etc/vim/vimrc.local") + source /etc/vim/vimrc.local +endif -- 2.56.1