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