FichierVimrc
Voici le fichier .vimrc (.exrc) que j'utilise pour l'éditeur de texte vim. Celui-ci suit les recommandations PEAR concernant les conventions de codage PHP.
set expandtab set shiftwidth=4 set softtabstop=4 set tabstop=4 nnoremap <silent> <F7> :TlistUpdate<CR> nnoremap <silent> <F8> :Tlist<CR> nnoremap <silent> <F9> :TlistSync<CR> let Tlist_Auto_Open = 1 let Tlist_Exit_OnlyWindow = 1 let g:explVertical=1
- expandtab : Active les tabulations en espaces.
- shiftwidth : Nombre d'espaces à utiliser pour chaque pas d'(auto-)indentation.
- softtabstop : Nombre d'espaces qu'une tabulation représentera lors d'opérations d'édition.
- tabstop : Nombre d'espaces que vaut une tabulation dans un fichier.
- nnoremap : Attribution d'une commandes à la touche indiquée.
- Tlist_Auto_Open : Voir taglist.
- Tlist_Exit_OnlyWindow : Idem Tlist_Auto_Open.
- g:explVertical : Ouverture de l'Explorer de manière verticale.
Une seconde version, un peu plus complète, mais où je n'explique pas chaque ligne :
colors evening
syntax enable
"source $VIMRUNTIME/mswin.vim
set number
set noautoindent
set ruler
set showmatch
set showmode
set hlsearch
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
filetype on
filetype plugin on
let Tlist_Inc_Winwidth = 0
nnoremap <silent> <F7> :TlistUpdate<CR>
nnoremap <silent> <F8> :Tlist<CR>
nnoremap <silent> <F9> :TlistSync<CR>
let Tlist_Auto_Open = 1
let Tlist_Exit_OnlyWindow = 1
"let Tlist_Ctags_Cmd = '/usr/bin/ctags'
let g:explVertical=1
abbr _header ^M #/^M #* @file ^[:r!echo %^MkJA^M #* @author e247135^M #* @version ^[:r!date +\%Y-\%m-\%d^M-JA^M #* @desc ^M #* @comment ^M #/^M
map ,ksh 1Gi#!/bin/ksh^M ^[k
map ,perl :r $HOME/cfg/perl.shebang^M
map ,php 1GO<?php^M^[Go^M?>^[2Gf"
map ,ac I#^[
map ,ad ^[:r!date +\%Y-\%m-\%d^M-JA
map ,ce YPi#^[^M
map ,dc :s/#//^M
map ,rd 11x^[:r!date +\%Y-\%m-\%d^M-J
:if &term =~ "xterm"
: if has("terminfo")
: set t_Co=8
: set t_Sf=^[[3%p1%dm
: set t_Sb=^[[4%p1%dm
: else
: set t_Co=8
: set t_Sf=^[[3%dm
: set t_Sb=^[[4%dm
: endif
:endif
set history=50
set incsearch