-
Notifications
You must be signed in to change notification settings - Fork 5
/
vimrc.kilian
162 lines (154 loc) · 5.12 KB
/
vimrc.kilian
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
" vim:foldmethod=marker
if has('gui_running')
colorscheme elrodeo
set guioptions-=T
else
colorscheme pychimp
endif
""" Vim Plugins Configurations: """
" Command-T {{{
let g:CommandTMaxHeight = 15
set wildignore+=*.o,*.obj,.git,*.pyc
if has("gui_macvim")
map <D-t> :CommandT<CR>
map <D-r> :CommandTFlush<CR>
endif
" }}}
" 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 :MiniBufExplorer<cr>
map <leader>c :TMiniBufExplorer<cr>
let g:miniBufExplSplitBelow=0
let g:miniBufExplSplitEdge=1
" }}}
" 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 }}"
" }}}
" Vimwiki {{{
nmap <silent><Leader>w :VimwikiIndex<cr>
" }}}
" Powerline {{{
"set Powerline_cache_enabled = 1
"set g:Powerline_symbols = unicode
"set Powerline_symbols = 'Menlo'
let g:Powerline_cache_enabled = 1
let g:Powerline_symbols = "fancy"
" }}}
" 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'
" }}}
" ZoomWin {{{
nmap <silent> <leader>z :ZoomWin<cr>
" }}}
" 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"],
\ {
\ "'\\(\\w\\+\\)'": '"\1"',
\ '"\(\w\+\)"': "'\\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
" }}}
" Fivestars stuff {{{
nmap <leader><leader>f :cd ~/FiveStars/github/server/loyalty<cr>
nmap <M-s> :NERDTreeFromBookmark server<CR>
nmap <M-l> :NERDTreeFromBookmark loyalty<CR>
nmap <M-a> :NERDTreeFromBookmark fsapi<CR>
nmap <M-c> :NERDTreeFromBookmark client<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>
" }}}
" maps <F8> to turn off auto indent {{{
nnoremap <F8> :setl noai nocin nosi inde=<CR>
" }}}