-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc-myversion
151 lines (105 loc) · 4.01 KB
/
vimrc-myversion
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
" dsoivsdoivuds
" YOU SOUND HAVE TO LOOK AT ~/.gvimrc
"nmap ,s :source $MYVIMRC
"nmap ,v :e $MYVIMR
"=============================================================================
" General settings
"=============================================================================
set nocompatible
set ruler
set shiftwidth=4
set tabstop=4
set expandtab
set smarttab
set ambiwidth=double
"Color section
set laststatus=2
"Deprecated.. set stl='%F%m%r%h%w\ [%{&ff}]\ [%Y]\ [%{(&fenc==\"\")?&enc:&fenc}%{(&bomb?\",BOM\":\"\")}]\ [POS=%l,%v][%p%%]\ %=[%{GitBranch()}]'
set stl=%f\ %m\ %r\ Line:%l/%L[%p%%]\ Col:%c\ Buf:%n\ [%b][0x%B]\ %=[%{GitBranch()}]
set showcmd " 'sc' show (partial) command in status line
" Format related
set lbr
"set fold+=mB
set number
autocmd FileType text setlocal textwidth=78
"set lines=36
"set columns=82
set autoindent
" Editing
set backspace=indent,eol,start
"set encoding=utf-8
set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1 " 如果你要打开的文件编码不在此列,那就添加进去
"set termencoding=utf-8
set switchbuf=usetab "With the set switchbuf=usetab option, you can tell Vim to first search the tab and window list for the requested buffer - if the buffer exists is in a window or tab, the focus goes right to that window.
" :b<number> replaces the contents of the current window with the requested buffer; :gt moves to the next tab; and I configured <Leader>w to move to the next window (within a tab). That's a lot of options.
"
set ignorecase " you nearly always want this
set smartcase " use case-sensitive search if your search contains an uppercase character
set hls
"光标在窗口上下边界时距离边界3行即开始滚屏
set so=2
syntax on
" Maps to make handling windows a bit easier
noremap <silent> ,h :wincmd h<CR>
noremap <silent> ,j :wincmd j<CR>
noremap <silent> ,k :wincmd k<CR>
noremap <silent> ,l :wincmd l<CR>
noremap <silent> ,ml <C-W>L
noremap <silent> ,mk <C-W>K
noremap <silent> ,mh <C-W>H
noremap <silent> ,mj <C-W>J
" Running file thru an external program (eg php)
" map <F9> :w<CR>:!c:/php/php.exe %<CR>
"# Inserting Carriage Returns
":%s/nubian/<C-V><C-M>&/g : that's what you type
":%s/nubian/<C-Q><C-M>&/g : for Win32
":%s/nubian/^M&/g : what you'll see where ^M is ONE character
nmap <C-K> <C-W>k<C-W>_
nmap <C-J> <C-W>j<C-W>_
" VIM Tip: 上下移动一行或多行代码并自动调整缩进_drdr_xp_百度空间 http://goo.gl/3wt0
nnoremap <C-k> mz:m-2<cr>`z==
nnoremap <C-j> mz:m+<cr>`z==
xnoremap <C-k> :m'<-2<cr>gv=gv
xnoremap <C-j> :m'>+<cr>gv=gv
set wildmenu " 显示补全列表
set wildmode=full " 补全行为设置
set ignorecase " you nearly always want this
set smartcase " use case-sensitive search if your search contains an uppercase characte
" section for closetag script
let g:closetag_html_style=1
" For all text files set 'textwidth' to 78 characters.
" Abbs
ab #b /************************************************
ab #e ************************************************/
ab #d #define
ab #i #includ
" Platform specified
if has('unix')
" unix-like platform (including Cygwin)
if has('mac')
if has('gui')
set toolbar=text
set guioptions-=T
set gfn=Monaco:h12.00
colorscheme default
endif
endif
source ~/.vim/scripts/closetag.vim "source closetag script
else
if (has("win32"))
"-------------------------------------------------------------------------
" Win32
"-------------------------------------------------------------------------
" probably Windows
" Note: Ctrl-Q is block visual mode
" In insert mode, Ctrl-G s, is the surround function
source vimfiles/scripts/closetag.vim "source closetag script
set dir=c:\\tmp
set bdir=c:\\tmp
if has('gui')
set gfn=Consolas:h9
endif
endif
"End windows section
endif
"set list "When the display is set into list mode all characters print. Tabs show up as ^I and the end of line shows up as $.