Vim is a highly configurable text editor built to enable efficient text editing.
It is an improved version of the vi editor distributed with most UNIX systems.
Vim is often called a "programmer's editor," and so useful for programming that
many consider it an entire IDE. It's not just for programmers, though. Vim is
perfect for all kinds of text editing, from composing email to editing
configuration files.
FreeBSD has the following Vim packages:
* vim: Console-only Vim (vim binary) with all runtime files
* vim-gtk3, -gtk2, -motif: Console Vim plus a GUI (gvim binary)
* vim-x11: Console Vim only, with xclipboard support
* vim-tiny: Vim binary only, with no runtime files. Not useful for most people;
intended for minimal (ex. jail) installations
===> The following configuration options are available for vim-9.2.1178:
MAKE_JOBS=off: Enable parallel build
NLS=on: Native Language Support
XTERM_SAVE=off: Restore xterm screen after exit
XXD=on: Install xxd hexdumper
====> Optional language bindings
LUA=off: Lua scripting language support
PERL=off: Perl scripting language support
RUBY=off: Ruby bindings or support
SCHEME=off: MzScheme (Racket) bindings
TCL=off: Tcl scripting language support
====> Options available for the single CTAGS: you have to select exactly one of them
CTAGS_BASE=on: Use system ctags
CTAGS_EXUBERANT=off: Use exctags instead of ctags
CTAGS_UNIVERSAL=off: Use uctags instead of ctags
===> Use 'make config' to modify these settings
Reason:
The Vim port no longer installs a system-wide vimrc. It drastically affected
config loading order, and led to various settings being clobbered, duplicated,
or ignored.
Vim's provided defaults.vim (/usr/local/share/vim/vim90/defaults.vim) continues
to be read just as before, but its settings are no longer clobbered. Take a look
in there for any settings you may want to change, and do ':h initialization' to
see where Vim looks for config files.
Reason:
The vim ports have been completely reworked to take advantage of flavors.
The biggest change is that the `vim' package is now console-only. If
you want the GTk3 GUI, you'll need to install the `vim-gtk3' package
instead. All the GUI toolkits have their own package now: vim-gtk3,
vim-gtk2, -athena, -motif, and -x11. The vim-tiny package still exists.
Also: only python3 bindings are included now. There are very few plugins
written in Perl or Ruby, so there really wasn't a need to bundle those
languages with Vim. They still exist as OPTIONS, so you can still enable
them if you'd like. Also, support for py27 has been dropped.
editors/vim: Update to 9.2.0272 (security)
This update addresses GHSA-2gmj-rpqf-pxvh (see advisory link below):
Summary (from advisory):
A bug chain in Vim allows arbitrary OS command execution when a user
opens a crafted file. The tabpanel option is missing the P_MLE flag,
allowing a modeline to inject a %{expr} expression string without
requiring modelineexpr to be enabled. Although Vim correctly
evaluates the expression inside the sandbox, autocmd_add() lacks
a check_secure() call, allowing sandboxed code to register an
autocommand that fires after the sandbox exits.
Security: https://github.com/vim/vim/security/advisories/GHSA-2gmj-rpqf-pxvh
editors/vim: Update to 9.2.0204 (security fix)
In particular, this addresses the following:
Problem: The glob() function on Unix-like systems does not escape
newline characters when expanding wildcards. A maliciously
crafted string containing '\n' can be used as a command
separator to execute arbitrary shell commands via
mch_expand_wildcards(). This depends on the user's 'shell'
setting.
Solution: Add the newline character ('\n') to the SHELL_SPECIAL
definition to ensure it is properly escaped before being
passed to the shell (pyllyukko).
Security: GHSA-w5jw-f54h-x46c
editors/vim: Update to 9.2.0073, multiple security fixes
While the minor has bumped, and much has changed from 9.1 to 9.2,
we've been incrementally adopting the patches so it's not "new" to us,
per se. All the gory details are at:
https://github.com/vim/vim/blob/master/runtime/doc/version9.txt
This commit adds patches for six security issues:
patch 9.2.0073: [security]: possible command injection using netrw
Problem: [security]: Insufficient validation of hostname and port in
netrw URIs allows command injection via shell metacharacters
(ehdgks0627, un3xploitable).
Solution: Implement stricter RFC1123 hostname and IP validation.
Use shellescape() for the provided hostname and port.
(Only the first 15 lines of the commit message are shown above )
editors/vim: Update to 9.1.1744 and handle wayland properly
Add --without-wayland for everything except the gtk3 FLAVOR. That
flavor now has a hard dep on wayland (it's already present from the
default gtk30 and libxkbcommon configurations).
This is a NOOP for everybody except gtk3 users who explicitly disabled
wayland in both gtk30 and libxkbcommon. The only effect for those
users is that wayland is now a LIB_DEP. There is no runtime effect
either way.
In the below PR, Piotr identified that vim will eagerly link against
wayland if present, even for a pure-console build.
The only toolkit that vim uses that can use wayland is gtk3, so
(Only the first 15 lines of the commit message are shown above )
editors/vim: Update to 9.1.1723
This update changes how python plugins are handled. Previosuly, we
linked directly against python, requiring all vim installations to
have a dependency on python. Perhaps that's fine for flavours like
gtk20 and gtk30, but it's burdensome and often unexpected for TUI
users.
Now, we use dynamic loading of python libraries, which means that
vim should automatically support python plugins if python is
installed. If python is NOT installed, no harm/no foul, just no
python plugin support.
I'm not expecting this to cause any issues, but if it does please
reach out!
editors/vim: Pull in gnome.mk's gdkpixhufextra to fix runtime warnings
Non-fatal console warnings were generated when running vim-gtk3 and 2.
This is due to certain loadable modules moving from gdk-pixhuf to
gdk-pixbuf-extras.
See
https://forums.freebsd.org/threads/gvim-messages-gdkpixbuf-warning-and-glib-gobject-critical.98679/
PR: Yusuf Yaman
Reported by: thierry, in the above FreeBSD Forums post
MFH: 2025Q3
editors/vim: Update to 9.1.1563
CWE for both CVEs:
Improper Limitation of a Pathname to a Restricted Directory ('Path
Traversal') (CWE-22)
Security: CVE-2025-53905
Security: CVE-2025-53906
gnome.mk: rename gdkpixbuf2 to gdkpixbuf to prepare for port move
The GTK 1-based gdk-pixbuf has not existed for some time.
No functional or package changes.
editors/vim: Update to 9.1.1198 (security)
potential data loss with zip.vim and special crafted zip files
Date: 12.03.2025
Severity: Medium
CVE: CVE-2025-29768
CWE: Improper Neutralization of Argument Delimiters in a Command ('Argument
Injection') (CWE-88)
Summary
potential data loss with zip.vim and special crafted zip files
Description
Vim is distributed with the zip.vim plugin, that allows easy editing and
viewing of zip archives.
(Only the first 15 lines of the commit message are shown above )
editors/vim: Update to 9.1.1164 (security, high severity)
From the Github Advisory
(https://github.com/vim/vim/security/advisories/GHSA-wfmf-8626-q3r3):
Summary:
Potential code execution with tar.vim and special crafted tar
files.
Description:
Vim is distributed with the tar.vim plugin, that allows easy
editing and viewing of (compressed or uncompressed) tar files.
Since commit 129a844 (Nov 11, 2024 runtime(tar): Update tar.vim to
support permissions), the tar.vim plugin uses the ":read " ex
(Only the first 15 lines of the commit message are shown above )
editors/vim: Update to 9.1.0158
While here:
- Add explicit --disable-libsodium [1]
- Clear PORTREVISION on xxd as it gets a bump from this update
PR: 277545
Reported by: dewayne heuristicsystems com au [1]
*/*: Fix broken UCL
Most of this is a missing ] or }. In one case, it was leading
whitespace before a EOM tag.
PR: 259533
Approved by: portmgr (blanket)
editors/vim: Add XXD option
Rather than conflicting with xxd (which presents a dependency problem
for users who don't want to install vim), add an option to depend on
xxd. So, the vim port will no longer install xxd, but the option is
on by default so most users won't see a difference (other than the new
dependency).
PR: 274104
Reported by: corvink
editors/vim: Update to 9.0.1857
On 5 August, 2023, Bram Moolenaar, the long-time maintainer and
architect of Vim, passed away. In addition to being a legendary
software engineer and open-source advocate, he was a major
philanthropist. His impact on the OSS world was immense, as was
his dedication to speaking out for those whose voices are too
often missed.. The Vim project remains in good hands with the
Vim community.
all: remove explicit versions in USES=python for "3.x+"
The logic in USES=python will automatically convert this to 3.8+ by
itself.
Adjust two ports that only had Python 3.7 mentioned but build fine
on Python 3.8 too.
finance/quickfix: mark BROKEN with PYTHON
libtool: compile: c++ -DHAVE_CONFIG_H -I. -I../.. -I -I. -I.. -I../.. -I../C++
-DLIBICONV_PLUG -DPYTHON_MAJOR_VERSION=3 -Wno-unused-variable
-Wno-maybe-uninitialized -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong
-fno-strict-aliasing -DLIBICONV_PLUG -Wall -ansi
-Wno-unused-command-line-argument -Wpointer-arith -Wwrite-strings
-Wno-overloaded-virtual -Wno-deprecated-declarations -Wno-deprecated -std=c++0x
-MT _quickfix_la-QuickfixPython.lo -MD -MP -MF
.deps/_quickfix_la-QuickfixPython.Tpo -c QuickfixPython.cpp -fPIC -DPIC -o
.libs/_quickfix_la-QuickfixPython.o
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean
'-Wno-uninitialized'? [-Wunknown-warning-option]
QuickfixPython.cpp:175:11: fatal error: 'Python.h' file not found
^~~~~~~~~~
1 warning and 1 error generated.
Reviewed by: portmgr, vishwin, yuri
Differential Revision: <https://reviews.freebsd.org/D40568>
sysutils/xxd: New port
Xxd creates a hex dump of a given file or standard input.
It can also convert a hex dump back to its original binary form.
This is the standalone version of the xxd tool provided by vim.
Submitted by: Gianmarco Giovannelli <gmarco@giovannelli.it>
*/*: Fix some ports conversion from USE_RUBY to USES=ruby
In my previous commit 18c6e18 I missed some ports where RUBY was
optional. This commit fixes those missing ports and fixes INDEX build.
Approved by: portmgr
Fixes: 18c6e18 Mk/**ruby.mk: Switch from USE_RUBY=yes to USES=ruby
Remove WWW entries moved into port Makefiles
Commit b7f05445c00f has added WWW entries to port Makefiles based on
WWW: lines in pkg-descr files.
This commit removes the WWW: lines of moved-over URLs from these
pkg-descr files.
Approved by: portmgr (tcberner)
Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.
Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.
There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.
(Only the first 15 lines of the commit message are shown above )
editors/vim: Allow system vimrc, and include defaults.vim for vim-tiny
Two changes here (along with bumping to the latest upstream patch):
1) In the previous Vim commit, support for the system-wide vimrc/gvimrc
was dropped because we went through contortions to fix loading order
and monkey around with various defaults.
However, many people used that file for their system. This commit
re-adds support for loading it. All work for untangling the mess of
loading defaults.vim and preventing circular loads is left to the
user. We just support loading that file; what you do with it is your
call.
2) vim-tiny is supposed to be the smallest possible Vim experience,
being just the binary and no runtime library. However, without a
viable defaults.vim, it's essentially just a larger, slower Vi.
The vim-tiny package now ships with defaults.vim, which is patched
to prevent errors from Vim loading the syntax library (which is not
installed).
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
editors/vim: Add some explanatory comments to the vimrc
Our vimrc duplicates settings from $VIMRUNTIME/defaults.vim, which
appears odd.
However, it's actually required because of vim-tiny. vim-tiny installs
an empty defaults.vim stub, meaning that it only gets the settings that
appear in our vimrc.
PR: 265502
editors: remove 'Created by' lines
A big Thank You to the original contributors of these ports:
* Adam Saponara <as@php.net>
* Adam Weinberger <adamw@FreeBSD.org>
* Akinori MUSHA aka knu <knu@idaemons.org>
* Alexey Dokuchaev <danfe@FreeBSD.org>
* Andreas Kohout <shanee@augusta.de>
* Andrej Zverev <az@inec.ru>
* Andrey Zakhvatov
* Anton Tornqvist <antont@inbox.lv>
* Bill Fumerola <billf@chc-chimes.com>
* Bob Eager <bob@eager.cx>
* Chris D. Faulhaber <jedgar@fxp.org>
(Only the first 15 lines of the commit message are shown above )
editors/vim: Update to 9.0.0016
This is a major release. The biggest new feature is vim9 script, a
backwards-incompatible dialect that improves some of the worst
headaches of classic vimscript.
editors/vim: Update to 8.2.5052 and fix vimrc clobbering
Vim runtime's defaults.vim will clobber global vimrc settings. It's
fine for the settings we provide, but other edits to that file can
get lost.
To work around this, defaults.vim is now directly sourced and a flag
is set to stop that file from getting loaded a second time. Thanks go
to Anton Saietskii for that bit of magic.
PR: 251420
editors/vim: Update to 8.2.4669, add x11 support, drop Athena
Vim no longer includes the Athena (Xaw) frontend, so drop the
athena flavor.
As requested by many (and based on a patch from scf), restore the x11
flavor. The x11 flavor is a bit odd; it doesn't actually include an X
GUI. As a result, when Vim got flavorized I dropped it as I thought
it was vestigial. What the x11 flavor actually provides is support for
some X interaction (mainly xclipboard), and is highly useful to people
who run console Vim within X.
The outcry was pretty swift, and I'd like to thank all the people who
took the time to email me about it, and especially scf who provided
the bulk of this patch.
I'm going to MFH this due to the athena build failure.
editors/vim: Update to 8.2.3570
Remove x11 flavor. It adds xclip support but doesn't contain a GUI,
making it more confusing than helpful.
I doubt anyone really used it, but if so then vim-athena, the simplest
X GUI toolkit, is the one you're looking for.
INSTALLS_ICONS: retire the macro and rework the related dependencies
While here, make sure gtk-update-icon-cache is only on run dependency
where added as a dependency
Enforce gtk3 to depend on gtk-update-icon-cache (previously it was
inheriting the dependency)