2015-03-01 20:44:10 +01:00
|
|
|
" ------ [ Gestion des options ] ----------------------------------------------
|
2015-03-01 21:02:06 +01:00
|
|
|
|
2015-03-01 20:44:10 +01:00
|
|
|
" We don't want vi compatibility.
|
|
|
|
set nocompatible
|
|
|
|
|
|
|
|
" we have a fast terminal
|
|
|
|
set ttyfast
|
|
|
|
|
2015-03-01 21:02:06 +01:00
|
|
|
" ------ [ Gestion des plugins ] ----------------------------------------------
|
|
|
|
|
|
|
|
execute pathogen#infect()
|
|
|
|
|
2015-03-07 19:31:19 +01:00
|
|
|
" ------[ Gestion de la barre de statut ] -------------------------------------
|
2015-03-01 21:02:06 +01:00
|
|
|
|
|
|
|
" Display title
|
|
|
|
set title
|
|
|
|
|
|
|
|
" ruler display in status line
|
|
|
|
set ruler
|
|
|
|
|
|
|
|
" show mode at bottom of screen
|
|
|
|
set showmode
|
|
|
|
|
|
|
|
" Custom statusline
|
|
|
|
" cf the default statusline: %<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
|
|
|
|
" format markers:
|
|
|
|
" %< truncation point
|
|
|
|
" %n buffer number
|
|
|
|
" %f relative path to file
|
|
|
|
" %m modified flag [+] (modified), [-] (unmodifiable) or nothing
|
|
|
|
" %r readonly flag [RO]
|
|
|
|
" %y filetype [ruby]
|
|
|
|
" %= split point for left and right justification
|
|
|
|
" %-35. width specification
|
|
|
|
" %l current line number
|
|
|
|
" %L number of lines in buffer
|
|
|
|
" %c current column number
|
|
|
|
" %V current virtual column number (-n), if different from %c
|
|
|
|
" %P percentage through buffer
|
|
|
|
" %) end of width specification
|
|
|
|
set statusline=
|
|
|
|
set statusline+=%n " buffer number
|
|
|
|
set statusline+=\ " space separator
|
|
|
|
set statusline+=%t " file name
|
|
|
|
set statusline+=%= " right align
|
|
|
|
set statusline+=%m%r%h%w
|
|
|
|
set statusline+=\ " space separator
|
|
|
|
set statusline+=Encoding:[%{strlen(&fenc)?&fenc:&enc}] " encoding
|
|
|
|
set statusline+=\ " space separator
|
|
|
|
set statusline+=Type:%y
|
|
|
|
set statusline+=\ " space separator
|
|
|
|
set statusline+=Curseur:[colonne\ %c/ligne\ %l]
|
|
|
|
set statusline+=\ " space separator
|
|
|
|
set statusline+=Position:[%l/%L\ (%p%%)]
|
|
|
|
|
|
|
|
" occasions to show status line, 2=always.
|
|
|
|
set laststatus=2
|
2015-03-01 20:44:10 +01:00
|
|
|
|
2015-03-07 19:31:19 +01:00
|
|
|
" ------[ Gestion du fichier viminfo ] ----------------------------------------
|
2015-03-01 21:03:21 +01:00
|
|
|
|
|
|
|
" Tell vim to remember certain things when we exit
|
|
|
|
" '10 : marks will be remembered for up to 10 previously edited files
|
|
|
|
" "100 : will save up to 100 lines for each register
|
|
|
|
" :100 : up to 100 lines of command-line history will be remembered
|
|
|
|
" % : saves and restores the buffer list
|
|
|
|
" n... : where to save the viminfo files
|
|
|
|
set viminfo='10,\"100,:100,%,n~/.vim/viminfo
|
|
|
|
|
2015-03-07 19:31:19 +01:00
|
|
|
" ------[ Restauration de la position du curseur ] ----------------------------
|
2015-03-01 21:05:31 +01:00
|
|
|
|
|
|
|
function! ResCur()
|
|
|
|
if line("'\"") <= line("$")
|
|
|
|
normal! g`"
|
|
|
|
return 1
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
augroup resCur
|
|
|
|
autocmd!
|
|
|
|
autocmd BufWinEnter * call ResCur()
|
|
|
|
augroup END
|
|
|
|
|
2015-03-07 19:31:19 +01:00
|
|
|
" ------ [ Gestion de la coloration syntaxique ] ------------------------------
|
2015-03-01 20:44:10 +01:00
|
|
|
syntax on
|
|
|
|
|
2015-03-07 19:31:19 +01:00
|
|
|
" ------ [ Gestion de la correction d'orthographe ] ---------------------------
|
2015-03-01 20:44:49 +01:00
|
|
|
setlocal nospell
|
|
|
|
setlocal spelllang=fr
|
|
|
|
|
2015-03-07 19:31:19 +01:00
|
|
|
" ------[ Gestion des types de fichiers ] -------------------------------------
|
2015-03-01 21:06:52 +01:00
|
|
|
|
2015-03-02 11:40:01 +01:00
|
|
|
filetype on " Enable filetype detection
|
|
|
|
filetype indent on " Enable filetype-specific indenting
|
|
|
|
filetype plugin on " Enable filetype-specific plugins
|
2015-03-01 21:06:52 +01:00
|
|
|
|
|
|
|
"misc
|
2015-03-07 19:15:37 +01:00
|
|
|
" 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
|
2015-03-01 21:06:52 +01:00
|
|
|
|
2015-03-01 21:11:10 +01:00
|
|
|
" ------[ Gestion des types de terminaux ] ----------------------------------------------
|
|
|
|
|
|
|
|
if (&term =~ 'xterm')
|
|
|
|
set termencoding=utf-8
|
|
|
|
set t_Co=256
|
|
|
|
set mouse=a
|
2015-03-01 22:07:35 +01:00
|
|
|
colorscheme mustang
|
2022-09-22 18:34:30 +02:00
|
|
|
if (&term =~ 'kitty')
|
|
|
|
set termencoding=utf-8
|
|
|
|
set t_Co=256
|
|
|
|
set mouse=a
|
|
|
|
colorscheme mustang
|
2015-03-01 21:11:10 +01:00
|
|
|
elseif (&term =~ 'rxvt')
|
|
|
|
set termencoding=utf-8
|
|
|
|
set t_Co=256
|
|
|
|
set mouse=a
|
|
|
|
colorscheme mustang
|
|
|
|
map <C-up> :tabr<cr>
|
|
|
|
map <C-down> :tabl<cr>
|
|
|
|
map <C-t><left> :tabp<cr>
|
|
|
|
map <C-t><right> :tabn<cr>
|
|
|
|
elseif (&term =~ 'screen')
|
|
|
|
set termencoding=utf-8
|
|
|
|
set t_Co=16
|
|
|
|
set background=dark
|
|
|
|
colorscheme zenburn
|
2015-03-01 22:13:59 +01:00
|
|
|
elseif (&term =~ 'screen-256color')
|
|
|
|
set termencoding=utf-8
|
|
|
|
set t_Co=256
|
|
|
|
set mouse=a
|
|
|
|
colorscheme mustang
|
2015-03-01 21:11:10 +01:00
|
|
|
elseif (&term =~ 'linux')
|
|
|
|
set termencoding=utf-8
|
|
|
|
set t_Co=16
|
|
|
|
else
|
|
|
|
set termencoding=utf-8
|
|
|
|
set t_Co=16
|
|
|
|
endif
|
2015-03-01 22:33:16 +01:00
|
|
|
|
|
|
|
" ------[ Paste ] ----------------------------------------------
|
|
|
|
|
|
|
|
function! PasteToggle()
|
|
|
|
set invpaste
|
|
|
|
set paste?
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
map <F2> :call PasteToggle()<CR>
|
|
|
|
imap <F2> <c-o>:call PasteToggle()<CR>
|
|
|
|
set pastetoggle=<F2>
|
2015-03-01 23:02:22 +01:00
|
|
|
|
|
|
|
" ------[ Mapping ] ----------------------------------------------
|
|
|
|
let mapleader = ","
|
|
|
|
|
2015-03-02 12:24:07 +01:00
|
|
|
map <Leader>ve :tabedit ~/.vimrc<CR>
|
|
|
|
map <Leader>ne :tabedit ~/.notes<CR>
|
|
|
|
map <Leader>te :tabedit ~/.todo<CR>
|
2019-07-08 16:28:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
" ------[ Vim Airline ] ----------------------------------------------
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
let g:airline#extensions#tabline#enabled = 1
|