-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
132 lines (94 loc) · 2.54 KB
/
vimrc
File metadata and controls
132 lines (94 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
" change the leader to be a comma vs slash
let mapleader=","
" syntax highlighting
syntax on
" display line numbers
set number
" using only 1 column (and 1 space) while possible
set numberwidth=1
" we are using dark background in vim
set background=dark
" ignore these files when completing
set wildignore+=.git,*.pyc
" show a line at column 79
if exists("&colorcolumn")
set colorcolumn=79
endif
" have a line indicate the cursor location
set cursorline
" show the cursor position all the time
set ruler
" use spaces, not tabs, for autoindent/tab key.
set expandtab
" don't wrap text
set nowrap
" don't wrap text in the middle of a word
set linebreak
" always set auto-indenting on
set autoindent
" use smart indent if there is no indent file
set smartindent
" <tab> inserts 4 spaces
set tabstop=4
" but an indent level is 4 spaces wide.
set shiftwidth=4
" <BS> over an autoindent deletes both spaces.
set softtabstop=4
" rounds indent to a multiple of shiftwidth
set shiftround
" show matching <> (html mainly) as well
set matchpairs+=<:>
" allow us to fold on indents
set foldmethod=indent
" don't fold by default
set foldlevel=99
" don't bell or blink
set noerrorbells
set vb t_vb=
" keep our cursor in the middle of the screen
set scrolloff=100
set sidescrolloff=30
" show whitespace
set list
set listchars=tab:>-,trail:~
" default to using case insensitive searches ...
set ignorecase
" ... unless uppercase letters are used in the regex.
set smartcase
" handle tabs more intelligently while searching
set smarttab
" highlight searches by default.
set hlsearch
" incrementally search while typing a /regex
set incsearch
" replace line numbers with relative line numbers
set relativenumber
" remove trailing whitespace on <leader>S
noremap <leader>S :%s/\s\+$//<cr>:let @/=''<CR>
filetype plugin indent on
" powerline settings
set laststatus=2
set encoding=utf-8
set t_co=256
source /usr/share/powerline/bindings/vim/plugin/powerline.vim
" source ~/Library/Python/2.7/lib/python/site-packages/powerline/bindings/vim/plugin/powerline.vim
" set color theme
colorscheme solarized8
" enable pyflakes?
filetype plugin indent on
" run flake8 on save
autocmd BufWritePost *.py call Flake8()
" ignore pep8 violations
" E711: bool(Object() == None): N/A if Object overrides __eq__()
let g:flake8_ignore='E711'
" cut, copy & paste
nmap <C-V> "+gP
imap <C-V> <ESC>"+gpi
vmap <C-V> c<ESC>"+gph
vmap <C-C> "+y
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 spell checking
set spell spelllang=en_us