-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyVimRc_Backup
More file actions
66 lines (63 loc) · 1.17 KB
/
MyVimRc_Backup
File metadata and controls
66 lines (63 loc) · 1.17 KB
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
set number
filetype on
set history=1000
syntax on
set nocompatible
set shiftwidth=4
set backspace=2
set cindent
set mouse=a
set previewwindow
""color evening
""set bg=dark
set cursorline
"colorscheme desert
set autoindent
set smartindent
set tabstop=4
set showmatch
set guioptions-=T
set vb t_vb=
set ruler
set nohls
set incsearch
set showcmd
set wrap
"inoremap ( ()
"inoremap [ []
"inoremap { {}
"inoremap < <>
inoremap ( ()<Esc>i
inoremap [ []<Esc>i
inoremap { {<CR>}<Esc>O
autocmd Syntax html,vim inoremap < <lt>><Esc>i| inoremap > <c-r>=ClosePair('>')<CR>
inoremap ) <c-r>=ClosePair(')')<CR>
inoremap ] <c-r>=ClosePair(']')<CR>
inoremap } <c-r>=CloseBracket()<CR>
inoremap " <c-r>=QuoteDelim('"')<CR>
inoremap ' <c-r>=QuoteDelim("'")<CR>
function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endf
function CloseBracket()
if match(getline(line('.') + 1), '\s*}') < 0
return "\<CR>}"
else
return "\<Esc>j0f}a"
endif
endf
function QuoteDelim(char)
let line = getline('.')
let col = col('.')
if line[col - 2] == "\\"
return a:char
elseif line[col - 1] == a:char
return "\<Right>"
else
return a:char.a:char."\<Esc>i"
endif
endf