update clean vimrc

This commit is contained in:
light 2019-09-16 15:51:35 +08:00
parent 6b19dac2c1
commit 9c7433663d

View File

@ -1,5 +1,7 @@
nnoremap <leader>[ :bp<CR> nnoremap <leader>[ :bp<CR>
nnoremap <leader>] :bn<CR> nnoremap <leader>] :bn<CR>
nnoremap <A-Left> :bp<CR>
nnoremap <A-Right> :bn<CR>
" 映射<leader>num到num buffer " 映射<leader>num到num buffer
"nmap <tab> :bn<cr> "nmap <tab> :bn<cr>
map <leader>1 :b 1<CR> map <leader>1 :b 1<CR>
@ -17,6 +19,7 @@ nmap J 5j
nmap K 5k nmap K 5k
nmap H 5h nmap H 5h
nmap L 5l nmap L 5l
nmap & $
nnoremap <c-h> <c-w>h nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l nnoremap <c-l> <c-w>l
@ -87,6 +90,7 @@ set expandtab
set smarttab set smarttab
" 显示行号 " 显示行号
set number set number
set rnu
" 历史记录数 " 历史记录数
set history=1000 set history=1000
"禁止生成临时文件 "禁止生成临时文件
@ -94,9 +98,9 @@ set nobackup
set noswapfile set noswapfile
"搜索忽略大小写 "搜索忽略大小写
set ignorecase set ignorecase
" 搜索时忽略大小写,但在有一个或以上大写字母时仍大小写敏感 " 搜索时忽略大小写,但在有一个或以上大写字母时仍大小写敏感
set ignorecase set ignorecase
set smartcase set smartcase
"搜索逐字符高亮 "搜索逐字符高亮
@ -142,9 +146,9 @@ map <space>mc :set mouse=c<CR>:set nu!<CR>:set paste<CR>
set mouse=a set mouse=a
" 选中状态下 Ctrl+c 复制 " 选中状态下 Ctrl+c 复制
vnoremap <c-c> "+y vnoremap <c-c> "+y
" Ctrl+v " Ctrl+v
"nmap <silent> <C-v> "+p "nmap <silent> <C-v> "+p
@ -163,7 +167,7 @@ set scrolloff=3
" 为C程序提供自动缩进 " 为C程序提供自动缩进
set smartindent set smartindent
" 高亮显示普通txt文件需要txt.vim脚本 " 高亮显示普通txt文件需要txt.vim脚本
au BufRead,BufNewFile * setfiletype txt au BufRead,BufNewFile * setfiletype txt
filetype plugin indent on filetype plugin indent on
"打开文件类型检测, 加了这句才可以用智能补全 "打开文件类型检测, 加了这句才可以用智能补全
set completeopt=longest,menu set completeopt=longest,menu
@ -182,15 +186,14 @@ fun! CleanExtraSpaces()
silent! %s/\s\+$//e silent! %s/\s\+$//e
call setpos('.', save_cursor) call setpos('.', save_cursor)
call setreg('/', old_query) call setreg('/', old_query)
endfun endfun
if has("autocmd") if has("autocmd")
autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee,*.vue :call CleanExtraSpaces() autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee,*.vue :call CleanExtraSpaces()
endif endif
colorscheme slate colorscheme desert
highlight Comment ctermfg=blue
au BufNewFile,BufRead *.launch,*.urdf set filetype=xml au BufNewFile,BufRead *.launch,*.urdf set filetype=xml