" /etc/vim/vimrc, ~/.vimrc or ~/.exrc"VIMConfigurationFile
" Made by Pierre Mavro"Version0.3
" Show matching parenthesesset showmatch"Numberthelines
setnumber
" Try to keep the cursor in the same column when changing linesset nostartofline"Auto-completionoptions
setwildmode=list:full
" Always keep one visible line above the cursor on the screenset scrolloff=1"Euroencodingwithaccents
setenc=UTF-8
" Character font for Gvim that supports the euro symbolset guifont=-misc-fixed-medium-r-semicondensed-*-*-111-75-75-c-*-iso8859-15"Activatesyntaxhighlighting
syntaxon
" Use the standard color schemecolorscheme default"Displaycursorposition'line,column'setruler
" Searches are not 'case sensitive'set ignorecase"Highlightsearchedexpressions
sethlsearch
" Tabulation sectionset autoindentset expandtabset shiftwidth=4set softtabstop=4set tabstop=4"Messagefunctionfunction!s:DisplayStatus(msg)echohlTodo
echoa:msg
echohlNone
endfunction
" Mouse state modelet s:mouseActivation = 1 "Activating/Desactivatingmousemode
function!ToogleMouseActivation()if(s:mouseActivation)lets:mouseActivation=0setmouse=n
setpaste
calls:DisplayStatus('Paste Mode Desactivated')elselets:mouseActivation=1setmouse=a
setnopaste
calls:DisplayStatus('Paste Mode Activated')endif
endfunction
" Activating mouse mode by default"setmouse=a
setpaste
" Cleaning function"Callthisfunction:':call Clean()'function!Clean()%retab
%s/^M//g
%s/\s\+$//
calls:DisplayStatus('Code cleaned')endfunction
" Advanced completion"Use:'Ctrl+x & Ctrl+o | Ctrl+x & Ctrl+k | Ctrl+x & Ctrl+n'function!MultipleAutoCompletion()if&omnifunc!=''return"\<C-x>\<C-o>"elseif&dictionary!=''return"\<C-x>\<C-k>"elsereturn"\<C-x>\<C-n>"endif
endfunction
" Fold functionfunction! MyFoldFunction() let line = getline(v:foldstart) let sub = substitute(line, '/\*\|\*/\|^\s+', '', 'g') let lines = v:foldend - v:foldstart + 1 return '[+] '. v:folddashes.sub . '...' . lines . 'lines...' . getline(v:foldend)endfunction"ActivateFoldfunction" Use: za (open or close), zm (close all) or zr (close zr)set foldenableset fillchars=fold:=set foldtext=MyFoldFunction()"Comment/Uncommentwith# or //" Use: Shift+v, select wished lines and press F5 or F6map <F5> :s.^.#. <CR> :noh <CR>map <F6> :s.^#.. <CR> :noh <CR>"Use:Shift+v,selectwishedlinesandpressF7orF8
map<F7>:s.^.\/\/.<CR>:noh<CR>
map<F8>:s.^\/\/..<CR>:noh<CR>
" Indent or not from 4 spaces"Use:Shift+v,selectwishedlinesandpressF3orF4
map<F3>:s.^..<CR>:noh<CR>
map<F4>:s.^..<CR>:noh<CR>
This should be placed in ~/.exrc. You will then have auto-indentation, line numbering, etc.