How to Install VIM Text Editor on FreeBSD 12

You just moved from Linux or Windows to FreeBSD and you’re wondering how you can install VIM Text Editor on FreeBSD 12 ?. Choosing the right text / code editor for your daily tasks is crucial to ensure you deliver in time and keep up with the workload.

VIM comes with an impressive set of features which can be extended using the plenty of plugins available for various Programming Languages. It is sad that FreeBSD 12 is not shipped with VIM text editor but it can easily be installed using ports or binary installation.

$ vim
vim: Command not found.

Install VIM Text Editor on FreeBSD 12 by running the command:

# pkg install vim
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01    
Fetching packagesite.txz: 100%    6 MiB 431.1kB/s    00:15    
Processing entries: 100%
FreeBSD repository update completed. 31468 packages processed.
All repositories are up to date.
The following 76 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
	vim: 8.1.0342
Number of packages to be installed: 76

The process will require 414 MiB more space.
70 MiB to be downloaded.

Proceed with this action? [y/N]: y

The binary package will be installed to:

# which vim

If you now execute the vim Command, you should get below output.

Configure vim With basic settings by creating a new file on ~/.vimrc with the contents below.

set nocompatible
set backup
set history=1000
set ignorecase
set smartcase
set hlsearch
set incsearch
set number
set showmatch
syntax on
highlight Comment ctermfg=LightCyan
set wrap

Save the file and then exit. You now have VIM Text Editor installed on your FreeBSD 12 operating system.

If you ’re new to VIM, read the Vim Cheat Sheet guide.