dotfiles/.vimrc2
2022-09-01 23:22:18 +08:00

44 lines
1.4 KiB
Plaintext

" vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'https://gitee.com/dictxiong/Vundle.vim'
Plugin 'https://gitee.com/dictxiong/onedark.vim'
call vundle#end()
filetype plugin indent on
" end vundle
colorscheme onedark
set cursorline
set syntax=on
set autoindent
set smartindent
set tabstop=4
set expandtab "spaces instead of tabs
set backspace=indent,eol,start
set number "line numbers
set history=1000
set ignorecase "when searching
set smartcase "but not when containing upper case chars
set linebreak
"set termguicolors "true color
set completeopt=preview,menu "auto complete
set laststatus=2 "always show statusline
hi User1 ctermfg=14 ctermbg=236
hi User2 ctermfg=237 ctermbg=214
hi User3 ctermfg=15 ctermbg=2
au InsertEnter * hi User3 ctermfg=15 ctermbg=5
au InsertLeave * hi User3 ctermfg=15 ctermbg=2
set statusline=%3*\ %{mode()}\ %*[%n][%F](%{\"\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\"+\":\"\").\"\"},%{&ff},%Y)%2*%r%1*%m%*%<%=\'0x%B\'\ [Line:%l/%L,Col:%c][%p%%]
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid, when inside an event handler
" (happens when dropping a file on gvim) and for a commit message (it's
" likely a different one than last time).
" Taken from /usr/share/vim/vim81/defaults.vim
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ | exe "normal! g`\""
\ | endif