Ce billet n'apporte pas grand chose au monde, mais juste ma configuration vim du moment qui se trouve dans mon fichier ~/.vimrc (et que vous pouvez aussi mettre dans votre fichier /etc/vim/vimrc. C'est pas grand chose c'est vrai, mais en même temps c'est vraiment pratique d'avoir bien configuré son éditeur de fichier préféré pour optimiser sa vitesse de travail.

Si vous avez vous aussi des configurations particulières et perso que vous trouvez bien pratiques et que vous ne retrouver pas ici, n'hésitez pas à m'en faire part dans les commentaires. Autant optimiser au maximum pour avoir une configuration parfaite (même si chacun a ses petites manies, j'en convient

set nocompatible " breaks compatibility with original vi
set backspace=indent,eol,start " allow backspace in insert mode
set autoindent " text indenting
set smartindent " as above
set tabstop=4 " number of spaces in a tab
set softtabstop=4 " as above
set shiftwidth=4 " as above
set history=100 " lines of command history
set showcmd " show incomplete commands
set hlsearch " highlight searched-for phrases
set incsearch " highlight search as you type
set smarttab
set list " affiche les caracteres louches
" keep a copy of last edit
" if this throws errors, make sure the backup dir exists
set backup
set backupdir=~/.vim/backup/
colorscheme desert
syntax on
let mywinfont="Monospace:h8:cANSI"
if has("gui_running") " console Vim cannot set the font
if has("gui_gtk2") " GTK+2, not GTK+1
set gfn=Bitstream\ Vera\ Sans\ Mono\ 8
elseif has("gui_photon") " Photon GUI
set gfn=Bitstream\ Vera\ Sans\ Mono:s8
elseif has("gui_kde") " the obsolete kvim
set gfn=Bitstream\ Vera\ Sans\ Mono/8/-1/5/50/0/0/0/1/0
elseif has("x11") " other X11 GUIs including GTK+1
set gfn=-*-lucidatypewriter-medium-r-normal-*-*-100-*-*-m-*-*
else " non-X11 GUIs including Windows
set gfn=Lucida_Console:h9:cDEFAULT
endif
set number " display current line number
set listchars=eol:•,tab:‣ ,trail:»,extends:↷,precedes:↶
else
set listchars=eol:¶,tab:→ ,trail:»,extends:↓,precedes:←
endif
if has("autocmd")
filetype plugin indent on
autocmd FileType text setlocal textwidth=78
" always jump to last edit position when opening a file
autocmd BufReadPost *
\ if line("'\"") > 0 & line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
endif
set tabpagemax=15
set cursorline
highlight CursorLine guibg=#001000
