-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
180 lines (135 loc) · 3.62 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
"""""""""""""""""""""""""""""""""""""""""""""""
" Vimrc of Dante
"
"
"""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""
" Generic
"""""""""""""""""""""""""""""""""""""""""""""""
" Lines of history Vim need to remember
set history=800
" Auto read if file is changed outside
set autoread
" Set <Leader> mapping to use more combinations
let mapleader=","
let g:mapleader=","
" Quick key sets using <leader> key
nmap <leader>w :w!<cr>
nmap <leader>q :q<cr>
nmap <leader>e :e ~/.vimrc<cr>
" enable C-C, C-V
map <C-V> "+gP
cmap <C-V> <C-R>+
vnoremap <C-C> "+y
"""""""""""""""""""""""""""""""""""""""""""""""
" Interface
"""""""""""""""""""""""""""""""""""""""""""""""
" use wild menu
set wildmenu
set wildignore=*.dll,*.o,*.obj,*.bak,*.exe,*.pyc,
\*.jpg,*.gif,*.png
" always show current position
set ruler
" set commander bar height
set cmdheight=2
" ignore case for searching
set ignorecase
set smartcase
" search
set hlsearch
set incsearch
" don't redraw while executing macro
set nolazyredraw
" set magic on for regex
set magic
" show matching bracet
set showmatch
" how many sec to blink the cursor
set mat=2
" no sound on error
set noerrorbells
set novisualbell
"""""""""""""""""""""""""""""""""""""""""""""""
" Color and font
"""""""""""""""""""""""""""""""""""""""""""""""
" syntax highlight
syntax enable
" font
set gfn=Monospace\ 12
" set shell
set shell=/bin/tcsh
" color scheme
colo desert
"set encoding
set encoding=utf8
" default file type
set ffs=unix,dos,mac
"""""""""""""""""""""""""""""""""""""""""""""""
" Backup and undo
"""""""""""""""""""""""""""""""""""""""""""""""
" no backup needed
set nobackup
set nowb
set noswapfile
set undodir=~/.vim/undodir
"""""""""""""""""""""""""""""""""""""""""""""""
" Tab, text, indent
"""""""""""""""""""""""""""""""""""""""""""""""
set expandtab
set shiftwidth=4
set tabstop=4
set smarttab
set lbr
set tw=500
set ai
set si
set wrap
"""""""""""""""""""""""""""""""""""""""""""""""
" Key bindings
"""""""""""""""""""""""""""""""""""""""""""""""
" mapping window moving
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" tab operations
map <leader>t :tabnew<cr>
"""""""""""""""""""""""""""""""""""""""""""""""
" Status line
"""""""""""""""""""""""""""""""""""""""""""""""
" always show the bar
set laststatus=2
" bar format
set statusline=
set statusline +=%1*\ %n\ %* "buffer number
set statusline +=%5*%{&ff}%* "file format
set statusline +=%3*%y%* "file type
set statusline +=%4*\ %<%F%* "full path
set statusline +=%2*%m%* "modified flag
set statusline +=%1*%=%5l%* "current line
set statusline +=%2*/%L%* "total lines
set statusline +=%1*%4c\ %* "column number
set statusline +=%2*0x%04B\ %* "character under cursor
hi User1 guifg=#eea040 guibg=#222222
hi User2 guifg=#dd3333 guibg=#222222
hi User3 guifg=#ff66ff guibg=#222222
hi User4 guifg=#a0ee40 guibg=#222222
hi User5 guifg=#eeee40 guibg=#222222
"""""""""""""""""""""""""""""""""""""""""""""""
" Omni Auto complete
"""""""""""""""""""""""""""""""""""""""""""""""
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
"""""""""""""""""""""""""""""""""""""""""""""""
" Folding
"""""""""""""""""""""""""""""""""""""""""""""""
" set folding on
set foldenable
"dont auto folding
set foldlevel=100
"what movement will open fold
set foldopen=block,hor,mark,percent,quickfix,tag
" Custom fold text function
function SimpleFoldText()
return getline(v:foldstart).' '
endfunction
set foldtext=SimpleFoldText()