" ===============================================
" === set设置===================================
" ===============================================
" 设置leader键"
let mapleader=" "
"设置剪贴板
set clipboard=unnamed
let &t_ut=''
set autochdir
" 设置寻找高亮
set hlsearch
exec "nohlsearch"
set incsearch
"从不备份
set nobackup
" 不要使用vi的键盘模式,而是vim自己的
set nocompatible
" 设置没有声音
set noerrorbells
set novisualbell
" 设置在cmap单词补全
set wildmenu
" 设置搜索ignorecase/smartcase
set ignorecase
set smartcase
set t_vb=
set tm=500
" 设置行号
set number
set relativenumber
" 设置最大标签页
set tabpagemax=20
"设置水平显示
set cursorline
set cuc
" 设置tab键和自动缩进
set tabstop=4
set shiftwidth=4
set softtabstop=4
” 下一行和上一行的格式相同
set autoindent
set cindent
" 不要用空格代替制表符
set noexpandtab
" 在行和段开始处使用制表符
set smarttab
"编码设置
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set fileformats=unix,dos,mac
set termencoding=utf-8
set formatoptions+=m
set formatoptions+=B
" 可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位)
set mouse=a
set selection=exclusive
set selectmode=mouse,key
" 在被分割的窗口间显示空白,便于阅读
set fillchars=vert:\ ,stl:\ ,stlnc:\
" 高亮显示匹配的括号
“ set showmatch
" 设置在状态栏显示按键
set showcmd
” 总是显示状态栏
set showtabline=2
” 设置显示行尾结束符和制表符/空格和tab的样式
set list
set listchars=tab:\|\ ,trail:▫
“ 总是显示状态栏
set laststatus=2
” 设置粘贴的模式
set paste
” 显示光标当前位置'
set ruler
" 设置一直留下的行数
set scrolloff=15
" 设置vim操作的等待时间
set ttimeoutlen=0
set notimeout
“ 设置字不超过窗口
set wrap
set tw=0
set indentexpr=
set foldmethod=indent
set foldlevel=99
set foldenable
set formatoptions-=tc
set splitright
set splitbelow
set noshowmode
set shortmess+=c
set completeopt=longest,noinsert,menuone,noselect,preview
set ttyfast "should make scrolling faster
set visualbell
set colorcolumn=80
set updatetime=1000
set virtualedit=block
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" ===============================================
" === 移动光标===================================
" ===============================================
" J K 快速移动上下五行
noremap <silent> K 5k
noremap <silent> J 5j
" 快速到行首
noremap H 0
" 快速到行尾
noremap L $
" 快速的单词跳转
noremap W 5w
noremap B 5b
" 快速移动5行
noremap <C-J> 5<C-y>
noremap <C-K> 5<C-e>
" 在插入模式下快速到行尾和行首
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
inoremap <C-a> <Home>
inoremap <C-e> <End>
" ===============================================
" === 复制,删除,查找和替换恢复和撤消=============
" ===============================================
" 快速选中一个单词
noremap vw viwl
" 快速选中括号中的内
noremap vb vibl
" 快速选中""的内
noremap v' vi"l
" 快速选中''的内
noremap v" vi"l
" 快速选html标签中的
noremap vt vitl
noremap vws viwl"+p
noremap vbs vibl"+p
noremap vts vitl"+p
noremap v's vi"l"+p
noremap v"s vi'l"+p
" ===
" ===b () t html中的<> s {}
" ===
" ciw
nnoremap ciw "+ciw
nnoremap cw ciw
" ci' "word"
nnoremap ci" "+ci'
nnoremap c" ci'
" cib (word)
nnoremap cib "+cib
nnoremap cb cib
" ci" "word"
nnoremap ci' "+ci"
nnoremap c' ci"
" cis {word}
nnoremap cis "+ci{
nnoremap cs ci{
" cit <>word<>
nnoremap cit "+cit
nnoremap ct cit
" yiw