diff --git a/editors/vim/files/vimrc b/editors/vim/files/vimrc index 6faf60ca412d..cc200a086c9d 100644 --- a/editors/vim/files/vimrc +++ b/editors/vim/files/vimrc @@ -1,39 +1,45 @@ +" FreeBSD provides this file for three reasons: +" 1. Some of the default settings are not great (e.g. backspace) +" 2. FreeBSD requires some special handling (e.g. g:is_posix) +" 3. vim-tiny doesn't ship with $VIMRUNTIME/defaults.vim, so any +" settings that vim-tiny gets must appear in this file + " defaults.vim will override this file. Sourcing it here and " setting the skip flag prevents clobbering settings source $VIMRUNTIME/defaults.vim let skip_defaults_vim = 1 set nocompatible " Enable Vim mode (instead of vi emulation) 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 -try +try syntax on " Enable syntax highlighting catch | endtry " vim-tiny is installed without the syntax files if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" set fileencodings=ucs-bom,utf-8,latin1 endif " CTRL-L will mute highlighted search results nnoremap :nohlsearch 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