summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2014-12-04 17:28:09 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2014-12-04 17:28:09 +0000
commit4930b610602e519f40f8b1de64f96fbbb8cc7c40 (patch)
tree69d7f2f5ee57f3dadd2ff4d308d76b584a68184e /editors
parentAdd a template for the port Makefiles (diff)
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
Notes
Notes: svn path=/head/; revision=373973
Diffstat (limited to 'editors')
-rw-r--r--editors/vim-lite/Makefile2
-rw-r--r--editors/vim/Makefile10
-rw-r--r--editors/vim/files/vimrc23
-rw-r--r--editors/vim/pkg-plist4
4 files changed, 33 insertions, 6 deletions
diff --git a/editors/vim-lite/Makefile b/editors/vim-lite/Makefile
index b12efbf9145a..1d58964e4e02 100644
--- a/editors/vim-lite/Makefile
+++ b/editors/vim-lite/Makefile
@@ -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)
diff --git a/editors/vim/Makefile b/editors/vim/Makefile
index e1fe2bff366f..cda964c86572 100644
--- a/editors/vim/Makefile
+++ b/editors/vim/Makefile
@@ -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 after exit
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/
diff --git a/editors/vim/files/vimrc b/editors/vim/files/vimrc
new file mode 100644
index 000000000000..21df2d3f1b11
--- /dev/null
+++ b/editors/vim/files/vimrc
@@ -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
diff --git a/editors/vim/pkg-plist b/editors/vim/pkg-plist
index 874bfc788132..17798136829f 100644
--- a/editors/vim/pkg-plist
+++ b/editors/vim/pkg-plist
@@ -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