filetype plugin on syntax on set colorcolumn=80 set background=dark set number set relativenumber set tabstop=4 "set softtabstop=4 set shiftwidth=4 set expandtab set smartindent set incsearch set ttimeoutlen=100 set scrolloff=5 set tw=79 " Tab completion set wildmode=longest,list,full set wildmenu " Splitting set splitbelow set splitright " Split delimiter set fillchars+=vert:\│ hi! VertSplit ctermbg=243 ctermfg=16 hi! SignColumn ctermbg=16 "" Replaced by christoomey/vim-tmux-navigator " nnoremap " nnoremap " nnoremap " nnoremap set exrc set secure if has("autocmd") au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") \| exe "normal! g'\"" | endif endif """""""""""""""""" 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' Plugin 'tpope/vim-fugitive' "Plugin 'Smart-Tabs' Plugin 'hynek/vim-python-pep8-indent' Plugin 'tpope/vim-git' Plugin 'fs111/pydoc.vim' " Plugin 'vim-syntastic/syntastic' Plugin 'w0rp/ale' Plugin 'itchyny/vim-haskell-indent' Plugin 'junegunn/goyo.vim' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' "Plugin 'davidhalter/jedi-vim' Plugin 'vim-scripts/a.vim' Plugin 'rhysd/vim-clang-format' Plugin 'chrisbra/csv.vim' Plugin 'let-def/vimbufsync' Plugin 'the-lambda-church/coquille' Plugin 'vim-latex/vim-latex' Plugin 'christoomey/vim-tmux-navigator' Plugin 'let-def/ocp-indent-vim' Plugin 'psf/black' Plugin 'rust-lang/rust.vim' 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++ let g:syntastic_cpp_compiler_options = '-std=c++14 -Wall -Wextra' "" Disabled languages "let g:syntastic_mode_map = { 'passive_filetypes': ['python'] } let g:syntastic_python_checkers = ['flake8'] " let g:syntastic_ignore_files = [] """"""""""""""""" ALE let g:ale_c_clangtidy_checks = ['clang-diagnostic-*', 'clang-analyzer-*', '*', '-google-readability-*', '-llvm-include-order', '-hicpp-braces-around-statements', '-readability-braces-around-statements', '-cppcoreguidelines-avoid-magic-numbers', '-readability-magic-numbers'] let g:ale_c_parse_makefile=1 let g:ale_python_flake8_options="--append-config ~/.config/flake8" """ ALE Rust let g:ale_rust_cargo_use_clippy = executable('cargo-clippy') let g:rustfmt_autosave = 1 let g:rustfmt_fail_silently = 1 """"""""""""""""" LaTeX augroup tex_mappings autocmd! autocmd FileType tex,latex,context,plaintex nmap IMAP_JumpForward autocmd FileType tex,latex,context,plaintex imap IMAP_JumpForward augroup END """"""""""""""""" OCaml au BufEnter *.ml setf ocaml au BufEnter *.mli setf ocaml au FileType ocaml call FT_ocaml() function FT_ocaml() set shiftwidth=2 set tabstop=2 endfunction let g:opamshare = substitute(system('opam config var share'),'\n$','','''') execute "set rtp+=" . g:opamshare . "/merlin/vim" execute "set rtp+=" . g:opamshare . "/merlin/vimbufsync" execute "set rtp+=" . g:opamshare . "/ocp-indent/vim" """"""""""""""""" Python function Autoblack() if g:black_auto execute ':Black' endif endfunction augroup python_settings autocmd! autocmd BufWritePre *.py call Autoblack() autocmd FileType python nmap b :Black autocmd FileType python set colorcolumn=88 autocmd FileType python set textwidth=87 augroup END let g:jedi#goto_definitions_command = "l" let g:jedi#completions_enabled = 0 let g:black_auto = 1 """"""""""""""""" Airline set laststatus=2 let g:airline_powerline_fonts = 1 let g:airline#extensions#tabline#enabled = 1 set noshowmode let g:airline_left_sep = '»' let g:airline_left_sep = '▶' let g:airline_right_sep = '«' let g:airline_right_sep = '◀' """"""""""""""""" clang-format let g:clang_format#detect_style_file = 1 autocmd FileType c,cpp,objc nnoremap cf :ClangFormat autocmd FileType c,cpp,objc vnoremap cf :ClangFormat """"""""""""""""" 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 nnoremap :w:!make inoremap :echo 'F1 help disabled' nnoremap :!git status nnoremap __ :lprev nnoremap ++ :lnext nnoremap _+ :ll nnoremap w :call TrimWhitespace() xnoremap x :'<,'>:w !xclip -selection clipboard cmap w!! w !sudo tee % > /dev/null set tw=79 " Disable arrow keys - use hjkl, ffs. noremap noremap noremap noremap xnoremap b :'<,'>:w ! xnoremap x :'<,'>:w !xclip -selection clipboard noremap a :ALEToggle