-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
194 lines (153 loc) · 4.77 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
set nocompatible
execute pathogen#infect()
syntax on
filetype plugin indent on
" call pathogen#helptags()
if has('mouse')
" have the mouse enabled all the time
set mouse=a
" make a menu popup on right click
set mousemodel=popup
endif
set ruler
set statusline=%t[%{strlen(&fenc)?&fenc:'none'},%{&ff}]%h%m%r%y%=%c,%l/%L\ %P
set laststatus=2
set showmatch
set showcmd
set tabstop=4
set shiftwidth=4
set expandtab
set number
set numberwidth=4
" turn off smart indentation when pasting
set pastetoggle=<F2>
" " shortcut for pasting clipboard contents
map <silent> <leader>* "+gP
" find as you type
set incsearch
" highlight the terms
set hlsearch
" make searches case-insensitive
set ignorecase
" unless they contain upper-case letters
set smartcase
" a toggle for search highlight
map <silent> <leader>h :set hlsearch!<CR>
" Colors and Syntax {{{1
" -----------------------------------------------------------------
" turn on syntax highlighting
syntax on
" highlight all python syntax
let python_highlight_all=1
" gui and terminal compatible color scheme
set t_Co=256
" set background=dark
" set global variables that will define the colorscheme
let g:light_theme='zenburn'
let g:dark_theme='zenburn'
" Use the "original" molokai theme colors instead of "dark"
"let g:molokai_original=1
" Zenburn settings
" let g:zenburn_alternate_Error = 1
" Solarized settings
" let g:solarized_termcolors=16
" let g:zenburn_alternate_Visual = 1
let g:zenburn_old_Visual = 1
" Command to call the ColorSwitch funciton
command! -nargs=? -complete=customlist,s:completeColorSchemes ColorSwitcher :call s:colorSwitch(<q-args>)
function! s:extraHighlights()
" Syntax highlights for the mappings set above
hi InterestingWord1 guifg=#000000 guibg=#FF4300
hi InterestingWord2 guifg=#000000 guibg=#53FF00
hi InterestingWord3 guifg=#000000 guibg=#FF74F8
hi IndentGuides guibg=#373737
endfunction
" A function to toggle between light and dark colors
function! s:colorSwitch(...)
" function to switch colorscheme
function! ChangeMe(theme)
execute('colorscheme '.a:theme)
try
execute('colorscheme '.a:theme.'_custom')
catch /E185:/
" There was no '_custom' scheme...
endtry
endfunction
" Change to the specified theme
if eval('a:1') != ""
" check to see if we are passing in an existing var
if exists(a:1)
call ChangeMe(eval(a:1))
else
call ChangeMe(a:1)
endif
" Put the extra highlights back in place
call s:extraHighlights()
return
endif
" Toggle between a light and dark vim colorscheme
" This also takes care of the solarized scheme
if &background == 'dark'
set background=light
call ChangeMe(g:light_theme)
elseif &background == 'light'
set background=dark
call ChangeMe(g:dark_theme)
endif
" Put the extra highlights back in place
call s:extraHighlights()
endfunction
" completion function for colorscheme names
function! s:completeColorSchemes(A,L,P)
let colorscheme_names = []
for i in split(globpath(&runtimepath, "colors/*.vim"), "\n")
let colorscheme_name = fnamemodify(i, ":t:r")
if stridx(colorscheme_name, "_custom") < 0
call add(colorscheme_names, colorscheme_name)
endif
endfor
return filter(colorscheme_names, 'v:val =~ "^' . a:A . '"')
endfunction
" set the colorscheme
ColorSwitcher g:dark_theme
set cuc cul
if &bg == 'dark'
hi CursorLine ctermbg=darkgrey ctermfg=white cterm=bold
else
" hi CursorLine gui=NONE guibg=#CCCCCC ctermbg=darkblue cterm=bold
hi CursorLine guifg=darkgray ctermbg=darkgrey term=bold
endif
hi! link CursorColumn CursorLine
au WinLeave * set nocursorline nocursorcolumn
au WinEnter * set cursorline cursorcolumn
au BufLeave * set nocursorline nocursorcolumn
au BufEnter * set cursorline cursorcolumn
let g:jedi#use_tabs_not_buffers = 0
let g:user_zen_leader_key = '<c-e>'
let g:miniBufExplMapCTabSwitchBufs = 1
let NERDTreeIgnore = ['\.pyc$']
" EasyGrep options: <Leader>vo
let g:EasyGrepFilesToExclude = '*.pyc'
" 0 - All files
" 1 - Open buffers
" 2 - Track the current extension
" 3 - User mode
let g:EasyGrepMode = 2
" 0 - vimgrep
" 1 - grep
let g:EasyGrepCpmmand = 1
let g:EasyGrepRecursive = 1
" indentLine options
let g:indentLine_enabled = 1
let g:indentLine_color_term = 150
let g:gitgutter_enabled = 0
let g:gitgutter_highlight_lines = 1
" shortcuts
nnoremap <silent> <F4> :TagbarToggle<CR>
map <silent> <F3> :NERDTreeToggle<CR>
vmap <silent> <F3> :NERDTreeToggle<CR>i
imap <silent> <F3> :NERDTreeToggle<CR>i
noremap <C-o> :CtrlPBufTag<CR>
" map <leader><Tab> :bn<CR>
" map <leader><S-Tab> :bp<CR>
noremap <leader><F2> :GitGutterToggle<CR>