You are probably using vim in compatible mode. This means it behaves exactly like the traditional vi editor.
First make sure you have the full vim installed. If you have problems locating the packages for your distribution I suggest you do an
AAP install of vim. It works great for me and you'll get the very latest version.
When in vim, to enable syntax highlighting type these commands:
:set nocompatible <enter>
:syntax on <enter>
You can set your default preferences in ~/.vimrc and ~/.gvimrc. The latter is loaded by vim-gtk (if you use the GTK+ interface). I have my .vimrc sourced from .gvimrc so I set all my preferences in ~/.vimrc and only the graphical ones in ~/.gvimrc.
My .vimrc:
Code:
set hlsearch
set ignorecase
set softtabstop=4
set shiftwidth=4
set showmatch
" Make program (javac for compiling Java code, use :cl to list errors, :cn to jump to next error
set makeprg=javac\ %
set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%#
" Map smart stuff
nmap <silent> <C-N> :silent noh<CR> " Maps Ctrl+N to :nohls
My .gvimrc:
Code:
"Source (parse) the .vimrc file
so ~/.vimrc
"Set color scheme downloaded from www.vim.org
colo oceanblack
" Set font to use in GUI mode, if you don't use the GTK2 version you need to use classic X font names
set guifont=Andale\ Mono\ 8
Håkan