Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Dec 2014 17:28:10 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r373973 - in head/editors: vim vim-lite vim/files
Message-ID:  <201412041728.sB4HSAnL036588@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Thu Dec  4 17:28:09 2014
New Revision: 373973
URL: https://svnweb.freebsd.org/changeset/ports/373973
QAT: https://qat.redports.org/buildarchive/r373973/

Log:
  Move the vimrc into ETCDIR to user may have a look at it.
  Now install a minimalistic vimrc without all the controversial options (I hope)
  Define a template for port Makefiles to vim automatically creates it in case of
  opening a new one

Added:
  head/editors/vim/files/vimrc   (contents, props changed)
Modified:
  head/editors/vim-lite/Makefile
  head/editors/vim/Makefile
  head/editors/vim/pkg-plist

Modified: head/editors/vim-lite/Makefile
==============================================================================
--- head/editors/vim-lite/Makefile	Thu Dec  4 17:25:03 2014	(r373972)
+++ head/editors/vim-lite/Makefile	Thu Dec  4 17:28:09 2014	(r373973)
@@ -1,7 +1,7 @@
 # Created by: David O'Brien (obrien@NUXI.com)
 # $FreeBSD$
 
-PORTREVISION=	0
+PORTREVISION=	1
 
 MAINTAINER=	sunpoet@FreeBSD.org
 COMMENT=	Improved version of the vi editor (lite package)

Modified: head/editors/vim/Makefile
==============================================================================
--- head/editors/vim/Makefile	Thu Dec  4 17:25:03 2014	(r373972)
+++ head/editors/vim/Makefile	Thu Dec  4 17:28:09 2014	(r373973)
@@ -3,7 +3,7 @@
 
 PORTNAME=	vim
 PORTVERSION=	7.4.${PATCHLEVEL}
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES?=	editors
 MASTER_SITES=	VIM:source \
 		${MASTER_SITE_VIM:S|unix|patches/${PORTVERSION:R}|}:patch \
@@ -34,6 +34,7 @@ XTERM_SAVE_DESC=	Restore xterm screen af
 
 ALL_TARGET=	# empty
 MAKE_ARGS+=	CC="${CC}" CONF_ARGS="--prefix=${PREFIX} ${CSCOPE_ARG}" STRIP="${STRIP_CMD}" CONF_OPT_MULTIBYTE=--enable-multibyte CONF_TERM_LIB=--with-tlib=termlib
+MAKE_ARGS+=	VIMRUNTIMEDIR=${PREFIX}/share/vim/${VIM_VER} VIMRCLOC=${ETCDIR}
 PATCH=		${LOCALBASE}/bin/gpatch
 PATCH_DIST_ARGS=--batch --directory ${WRKSRC} --forward --quiet --remove-empty-files ${PATCH_DIST_STRIP}
 REINPLACE_ARGS=	-i ''
@@ -153,6 +154,8 @@ post-patch:
 	@${ECHO_MSG} "===>   Applying distribution patch ${p}"
 	@${PATCH} ${PATCH_DIST_ARGS} -i ${_DISTDIR}/${PORTVERSION:R}.${p}
 .endfor
+	@${ECHO_CMD} '#define SYS_VIMRC_FILE "'${ETCDIR}'/vimrc"' >> ${WRKSRC}/src/feature.h
+	@${ECHO_CMD} '#define SYS_GVIMRC_FILE "'${ETCDIR}'/gvimrc"' >> ${WRKSRC}/src/feature.h
 
 pre-configure:
 	@${CP} ${WRKSRC}/src/config.mk.dist ${WRKSRC}/src/auto/config.mk
@@ -180,8 +183,9 @@ post-install:
 .endfor
 .endif
 .if ${PORT_OPTIONS:MDEFAULT_VIMRC}
-	${INSTALL_DATA} ${WRKSRC}/runtime/gvimrc_example.vim ${STAGEDIR}${DATADIR}/gvimrc.sample
-	${INSTALL_DATA} ${WRKSRC}/runtime/vimrc_example.vim ${STAGEDIR}${DATADIR}/vimrc.sample
+	${MKDIR} ${STAGEDIR}${ETCDIR}
+	${INSTALL_DATA} ${FILESDIR}/vimrc ${STAGEDIR}${ETCDIR}/gvimrc.sample
+	${INSTALL_DATA} ${FILESDIR}/vimrc ${STAGEDIR}${ETCDIR}/vimrc.sample
 .endif
 .if !${PORT_OPTIONS:MNLS}
 	${MKDIR} ${STAGEDIR}${DATADIR}/${VIM_VER}/keymap/

Added: head/editors/vim/files/vimrc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/vim/files/vimrc	Thu Dec  4 17:28:09 2014	(r373973)
@@ -0,0 +1,23 @@
+if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
+	set fileencodings=ucs-bom,utf-8,latin1
+endif
+
+set nocompatible
+set bs=indent,eol,start
+set history=50
+set ruler
+
+if &t_Co > 2 || has("gui_running")
+	syntax on
+	set hlsearch
+endif
+
+if has("autocmd")
+	augroup freebsd
+	autocmd!
+	if $PORTSDIR != ""
+		autocmd BufNewFile $PORTSDIR/*/*/Makefile 0r $PORTSDIR/Templates/Makefile
+	else
+		autocmd BufNewFile /usr/ports/*/*/Makefile 0r /usr/ports/Templates/Makefile
+	endif
+endif

Modified: head/editors/vim/pkg-plist
==============================================================================
--- head/editors/vim/pkg-plist	Thu Dec  4 17:25:03 2014	(r373972)
+++ head/editors/vim/pkg-plist	Thu Dec  4 17:28:09 2014	(r373973)
@@ -1,3 +1,5 @@
+%%DEFAULT_VIMRC%%@sample %%ETCDIR%%/gvimrc.sample
+%%DEFAULT_VIMRC%%@sample %%ETCDIR%%/vimrc.sample
 %%GUI%%bin/eview
 bin/evim
 @comment bin/ex
@@ -184,5 +186,3 @@ man/man1/xxd.1.gz
 %%NON_LITE%%%%NLS%%man/ru.UTF-8/man1/vimdiff.1.gz
 %%NON_LITE%%%%NLS%%man/ru.UTF-8/man1/vimtutor.1.gz
 %%NON_LITE%%%%NLS%%man/ru.UTF-8/man1/xxd.1.gz
-%%DEFAULT_VIMRC%%@sample share/vim/gvimrc.sample
-%%DEFAULT_VIMRC%%@sample share/vim/vimrc.sample



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412041728.sB4HSAnL036588>