为了表示对Ruchee的感谢,首先这是Ruchee的个人网站:http://www.ruchee.com/index.html,他的以前很多的代码都放到Git里面了,里面有链接。

看了整整一天,刚开始学习vim的时候就是用的Ruchee的vimrc脚本,现在终于可以自己写一点了,又认真看了一下Ruchee原来的脚本,虽然还有一些不太懂,但还是赶脚好腻害的样子。

然后自己又加了一点自己东西:——适用于mac, linux平台

 "Copyright 2013 Xueyang Liu, all rights reserved.
"www.cnblogs.com/liuxueyang/
"Hunan University " ********************SET********************
color lucius
"color desert
set nocompatible
set guifont=Monaco:h16
set lines= columns=
set nu numberwidth=
set cindent
set ai
set tabstop=
set shiftwidth=
set mouse=a
set autochdir
se hlsearch incsearch
se ruler
set laststatus=
set cmdheight=
syntax on
syntax enable
filetype plugin indent on
filetype indent on
filetype plugin on
"filetype on
"set bg=dark " ********************MAP********************
let mapleader=","
noremap <space> ve
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
nnoremap wt :WMToggle<cr>
nnoremap <c-t> :NERDTree<cr>
nnoremap <c-a> :Tlist<cr>
"在某个单词上加上引号,括号
nnoremap <leader>" viw<esc>a"<esc>hbi"<esc>lel
nnoremap <leader>' viw<esc>a'<esc>hbi'<esc>lel
nnoremap <leader>< viw<esc>a><esc>'<i<<esc>lw
"~~~~~~~~~~~~~~~大风歌~~~~~~~~~~~~~~~
vnoremap \ U
inoremap <c-d> <esc>ddi
inoremap <c-u> <esc>veU
inoremap jk <esc>
inoremap <esc> <nop>
"括号,引号自动补全
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
onoremap p i(
onoremap b /return<cr> " ********************OTHER********************
iabbrev @@ www.cnblogs.com/liuxueyang/
iabbrev ccopy Copyright Xueyang Liu, all rights reserved.
autocmd BufWritePre *.html :normal gg=G
"下面这些autocmd还没有学会=_=
"autocmd FileType C++ nnoremap <buffer> <localleader>c I//<esc>
"autocmd FileType javascript nnoremap <buffer> <localleader>c I//<esc>
"autocmd FileType javascript :iabbrev <buffer> iff if()<left>
"autocmd FileType python nnoremap <buffer> <localleader>c I#<esc>
"autocmd FileType python : iabbrev <buffer> iff if:<left>
"echo ">^.^<" " ********************编译 && 运行********************
" Compile
func! CompileCode()
exec "w"
if &filetype == "c"
exec "!gcc -Wall -std=c99 %<.c -o %<"
elseif &filetype == "cpp"
exec "!g++ -Wall -std=c++98 %<.cpp -o %<"
elseif &filetype == "python"
exec "!python %<.py"
endif
endfunc
"Run
func! RunCode()
exec "w"
if &filetype == "c" || &filetype == "cpp"
exec "! ./%<"
elseif &filetype == "python"
exec "!python %<.py"
endif
endfunc
"<c-c> OneKey ComplieAndSave
nnoremap <c-c> :call CompileCode()<cr>
inoremap <c-c> <esc>:call CompileCode()<cr>
vnoremap <c-c> <esc>:call CompileCode()<cr>
"<c-r> OneKey RunAndSave
nnoremap <c-r> :call RunCode()<cr>
inoremap <c-r> <esc>:call RunCode()<cr>
vnoremap <c-r> <esc>:call RunCode()<cr>
"pathogen{
execute pathogen#infect()
call pathogen#infect()
"}
"taglist{
let Tlist_Show_One_File = "只显示当前文件的taglist,默认是显示多个
let Tlist_Exit_OnlyWindow = "如果taglist是最后一个窗口,则退出vim
let Tlist_Use_Right_Window = "在右侧窗口中显示taglist
let Tlist_GainFocus_On_ToggleOpen = "打开taglist时,光标保留在taglist窗口
let Tlist_Ctags_Cmd='/opt/local/bin/ctags' "设置ctags命令的位置
nnoremap <leader>tl : Tlist<CR> "设置关闭和打开taglist窗口的快捷键
"}
autocmd BufEnter * call DoWordComplete()

主要部分是抄的Ruchee的=_=

最新文章

  1. python框架之django
  2. CH Round #52 还教室[线段树 方差]
  3. python集合
  4. .Net判断一个对象是否为数值类型探讨总结(高营养含量,含最终代码及跑分)
  5. cocoapods遇到的问题 (pod: command not found的问题)
  6. [No000043]学习Linux操作系统必备基础知识
  7. Hadoop 面试题redis
  8. 机器学习(Machine Learning)&amp;深入学习(Deep Learning)资料
  9. API 双方认证探讨
  10. 持久化消息队列memcacheq的安装配置
  11. 【剑指offer】面试题20:顺时针打印矩阵
  12. 访问项目时,不能自动加载index.php文件
  13. pygame系列_箭刺Elephant游戏
  14. javascript于&amp;quot;return obj === void 0&amp;quot;这样的书面理由和优势
  15. HashMap和Hashtable的异同点
  16. undefined reference to symbol &#39;pthread_create@@GLIBC_2.2.5&#39; 的修改方法
  17. windows系统,添加网络位置向导。
  18. boost-智能指针
  19. 获得discuz7.2 目录下所有文件,并写到txt
  20. jQuery $.extend()使用方法

热门文章

  1. JavaScript中字符串转Json方法小记
  2. ROS服务器与客户端
  3. 从协议VersionedProtocol开始2&mdash;&mdash;ClientDatanodeProtocol和InterDatanodeProtocol
  4. Android 获取网络状态
  5. java基础之 垃圾回收机制
  6. 自定义圆的半径attr.xml
  7. WordPress 4.0 “Benny” 正式发布
  8. win7下利用笔记本无线网卡创建AP 组建无线局域网(可以连魔兽,TCP、UDP也没问题)
  9. java 集合归类
  10. 《Programming with Objective-C》的常规规定