Skip to content

Commit

Permalink
Replace Vim xxd with new "rexxd" implementation
Browse files Browse the repository at this point in the history
An order of magnitude faster, and far less buggy.

Ref: https://nullprogram.com/blog/2025/02/17/
  • Loading branch information
skeeto committed Feb 17, 2025
1 parent cbb4c3f commit 05d3306
Show file tree
Hide file tree
Showing 3 changed files with 3,058 additions and 95 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -426,17 +426,15 @@ RUN $ARCH-gcc -Os -fno-asynchronous-unwind-tables -Wl,--gc-sections -s \

# TODO: Either somehow use $VIM_VERSION or normalize the workdir
WORKDIR /vim90/src
COPY src/vim-*.patch $PREFIX/src/
RUN cat $PREFIX/src/vim-*.patch | patch -p1 \
&& ARCH= make -j$(nproc) -f Make_ming.mak \
COPY src/rexxd.c $PREFIX/src/
RUN ARCH= make -j$(nproc) -f Make_ming.mak \
OPTIMIZE=SIZE STATIC_STDCPLUS=yes HAS_GCC_EH=no \
UNDER_CYGWIN=yes CROSS=yes CROSS_COMPILE=$ARCH- \
FEATURES=HUGE VIMDLL=yes NETBEANS=no WINVER=0x0501 \
&& $ARCH-strip vimrun.exe \
&& rm -rf ../runtime/tutor/tutor.* \
&& cp -r ../runtime $PREFIX/share/vim \
&& cp vimrun.exe gvim.exe vim.exe *.dll $PREFIX/share/vim/ \
&& cp xxd/xxd.exe $PREFIX/bin \
&& printf '@set SHELL=\r\n@start "" "%%~dp0/../share/vim/gvim.exe" %%*\r\n' \
>$PREFIX/bin/gvim.bat \
&& printf '@set SHELL=\r\n@"%%~dp0/../share/vim/vim.exe" %%*\r\n' \
Expand All @@ -445,7 +443,9 @@ RUN cat $PREFIX/src/vim-*.patch | patch -p1 \
>$PREFIX/bin/vi.bat \
&& printf '@vim -N -u NONE "+read %s" "+write" "%s"\r\n' \
'$VIMRUNTIME/tutor/tutor' '%TMP%/tutor%RANDOM%' \
>$PREFIX/bin/vimtutor.bat
>$PREFIX/bin/vimtutor.bat \
&& $ARCH-gcc -nostartfiles -O2 -funroll-loops -s -o $PREFIX/bin/xxd.exe \
$PREFIX/src/rexxd.c -lmemory

WORKDIR /ctags-$CTAGS_VERSION
RUN sed -i /RT_MANIFEST/d win32/ctags.rc \
Expand Down
Loading

0 comments on commit 05d3306

Please sign in to comment.