diff options
author | Adam Weinberger <adamw@FreeBSD.org> | 2022-09-03 11:56:00 -0600 |
---|---|---|
committer | Adam Weinberger <adamw@FreeBSD.org> | 2022-09-03 12:03:52 -0600 |
commit | a058c61ea36c0cb64a61c83563b55a157cf549f4 (patch) | |
tree | bf20b45786c2183eebc119e0e7cce62611731953 /editors/vim | |
parent | 3277d3588c70f440f16b298d8570746367471230 (diff) | |
download | freebsd-ports-a058c61ea36c0cb64a61c83563b55a157cf549f4.zip |
editors/vim: Update to 9.0.0369, and drop the FreeBSD vimrc
Our FreeBSD vimrc has caused a lot of trouble. It seriously mangles
config loading order (see below PR for the 21 comments it took before
I could get my head around it), clobbers defaults, duplicates defaults,
and simply isn't how Vim does things.
In this patch, the system vimrc is dropped entirely. Instead,
$VIMRUNTIME/defaults.vim sources $VIMRUNTIME/defaults_freebsd.vim, which
contains only FreeBSD-specific settings (today, a convenience augroup
for port creation, and a flag to let syntax/sh.vim know that /bin/sh
isn't bash).
There is no perfect solution here, but by not clobbering anything
anymore, we at least don't *prevent* other solutions. You now get Vim's
defaults, and you are free to override them in your ~/.vimrc.
PR: 251420
Diffstat (limited to 'editors/vim')
-rw-r--r-- | editors/vim/Makefile | 21 | ||||
-rw-r--r-- | editors/vim/distinfo | 6 | ||||
-rw-r--r-- | editors/vim/files/defaults_freebsd.vim | 10 | ||||
-rw-r--r-- | editors/vim/files/vimrc | 45 | ||||
-rw-r--r-- | editors/vim/pkg-message | 11 | ||||
-rw-r--r-- | editors/vim/pkg-plist | 1 | ||||
-rw-r--r-- | editors/vim/pkg-plist-tiny | 1 |
7 files changed, 32 insertions, 63 deletions
diff --git a/editors/vim/Makefile b/editors/vim/Makefile index 2781e77292f9..5df59d5429eb 100644 --- a/editors/vim/Makefile +++ b/editors/vim/Makefile @@ -1,5 +1,5 @@ PORTNAME= vim -PORTVERSION= 9.0.0129 +PORTVERSION= 9.0.0369 DISTVERSIONPREFIX= v CATEGORIES= editors @@ -90,23 +90,22 @@ USE_XORG= ice sm x11 xmu xpm xt # Options {{{1 # The bulk of the OPTIONS are for normal (non-tiny) vim ### Make sure any new options are excluded below in CONSOLE/TINY -OPTIONS_DEFAULT= CTAGS_BASE DEFAULT_VIMRC PYTHON -OPTIONS_DEFINE= DEFAULT_VIMRC MAKE_JOBS NLS XTERM_SAVE +OPTIONS_DEFAULT= CTAGS_BASE PYTHON +OPTIONS_DEFINE= MAKE_JOBS NLS XTERM_SAVE OPTIONS_SINGLE= CTAGS OPTIONS_SINGLE_CTAGS= CTAGS_BASE CTAGS_EXUBERANT CTAGS_UNIVERSAL OPTIONS_GROUP= LANGBIND OPTIONS_GROUP_LANGBIND= LUA PERL PYTHON RUBY SCHEME TCL OPTIONS_SUB= yes -# vim-tiny excludes everything except CONSOLE, DEFAULT_VIMRC, MAKE_JOBS +# vim-tiny excludes everything except CONSOLE, MAKE_JOBS .if ${FLAVOR:U} == tiny -OPTIONS_EXCLUDE:= ${OPTIONS_DEFINE:NDEFAULT_VIMRC:NMAKE_JOBS} \ +OPTIONS_EXCLUDE:= ${OPTIONS_DEFINE:NMAKE_JOBS} \ ${OPTIONS_SINGLE_UI:NCONSOLE} \ ${OPTIONS_GROUP_LANGBIND} \ ${OPTIONS_SINGLE_CTAGS} .endif -DEFAULT_VIMRC_DESC= Install bundled vimrc as default setting MAKE_JOBS_DESC= Enable parallel build XTERM_SAVE_DESC= Restore xterm screen after exit @@ -161,8 +160,7 @@ post-extract: ${INSTALL_DATA} ${FILESDIR}/vietnamese_viscii.vim ${WRKSRC}/runtime/keymap post-patch: - ${ECHO_CMD} '#define SYS_VIMRC_FILE "'${ETCDIR}'/vimrc"' >> ${WRKSRC}/src/feature.h - ${ECHO_CMD} '#define SYS_GVIMRC_FILE "'${ETCDIR}'/gvimrc"' >> ${WRKSRC}/src/feature.h + ${ECHO_CMD} 'source $$VIMRUNTIME/defaults_freebsd.vim' >> ${WRKSRC}/runtime/defaults.vim ${REINPLACE_CMD} -e 's|-liconv|${ICONV_LIB}|g; s|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/src/auto/configure @@ -170,19 +168,16 @@ post-configure: # Needed when devel/libsysinfo is installed: ${REINPLACE_CMD} -e '/^#define HAVE_SYSINFO/ d' ${WRKSRC}/src/auto/config.h -post-install-DEFAULT_VIMRC-on: - ${MKDIR} ${STAGEDIR}${ETCDIR} - ${INSTALL_DATA} ${FILESDIR}/vimrc ${STAGEDIR}${ETCDIR}/vimrc.sample - .if ${FLAVOR:U} == tiny do-install: ${MKDIR} ${STAGEDIR}${DATADIR}/${VIM_VER} ${INSTALL_PROGRAM} ${WRKSRC}/src/vim ${STAGEDIR}${PREFIX}/bin - ${TOUCH} ${STAGEDIR}${DATADIR}/${VIM_VER}/defaults.vim + ${INSTALL_DATA} ${FILESDIR}/defaults_freebsd.vim ${STAGEDIR}${DATADIR}/${VIM_VER}/defaults.vim ${INSTALL_MAN} ${WRKSRC}/runtime/doc/vim.1 ${STAGEDIR}${MAN1PREFIX}/man/man1 .else # flavor != tiny post-install: + ${INSTALL_DATA} ${FILESDIR}/defaults_freebsd.vim ${STAGEDIR}${DATADIR}/${VIM_VER}/ ${RM} ${STAGEDIR}${PREFIX}/bin/ex ${RM} ${STAGEDIR}${PREFIX}/bin/view . for F in eview evim gview gvim gvimdiff rgview rgvim rview rvim vimdiff diff --git a/editors/vim/distinfo b/editors/vim/distinfo index ac8f23f0d48c..fabbe4801854 100644 --- a/editors/vim/distinfo +++ b/editors/vim/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1659361348 -SHA256 (vim-vim-v9.0.0129_GH0.tar.gz) = 4d8c80d4f9bfbded3749016f84636f5038c9679370d12f81ca18f7f660ac2d2b -SIZE (vim-vim-v9.0.0129_GH0.tar.gz) = 16723651 +TIMESTAMP = 1662223469 +SHA256 (vim-vim-v9.0.0369_GH0.tar.gz) = 990710ef46e581461e39f38778dd38654f1b61b5768f846553e7c16a8ecb3231 +SIZE (vim-vim-v9.0.0369_GH0.tar.gz) = 16822389 diff --git a/editors/vim/files/defaults_freebsd.vim b/editors/vim/files/defaults_freebsd.vim new file mode 100644 index 000000000000..7af379c40118 --- /dev/null +++ b/editors/vim/files/defaults_freebsd.vim @@ -0,0 +1,10 @@ +let g:is_posix = 1 " Our /bin/sh is POSIX, not bash + +" Load a port template when creating a Makefile under the ports tree +augroup FreeBSD + autocmd! + autocmd BufNewFile /usr/ports/*/*/Makefile 0r /usr/ports/Templates/Makefile + if !empty($PORTSDIR) + autocmd BufNewFile $PORTSDIR/*/*/Makefile 0r $PORTSDIR/Templates/Makefile + endif +augroup END diff --git a/editors/vim/files/vimrc b/editors/vim/files/vimrc deleted file mode 100644 index cc200a086c9d..000000000000 --- a/editors/vim/files/vimrc +++ /dev/null @@ -1,45 +0,0 @@ -" FreeBSD provides this file for three reasons: -" 1. Some of the default settings are not great (e.g. backspace) -" 2. FreeBSD requires some special handling (e.g. g:is_posix) -" 3. vim-tiny doesn't ship with $VIMRUNTIME/defaults.vim, so any -" settings that vim-tiny gets must appear in this file - -" defaults.vim will override this file. Sourcing it here and -" setting the skip flag prevents clobbering settings -source $VIMRUNTIME/defaults.vim -let skip_defaults_vim = 1 - -set nocompatible " Enable Vim mode (instead of vi emulation) - -let g:is_posix = 1 " Our /bin/sh is POSIX, not bash -set autoindent " Intelligent indentation matching -set autoread " Update the file if it's changed externally -set backspace=indent,eol,start " Allow backspacing over anything -set belloff=all " Turn off bells -set display=truncate " Show '@@@' when the last screen line overflows -set formatoptions+=j " Delete comment char when joining lines -set history=100 " Undo up to this many commands -set hlsearch " Highlight search results -set incsearch " Highlight search matches as you type them -set ruler " Show cursor position -set ttyfast " Redraw faster for smoother scrolling -set wildmenu " Show menu for tab completion in command mode - -try - syntax on " Enable syntax highlighting -catch | endtry " vim-tiny is installed without the syntax files - -if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" - set fileencodings=ucs-bom,utf-8,latin1 -endif - -" CTRL-L will mute highlighted search results -nnoremap <silent> <C-l> :<C-u>nohlsearch<CR><C-l> - -augroup FreeBSD - autocmd! - autocmd BufNewFile /usr/ports/*/*/Makefile 0r /usr/ports/Templates/Makefile - if !empty($PORTSDIR) - autocmd BufNewFile $PORTSDIR/*/*/Makefile 0r $PORTSDIR/Templates/Makefile - endif -augroup END diff --git a/editors/vim/pkg-message b/editors/vim/pkg-message new file mode 100644 index 000000000000..1def839e84fb --- /dev/null +++ b/editors/vim/pkg-message @@ -0,0 +1,11 @@ +[ + { type: upgrade + maximum_version: "9.0.0129" + message: <<EOM + Vim no longer installs or reads a system-wide vimrc. The only overridden + defaults are those which provide FreeBSD-specific settings. Read through + $VIMRUNTIME/defaults.vim to see Vim's defaults, and see ':h initialization' + for the standard locations Vim looks for configuration files. + EOM + } +] diff --git a/editors/vim/pkg-plist b/editors/vim/pkg-plist index dac505b7b88f..e793e1414091 100644 --- a/editors/vim/pkg-plist +++ b/editors/vim/pkg-plist @@ -63,7 +63,6 @@ bin/xxd %%NLS%%man/de.UTF-8/man1/rview.1.gz %%NLS%%man/de.UTF-8/man1/rvim.1.gz %%NLS%%man/de.UTF-8/man1/vim.1.gz -%%DEFAULT_VIMRC%%@sample %%ETCDIR%%/vimrc.sample %%GUI%%%%NLS%%man/fr/man1/eview.1.gz %%NLS%%man/fr/man1/evim.1.gz %%GUI%%%%NLS%%man/fr/man1/gview.1.gz diff --git a/editors/vim/pkg-plist-tiny b/editors/vim/pkg-plist-tiny index 4f0add561d15..4406cffefade 100644 --- a/editors/vim/pkg-plist-tiny +++ b/editors/vim/pkg-plist-tiny @@ -1,3 +1,2 @@ bin/vim -%%DEFAULT_VIMRC%%@sample %%ETCDIR%%/vimrc.sample man/man1/vim.1.gz |