set nocompatible set secure set nomodeline augroup vimrc autocmd! augroup END filetype plugin indent on " Built-in plugins silent! packadd! matchit silent! packadd! editorconfig " Vim 9.1 silent! packadd! comment " Vim 9.1.? runtime! ftplugin/man.vim silent! syntax enable set termguicolors color halation set shortmess+=I " No intro message on startup. set encoding=utf-8 set nowrap set textwidth=79 set colorcolumn=80 " See :h fo-table. set formatoptions+=cqnl1j set wildmode=longest:full,full set wildmenu set wildoptions=pum,fuzzy set wildignore=*.o,*.obj,*.pyc,*/node_modules/*,*/.git/*,*/build/* set autoindent set smarttab set ignorecase set smartcase set autoread set incsearch set nohlsearch set ttimeoutlen=100 set splitright set splitbelow set nojoinspaces set noshowcmd set foldmethod=syntax setlocal foldlevelstart=99 setlocal foldlevel=99 " Store swapfiles in ~/tmp/vim. if !isdirectory($HOME . "/tmp/vim") call mkdir($HOME . "/tmp/vim", "p") endif set directory=$HOME/tmp/vim " Filetypes for file extensions autocmd vimrc BufRead,BufNewFile .gitignore set filetype=conf autocmd vimrc BufRead,BufNewFile Jenkinsfile set filetype=groovy map e :Explore map s :Sexplore map v :Vexplore let g:netrw_banner = 0 " Hide banner. " Don't save netrw directory history (and thus don't create .netrwhist). let g:netrw_dirhistmax = 0 " Toggle paste mode. noremap p :set paste! paste? " In Insert mode, press Ctrl-F to make the word before the cursor uppercase. inoremap gUiw`]a if executable("rg") set grepprg=rg\ --vimgrep\ $* else set grepprg=grep\ -rIn\ $*\ /dev/null endif " Treat .h files as C, not C++. let g:c_syntax_for_h = 1 " Disable error highlighting on C99 compound literals. let c_no_curly_error = 1 let g:ale_set_signs = 0 let g:ale_virtualtext_cursor = 'disabled' let g:ale_linters = \ { \ 'python': ['flake8', 'mypy'], \ 'c': ['cc'] \ } let g:EditorConfig_max_line_indicator = "none" " CtrlP let g:ctrlp_map = 'f' noremap c :CtrlPClearCache let g:ctrlp_custom_ignore = '\v.+\.(gcda|gcno)$' let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp' autocmd BufNewFile,BufRead muttrc,.muttrc :set ft=conf