-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
201 lines (158 loc) · 5.22 KB
/
.vimrc
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-unimpaired'
Plugin 'micha/vim-colors-solarized'
Plugin 'morhetz/gruvbox'
Plugin 'scrooloose/nerdtree'
Plugin 'klen/python-mode'
let g:pymode_folding = 0
"let g:pymode_lint = 0 " temp attempt to fix hangs :(
filetype plugin indent on " required!
" Insert spaces instead of character when the key is pressed.
" This is also the prefered method of Python coding, since Python is especially sensitive to problems
" with indenting which can occur when people load files in different editors with different tab settings,
" and also cutting and pasting between applications (ie email/news for example) can result in problems.
" It is safer and more portable to use spaces for indenting.
set expandtab
" A four-space tab indent width is the prefered coding style for Python (and everything else!),
" although of course some disagree. This page generally assumes you want 4-space indents.set tabstop = 4
set tabstop=4
" This allows you to use the < and > keys from VIM's visual (marking) mode to block indent/unindent regions
set shiftwidth=4
" Use the \"shiftwidth\" setting for inserting s instead of the \"tabstop\" setting, when at the beginning of a line.
" This may be redundant for most people, but some poeple like to keep their tabstop=8 for compatability
" when loading files, but setting shiftwidth=4 for nicer coding style.
set smarttab
" People like using real tab character instead of spaces because it makes it easier
" when pressing BACKSPACE or DELETE, since if the indent is using spaces
" it will take 4 keystrokes to delete the indent. Using this setting,
" however, makes VIM see multiple space characters as tabstops,
" and so does the right thing and will delete four spaces (assuming 4 is your setting).
set softtabstop=4
" Very painful to live without this (especially with Python)!
" It means that when you press RETURN and a new line is created, the indent of the new line will match that of the previous line. set autoindent
" Run python on this program when pressing F9
nmap <silent> <F9> :w<CR>:!%:p<CR>
vmap <silent> <F9> <esc>:w<CR>:!%:p<CR>
imap <silent> <F9> <esc>:w<CR>:!%:p<CR>
" Set Python dic set dictionary=~/.vim/dic/python
let python_highlight_all = 1
" setlocal keywordprg=pydoc
set nu
"set relativenumber
set autoindent
set ignorecase
set smartcase
set cursorline
set wildmode=longest:full
set wildmenu
set ruler
set ttyfast
set backspace=indent,eol,start
set laststatus=2
set hidden
set showcmd
set showmode
set gdefault
set incsearch
set showmatch
set hlsearch
set wrap
set textwidth=79
set formatoptions=qrn1
set colorcolumn=79
set mouse=a
set mousehide
call pathogen#infect()
syntax on
filetype plugin indent on
" TODO: move this to py-only filetype
"iab ipdb import ipdb; ipdb.set_trace()
"imap ``` import debug # noqa
"nmap ``` oimport debug # noqa<esc>:w<cr>
map <F6> :NERDTreeToggle<CR>
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>
" NERDTree
"autocmd vimenter * if !argc() | NERDTree | endif
let g:NERDTreeWinPos = "left"
"autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
set t_Co=256
syntax enable
set background=dark
set background=light
" let g:solarized_termcolors=16
let g:solarized_termcolors=256
let g:solarized_visibility="high"
let g:solarized_diffmode="high"
set list
set listchars=trail:\
colorscheme solarized
highlight ColorColumn ctermbg=black guibg=black
filetype plugin on
"let g:pydiction_location = '~/.vim/complete-dict'
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
let NERDTreeIgnore=['\.pyc$']
" Rope AutoComplete
let ropevim_vim_completion=1
let ropevim_extended_complete = 1
let g:ropevim_autoimport_modules = ["os.*","traceback","django.*", "xml.etree"]
imap <c-space> <C-R>=RopeCodeAssistInsertMode()<CR>
set completeopt=menu
"autocmd BufWritePost *.py call Flake8()
" Generate tags with:
" ctags -R -f ~/.vim/tags/python27.ctags /usr/lib/python2.7/
" ctrl-[ to go to the tag under the cursor, ctrl-T to go back.
set tags+=$HOME/.vim/tags/python27.ctags
set tags+=./.ctags
" Autopep8
"function! App8()
" set noautoread
" !autopep8 --in-place %
" let filetype=&ft
" diffthis
" vnew | r # | normal! 1Gdd
" diffthis
" exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype
" set autoread
"endfunction
" easier window navigation
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
" russian hotkeys
" autpaste mode on insert
function! WrapForTmux(s)
if !exists('$TMUX')
return a:s
endif
let tmux_start = "\<Esc>Ptmux;"
let tmux_end = "\<Esc>\\"
return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
endfunction
let &t_SI .= WrapForTmux("\<Esc>[?2004h")
let &t_EI .= WrapForTmux("\<Esc>[?2004l")
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste
return ""
endfunction
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
" Required to use os x clipboard
set clipboard=unnamed
set rtp+=/usr/local/opt/fzf