From 3c4061b37eb0918b6dc7bfeba2a4a261266c6b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0urda?= Date: Wed, 1 Dec 2021 12:18:36 +0800 Subject: [PATCH] Add vimrc --- files/vimrc | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/files/vimrc b/files/vimrc index e69de29..9254450 100644 --- a/files/vimrc +++ b/files/vimrc @@ -0,0 +1,101 @@ +let vim_plug_just_installed = 0 +let vim_plug_path = expand('~/.vim/autoload/plug.vim') +if !filereadable(vim_plug_path) + echo "Installing Vim-plug..." + echo "" + silent !mkdir -p ~/.vim/autoload + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + let vim_plug_just_installed = 1 +endif + +" manually load vim-plug the first time +if vim_plug_just_installed + :execute 'source '.fnameescape(vim_plug_path) +endif + +" Obscure hacks done, you can now modify the rest of the .vimrc as you wish :) + +" ============================================================================ +" Active plugins +" You can disable or add new ones here: + +" this needs to be here, so vim-plug knows we are declaring the plugins we +" want to use +call plug#begin('~/.vim/plugged') + +Plug 'preservim/nerdtree' +Plug 'frazrepo/vim-rainbow' +Plug 'w0rp/ale' +Plug 'scrooloose/syntastic' +" Plug 'itchyny/lightline.vim' +Plug 'vim-airline/vim-airline' +Plug 'airblade/vim-gitgutter' +Plug 'jiangmiao/auto-pairs' +Plug 'mileszs/ack.vim' +Plug 'tpope/vim-fugitive' +Plug 'junegunn/fzf.vim' +" Plug 'altercation/vim-colors-solarized' + +if has('python') + " YAPF formatter for Python + Plug 'pignacio/vim-yapf-format' +endif + +" Tell vim-plug we finished declaring plugins, so it can load them +call plug#end() + +" ============================================================================ +" Install plugins the first time vim runs + +if vim_plug_just_installed + echo "Installing Bundles, please ignore key map error messages" + :PlugInstall +endif + +" ALE +let g:ale_python_pycodestyle_options='--config=setup.cfg' +let g:ale_python_flake8_options='--config=setup.cfg' +let g:ale_python_pylint_options='--rcfile=setup.cfg' +let g:ale_python_pycodestyle_change_directory=0 +let g:ale_python_flake8_change_directory=0 +let g:ale_python_pylint_change_directory=0 +let g:ale_completion_enabled=1 + +" autocompletion +set completeopt+=preview +set completeopt+=menuone +set completeopt+=noinsert +set shortmess+=c " turn off completion messages + +" vim-airline +let g:airline#extensions#branch#enabled = 1 +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tagbar#enabled = 1 +let g:airline_skip_empty_sections = 1 + +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif + +let g:airline#extensions#tabline#left_sep = ' ' +let g:airline#extensions#tabline#left_alt_sep = '|' +let g:airline_left_sep = '▶' +let g:airline_left_alt_sep = '»' +let g:airline_right_sep = '◀' +let g:airline_right_alt_sep = '«' +let g:airline#extensions#branch#prefix = '⤴' "➔, ➥, ⎇ +let g:airline#extensions#readonly#symbol = '⊘' +let g:airline#extensions#linecolumn#prefix = '¶' +let g:airline#extensions#paste#symbol = 'ρ' +let g:airline_symbols.linenr = '␊' +let g:airline_symbols.branch = '⎇' +let g:airline_symbols.paste = 'ρ' +let g:airline_symbols.paste = 'Þ' +let g:airline_symbols.paste = '∥' +let g:airline_symbols.whitespace = 'Ξ' + + +set nocompatible +set number +set background=dark +colorscheme industry