Created
April 5, 2017 19:09
-
-
Save xiaohk/587c45e681cef736dcd22a9cd46696af to your computer and use it in GitHub Desktop.
My .vimrc file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"The default color theme of vim" :colo obsidian2 | |
:colo obsidian2 | |
"set background=dark | |
"colo solarized | |
"Execute the python scrip by clicking control + B" | |
:nnoremap <C-B> :w<CR>:!python3 %<CR> | |
"Change the current working directory to dropbox" | |
":cd ~/Dropbox/Vim_programming | |
" | |
" Use 256 colours (Use this setting only if your terminal supports 256 colours) | |
set t_Co=256 | |
" Set font to SF Mono | |
set guifont=SF\ Mono:h12 | |
set linespace=2 | |
:set tabstop=4 " The width of a TAB is set to 4. | |
" Still it is a \t. It is just that | |
" Vim will interpret it to be having | |
" a width of 4. | |
:set shiftwidth=4 " Indents will have a width of 4 | |
:set softtabstop=4 " Sets the number of columns for a TAB | |
:set expandtab " Expand TABs to spaces | |
:set fileformat=unix | |
:set encoding=utf-8 "Set up the encoding for Python" | |
:set number "Display the line numbers" | |
:set spell "To turn on the auto-spell check" | |
:set autoindent " copy indent from current line when starting a new line | |
"Set a 80-characters ruler with gray color" | |
:set cc=79 | |
:hi ColorColumn guibg=gray27 | |
"python with virtualenv support | |
py << EOF | |
import os | |
import sys | |
if 'VIRTUAL_ENV' in os.environ: | |
project_base_dir = os.environ['VIRTUAL_ENV'] | |
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py') | |
execfile(activate_this, dict(__file__=activate_this)) | |
EOF | |
"Set up the plug manager Vim-Plug" | |
call plug#begin('~/.vim/plugged') | |
"Use :PlugInstall to instal | |
"https://github.com/junegunn/vim-plug to auto pairs" | |
Plug 'https://github.com/jiangmiao/auto-pairs.git' | |
"https://github.com/vim-scripts/indentpython.vim For better indentation" | |
Plug 'https://github.com/vim-scripts/indentpython.vim.git' | |
"https://github.com/nvie/vim-flake8 Stype checking | |
Plug 'https://github.com/nvie/vim-flake8.git' | |
"https://github.com/powerline/powerline Powerline! | |
Plug 'https://github.com/powerline/powerline.git' | |
"https://github.com/JuliaEditorSupport/julia-vim | |
Plug 'JuliaEditorSupport/julia-vim' | |
"Syntax checking | |
Plug 'https://github.com/vim-syntastic/syntastic.git' | |
call plug#end() | |
" Set up for powerline | |
set rtp+=/usr/local/lib/python3.5/site-packages/powerline/bindings/vim | |
" Always show statusline | |
set laststatus=2 | |
" Set up 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_loc_list_height = 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment