UserPreferences

VimConfig


You are not allowed to edit this page.

Clear message

ColinMacDonald's Vim configuration:

Note that the ^Ms here are two chars, and need to be replaced with <CTRL-V><RET> or whatever.

set nocompatible
" Don't use Ex mode, use Q for formatting
map Q gq
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

" This makes the search hilight black on gray
highlight Search ctermbg=7

set t_kb=^H
fixdel

" source $VIMRUNTIME/vimrc_example.vim
behave xterm
set selectmode=mouse
set nobackup       
set nowritebackup
set ruler
set backspace=indent,eol,start           
set autoindent     
set tabstop=4      
set softtabstop=4  
set expandtab      
set shiftwidth=4
au BufRead *.java silent loadview
au BufWrite *.java mkview    
au BufUnload *.java mkview

set statusline=%F%y%r%m%l,%c-%p
set showcmd

" make the F8 key insert the inter-method break line.
imap <F8> //---------------------------------------------------------------------------^M
nmap <F8> 0i^M  //---------------------------------------------------------------------------^M^[

" make the F7 key insert a new method definition.
imap <F7> /**^M * Method description^M*^M* @param variable description^M* @return description^M* @exception ExceptionClass description^M*/^M^?public void doStuff(Object param)^M{^M}^M^[
nmap <F7> 0i^M  /**^M * Method description^M*^M* @param variable description^M* @return description^M* @exception ExceptionClass description^M*/^M^?public void doStuff(Object param)^M{^M}^M^[

" make the F6 key insert a for loop
imap <F6> for ( int i = 0; i < XXX; i++ )^M{^M}
nmap <F6> 0i^M  for ( int i = 0; i < XXX; i++ )^M{^M}^[

" reformat the current line
nmap <F5> :,!fmt^M