Commit 6535efde authored by François Magimel's avatar François Magimel
Browse files

Dotfiles / vim: add conf

parent 4dcba4b2
"
" Vimrc
"
" Links:
" - http://justinlilly.com/vim/vim_and_python.html
" - http://items.sjbach.com/319/configuring-vim-right
" - http://vimdoc.sourceforge.net/htmldoc/options.html#%27scrolloff%27
" Runtimes
runtime! archlinux.vim " archlinux: /usr/share/vim/vimfiles/archlinux.vim
runtime! debian.vim " debian: /usr/share/vim/vim80/debian.vim
runtime macros/matchit.vim " switch between brackets, if/elif/else, …
" Options
set nocompatible " use Vim settings, rather than Vi settings (much better!)
set bs=2 " allow deletion of everything in insert mode
set si " always use autoindent
set viminfo='20,\"50 " read / write in .viminfo, no more than 50 lines
set history=50 " keep 50 lines of command line history
set ruler " always show the cursor position
set incsearch " do incremental searching
set showmatch " show parenthesis
set smartcase " casse
set ignorecase " casse
set title
set encoding=utf-8
set fileencoding=utf-8
set wildmenu " improved completion (always on)
set tabstop=4 " ou ts=4 : nb of space in a tabulation
set shiftwidth=4 " sw=4
set softtabstop=4 " sts=4
set expandtab " tabulation → spaces
set textwidth=80 " 80 chars in a line
set suffixes=.bak,~,.swp,.o,.aux,.log,.dvi,.bbl,.blg,.out,.toc
"set scrolloff=3
" indent
set backspace=indent,eol,start " allow backspacing over everything in insert mode
if has("autocmd")
filetype on
filetype indent plugin on " indentation auto…
else
set autoindent
endif
" syntax highlighting
set t_Co=256
if has("syntax")
syntax on
set hlsearch " highlighting the last used search pattern
endif
" save cursor position when exit
augroup resCur
autocmd!
autocmd BufReadPost * call setpos(".", getpos("'\""))
augroup END
" show line numbers
set nu
highlight LineNr ctermbg=None ctermfg=black
set cursorline
hi CursorLine cterm=bold
" leader
let mapleader = ","
set list listchars=tab:▷⋅,trail:¤,nbsp:¤,extends:>,precedes:< " show tabs and trailing spaces
nmap <silent> <leader>s :set nolist!<CR>
" aspell
"setlocal spell spelllang=fr
"map :w!:!aspell -c % --encoding=utf-8:e! %
hi clear SpellBad
hi SpellBad cterm=underline ctermfg=red
" Filetypes
" colorscheme torte
if has("autocmd")
" filetype plugin indent on " file type detection
au BufRead,BufNewFile Makefile* set noexpandtab
au BufRead,BufNewFile *.html,*.php,*.tex set ts=2 sw=2 sts=2 "noexpandtab
autocmd Filetype python set ts=4 shiftwidth=4 expandtab
autocmd FileType java set ts=2 shiftwidth=2 expandtab
autocmd Filetype cpp set ts=4 shiftwidth=4 noexpandtab
autocmd Filetype gitcommit setlocal spell textwidth=72
endif
"
" Plugins
"
" Manager
"source $HOME/.vim/vimrcs/pathogen.vimrc
source $HOME/.vim/vimrcs/plug.vimrc
" plugins
"" vim-airline
"let g:airline_theme = 'wombat'
"let g:airline_enable_branch = 1
"let g:airline_enable_syntastic = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = '▶'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.whitespace = 'Ξ'
set laststatus=2
set ttimeoutlen=50
"" YouCompleteMe
"set completeopt-=preview
"let g:ycm_add_preview_to_completeopt = 0
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_path_to_python_interpreter = '/usr/bin/python2'
"" Syntastic
" E116 unexpected indentation (comment)
" E124 closing bracket does not match visual indentation
" E128 continuation line under-indented for visual indent
" E261 at least two spaces before inline comment
" E262 inline comment should start with '# '
" E265 block comment should start with ‘# ‘
" F403 'from X import *' used; unable to detect undefined names
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_python_checkers=["flake8"]
"let g:syntastic_python_checker_args='--ignore=E116,E124,E261,E262,F403'
let g:syntastic_python_flake8_args='--ignore=E116,E124,E128,E261,E262,E265,E501,F403,E266,E402'
let g:flake8_cmd="/usr/bin/flake8-python2"
"let g:pep8_ignore="E501,W601"
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
set path+=include,/usr/include/c++/*
"" Grammalecte
let g:grammalecte_cli_py='/opt/grammalecte/grammalecte-cli.py'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment