不错的vim配置

"=============================================================================
" Description: MY vimrc with dozens of scripts, for Linux/Windows, GUI/Console
"              Originally from MetaCosm's http://vi-improved.org/vimrc.php
"
" Last Change: 0 14/05/2006 23:36:39 Leal@RAINT:_vimrc
"
" Author:      Leal <linxiao.li AT gmail DOT com>
"              Get latest vimrc from http://www.leal.cn/
"
" Version:     1.0065
"
" Usage:       1. Prepare necessary dirs and files.
"
"              $VIMDATA         X:/Vim/vimdata on Win, ~/vimdata on Linux
"               |
"               |-- temp        to put swap files <DIR>
"               |-- backup      to put backup files <DIR>
"               |-- diary       to save calendar.vim's diaries <DIR>
"               |-- GetLatest   to save GetLatestVimScripts.vim's <DIR>
"               |      |
"               |      `-- GetLatestVimScripts.dat   to store GLVS's items
"               |
"               |-- _vim_fav_files   to store favmenu.vim's items
"               `-- _vim_mru_files   to store mru.vim's items
"
"              2. Get all scripts you favor on www.vim.org, better with GLVS.
"
"              3. Get all needed utilities, especially on Windows, e.g.
"              wget  -- WGET for Windows  http://users.ugent.be/~bpuype/wget/
"              ctags -- Exuberant Ctags   http://ctags.sf.net/
"
"              4. If have no idea of some option, just press K (<S-k>) on it.
"
"              5. HTML file is produced with :TOhtml, with colo default.
"
"=============================================================================

"-----------------------------------------------------------------------------
" general
"-----------------------------------------------------------------------------
set nocompatible        " use vim as vim, should be put at the very start
set history=100         " lines of Ex-mode commands, search history
set browsedir=buffer    " use directory of the related buffer for file browser
set clipboard+=unnamed  " use clipboard register '*' for all y, d, c, p ops
set viminfo+=!          " make sure it can save viminfo
set isk+=$,%,#,-,@,_    " none of these should be word dividers
set confirm             " raise a dialog confirm whether save changed buffer
set ffs=unix,dos,mac    " favor unix, which behaves good under Linux/Windows
set fenc=utf-8          " default fileencoding
set fencs=utf-8,ucs-bom,euc-jp,gb18030,gbk,gb2312,cp936
map Q gq
                        " do not use Ex-mode, use Q for formatting
filetype on             " enable file type detection
filetype plugin on      " enable loading the plugin for appropriate file type

"-----------------------------------------------------------------------------
" colors
"-----------------------------------------------------------------------------
colorscheme evening
set background=dark     " use a dark background
syntax on               " syntax highlighting

"-----------------------------------------------------------------------------
" gui-only settings
"-----------------------------------------------------------------------------
if has("gui_running")
"  colo inkpot           " colorscheme, inkpot.vim
  set lines=35          " window tall and wide, only if gui_running,
  set columns=105       " or vim under console behaves badly
endif

"-----------------------------------------------------------------------------
" Vim UI
"-----------------------------------------------------------------------------
set linespace=1         " space it out a little more (easier to read)
set wildmenu            " type :h and press <Tab> to look what happens
set ruler               " always show current position along the bottom
set cmdheight=2         " use 2 screen lines for command-line
set lazyredraw          " do not redraw while executing macros (much faster)
set number              " don't print line number
set hid                 " allow to change buffer without saving
set backspace=2         " make backspace work normal
set whichwrap+=<,>,h,l  " allow backspace and cursor keys to wrap
set mouse=a             " use mouse in all modes
set shortmess=atI       " shorten messages to avoid 'press a key' prompt
set report=0            " tell us when anything is changed via :...
set fillchars=vert:/ ,stl:/ ,stlnc:/
                        " make the splitters between windows be blank

"-----------------------------------------------------------------------------
" visual cues
"-----------------------------------------------------------------------------
set showmatch           " show matching paren
set matchtime=5         " 1/10 second to show the matching paren
set hlsearch            " do not highlight searched for phrases
set incsearch           " BUT do highlight where the typed pattern matches
set scrolloff=3         " minimal number of screen lines to keep above/below the cursor
set novisualbell        " use visual bell instead of beeping
set noerrorbells        " do not make noise
set laststatus=2        " always show the status line
set listchars=tab:/|/ ,trail:.,extends:>,precedes:<,eol:$ " how :set list show
"set statusline=%{VimBuddy()}/ %F%m%r%h%w/ [%{&ff}]/ [%Y]/ [/%03.3b/ /%02.2B]/ [%02v/ %03l/ %L/ %p%%]
                        " need vimbuddy.vim, dislike it? just remove it

"-----------------------------------------------------------------------------
" text formatting/layout
"-----------------------------------------------------------------------------
set ai                  " autoindent
set si                  " smartindent
set cindent             " do C-style indenting
set fo=tcrqn            " see help (complex)
set tabstop=4           " tab spacing
set softtabstop=4       " unify it
set shiftwidth=4        " unify it
set noexpandtab         " real tabs please!
set smarttab            " use tabs at the start of a line, spaces elsewhere
set wrap                " do not wrap lines
set formatoptions+=mM   " thus vim can reformat multibyte text (e.g. Chinese)

" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
/ if line("'/"") > 0 && line("'/"") <= line("$") |
/ exe "normal g`/"" |
/ endif

"-----------------------------------------------------------------------------
" folding
"-----------------------------------------------------------------------------
set foldenable          " turn on folding
set foldmethod=indent   " make folding indent sensitive
set foldlevel=100       " don't autofold anything, but can still fold manually
set foldopen -=search   " don't open folds when you search into them
set foldopen -=undo     " don't open folds when you undo stuff

"set guifont=Monospace/ 13
set guifont=Liberation_Mono:h12:cANSI
"set guifont=Courier_New:h13:cANSI
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值