" vimrc - Jeff Aigner
set nomodeline
set nocompatible " switch to vim mode (as opposed to vi)
set ls=2 " allways show status line
set tabstop=4 " numbers of spaces of tab character
set shiftwidth=4 " numbers of spaces to (auto)indent
set scrolloff=3 " keep 3 lines when scrolling
set smartindent " smart indent
set autoindent " always set autoindenting on
set showcmd " display incomplete commands
set ruler " show the cursor position all the time
set visualbell t_vb= " turn off error beep/flash
set novisualbell " turn off visual bell
set nobackup " do not keep a backup file
set number " show line numbers
set ignorecase " ignore case when searching
set title " show title in console title bar
set ttyfast " smoother changes
set modeline " last lines in document sets vim mode
set modelines=3 " number lines checked for modelines
set shortmess=atI " Abbreviate messages
set nostartofline " don't jump to first character when paging
set whichwrap=b,s,h,l,<,>,[,] " move freely between files
filetype indent on " fixes python indentation
"set cindent " cindent - not good unless you only edit c
"set hlsearch " highlight searches
"set incsearch " do incremental searching
"set noignorecase " don't ignore case
"set ttyscroll=0 " turn off scrolling, didn't work well with PuTTY
"set autowrite " auto saves changes when quitting and swiching buffer
"set expandtab " tabs are converted to spaces, use only when required
"set sm " show matching braces, somewhat annoying...
"set nowrap " don't wrap lines
if version>=600
syntax on " syntax highlighing
set background=dark " adapt colors for dark background
colorscheme peachpuff " use this color scheme
" Filetypes (au = autocmd)
au filetype help set nonumber " no line numbers when viewing help
au filetype help nnoremap " Enter selects subject
au filetype help nnoremap " Backspace to go back
" this actually gets very annoying
" Automatically chmod +x Shell and Perl scripts
" au BufWritePost *.sh !chmod +x %
" au BufWritePost *.pl !chmod +x %
" au BufWritePost *.py !chmod +x %
" File formats
au BufNewFile,BufRead *.pls set syntax=dosini
au BufNewFile,BufRead modprobe.conf set syntax=modconf
endif
" Keyboard mappings
map ,1 :tabprevious " map 1 to open previous tab
map ,2 :tabnext " map 2 to open next tab
map ,3 :tabnew " map 3 to open a new tab
map ,4 :clo " map 4 to close a tab
map :silent noh " turn off highlighted search
map ,v :sp ~/.vimrc " edit my .vimrc file in a split
map ,e :e ~/.vimrc " edit my .vimrc file
map ,u :source ~/.vimrc " update the system settings from my vimrc file
" Automatically load and save folds
"au BufWinLeave * mkview
"au BufWinEnter * silent loadview
set background=dark