-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvimrc.charles
216 lines (204 loc) · 6.61 KB
/
vimrc.charles
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
" vim:foldmethod=marker
"
colorscheme dracula
if has('gui_running')
set guioptions-=T
endif
set wildignore+=*.o,*.obj,.git,*.pyc
""" Vim Plugins Configurations: """
" Command-T {{{
" let g:CommandTMaxHeight = 15
" let g:CommandTTraverseSCM = "pwd"
" if has("gui_macvim")
" map <D-t> :CommandT<CR>
" map <D-r> :CommandTFlush<CR>
" else
" nmap <leader><leader>t :CommandT<CR>
" nmap <leader><leader>r :CommandTFlush<CR>
" endif
" }}}
" CtrlP {{{
" let g:CommandTMaxHeight = 15
" let g:CommandTTraverseSCM = "pwd"
if has("gui_macvim")
map <D-t> :CtrlPMixed<CR>
endif
let g:ctrlp_working_path_mode = 'w'
let g:ctrlp_match_window = 'bottom,order:ttb,min:1,max:10,results:10'
let g:ctrlp_switch_buffer = 0
" }}}
" NERDTree {{{
map <leader>f :NERDTreeToggle<CR>
let NERDTreeWinPos = 0
let NERDTreeWinSize = 31
let NERDTreeIgnore = ['\.vim$','\~$','\.png$','\.bmp$','\.jpg$','\.gif$','\.psd$','\.doc','\.ppt','\.xls','\.pdf$','\.exe$','\.lnk$','\.pyc$']
let NERDTreeMouseMode = 3
" }}}
" MiniBufExplorer plugin {{{
map <leader>o :MBEFocus<cr>
map <leader>c :MBEToggle<cr>
let g:miniBufExplSplitBelow=0
let g:miniBufExplSplitEdge=1
let g:miniBufExplorerAutoStart=0
" }}}
" Omni complete functions {{{
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
" }}}
" AutoComplete Popup {{{
" let g:acp_enableAtStartup = 0
let g:acp_behaviorSnipmateLength = 1
" }}}
" Tagbar {{{
" let g:tagbar_usearrows = 1
" nnoremap <leader>l :TagbarToggle<CR>
" }}}
" VIm grep {{{
let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated'
set grepprg=/usr/bin/grep\ -nH
" }}}
" SnipMate {{{
:autocmd FileType python set ft=python.django
:autocmd FileType html set ft=html.djangohtml
:autocmd FileType soy set ft=html
" }}}
" Surround {{{
let g:surround_{char2nr("b")} = "{% block\1 \r..*\r &\1%}\r{% endblock %}"
let g:surround_{char2nr("i")} = "{% if\1 \r..*\r &\1%}\r{% endif %}"
let g:surround_{char2nr("w")} = "{% with\1 \r..*\r &\1%}\r{% endwith %}"
let g:surround_{char2nr("c")} = "{% comment\1 \r..*\r &\1%}\r{% endcomment %}"
let g:surround_{char2nr("f")} = "{% for\1 \r..*\r &\1%}\r{% endfor %}"
let g:surround_{char2nr("v")} = "{{ \1 \r..*\r &\1\r }}"
" }}}
" airline {{{
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_buffers = 0
let g:airline_theme = 'deus'
" }}}
" Ack {{{
nmap <D-l> :Ack
" }}}
" Tabman {{{
map <silent><leader>t :TMToggle<CR>
"let g:tabman_toggle = '<leader>mt'
"let g:tabman_focus = '<leader>mf'
let g:tabman_width = 25
let g:tabman_side = 'left'
" }}}
" NeoComplcache {{{
" let g:neocomplcache_enable_at_startup = 1
" let g:neocomplcache_enable_smart_case = 1
" let g:neocomplcache_camel_case_completion = 1
" let g:neocomplcache_enable_underbar_completion = 1
" let g:neocomplcache_min_syntax_length = 3
" let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
"
" let g:neocomplcache_dictionary_filetype_lists = {
" \ 'default' : '',
" \ 'vimshell' : $HOME.'/.vimshell_hist',
" \ 'scheme' : $HOME.'/.gosh_completions'
" \ }
"
" imap <C-k> <Plug>(neocomplcache_snippets_expand)
" smap <C-k> <Plug>(neocomplcache_snippets_expand)
" }}}
" Switch {{{
" nnoremap - :Switch<cr>
let g:switch_definitions =
\[
\ ["if", "else", "elif"],
\ ["True", "False"],
\ {
\ '"\(\k\+\)"': '''\1''',
\ '''\(\k\+\)''': '"\1"'
\ }
\]
" }}}
" vim-notes {{{
let g:notes_directories = ['~/Notes']
" }}}
" jshint2.vim {{{
:map <F8> :JSHint<CR>
" }}}
" vim-signify {{{
" :SignifyToggle
" }}}
" vim-flake8 {{{
" }}}
" ale {{{
" }}}
" indentLine {{{
let g:indentLine_setConceal = 1
" }}}
""" Visual mode related
vnoremap <silent> * :call VisualSearch('f')<CR>
vnoremap <silent> * :call VisualSearch('b')<CR>
""" Random Stuff: """
" Substitute word under cursor/selection {{{
nnoremap <C-s> :%s/\<<C-r><C-w>\>//gc<Left><Left><Left>
" }}}
" tab controls {{{
if has("gui_macvim")
" emulate textmate's shift left/right key commands
nmap <D-[> <<
nmap <D-]> >>
vmap <D-[> <gv
vmap <D-]> >gv
endif
" }}}
" Move line up or down (visual mode too) {{{
if has("gui_macvim")
nmap <D-j> mz:m+<cr>`z
nmap <D-k> mz:m-2<cr>`z
vmap <D-j> :m'>+<cr>`<my`>mzgv`yo`z
vmap <D-k> :m'<-2<cr>`>my`<mzgv`yo`z
endif
" }}}
" Orca stuff{{{
function! SetupGame()
:cd ~/github/orca/src
endfunction
nmap <leader><leader>o :exec SetupGame()<cr>
" }}}
" Baylab stuff{{{
function! SetupBaylabsIO(...)
:cd ~/baylabs/github/
let python_version = (a:0 >= 1) ? ('_' . a:1) : ''
:let g:flake8_cmd="/Users/churros/workspace" . python_version . "/bin/flake8"
:let g:ale_python_flake8_executable="/Users/churros/workspace" . python_version . "/bin/flake8"
:set colorcolumn=79
endfunction
nmap <leader><leader>b :exec SetupBaylabsIO()<cr>
nmap <leader><leader>b3 :exec SetupBaylabsIO('p3')<cr>
" }}}
" CareSprout stuff {{{
function! SetupCareSprout()
:cd ~/CareSprout/git/workspace/caresprout
:let g:flake8_cmd="/Users/churros/workspace/bin/flake8"
:set colorcolumn=79
endfunction
nmap <leader><leader>c :exec SetupCareSprout()<cr>
" }}}
" Tokyo stuff {{{
function! SetupTokyo()
:cd /Users/churros/tokyo/repos/tokyo
:let g:flake8_cmd="/Users/churros/workspace_p3/bin/flake8"
:set colorcolumn=79
endfunction
nmap <leader><leader>t :exec SetupTokyo()<cr>
" }}}
nmap <silent> <leader>/ :nohlsearch<CR>
" maps enter to insert a new-line and shift enter to insert a line before the current line {{{
map <S-Enter> O<Esc>
map <CR> o<Esc>
" }}}