freebsd-ports/editors/vim/files/patch-runtime_defaults.vim
Adam Weinberger 91ef78b58b editors/vim: Allow system vimrc, and include defaults.vim for vim-tiny
Two changes here (along with bumping to the latest upstream patch):

1) In the previous Vim commit, support for the system-wide vimrc/gvimrc
   was dropped because we went through contortions to fix loading order
   and monkey around with various defaults.

   However, many people used that file for their system. This commit
   re-adds support for loading it. All work for untangling the mess of
   loading defaults.vim and preventing circular loads is left to the
   user. We just support loading that file; what you do with it is your
   call.

2) vim-tiny is supposed to be the smallest possible Vim experience,
   being just the binary and no runtime library. However, without a
   viable defaults.vim, it's essentially just a larger, slower Vi.
   The vim-tiny package now ships with defaults.vim, which is patched
   to prevent errors from Vim loading the syntax library (which is not
   installed).
2022-09-04 10:07:01 -06:00

24 lines
689 B
VimL

We wrap `syntax on` in a try block so that it won't produce errors for
vim-tiny, which doens't include the runtime library.
We also source our own FreeBSD-specific defaults file.
--- runtime/defaults.vim.orig 2022-09-04 15:43:53 UTC
+++ runtime/defaults.vim
@@ -130,7 +130,9 @@ endif
" GUI (which always has colors).
if &t_Co > 2 || has("gui_running")
" Revert with ":syntax off".
- syntax on
+ try
+ syntax on
+ catch | endtry
" I like highlighting strings inside C comments.
" Revert with ":unlet c_comment_strings".
@@ -152,3 +154,5 @@ if has('langmap') && exists('+langremap')
" compatible).
set nolangremap
endif
+
+source $VIMRUNTIME/defaults_freebsd.vim