-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vimrc
106 lines (80 loc) · 2.68 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
" Get out of VI's compatible mode..
set nocompatible
" Sets how many lines of history VIM has to remember
set history=700
" switch syntax highlighting on
syntax on
" Set to auto read when a file is changed from the outside
set autoread
" save when changing buffer
set autowrite
filetype off " required
filetype plugin indent on
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" colorscheme desert
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Interface & Display
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" set scroll offset
set scrolloff=5
" Show the line and column number of the cursor position, separated by a comma
set ruler
" Turn on wild menu
set wildmenu
set wildmode=longest:full
" change buffer without saving
set hid
" set backspace
set backspace=indent,eol,start
" Ignore case in search patterns.
set ignorecase
set smartcase
" When there is a previous search pattern, highlight all its matches.
set hlsearch
" While typing a search command, show where the pattern, as it was typed so far, matches.
set incsearch
" Set magic on, for regular expressions
set magic
" When a bracket is inserted, briefly jump to the matching one
set showmatch
set matchtime=2
" no sound on errors
set noerrorbells
set novisualbell
" The value of this option influences when the last window will have a status line
set laststatus=2 " always show the statue line
" line number
set number
""""""""""""""""""""""""""""""
" Indent
""""""""""""""""""""""""""""""
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab "Use the appropriate number of spaces to insert a <Tab>.
"set smarttab "set smarttab, at the start of line use shiftwide and others tabstop
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,cp936,latin1
set termencoding=utf-8
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" AutoCmd
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("autocmd")
"auto read vimrc when it refreshed
autocmd! bufwritepost .vimrc source ~/.vimrc
"自动回到上次打开的位置
autocmd! BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
endif " has(autocmd)
" 保存自动删除行位空格
autocmd BufWritePre * :%s/\s\+$//e