Skip to content

Commit ff695fc

Browse files
committed
vim: Improve HiDPI experience with a better font
GUI Vim defaults to Fixedsys, a raster font which does not scale. On HiDPI displays, Vim is unusable in its default configuration despite supporting HiDPI generally. This issue was never solved upstream, and the official Vim builds still have this poor experience. For w64dk, I want a better out-of-the-box experience. It tries Consolas, present on any HiDPI system, and then falls back to Fixedsys if necessary (XP). As a side effect, the unicode experience improves as well because Fixedsys has little support beyond ASCII. There's an argument to be made for Lucida Console, but Consolas edges out by not having a space in the name. This also "breaks the seal" on making other changes to Vim's generally poor defaults, perhaps to adopt some of neovim's more thoughtful defaults: https://neovim.io/doc/user/vim_diff.html#defaults
1 parent 1d0ed34 commit ff695fc

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -435,16 +435,17 @@ RUN $ARCH-gcc -Os -fno-asynchronous-unwind-tables -Wl,--gc-sections -s \
435435
| xargs -I{} cp alias.exe $PREFIX/bin/{}.exe
436436

437437
# TODO: Either somehow use $VIM_VERSION or normalize the workdir
438-
WORKDIR /vim90/src
439-
COPY src/rexxd.c $PREFIX/src/
440-
RUN ARCH= make -j$(nproc) -f Make_ming.mak CC="$ARCH-gcc -std=gnu17" \
438+
WORKDIR /vim90
439+
COPY src/rexxd.c src/vim-*.patch $PREFIX/src/
440+
RUN cat $PREFIX/src/vim-*.patch | patch -p1 \
441+
&& ARCH= make -C src -j$(nproc) -f Make_ming.mak CC="$ARCH-gcc -std=gnu17" \
441442
OPTIMIZE=SIZE STATIC_STDCPLUS=yes HAS_GCC_EH=no \
442443
UNDER_CYGWIN=yes CROSS=yes CROSS_COMPILE=$ARCH- \
443444
FEATURES=HUGE VIMDLL=yes NETBEANS=no WINVER=0x0501 \
444-
&& $ARCH-strip vimrun.exe \
445-
&& rm -rf ../runtime/tutor/tutor.* \
446-
&& cp -r ../runtime $PREFIX/share/vim \
447-
&& cp vimrun.exe gvim.exe vim.exe *.dll $PREFIX/share/vim/ \
445+
&& $ARCH-strip src/vimrun.exe \
446+
&& rm -rf runtime/tutor/tutor.* \
447+
&& cp -r runtime $PREFIX/share/vim \
448+
&& cp src/vimrun.exe src/gvim.exe src/vim.exe src/*.dll $PREFIX/share/vim/ \
448449
&& printf '@set SHELL=\r\n@start "" "%%~dp0/../share/vim/gvim.exe" %%*\r\n' \
449450
>$PREFIX/bin/gvim.bat \
450451
&& printf '@set SHELL=\r\n@"%%~dp0/../share/vim/vim.exe" %%*\r\n' \

src/vim-guifont.patch

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--- a/runtime/defaults.vim
2+
+++ b/runtime/defaults.vim
3+
@@ -131,2 +131,5 @@
4+
if &t_Co > 2 || has("gui_running")
5+
+ " Prefer a font that scales for HiDPI
6+
+ set guifont=consolas:h11,fixedsys
7+
+
8+
" Revert with ":syntax off".

0 commit comments

Comments
 (0)