mirror of
https://github.com/hcartiaux/dotfiles.git
synced 2024-10-18 17:25:23 +02:00
99 lines
2.3 KiB
VimL
Executable file
99 lines
2.3 KiB
VimL
Executable file
" vundle
|
|
" https://github.com/shingara/vim-conf/blob/master/vimrc
|
|
" http://blog.shingara.fr/vundle-ou-le-bundler-de-vim.html
|
|
|
|
set rtp+=~/.vim/bundle/vundle/
|
|
call vundle#rc()
|
|
|
|
Bundle 'tpope/vim-fugitive'
|
|
Bundle 'tpope/vim-git'
|
|
Bundle 'scrooloose/nerdtree'
|
|
Bundle 'tpope/vim-markdown'
|
|
Bundle 'vim-ruby/vim-ruby'
|
|
" Bundle 'altercation/vim-colors-solarized'
|
|
|
|
syntax on
|
|
set background=dark
|
|
colorscheme default
|
|
" hi CursorLineNr term=bold ctermfg=Yellow gui=bold guifg=Yellow
|
|
filetype on
|
|
|
|
" set number
|
|
set nocompatible
|
|
set hlsearch
|
|
set nostartofline
|
|
|
|
" Garde toujours une ligne visible au dessus du curseur
|
|
set scrolloff=1
|
|
|
|
" Essaye de garder le curseur dans la même colonne quand on change de ligne
|
|
set nostartofline
|
|
|
|
" set smartindent
|
|
set cindent
|
|
set softtabstop=2
|
|
set tabstop=2
|
|
set expandtab
|
|
set shiftwidth=2
|
|
|
|
" set textwidth=80
|
|
|
|
" set mouse=a
|
|
|
|
set encoding=utf-8
|
|
set fileencoding=utf-8
|
|
|
|
set showcmd
|
|
set showmatch
|
|
set cursorline
|
|
|
|
let g:qb_hotkey = "<F1>"
|
|
|
|
"set laststatus=2
|
|
|
|
" Centralize backups, swapfiles and undo history
|
|
set backup
|
|
set backupdir=$HOME/.vim/backup
|
|
set directory=$HOME/.vim/swap
|
|
if exists("&undodir")
|
|
set undodir=$HOME/.vim/undo
|
|
endif
|
|
set viminfo+=n$HOME/.vim/.viminfo
|
|
|
|
" Vim 7 spell checker (z=)
|
|
if has("spell")
|
|
setlocal spell spelllang=
|
|
" Language : FR
|
|
map ,lf :setlocal spell spelllang=fr<cr>
|
|
" Language : EN
|
|
map ,le :setlocal spell spelllang=en<cr>
|
|
" Language : Aucun
|
|
map ,ln :setlocal spell spelllang=<cr>
|
|
endif
|
|
|
|
|
|
set spellsuggest=5
|
|
autocmd BufEnter *.txt,*.tex,*.md set spell
|
|
autocmd BufEnter *.txt,*.tex set spelllang=fr
|
|
autocmd BufEnter *.md set spelllang=en
|
|
autocmd BufNewFile,BufRead PKGBUILD set syntax=sh
|
|
|
|
autocmd bufnewfile *.rb so ~/.vim/header/ruby
|
|
autocmd bufnewfile *.pl so ~/.vim/header/perl
|
|
autocmd bufnewfile *.sh so ~/.vim/header/shell
|
|
au BufRead,BufNewFile *.md set syntax=markdown
|
|
|
|
" Display trailing white spaces
|
|
set list listchars=tab:\ \ ,trail:·
|
|
" Remove trailing white spaces in all files except *.md
|
|
" http://stackoverflow.com/questions/6496778/vim-run-autocmd-on-all-filetypes-except
|
|
fun! StripTrailingWhitespace()
|
|
" Only strip if the b:noStripeWhitespace variable isn't set
|
|
if exists('b:noStripWhitespace')
|
|
return
|
|
endif
|
|
%s/\s\+$//e
|
|
endfun
|
|
autocmd BufWritePre * call StripTrailingWhitespace()
|
|
autocmd FileType markdown let b:noStripWhitespace=1
|
|
|