Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Nov 2014 02:32:19 +0000 (UTC)
From:      Alfred Perlstein <alfred@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r372622 - in head/editors/vim: . files
Message-ID:  <201411160232.sAG2WJ4Z084790@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alfred (src committer)
Date: Sun Nov 16 02:32:18 2014
New Revision: 372622
URL: https://svnweb.freebsd.org/changeset/ports/372622
QAT: https://qat.redports.org/buildarchive/r372622/

Log:
  A nice default vimrc for new users.
  
  Otherwise users get "vi compat mode" which gives very old and
  unfriendly vi defaults that breaks arrow keys and backspace as well
  as no color.
  
  Expert users can disable this default vimrc via "make config".
  
  Approved by: delphij

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

Modified: head/editors/vim/Makefile
==============================================================================
--- head/editors/vim/Makefile	Sun Nov 16 00:37:01 2014	(r372621)
+++ head/editors/vim/Makefile	Sun Nov 16 02:32:18 2014	(r372622)
@@ -20,13 +20,14 @@ COMMENT?=	Improved version of the vi edi
 
 PATCH_DEPENDS=	${LOCALBASE}/bin/gpatch:${PORTSDIR}/devel/patch
 
-OPTIONS_DEFINE=	CSCOPE EXUBERANT_CTAGS LUA NLS PERL PYTHON RUBY TCL XTERM_SAVE
+OPTIONS_DEFINE=	CSCOPE EXUBERANT_CTAGS LUA NLS PERL PYTHON RUBY TCL XTERM_SAVE DEFAULT_VIMRC
 OPTIONS_SINGLE=	UI
 OPTIONS_SINGLE_UI=	ATHENA CONSOLE GNOME GTK2 MOTIF X11
 OPTIONS_SUB=	yes
 ATHENA_DESC=		Athena GUI toolkit
 CSCOPE_DESC=		cscope support
 CONSOLE_DESC=		Console/terminal mode
+DEFAULT_VIMRC_DESC=	Install a default vimrc for new users
 EXUBERANT_CTAGS_DESC=	Use exctags instead of ctags
 UI_DESC=		User interface
 XTERM_SAVE_DESC=	Restore xterm screen after exit
@@ -88,6 +89,8 @@ MAKE_ARGS+=	CONF_OPT_FEAT=--with-feature
 PLIST_SUB+=	NON_LITE=""
 .endif
 
+OPTIONS_DEFAULT+=	DEFAULT_VIMRC
+
 ATHENA_MAKE_ARGS=	CONF_OPT_GUI=--enable-gui=athena
 ATHENA_USE=		XORG=xaw
 CONSOLE_MAKE_ARGS=	CONF_OPT_GUI="--enable-gui=no --without-x"
@@ -121,6 +124,10 @@ X11_USE=		XORG=x11,xt
 IGNORE=		this port has new UI option (CONSOLE) for users who do not need GUI support. Please run "make config" to modify your setting
 .endif
 
+.if ${PORT_OPTIONS:MDEFAULT_VIMRC}
+DEFAULT_VIMRC_LOCATION=${PREFIX}/share/vim
+.endif
+
 .if ${PORT_OPTIONS:MCONSOLE} || ${PORT_OPTIONS:MX11}
 PLIST_SUB+=	GUI="@comment "
 .else
@@ -183,5 +190,8 @@ post-install:
 .endif
 	${INSTALL_DATA} ${FILESDIR}/vietnamese_viscii.vim ${STAGEDIR}${DATADIR}/${VIM_VER}/keymap/
 	${TOUCH} ${STAGEDIR}${DATADIR}/${VIM_VER}/lang/.keepme
+.if ${PORT_OPTIONS:MDEFAULT_VIMRC}
+	${INSTALL_DATA} ${FILESDIR}/vimrc ${STAGEDIR}${DEFAULT_VIMRC_LOCATION}/vimrc
+.endif
 
 .include <bsd.port.post.mk>

Added: head/editors/vim/files/vimrc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/vim/files/vimrc	Sun Nov 16 02:32:18 2014	(r372622)
@@ -0,0 +1,49 @@
+" Uncomment the next line to make Vim more Vi-compatible
+" From ubuntu's vimrc, slightly modified for FreeBSD ports.
+"set compatible
+
+" Vim5 and later versions support syntax highlighting. Uncommenting the next
+" line enables syntax highlighting by default.
+if has("syntax")
+  syntax on
+endif
+
+" This is the problem most of the time.
+set nocompatible
+
+" Sensible backspace setting, seems to work on most terminals.
+set backspace=2
+
+" If using a dark background within the editing area and syntax highlighting
+" turn on this option as well
+"set background=dark
+
+" Uncomment the following to have Vim jump to the last position when
+" reopening a file
+"if has("autocmd")
+"  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
+"endif
+
+" Uncomment the following to have Vim load indentation rules and plugins
+" according to the detected filetype.
+"if has("autocmd")
+"  filetype plugin indent on
+"endif
+
+" The following are commented out as they cause vim to behave a lot
+" differently from regular Vi. They are highly recommended though.
+"set showcmd		" Show (partial) command in status line.
+"set showmatch		" Show matching brackets.
+"set ignorecase		" Do case insensitive matching
+"set smartcase		" Do smart case matching
+"set incsearch		" Incremental search
+"set autowrite		" Automatically save before commands like :next and :make
+"set hidden             " Hide buffers when they are abandoned
+"set mouse=a		" Enable mouse usage (all modes)
+
+" Source a global configuration file if available
+if filereadable($VIMRUNTIME . "/vimrc")
+  source $VIMRUNTIME . "/vimrc"
+endif
+
+



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