我的.vimrc

vimrc

if v:progname =~? "evim"
  finish
endif

set nocompatible
set backspace=indent,eol,start

set history=50      " keep 50 lines of command line history set ruler " show the cursor position all the time
set showcmd     " display incomplete commands set incsearch " do incremental searching

map Q gq
inoremap <C-U> <C-G>u<C-U>

set mouse=n

if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

if has("autocmd")
    filetype plugin indent on
    augroup vimrcEx
  au!

  autocmd FileType text setlocal textwidth=78

  autocmd BufReadPost *
    \ if line("'\"") > 1 && line("'\"") <= line("$") |
    \   exe "normal! g`\"" |
    \ endif

  augroup END

else

  set autoindent        " always set autoindenting on endif if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis \ | wincmd p | diffthis endif set wildignore=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,node_modules/* "allow deletion of previously entered data in insert mode
set backspace=indent,eol,start

" Allow saving of files as sudo when I forgot to start vim using sudo. cmap w!! %!sudo tee > /dev/null % "------  Searching  ------
set incsearch
set ignorecase
set smartcase
set hlsearch

nnoremap <silent> <leader>b :nohlsearch<CR>
noremap <leader>a :Ack
noremap <leader>A <C-w>j<C-w>c<C-w>l

let g:ackprg="ack -H --nocolor --nogroup --column"
let g:ctrlp_working_path_mode = ''
let g:ctrlp_custom_ignore = '\v[\/](node_modules|coverage|target|dist)|(\.(swp|ico|git|svn))$'
nmap S :%s//g<LEFT><LEFT>
vmap S :s//g<LEFT><LEFT>

map <Leader>T :%s/\s\+$//<CR>
map <Leader>U :g/^$/d<CR>
map <Leader>R :retab<CR>

"------ JSON Filetype Settings ------ au BufRead,BufNewFile *.json set filetype=json let g:vim_json_syntax_conceal = 0 nmap <silent> =j :%!python -m json.tool<CR>:setfiletype json<CR> " myself env
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
set number
set fileencodings=utf-8,gb18030,gbk,gb2312,big5
set encoding=utf-8
set nobackup
set noswapfile
set ai
set si
set smarttab
set laststatus=2

你可能感兴趣的:(vimrc)