aboutsummaryrefslogtreecommitdiff
path: root/editors/vim
diff options
context:
space:
mode:
authorAdam Weinberger <adamw@FreeBSD.org>2019-06-01 14:35:55 +0000
committerAdam Weinberger <adamw@FreeBSD.org>2019-06-01 14:35:55 +0000
commit41fd417789b35b7dda98b7bb72b6e85423e5c162 (patch)
tree1c233aa6982ad14d6e54d233d4b8f9cc49c146b9 /editors/vim
parent969c944841caf6182d936d0c3397ef3ef2c09c35 (diff)
downloadports-41fd417789b35b7dda98b7bb72b6e85423e5c162.tar.gz
ports-41fd417789b35b7dda98b7bb72b6e85423e5c162.zip
Update to Vim to patchlevel 1439, change default python, improve vimrc
Some big changes in this update: * Patchlevel 1439 * Default python is now 3.x instead of 2.x [1] * Expose DEFAULT_VIMRC option (on by default) to vim-tiny Also, many changes to the default vimrc. Any changes necessarily risk contention, but then I remembered that I actually maintain editors/vim, so here we are. The idea here is that Vim, by default, behaves like Vi, and people who install the Vim port do so because they DON'T just want Vi. I've enabled features that are basic quality-of-life settings for me, and that I hope will be ideal for most end-users. Important changes in the default vimrc: * Don't install gvimrc at all. gvim should load $ETCDIR/vimrc anyway. I can't test gvim locally, so someone please let me know if I broke it. * Turn on autoindent * Disable console bells entirely. Console bells are terrible. * Enable incsearch: highlights search results as you type them * ^L clears search highlights while redrawing the screen * Assume fast terminal by default * Explain every setting in comments Many of these settings are modeled after the defaults in NeoVim, which really got it right. I want our default vimrc to be usable and ideal, so please let me know if anything doesn't work for you, or if you have other settings you'd like to see changed in the default. In particular, please let me know if I broke gvim by removing the gvimrc! PR: 235142 [1] Submitted by: John W. O'Brien [1]
Notes
Notes: svn path=/head/; revision=503239
Diffstat (limited to 'editors/vim')
-rw-r--r--editors/vim/Makefile26
-rw-r--r--editors/vim/distinfo6
-rw-r--r--editors/vim/files/patch-src_po_Makefile14
-rw-r--r--editors/vim/files/vimrc50
-rw-r--r--editors/vim/pkg-plist1
5 files changed, 42 insertions, 55 deletions
diff --git a/editors/vim/Makefile b/editors/vim/Makefile
index 7ada5988690a..33d213e0fdaa 100644
--- a/editors/vim/Makefile
+++ b/editors/vim/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= vim
-PORTVERSION= 8.1.1248
+PORTVERSION= 8.1.1439
DISTVERSIONPREFIX= v
CATEGORIES= editors
@@ -14,11 +14,11 @@ LICENSE_NAME= VIM License
LICENSE_FILE= ${WRKSRC}/runtime/doc/uganda.txt
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-CONFLICTS_INSTALL?= vim-console vim-tiny
-
USES= cpe iconv ncurses pkgconfig shebangfix
USE_GITHUB= yes
+CONFLICTS_INSTALL?= vim-console vim-tiny
+
CONFIGURE_ARGS= --enable-gui=${GUI} \
--enable-multibyte \
--with-tlib=ncurses
@@ -38,7 +38,7 @@ VIM_VER= ${PORTNAME}${PORTVERSION:R:S|.||g}
# OPTIONS
# ### Make sure any new options are excluded below in CONSOLE/TINY
-OPTIONS_DEFAULT= CSCOPE DEFAULT_VIMRC CTAGS_EXUBERANT GTK3 PERL PYTHON2 RUBY
+OPTIONS_DEFAULT= CSCOPE DEFAULT_VIMRC CTAGS_EXUBERANT GTK3 PERL PYTHON3 RUBY
OPTIONS_DEFINE= CSCOPE DEFAULT_VIMRC NLS XTERM_SAVE
OPTIONS_SINGLE= CTAGS UI
OPTIONS_SINGLE_CTAGS= CTAGS_BASE CTAGS_EXUBERANT CTAGS_UNIVERSAL
@@ -47,20 +47,13 @@ OPTIONS_GROUP= LANGBIND
OPTIONS_GROUP_LANGBIND= LUA PERL PYTHON2 PYTHON3 RUBY SCHEME TCL
OPTIONS_SUB= yes
-.if defined(CONSOLE)
-OPTIONS_DEFAULT= DEFAULT_VIMRC
+.if defined(CONSOLE) || defined(TINY)
OPTIONS_SLAVE= CONSOLE
# Exclude everything except the two options above
OPTIONS_EXCLUDE:= ${OPTIONS_DEFINE:NDEFAULT_VIMRC} \
${OPTIONS_SINGLE_UI:NCONSOLE} \
${OPTIONS_GROUP_LANGBIND} \
${OPTIONS_SINGLE_CTAGS}
-.elif defined(TINY)
-OPTIONS_SLAVE= CONSOLE
-OPTIONS_EXCLUDE:= ${OPTIONS_DEFINE} \
- ${OPTIONS_SINGLE_UI:NCONSOLE} \
- ${OPTIONS_GROUP_LANGBIND} \
- ${OPTIONS_SINGLE_CTAGS}
.endif
DEFAULT_VIMRC_DESC= Install bundled vimrc as default setting
@@ -171,6 +164,10 @@ post-configure:
# Needed when devel/libsysinfo is installed:
@${REINPLACE_CMD} -e '/#define HAVE_SYSINFO 1/ d' ${WRKSRC}/src/auto/config.h
+post-install-DEFAULT_VIMRC-on:
+ @${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${INSTALL_DATA} ${FILESDIR}/vimrc ${STAGEDIR}${ETCDIR}/vimrc.sample
+
.if !defined(TINY)
post-install:
@${RM} ${STAGEDIR}${PREFIX}/bin/ex
@@ -197,11 +194,6 @@ post-patch-LUA-on:
post-patch-XTERM_SAVE-on:
@${REINPLACE_CMD} -e '/FEAT_XTERM_SAVE/ s|.*|#define FEAT_XTERM_SAVE|' ${WRKSRC}/src/feature.h
-post-install-DEFAULT_VIMRC-on:
- @${MKDIR} ${STAGEDIR}${ETCDIR}
- ${SED} -e '/set nocompatible/d' ${FILESDIR}/vimrc > ${STAGEDIR}${ETCDIR}/gvimrc.sample
- ${INSTALL_DATA} ${FILESDIR}/vimrc ${STAGEDIR}${ETCDIR}/vimrc.sample
-
post-install-NLS-off:
@${MKDIR} ${STAGEDIR}${DATADIR}/${VIM_VER}/lang
@${MKDIR} ${STAGEDIR}${DATADIR}/${VIM_VER}/keymap
diff --git a/editors/vim/distinfo b/editors/vim/distinfo
index 12a3600414fa..ed4e771e3408 100644
--- a/editors/vim/distinfo
+++ b/editors/vim/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1556841484
-SHA256 (vim-vim-v8.1.1248_GH0.tar.gz) = 5caa9b9d59bcfe172406352269ee5bc9d2d2837cf91eb937419454e0e9cc9a0e
-SIZE (vim-vim-v8.1.1248_GH0.tar.gz) = 14166070
+TIMESTAMP = 1559398078
+SHA256 (vim-vim-v8.1.1439_GH0.tar.gz) = f1dc6c76175bbe655686a418d50f46ce0c771b7702cb26d2ee32fd6dccc6ecde
+SIZE (vim-vim-v8.1.1439_GH0.tar.gz) = 14284028
diff --git a/editors/vim/files/patch-src_po_Makefile b/editors/vim/files/patch-src_po_Makefile
deleted file mode 100644
index ba0ffd232981..000000000000
--- a/editors/vim/files/patch-src_po_Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
---- src/po/Makefile.orig 2019-05-02 23:54:55 UTC
-+++ src/po/Makefile
-@@ -165,9 +165,9 @@ $(PACKAGE).pot: ../*.c ../if_perl.xs ../GvimExt/gvimex
- po/gvim.desktop.in po/vim.desktop.in
- mv -f ../$(PACKAGE).po $(PACKAGE).pot
-
--%.desktop: %.desktop.in $(POFILES)
-+gvim.desktop vim.desktop: $@.in $(POFILES)
- @echo $(LANGUAGES) | tr " " "\n" |sed -e '/\./d' | sort > LINGUAS
-- $(MSGFMT) --desktop -d . --template $< -o $@
-+ $(MSGFMT) --desktop -d . --template $@.in -o $@
-
- update-po: $(LANGUAGES)
-
diff --git a/editors/vim/files/vimrc b/editors/vim/files/vimrc
index cd041eb34648..b62c245beaa2 100644
--- a/editors/vim/files/vimrc
+++ b/editors/vim/files/vimrc
@@ -1,24 +1,34 @@
-if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
- set fileencodings=ucs-bom,utf-8,latin1
-endif
+set nocompatible " Enable Vim mode (instead of vi emulation)
-let g:is_posix = 1
-set nocompatible
-set bs=indent,eol,start
-set history=50
-set ruler
+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
-if &t_Co > 2 || has("gui_running")
- syntax on
- set hlsearch
-endif
+try
+ syntax on " Enable syntax highlighting
+catch | endtry " vim-tiny is installed without the syntax files
-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
+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-plist b/editors/vim/pkg-plist
index d596ab026a52..9b104283851d 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%%/gvimrc.sample
%%DEFAULT_VIMRC%%@sample %%ETCDIR%%/vimrc.sample
%%GUI%%%%NLS%%man/fr/man1/eview.1.gz
%%NLS%%man/fr/man1/evim.1.gz