d8888888b    888 .d8888b.888888888888888888888Y88b   d88P  .d8888b. 8888b
	       d888888888b   888d88P  Y88b   888    888        Y88b d88P  d88P  Y88b88888b
	      d88P88888888b  888Y88b.        888    888         Y88o88P   888    888888?88b
	     d88P 888888Y88b 888 "Y888b.     888    8888888      Y888P    888       888 ?88b
	    d88P  888888 Y88b888    "Y88b.   888    888           888     888       888  ?8bb
	   d88P   888888  Y88888      "888   888    888           888     888    888888   ?8bb
	  d8888888888888   Y8888Y88b  d88P   888    888           888  d8bY88b  d88P8888888888b
	 d88P     888888    Y888 "Y8888P"    888    8888888888    888  Y8P "Y8888P" 888     ?88b

Vim on FreeBSD

Posted Feb 15th, 2015

Vim takes a little bit of tweaking to get it running perfectly. These quick instructions will get you started.

Assuming your ports tree is up to date (if not, update using these instructions).

Note that we install the vim-lite port, which installs a default .vimrc file for us suitable for terminal use. If you're installing Vim in an X11 environment or need some additional options, you can install the standard Vim port and browse the included example configuration files afterwards.

# cd /usr/ports/editors/vim-lite
# make config && make config-recursive
# make && make install

Next, if you haven't done so already, you'll need to tweak your environment to correctly handle some control keys. This info is from this excellent page.

ee ~/.cshrc

While we're here, you may as well change the default editor from ee to vim:

setenv  EDITOR  vim

Add the following to the bottom of the file:

if ($term == "xterm" || $term == "vt100" \
            || $term == "vt102" || $term !~ "con*") then
          # bind keypad keys for console, vt100, vt102, xterm
          bindkey "\e[1~" beginning-of-line  # Home
          bindkey "\e[7~" beginning-of-line  # Home rxvt
          bindkey "\e[2~" overwrite-mode     # Ins
          bindkey "\e[3~" delete-char        # Delete
          bindkey "\e[4~" end-of-line        # End
          bindkey "\e[8~" end-of-line        # End rxvt

Finally, source the file to make the changes take effect immediately.

source ~/.cshrc

The vim-lite port installs a default .vimrc file for you; however, if you installed the standard package or need to restore the default, run this:

cp `find /usr/local/share/vim/ -type f -name vimrc_example.vim` ~/.vimrc

That's it, you're done. You'll probably want to tweak your ~/.vimrc file to your liking, but the defaults work pretty well.

Enjoy the wonderful world of Vim!

Home - Geocaching - PHP Scripts - Articles - Music - Programming - Hot Sauce Review
About This Site - Site Search - About Me - Link Directory - Contact Me

This site was constructed entirely by hand { more info }
Modified Monday, February 16th 2015 UTC

(C) Copyright 2000-2019 Marty Anstey ~~ I didn't rip you off, so don't rip me off.
server: ca-to-1