2013-05-02 23:39:27 +02:00
|
|
|
" 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()
|
|
|
|
|
2013-07-26 11:22:22 +02:00
|
|
|
" Git syntax highlighting and integration
|
2013-05-02 23:39:27 +02:00
|
|
|
Bundle 'tpope/vim-git'
|
2013-07-26 11:22:22 +02:00
|
|
|
Bundle 'tpope/vim-fugitive'
|
|
|
|
Bundle 'gregsexton/gitv'
|
|
|
|
" nerd plugins
|
2013-05-02 23:39:27 +02:00
|
|
|
Bundle 'scrooloose/nerdtree'
|
2013-07-26 11:22:22 +02:00
|
|
|
Bundle 'scrooloose/nerdcommenter'
|
|
|
|
Bundle 'scrooloose/nerdsnippets'
|
|
|
|
" syntax highlighting
|
2013-05-02 23:39:27 +02:00
|
|
|
Bundle 'tpope/vim-markdown'
|
|
|
|
Bundle 'vim-ruby/vim-ruby'
|
2013-07-26 11:22:22 +02:00
|
|
|
" Surround selection with quotes, parenthesis…
|
|
|
|
Bundle 'tpope/vim-surround'
|
|
|
|
" Automatically closes functions, blocks, etc.
|
|
|
|
Bundle 'tpope/vim-endwise'
|
|
|
|
" A better stats bar
|
|
|
|
Bundle 'Lokaltog/vim-powerline'
|
|
|
|
" Aligns text.
|
|
|
|
Bundle 'godlygeek/tabular'
|
|
|
|
" Browse tags of source code files.
|
|
|
|
Bundle 'majutsushi/tagbar'
|
|
|
|
" Increment dates
|
|
|
|
Bundle 'tpope/vim-speeddating'
|
2013-05-02 23:39:27 +02:00
|
|
|
|
|
|
|
syntax on
|
|
|
|
set background=dark
|
|
|
|
colorscheme default
|
|
|
|
filetype on
|
|
|
|
|
2013-07-26 11:22:22 +02:00
|
|
|
" set mouse=a
|
2013-05-02 23:39:27 +02:00
|
|
|
" set number
|
2013-07-26 11:22:22 +02:00
|
|
|
set ruler
|
2013-05-02 23:39:27 +02:00
|
|
|
set nocompatible
|
|
|
|
set hlsearch
|
|
|
|
set nostartofline
|
|
|
|
set scrolloff=1
|
|
|
|
set nostartofline
|
2013-07-26 11:22:22 +02:00
|
|
|
set laststatus=2
|
|
|
|
set showcmd
|
|
|
|
set showmatch
|
|
|
|
set cursorline
|
2013-05-02 23:39:27 +02:00
|
|
|
|
2013-07-26 11:22:22 +02:00
|
|
|
" Indent
|
2013-05-02 23:39:27 +02:00
|
|
|
set cindent
|
|
|
|
set softtabstop=2
|
|
|
|
set tabstop=2
|
|
|
|
set expandtab
|
|
|
|
set shiftwidth=2
|
|
|
|
|
|
|
|
" set textwidth=80
|
|
|
|
|
2013-07-26 11:22:22 +02:00
|
|
|
" Encoding
|
2013-05-02 23:39:27 +02:00
|
|
|
set encoding=utf-8
|
|
|
|
set fileencoding=utf-8
|
|
|
|
|
|
|
|
|
2013-07-26 11:22:22 +02:00
|
|
|
" filename completion
|
|
|
|
set wildmode=list:longest,list:full
|
|
|
|
set wildignore+=*.o,*.obj,.git,*.rbc
|
2013-05-02 23:39:27 +02:00
|
|
|
|
2013-07-26 11:22:22 +02:00
|
|
|
let g:qb_hotkey = "<F1>"
|
2013-05-02 23:39:27 +02:00
|
|
|
|
2013-05-03 02:54:00 +02:00
|
|
|
" Centralize backups, swapfiles and undo history
|
2013-05-02 23:39:27 +02:00
|
|
|
set backup
|
|
|
|
set backupdir=$HOME/.vim/backup
|
2013-05-03 02:54:00 +02:00
|
|
|
set directory=$HOME/.vim/swap
|
|
|
|
if exists("&undodir")
|
|
|
|
set undodir=$HOME/.vim/undo
|
|
|
|
endif
|
|
|
|
set viminfo+=n$HOME/.vim/.viminfo
|
2013-05-02 23:39:27 +02:00
|
|
|
|
|
|
|
" Vim 7 spell checker (z=)
|
2013-07-26 11:22:22 +02:00
|
|
|
" http://ftp.vim.org/pub/vim/runtime/spell/
|
2013-05-02 23:39:27 +02:00
|
|
|
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
|
|
|
|
|
2013-06-13 17:04:48 +02:00
|
|
|
" Display trailing white spaces
|
2013-05-02 23:39:27 +02:00
|
|
|
set list listchars=tab:\ \ ,trail:·
|
2013-06-13 17:04:48 +02:00
|
|
|
" 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
|
2013-05-02 23:39:27 +02:00
|
|
|
|
2013-07-26 11:22:22 +02:00
|
|
|
" Completion, C-X C-O in insert mode, navigation with C-N/C-P
|
|
|
|
" http://vim.wikia.com/wiki/Omni_completion
|
|
|
|
filetype plugin on
|
|
|
|
set ofu=syntaxcomplete#Complete
|
|
|
|
|
|
|
|
map <F3> <Esc>:tabnext<CR>
|
|
|
|
map <F2> <Esc>:tabprevious<CR>
|
|
|
|
map <F4> :NERDTreeToggle<CR>
|
|
|
|
map <F5> :TagbarToggle<CR>
|
|
|
|
map <F6> <Esc>:set paste<CR>
|
|
|
|
map <F10> <Esc>:s/"/'/g<CR>
|