From 141ac44f3f12380f8e94bce8b543969e5c1277e8 Mon Sep 17 00:00:00 2001 From: nojhan Date: Sat, 5 Feb 2011 17:22:17 +0100 Subject: [PATCH] update and cleaning --- .vimrc | 108 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/.vimrc b/.vimrc index c27626e..6ddfa9d 100644 --- a/.vimrc +++ b/.vimrc @@ -1,33 +1,66 @@ -syntax on " Coloration syntaxique +syntax on " syntax coloring by default color inkpot -set hlsearch " Surligne les resultats recherche -set wrap " retour a la ligne auto (affichage) -set showmatch " Affiche parenthese correspondante -set autoindent " Indentation automatique -set smartindent +set textwidth=80 +set wrap " auto wrap line view, but not text itself + filetype indent on " activates indenting for files -set softtabstop=4 " Largeur d'une tabulation -set shiftwidth=4 " Largeur de l'indentation -set nu " numérotation des lignes -set autochdir " utilise le répertoire courant comme base -set ai " auto indenting -set ic " case insensitive search -set scs " smartcase: Ignore case only if search string has no Uppercase chars. -set hlsearch " highlight what you search for -set incsearch " type-ahead-find -set shiftwidth=4 +set autoindent " automatic indentation +set smartindent +set softtabstop=4 " width of a tab set tabstop=4 +set shiftwidth=4 " width of the indentation set expandtab -set wildmenu " command-line completion shows a list of matches + + +set ignorecase " case-insentive search by default +set smartcase " search case-sensitive if there is an upper-case letter +set gdefault " when replacing, use /g by default +set showmatch " paren match highlighting +set hlsearch " highlight what you search for +set incsearch " type-ahead-find +set wildmenu " command-line completion shows a list of matches set wildmode=longest,list:longest,full " Bash-vim completion behavior +set autochdir " use current working directory of a file as base path + +set nocompatible " do not try to be vi-compatible +set encoding=utf-8 + +set nu " show line numbers +set showmode " show the current mode on the last line +set showcmd " show informations about selection while in visual mode + +let mapleader = "," " leader key is comma + +" ,v will reselect the text that was just pasted +nnoremap v V`] + +" ,s will split vertically and swith over the new panel +nnoremap s vl + +" activate rainbow parenthesis +nnoremap r :RainbowParenthesesToggle + +" activate gundo +nnoremap u :GundoToggle + +" fold all C++ comments (i.e. several lines starting with a //) +nnoremap h :set foldmethod=expr:set foldexpr=getline(v:lnum)=~'^\\s//'?1:getline(prevnonblank(v:lnum))=~'^\\s//'?1:getline(nextnonblank(v:lnum))=~'^\\s*//'?1:0 +" fold all C-like comments (i.e. /* lines inside slash stars */) +nnoremap H :set foldmethod=marker:set foldmarker=/*,*/ -set laststatus=2 " Affiche la barre de status quoi qu'il en soit (0 pour la masquer, 1 pour ne l'afficher que si l'ecran est divise) +set list +set listchars=tab:▸\ " print tabs with a special character (add ",eol:·" for end of lines) + +au FocusLost * :wa " save every opened buffer when the window lost focus + + +set laststatus=2 " always show the statusline, even when there is only one file edited if has("statusline") set statusline=\ %f%m%r\ [%{strlen(&ft)?&ft:'aucun'},%{strlen(&fenc)?&fenc:&enc},%{&fileformat},ts:%{&tabstop}]%=%l,%c%V\ %P elseif has("cmdline_info") - set ruler " Affiche la position du curseur en bas a gauche de l'ecran + set ruler " show current line and column number endif @@ -38,27 +71,19 @@ else endif -" move the current line up or down +" move the current line up or down with the Ctrl-arrow keys nmap :m+== nmap :m-2== imap :m+== imap :m-2== -"autocmd FileType python set omnifunc=pythoncomplete#Complete -"autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS -"autocmd FileType html set omnifunc=htmlcomplete#CompleteTags -"autocmd FileType css set omnifunc=csscomplete#CompleteCSS -"autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags -"autocmd FileType php set omnifunc=phpcomplete#CompletePHP -"autocmd FileType c set omnifunc=ccomplete#Complete - filetype plugin on set ofu=syntaxcomplete#Complete au BufRead,BufNewFile *.mwiki setf Wikipedia au BufRead,BufNewFile *.wikipedia.org.* setf Wikipedia -" autocomplétion avec plutôt que , en fonction du contexte +" autocomplétion with instead of , depending on the context function! Smart_TabComplete() let line = getline('.') " curline let substr = strpart(line, -1, col('.')+1) " from start to cursor @@ -79,18 +104,6 @@ endfunction inoremap =Smart_TabComplete() -" Idem, contexte moins précis -"function InsertTabWrapper() -" let col = col('.') - 1 -" if !col || getline('.')[col - 1] !~ '\k' -" return "\" -" else -" return "\\" -" endif -"endfunction -" -"inoremap =InsertTabWrapper() - "switch spellcheck languages let g:myLang = 0 @@ -107,18 +120,6 @@ endf map :call MySpellLang() imap :call MySpellLang() -" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file. -filetype plugin on - -" IMPORTANT: grep will sometimes skip displaying the file name if you -" search in a singe file. This will confuse Latex-Suite. Set your grep -" program to always generate a file-name. -set grepprg=grep\ -nH\ $* - -" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to -" 'plaintex' instead of 'tex', which results in vim-latex not being loaded. -" The following changes the default filetype back to 'tex': -let g:tex_flavor='latex' " search the file for FIXME, TODO and put them in a handy list map TaskList @@ -146,6 +147,7 @@ let OmniCpp_MayCompleteDot = 1 " autocomplete after . let OmniCpp_MayCompleteArrow = 1 " autocomplete after -> let OmniCpp_MayCompleteScope = 1 " autocomplete after :: let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"] + " automatically open and close the popup menu / preview window au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif set completeopt=menuone,menu,longest,preview