-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
executable file
·123 lines (100 loc) · 2.94 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
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vundle
" :BundleInstall
" vim +BundleInstall +qall
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible " do not compatible with vi
filetype off
set runtimepath+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" Nerd Tree
Bundle 'https://github.com/scrooloose/nerdtree.git'
"Git Wrapper
Bundle 'git://github.com/tpope/vim-fugitive.git'
" Bundle "https://github.com/majutsushi/tagbar.git"
" Bundle "https://github.com/xolox/vim-easytags.git"
" header/source switch
Bundle "a.vim"
" C/C++ IDE
" Bundle "c.vim"
syntax on
filetype plugin indent on
" vundle finished
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set ruler
set number
set nobackup
set backspace=eol,start,indent
set shiftwidth=4
set tabstop=4
set softtabstop=4
" use space instead tab
set expandtab
set smarttab
set nobackup
set nowritebackup
set hidden
set nowrap
set incsearch
set hlsearch
set ignorecase
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" For C++
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set smartindent
set autoindent
set cindent
syntax enable
syntax on
filetype on
filetype plugin on
filetype indent on
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Chinese multi-encoding setting
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("multi-byte")
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,latin1
if v:lang =~ "^zh_CN"
set encoding=chinese
set termencoding=chinese
set fileencoding=chinese
endif
if v:lang =~ "utf8$" || v:lang=~ "UTF-8$"
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
endif
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Gui Running
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("gui_running")
set guioptions-=T
set guifont=Consolas:h11:cANSI
set columns=85
colorscheme darkblue
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" key mapping
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
imap jj <ESC>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Status Line
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Always hide the statusline
set laststatus=2
" Format the statusline
set statusline=
set statusline+=%2*%-3.3n%0*\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%1*%m%r%w%0* " flags
set statusline+=\[%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{&fileencoding}, " encoding
set statusline+=%{&encoding}, " encoding
set statusline+=%{&fileformat}] " file format
set statusline+=%= " right align
set statusline+=%2*0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset