comparison vimrc @ 94:c31e63aba1dd

Use better colors for matching parentheses
author zegervdv <zegervdv@me.com>
date Thu, 07 Aug 2014 19:25:27 +0200
parents 8278ded5eb8c
children 384c853303af
comparison
equal deleted inserted replaced
93:8278ded5eb8c 94:c31e63aba1dd
3 " General Settings {{{ 3 " General Settings {{{
4 set nocompatible 4 set nocompatible
5 set laststatus=2 5 set laststatus=2
6 set noshowmode 6 set noshowmode
7 7
8 let g:pathogen_disabled = ['ack','ctrlp', 'yankring'] 8 let g:pathogen_disabled = ['ack']
9 execute pathogen#infect() 9 execute pathogen#infect()
10 10
11 set backspace=2 11 set backspace=2
12 set autowrite 12 set autowrite
13 13
102 nnoremap <F5> :buffers<CR>:buffer<Space> 102 nnoremap <F5> :buffers<CR>:buffer<Space>
103 103
104 " Set leader to , 104 " Set leader to ,
105 let mapleader = "," 105 let mapleader = ","
106 106
107 map <Leader>d :bp<bar>sp<bar>bn<bar>bd<CR>
108
109 " See long lines as line breaks 107 " See long lines as line breaks
110 map j gj 108 map j gj
111 map k gk 109 map k gk
112 110
113 " remap tag-search to better place 111 " remap tag-search to better place
115 function! JumpToTagInSplit() 113 function! JumpToTagInSplit()
116 execute "normal! \<c-w>v\<c-]>mzzMzvzz15\<c-e>" 114 execute "normal! \<c-w>v\<c-]>mzzMzvzz15\<c-e>"
117 execute "keepjumps normal! `z" 115 execute "keepjumps normal! `z"
118 Pulse 116 Pulse
119 endfunction 117 endfunction
120 nnoremap <c-$> :silent! call JumpToTag()<cr> 118 nnoremap <C-$> :silent! call JumpToTagInSplit()<CR>
121 119
122 " Jump to end of line in insert mode 120 " Jump to end of line in insert mode
123 inoremap <C-a> <C-o>I 121 inoremap <C-a> <C-o>I
124 inoremap <C-e> <C-o>A 122 inoremap <C-e> <C-o>A
125 123
168 166
169 " highlight last inserted text 167 " highlight last inserted text
170 nnoremap gV `[v`] 168 nnoremap gV `[v`]
171 169
172 " Briefly change colour of last highlight 170 " Briefly change colour of last highlight
173 nnoremap <silent> n n:call HLNext(0.4)<cr> 171 " nnoremap <silent> n n:call HLNext(0.4)<cr>
174 nnoremap <silent> N N:call HLNext(0.4)<cr> 172 " nnoremap <silent> N N:call HLNext(0.4)<cr>
175 173
176 function! HLNext (blinktime) 174 function! HLNext (blinktime)
177 highlight WhiteOnRed ctermfg=white ctermbg=red guifg=white guibg=red 175 highlight WhiteOnRed ctermfg=white ctermbg=red guifg=white guibg=red
178 let [bufnum, lnum, col, off] = getpos('.') 176 let [bufnum, lnum, col, off] = getpos('.')
179 let matchlen = strlen(matchstr(strpart(getline('.'),col-1),@/)) 177 let matchlen = strlen(matchstr(strpart(getline('.'),col-1),@/))
182 redraw 180 redraw
183 exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm' 181 exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm'
184 call matchdelete(ring) 182 call matchdelete(ring)
185 redraw 183 redraw
186 endfunction 184 endfunction
185
186 " Highlight matching parenthesis in different color so I don't mess up
187 hi MatchParen cterm=underline ctermbg=none ctermfg=white gui=underline guifg=white
187 188
188 " Highlight VCS conflict markers 189 " Highlight VCS conflict markers
189 match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' 190 match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
190 191
191 " Swap v and CTRL-V 192 " Swap v and CTRL-V