-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.ci
136 lines (110 loc) · 3.63 KB
/
vimrc.ci
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
" vimrc.ci
" An vimrc file created by Chen Ci.
"
" Maintainer: Chen Ci <[email protected]>
"
" Create Time: Thu, 23 Mar 2017 01:51:43 +0800
" Change Log: Create this file. Thu, 23 Mar 2017 01:53:22 +0800
"
" To use this file, create a hard link to it.
" ln vimrc.ci .vimrc
" or
" ln vimrc.ci .vim/vimrc
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" mapleader
let mapleader = ";"
" CI.vim
if isdirectory($HOME . "/.vim/CVimrc/CI.vim")
set runtimepath+=$HOME/.vim/CVimrc/CI.vim
endif
" map
if filereadable($HOME . "/.vim/CVimrc/map.vim")
source $HOME/.vim/CVimrc/map.vim
endif
" syntax
if filereadable($HOME . "/.vim/CVimrc/syntax.vim")
source $HOME/.vim/CVimrc/syntax.vim
endif
" Vundle
if isdirectory($HOME . "/.vim/bundle/Vundle.vim")
filetype off
set runtimepath+=$HOME/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
if isdirectory($HOME . "/.vim/CVimrc")
if filereadable($HOME . "/.vim/CVimrc/Vundle_config.vim")
source $HOME/.vim/CVimrc/Vundle_config.vim
endif
endif
call vundle#end()
endif
" CVimrc
let CVimrc_path = $HOME . "/.vim/CVimrc"
" configure files
let cfg_files = split(globpath(CVimrc_path, "*.vim"), '\n')
" load configure files
for f in cfg_files
if 0 != filereadable(f)
execute "source " . f
endif
endfor
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
filetype plugin indent on " Automatically detect file types.
setlocal noswapfile
" set nobackup " do not keep a backup file, use versions instead
set backup " keep a backup file (restore to previoius version)
" set undofile " keep an undo file (undo changes after closing)
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set ignorecase
set number
set relativenumber
set numberwidth=5
set cursorline
set cursorcolumn
set foldenable
set foldmethod=manual
" set foldcolumn=4
set cmdheight=2
" apearance configure
colorscheme molokai
set t_Co=256
set tabstop=4 " Number of spaces that a <Tab> in the file counts for.
set expandtab " In Insert mode: Use the appropriate number of spaces to insert a <Tab>.
set shiftwidth=4 " Number of spaces to use for each step of (auto)indent.
" set softtabstop=4 " Number of spaces that a <Tab> counts for while performing editing operations, like inserting a <Tab> or using <BS>.
set autoindent " Copy indent from current line when starting a new line.
set cindent " Enables automatic C program indenting.
set bufhidden=hide
set linespace=0
set scrolloff=3
set showtabline=2 " always show the tabline
set matchtime=1" Highlight current line
" get the root right to write
cmap w!! w !sudo tee > /dev/null %
hi Normal ctermfg=252 ctermbg=none
" Highlight current line
"au Winleave * set nocursorline nocursorcolumn
"au WinEnter * set cursorline nocursorcolumn
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
" set file encoding
set fileencodings=utf-8,gbk,ucs-bom,gb18030,gb2312,cp936
set enc=utf-8
let g:configure_last=1