dotfiles/files/.vimrc

108 lines
2.7 KiB
VimL
Raw Normal View History

2016-09-04 13:58:13 +02:00
syntax on
filetype plugin on
set colorcolumn=80
set background=dark
set number
set relativenumber
2016-09-04 13:58:13 +02:00
set tabstop=4
" set softtabstop=4
set shiftwidth=4
set noexpandtab
set smartindent
2016-12-13 16:06:25 +01:00
set incsearch
set ttimeoutlen=100
set scrolloff=5
2017-02-16 14:48:40 +01:00
set tw=79
2016-09-04 13:58:13 +02:00
set exrc
set secure
"""""""""""""""""" Vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
" Plugins
Plugin 'VundleVim/Vundle.vim'
Plugin 'LucHermitte/lh-vim-lib'
Plugin 'LucHermitte/local_vimrc'
2017-03-06 23:55:00 +01:00
Plugin 'tpope/vim-fugitive'
2016-09-04 13:58:13 +02:00
"Plugin 'Smart-Tabs'
Plugin 'hynek/vim-python-pep8-indent'
Plugin 'tpope/vim-git'
Plugin 'fs111/pydoc.vim'
Plugin 'vim-syntastic/syntastic'
2017-03-06 23:55:00 +01:00
Plugin 'itchyny/vim-haskell-indent'
2016-09-04 13:58:13 +02:00
call vundle#end() " required
filetype plugin indent on " required
"""""""""""""""""" Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_enable_signs=1
let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_remove_include_errors = 1
let g:syntastic_quiet_messages = {"regex":'pragma once in'}
"let g:syntastic_auto_jump=1
"" LaTeX
let g:syntastic_tex_checkers = [ 'chktex' ]
"" Python
let g:syntastic_python_python_exec = '/usr/bin/python3'
"" C++
2016-12-13 16:06:25 +01:00
let g:syntastic_cpp_compiler_options = '-std=c++14 -Wall -Wextra'
2016-09-04 13:58:13 +02:00
"" Disabled languages
"let g:syntastic_mode_map = { 'passive_filetypes': ['python'] }
let g:syntastic_python_checkers = ['pep8']
""""""""""""""""" OCaml
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
"""" Merlin
execute "set rtp+=" . g:opamshare . "/merlin/vim"
let g:syntastic_ocaml_checkers = ['merlin']
"""" Ocp-indent (OCaml indentation)
set rtp^=g:opamshare."/ocp-indent/vim"
2016-09-04 13:58:13 +02:00
""""""""""""""""" Trailing whitespaces
fun! TrimWhitespace()
let l:save_cursor = getpos('.')
%s/\s\+$//e
call setpos('.', l:save_cursor)
endfun
" Show trailing whitepace and spaces before a tab:
highlight ExtraWhitespace ctermbg=darkgreen guibg=lightgreen
match ExtraWhitespace /\s\+$\| \+\ze\t/
autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/
""""""""""""""""" Key bindings
2016-12-13 16:06:25 +01:00
map <F1> :w<CR>:!make<CR>
2016-09-04 13:58:13 +02:00
imap <F1> <esc>:echo 'F1 help disabled'<CR>
map <F2> :!git status<CR>
2016-12-13 16:06:25 +01:00
map [[ :lprev<CR>
map ]] :lnext<CR>
map [] :ll<CR>
2016-09-04 13:58:13 +02:00
nnoremap <Leader>w :call TrimWhitespace()<CR>
2017-03-06 23:55:00 +01:00
nnoremap K <Esc>i<CR><Esc>
2016-09-04 13:58:13 +02:00
2017-03-06 23:55:00 +01:00
xnoremap <Leader>x <esc>:'<,'>:w !xclip -selection clipboard<CR><esc>
set tw=79
2017-02-16 14:48:40 +01:00
" Disable arrow keys - use hjkl, ffs.
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>