-
Notifications
You must be signed in to change notification settings - Fork 2
/
.vimrc
232 lines (188 loc) · 5.6 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
" Set nocompatible mode
set nocompatible
syntax on
filetype on
filetype plugin indent on
filetype plugin on
set bs=2
set ttymouse=urxvt
set nofoldenable
set lazyredraw
set clipboard=unnamed
" Pathogen
"
call pathogen#infect()
" Golden Ratio Plug
"
let g:golden_ratio_autocommand = 0
map <leader><leader> :GoldenRatioResize<return>
" USE SYSTEM CLIPBOARD??????
" Maybe with tmux?
"set clipboard=unnamed
set t_Co=256
colo xoria256
"colorscheme solarized
" colorscheme grb256
set guifont=Source\ Code\ Pro:h12
"let g:solarized_termcolors=256
"let g:solarized_termtrans = 1
" Automatically fix line length
"
map <C-M> <S-J><S-V>gq
" Set tab options
"
set nosmartindent
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
" Sorry vimmers, it's just plain nice to beable to
" sit back and scroll with the mouse.
set mouse=a
" Powerline
let g:Powerline_symbols = 'fancy'
set laststatus=2
"" Easier split navigation
"
nnoremap <C-J> <C-W>j :call LineNums(1)<return>
nnoremap <C-K> <C-W>k :call LineNums(1)<return>
nnoremap <C-H> <C-W>h :call LineNums(1)<return>
nnoremap <C-L> <C-W>l :call LineNums(1)<return>
" Easy Tab Navigation
noremap <C-P> :tabp<Return>
noremap <C-N> :tabn<Return>
" better working with long lines
map j gj
map k gk
"" LatexStuff
map <C-I> <Plug>IMAP_JumpForward
let g:Imap_UsePlaceHolders = 0
"" Some Commands to make NERDTree a bit nicer.
"
map <F2> :NERDTreeToggle<CR>
map <F1> :NERDTreeToggle<CR>
autocmd vimenter * if !argc() | NERDTree | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
let NERDTreeIgnore = ['\.pyc$']
" Auto Load Arm Syntax
"
let asmsyntax='armasm'
let filetype_inc='armasm'
" Jinja settings
autocmd BufNewFile,BufRead *.jinja2 set syntax=htmljinja
autocmd BufNewFile,BufRead *.jinja2 set tabstop=4
autocmd BufNewFile,BufRead *.jinja2 set shiftwidth=4
autocmd BufNewFile,BufRead *.jinja2 set noexpandtab
" js settings
"let g:syntastic_javascript_closure_compiler_path = '/Users/lee/working/mediacore/private/plovr/closure/closure-library/compiler.jar'
autocmd BufNewFile,BufRead *.js set tabstop=2
autocmd BufNewFile,BufRead *.js set shiftwidth=2
autocmd BufNewFile,BufRead *.js set expandtab
autocmd BufNewFile,BufRead *.jinja2js set syntax=htmljinja
autocmd BufNewFile,BufRead *.jinja2js set tabstop=2
autocmd BufNewFile,BufRead *.jinja2js set shiftwidth=2
autocmd BufNewFile,BufRead *.jinja2js set expandtab
" CSS
"
autocmd FileType css setlocal noexpandtab
" Java Settings
"
let java_highlight_all=1
let java_highlight_functions=1
autocmd FileType java setlocal noexpandtab
autocmd FileType jsp setlocal noexpandtab
" Enable full Python highlighting
"
let python_highlight_exceptions = 1
let python_highlight_builtin_funcs = 1
let python_highlight_builtin_objs = 1
let python_slow_sync=1
let python_highlight_all=1
" Python settings
" TODO: Make this autocmd stuff a function so it is easier
" to remove...
autocmd FileType py setlocal tabstop=4
autocmd FileType py setlocal shiftwidth=4
autocmd FileType py setlocal expandtab
" C++ settings
"
autocmd FileType h setlocal noexpandtab
autocmd FileType cpp setlocal noexpandtab
autocmd FileType c setlocal noexpandtab
" Search hilighting. <Space> clears the highlight
set hlsearch
"highlight Search ctermfg=Black ctermbg=Red cterm=NONE
nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
" tag complete
map <C-C> <C-P>_
" Haskell
let g:haddock_browser = 1
let hs_highlight_delimiters = 1
" Relative line settings
function! NumberToggle()
if(&relativenumber == 1)
set number
else
set relativenumber
endif
endfunc
function! LineNums(relative)
if (&ft != "nerdtree" && &ft != "gitv")
if (a:relative == 0)
set number
elseif (a:relative == 1)
set relativenumber
endif
endif
endfunc
nnoremap <C-B> :call NumberToggle()<cr>
call LineNums(1)
au FocusLost * call LineNums(0)
au FocusGained * call LineNums(1)
autocmd InsertEnter * call LineNums(0)
autocmd InsertLeave * call LineNums(1)
hi CursorLine cterm=NONE ctermbg=0
hi CursorColumn cterm=NONE ctermbg=14
set cursorline!
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
" Colours
let g:EasyColourCustomColours = 1
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au BufReadPost * if exists("b:current_syntax") && b:current_syntax != "htmljinja"
au BufReadPost * RainbowParenthesesLoadBrace
au BufReadPost * endif
" Sort a block of imports (or any block. blocks are separated by blank lines
nnoremap <leader>si vip:!sort\|uniq<cr>
" Split the comma separated import on the current line into two separate
" imports, then sort. Returns to the same line after, so can be repeated
" when there are many imports on the same line.
nnoremap <leader>fi 0v/import<cr>eyf,pF,s<cr><esc>vip:!sort\|uniq<cr>
set incsearch
set wildmenu
set wildmode=longest:full
" Easy Retabing!
command! -nargs=1 -range SuperRetab <line1>,<line2>s/\v%(^ *)@<= {<args>}/\t/g
" Hilight trailing whitespace!
highlight ExtraWhitespace ctermbg=red guibg=red
au InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
au InsertLeave * match ExtraWhitespace /\s\+$/
" Gitv
let g:Gitv_DoNotMapCtrlKey=1
let g:Gitv_OpenPreviewOnLaunch=1
cnoreabbrev gitx Gitv
" Fugitive stuff
cnoreabbrev gits Gstatus
cnoreabbrev gitd Gdiff
cnoreabbrev git Git
cnoreabbrev gitrbi Git rebase -i
cnoreabbrev gitrbo Git rebase --onto
cnoreabbrev gitrbc Git rebase --continue
cnoreabbrev gitpo Git push origin
" Diff Stuff
nnoremap ,p :diffput<return>
nnoremap ,g :diffget<return>
nnoremap ,u :diffupdate<return>
vnoremap ,p :diffput<return>
vnoremap ,g :diffget<return>