justing.net

Vimrc file

Reload the vimrc with :so $MYVIMRC.

Sourced from various places.

You’ll need to do the first steps of the guide linked in [[setup.md]], namely:

  1. git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  2. Paste the vimrc below into ~/.vimrc
  3. :PluginInstall
  4. Follow YouCompleteMe install instructions
set nocompatible              " required
filetype off                  " required

" Install with :PluginInstall
" Uninstall with :PluginClean after commenting out/deleting the line
" set the runtime path to include Vundle and initialize
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
Plugin 'gmarik/Vundle.vim'

" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)

" ...
Bundle 'Valloric/YouCompleteMe'
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
" Plugin 'vim-syntastic/syntastic'
" Plugin 'nvie/vim-flake8'
Plugin 'jnurmine/Zenburn'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'dense-analysis/ale'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

set splitbelow
set splitright

"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Enable folding
set foldmethod=indent
set foldlevel=99

" Enable folding with the spacebar
nnoremap <space> za


au BufNewFile,BufRead *.py
    \ set tabstop=4 |
    \ set softtabstop=4 |
    \ set shiftwidth=4 |
    \ set textwidth=79 |
    \ set expandtab |
    \ set autoindent |
    \ set fileformat=unix


" au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/

set encoding=utf-8


let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g  :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:ycm_python_interpreter_path = '/usr/bin/python3'
let g:ycm_python_binary_path = '/usr/bin/python3'

" let g:syntastic_python_python_exec = 'python'
" let g:syntastic_python_checkers = ['pyflakes']

let python_highlight_all=1
syntax on
" default comment color is too dark.
hi Comment  guifg=#80a0ff ctermfg=darkred

set nu

set clipboard=unnamed

" free the cursor
set ve=all

" but show a good text width
set colorcolumn=80

let g:ale_fixers = {
            \ '*': ['remove_trailing_lines', 'trim_whitespace'],
            \ 'python': ['yapf', 'remove_trailing_lines', 'trim_whitespace'],
            \}
let g:ale_linters = {
            \ 'python': ['pylint'],
            \}
nmap <F10> :ALEFix<CR>
let g:ale_fix_on_save = 1
let g:ale_python_pylint_executable = 'pylint3'
let g:ale_sign_column_always = 1
let g:airline#extensions#ale#enabled = 1
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%] "pylint: disable=%code%"'

set hlsearch
set backspace=indent,eol,start