" .vimrc
"
" Copyright (c) 2006 by PiT (Pierre BETTENS) <pbettens@heb.be>
"
" You can use this configuration file at your convenience.
" I think it's beter if you understand each couple attribute/value but ...
" Remember, I encourage whose do not understand to ask question. 
" I hope this file will make your work easier and your comprehension of vim. 
" 
" I use this configuration file but I give NOT any warranty that this file 
" will work fine for you. If you don't like my abbréviation, just change it. 
" If part of this file is not usefull for you I don't care, cut it. 
"
" since:            january 1995
" last revision:    10 octobre 2007

"
" Set of setting
"
" I say vim is not vi
set nocompatible
" For a good indentation
set autoindent
set smartindent
" I want to see parenthesis balance
set showmatch
" I cut line to 80 char thus I have never long line. 
" Java recommand tab to be 8 and shift 4
set tabstop=4
set shiftwidth=4
set textwidth=82
" Set visual bell, ie turn off the beep sounds and replace it by flash screen
set vb
" Hide the mouse pointer while typing
set mousehide
" Increase  searching. When I search pattern with /foo, vim go to the fisrt f
" after I type f, then fisrt fo when I type fo ... 
set incsearch
" By default search if vim know the file's syntax, if yes color with elflord
" color. You can choice your colorscheme in vi with TAB key
syntax on
"colorscheme default 
" Max number of tabs when I open vim with -p option
set tabpagemax=25
" When vim start or open a file, it go to the dir who contain the file
set autochdir
" I want always see my statusline with filename, size and some other things
set laststatus=2
set statusline=%a\ %F%1*%m%*%10{getfsize(expand('%'))}o%10l/%L
highlight StatusLine term=bold cterm=bold ctermbg=9
" I wan autocomplet like bash
set wildmode=longest,list

" I learn vim, I map some extension file with file syntax
au BufRead,BufNewFile *.inc set filetype=asm
au BufRead,BufNewFile *.i set filetype=html
au BufRead,BufNewFile *.src set filetype=html
au BufRead,BufNewFile *.as set filetype=java    "Action script syntax close to Java syntax ;-) 

"
" Some abbreviations
" Synopsis: abbr key value
"
" Remember. A good abbreviation have a key who is NOT a common word ^^

" Some time my fingers failed
abbr itme item
abbr foonote footnote
abbr retrun return
abbr rigth right
abbr varaible variable
abbr vpsace vspace

" Java abbreviations
" To the end of the line you find some chars for well positionning the cursor
" (try with and without) 
abbr sout System.out.println("");<esc>hhha
abbr serr System.err.println("");<esc>hhha
abbr pr private
abbr pu public
abbr st static
abbr _scanner import java.util.Scanner ; <cr>
abbr _class public class <esc>:r!echo %:r<cr><up>A<del><end> { <cr>
abbr _main public static void main ( String[] args ) { <cr>
abbr _clavier Scanner clavier = new Scanner ( System.in ) ;
abbr _entete /** <cr> <esc>:r!echo %:r<cr><up>A<del><end> <cr><cr>@author PbT<cr>@since <esc>:r!date +"\%d \%B \%Y" <esc>i<bs><end><cr>/<cr><esc>kkkkko



" LaTeX abbreviations
" If you don't care, cut it.
abbr s{         \section{
abbr ss{    \subsection{
abbr sss{   \subsubsection{
abbr bf{        \textbf{
abbr it{    \textit{<esc>la
abbr tt{    \texttt{
abbr sc{    \textsc{
abbr \i         \item
" When I write text; I like to write english terms in italic.
abbr threadI \textit{thread}
abbr mutexI \textit{mutex}

" I don't speak good English. I like to say it when I speak on a forum or by
" mail. (Yes I write mail with vim)
abbr _E (English is not my native langage)

"Web
abbr _IDE <abbr title="Integrated Development Environment">IDE</abbr>
abbr _pbt <abbr title="Pierre BETTENS">PbT</abbr>
abbr _mcd <abbr title="Marco CODUTTI">MCD</abbr>

" Just for "fun" or exercice me
iab ladate <C-R>=strftime("%A %d %B %Y")<CR>
iab lheure <C-R>=strftime("%H:%M")<CR>



"
" Other commands
"

" Comment (visual bloc)
" Highlight a bloc and press ;c or ;j. The bloc is commented
vmap ;c <ESC>`<i/*<cr><ESC>`>a<cr>*/<ESC>
vmap ;j <ESC>`<i/**<cr><ESC>`>a<cr>*/<ESC>


" LaTeX commands
com L w|!latex %
com V !xdvi %:r &
com Pdf w|!pdflatex %
com Xpdf !xpdf %:r.pdf &

" print file
com A2ps w|!a2ps % &

" Last abbreviation
" Automaticaly close '{' by '} // end <name>'
iab }// } // end - <esc>10h%$?\w\+\s*(<cr>"xy/\s*(<cr>/{<cr>:nohl<cr>%$"xpa