ports/editors/vim/files/defaults_freebsd.vim
Adam Weinberger a058c61ea3 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
2022-09-03 12:03:52 -06:00

10 lines
362 B
VimL

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