Your vimrc


set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
" call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
" Plugin 'VundleVim/Vundle.vim'
" Plugin 'nathanaelkane/vim-indent-guides'
" Plugin 'Yggdroot/indentLine'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
" Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
" Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
" call vundle#end()            " required
filetype plugin indent on    " required

" 行号与标尺
set ruler                   " 右下角显示光标位置的状态行
set number                  " 显示行号
set cursorline              " 突出显示当前行
"set rulerformat=%15(%c%V\ %p%%%)

" 制表符(设置所有的tab和缩进为4个空格)
set tabstop=4               " 设置tab键的宽度
set shiftwidth=4            " 换行时行间交错使用4个空格
"set cindent shiftwidth=4   " 自动缩进4空格
set softtabstop=4
set expandtab               " 使用空格来替换tab
set smarttab                " 开启新行时使用智能 tab 缩进

set list                     " 显示Tab符,
set listchars=tab:\|\ ,      " 使用一高亮竖线代替 把符号显示为 |
"set listchars=tab:>-,trail:-
"set listchars=tab:\|\ ,nbsp:%,trail:-

" 缩进
set autoindent              " 设置自动缩进
set smartindent             " 设置智能缩进

" 搜索
set hlsearch                " 开启高亮显示结果
set incsearch               " 开启实时搜索功能
"set noincsearch             " 关闭显示查找匹配过程
"set magic     " Set magic on, for regular expressions
"set showmatch " Show matching bracets when text indicator is over them
"set mat=2     " How many tenths of a second to blink
set ignorecase              " 搜索时无视大小写
set nowrapscan              " 搜索到文件两端时不重新搜索


" 状态栏显示目前所执行的指令
set showcmd

" 自动重新读入
set autoread                " 当文件在外部被修改,自动更新该文件


" 备份与缓存
set nobackup
set nowb
"set noswapfile
set writebackup             " 设置无备份文件

set showmatch               " 显示括号配对情况
set iskeyword+=_,$,@,%,#,-  " 带有如下符号的单词不要被换行分割
"set wildmenu "打开 wildmenu 选项,启动具有菜单项提示的命令行自动完成。
"set matchpairs=(:),{:},[:],<:>
"set whichwrap=b,s,<,>,[,]

"set relativenumber          " 行标跟随
set clipboard+=unnamed      " 共享外部剪贴板

" 语法高亮
" ----------------------------------------------
syntax enable               " 打开语法高亮
syntax on                   " 开启文件类型侦测
au BufRead,BufNewFile *.txt setlocal ft=txt
au BufRead,BufNewFile *.tpl setlocal ft=smarty 		" 支持 Smarty
au BufRead,BufNewFile *.as setlocal ft=actionscript	" 支持 ActionScript
"au BufRead,BufNewFile *.js set ft=javascript syntax=jquery
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
"autocmd BufRead *.as set filetype=actionscript
"autocmd BufRead *.js set filetype=javascript
autocmd BufRead,BufNewFile *.txtfmt set filetype=txtfmt
"autocmd BufRead,BufNewFile *.txt set filetype=txtfmt
autocmd BufRead,BufNewFile *.mxml set filetype=mxml
autocmd BufRead,BufNewFile *.bash set filetype=bash
autocmd BufRead,BufNewFile *.php set filetype=php
autocmd BufRead,BufNewFile *.c set filetype=c

" 自动匹配括号
" -----------------------------------
:inoremap ( ()<ESC>i
"":inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {}<ESC>i
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
":inoremap < <><ESC>i
":inoremap > <c-r>=ClosePair('>')<CR>
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
:inoremap ` ``<ESC>i

let g:indentLine_enabled = 1
let g:indentLine_leadingSpaceEnabled = 1
let g:indentLine_color_term  = 100
if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值