Skip to content

Instantly share code, notes, and snippets.

@xiaohk
Created April 5, 2017 19:09
Show Gist options
  • Save xiaohk/587c45e681cef736dcd22a9cd46696af to your computer and use it in GitHub Desktop.
Save xiaohk/587c45e681cef736dcd22a9cd46696af to your computer and use it in GitHub Desktop.
My .vimrc file
"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