VIm变成sublime

只需要三步

   第一步:安装vundle 管理你的vim插件:

$ git clone  https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

   第二步:配置~/.vimrc 如下:


set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"插件
Bundle 'gmarik/vundle'
Bundle 'AutoComplPop'
Bundle 'The-NERD-tree'
Bundle 'Tagbar'
Bundle 'minibufexpl.vim'
Bundle 'molokai'
Bundle 'ZenCoding.vim'
Bundle 'L9'
Bundle 'FuzzyFinder'
Bundle 'WebAPI.vim'
Bundle 'Gist.vim'
filetype plugin indent on " required!
"autocomplpop 设置
let g:AutoComplPop_IgnoreCaseOption=1
set ignorecase
let g:acp_behaviorKeywordCommand="\<C-x>\<C-o>"
"搜索高亮
set hlsearch
"设置NERDTreetagbar的宽度
let g:NERDTreeWinSize = 20
let g:tagbar_width=20
"颜色主题设置
set t_Co=256
colorscheme molokai
"zencoding 设置
let g:user_zen_expandabbr_key='<S-O>'
let g:use_zen_complete_tag = 1
"Gist设置
let g:gist_detect_filetype = 1
let g:gist_clip_command = 'xclip -selection clipboard'
"查找手册
autocmd FileType php set keywordprg=~/.vim/phpman
autocmd FileType js,css,html set keywordprg=~/.vim/man
map <F2> <S-K><CR>
map! <F2> <Esc><S-K><CR>a
"检查php语法错误
map <F5> :! php -l %<CR>
map! <F5> <Esc>:! php-l %<CR>
"快速生成tag文件
map <F3> :! ctags -R<CR>
map! <F3> <Esc>:! ctags -R<CR>
"快捷键设置
map <F11> :NERDTreeToggle<CR>
map! <F11> <Esc>:NERDTreeToggle<CR>
map <F12> :TagbarToggle<CR>
map! <F12> <Esc>:TagbarToggle<CR>
map <F6> :AcpDisable<CR>
map! <F6> <Esc>:AcpDisable<CR>a
"快速查找文件
map <C-P> :FufCoverageFile<CR>
map! <C-P> :FufCoverageFile<CR>
"快速关闭
map <S-Q> :q<CR>:q<CR>:q<CR>:q<CR>
"映射复制、粘贴、剪贴ctrl+c ctrl+v ctrl+x
"map <C-V> "+pa<Esc>
map! <C-V> <Esc>"+pa
map <C-C> "+y
map <C-X> "+x
" 映射全选 ctrl+a
map <C-A> ggVG
map! <C-A> <Esc>ggVG
"ctrl+s为保存
map <C-S> :w<CR>
map! <C-S> <Esc>:w<CR>a
"ctrl+z撤销
map <C-Z> :u<CR>
map! <C-Z> <Esc>:u<CR>a
"双击时高亮
map <2-LeftMouse> *
map! <2-LeftMouse> <c-o>*
"ctrl+鼠标左键跳转
map <C-LeftMouse> <C-]>
map! <C-LeftMouse> <Esc><C-]>
"光标设在为竖线
autocmd InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
autocmd InsertLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
autocmd VimLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
"支持鼠标
set mouse=a
"显示行数
set nu
" 多行缩进
map <Tab> >
map <S-Tab> <
"基本设置
set encoding=utf-8
set fileencoding=chinese
set fileencodings=ucs-bom,utf-8,chinese
set ambiwidth=double
set ts=4
set sw=4
set wrap "自动换行
"设置无备份
set nobackup
set nowritebackup



使用说明:

F2 : 快速打开手册文档

F3:生成tags文件 ,(系统要先安装ctags)

F5: 检查是否有PHP语法错误 。

F6: 关闭自动提示代码, (有些文件因为不支持自动提示,打开自动提示会导致编辑很慢,可以用F6快速关闭自动提示)

F11 : 打开或关闭NERDTree 。

F12: 打开或关闭Tagbar。

ctrl+c : 复制,是复制到了系统的剪切板, 你可以在非vim的粘贴出来。 

ctrl+v : 粘贴, 是从系统剪切板粘贴, 也就是说 你可以在其他地方复制文字然后再vim中用ctrl+v粘贴(这时候用p粘贴是没有用的),注意,粘贴的时候 要是插入模版, 普通模式下 ctrl+v 触发的是选择块。

ctrl+z:撤销

ctrl+s: 保存,注意 ctrls+s 快捷键往往被终端禁用了, 如果你要启用ctrls+s, 需要设置: alias vim="stty stop '' -ixoff ; vim"

感谢博主:http://www.cnblogs.com/weishuan/p/4415580.html


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值