set nu
set wrap
set tabstop=
set softtabstop=
set shiftwidth=
syntax on
filetype on "打开vim文件类型自动检测功能
set autoindent
set smartindent
set scrolloff=
set ruler
set hlsearch
set history= "set foldenable
"set foldmethod=indent
"set foldcolumn=0
"set foldlevel=3 autocmd InsertLeave * se nocul
autocmd InsertEnter * se cul
autocmd BufNewFile *.cpp,*.c exec ":call SetTitle()"
func SetTitle()
call setline(,"/* I can do all things */")
call append(line("."),"/*")
call append(line(".")+,"File Name: ".expand("%"))
call append(line(".")+,"Create Time: ".strftime("%c"))
call append(line(".")+,"Description:")
call append(line(".")+,"*/")
if &filetype=='cpp'
call append(line(".")+,"#include<iostream>")
call append(line(".")+,"using namespace std;")
call append(line(".")+,"")
endif
if &filetype=='c'
call append(line(".")+,"#include<stdio.h>")
call append(line(".")+,"")
endif
endfunc
autocmd BufNewFile * normal G let Tlist_Sort_Type="name"
let Tlist_Use_Left_Window=
let Tlist_Compart_Format=
let Tlist_Exist_OnlyWindow= "若只有一个BUFFER kill掉窗口 let Tlist_Auto_Open=
set tags=tags;
set autochdir
let Tlist_Show_One_File=
let Tlsit_Exit_OnlyWindow=
let Tlist_WinWidth=
map <silent> <F8> :TlistToggle<CR> func! CompileGcc()
exec "w"
let compilecmd="!gcc "
let compileflag="-o %< "
if search("mpi\.h") !=
let compilecmd = "!mpicc "
endif
if search("glut\.h") !=
let compileflag .=" -lglut -lGLU -lGL "
endif
if search("cv\.h") !=
let cpmpileflag .= " -lcv -lhighgui -lcvaux "
endif
if search("omp\.h") !=
let compileflag .= " -fopenmp "
endif
if search("math\.h") !=
let compileflag .= " -lm "
endif
exec compilecmd." % ".compileflag
endfunc func! CompileGpp()
exec "w"
let compilecmd="!g++"
let compileflag="-o %< "
if search("mpi\.h") !=
let compilecmd = "!mpic++ "
endif
if search("glut\.h") !=
let compileflag .=" -lglut -lGLU -lGL "
endif
if search("cv\.h") !=
let cpmpileflag .= " -lcv -lhighgui -lcvaux "
endif
if search("omp\.h") !=
let compileflag .= " -fopenmp "
endif
if search("math.\h") !=
let compileflag .=" -lm "
endif
exec compilecmd." % ".compileflag
endfunc func! CompileCode()
exec "w"
if &filetype == "cpp"
exec "call CompileGpp()"
elseif &filetype == "c"
exec "call CompileGcc()"
endif
endfunc func! RunResult()
exec "w"
if &filetype == "cpp"
exec "call CompileGpp()"
exec "! ./%<"
endif
if &filetype == "c"
exec "call CompileGcc()"
exec "! ./%<"
endif
endfunc map <F6> :call RunResult()<CR> map <F5> :call CompileCode()<CR>
imap <F5> <ESC>:call CompileCode()<CR>
vmap <F5> <ESC>:call CompileCode()<CR>

vimrc 我的专属vim配置的更多相关文章

  1. acm的ubuntu (ubuntu16.04 安装指南,chrome安装,vim配置,git设置和github,装QQ)

    日常手贱把ubuntu14.04更新到了16.04,然后就game over了.mdzz,不然泥萌也看不到这篇博客了=.= 然后花了些时间重装了一个16.04版的,原来那个14.04的用可以用,就是动 ...

  2. VIM配置与管理

    VIM是写代码的神器,个人觉得比sublime更强,详情http://zh.wikipedia.org/wiki/Vim.如果用网游做类比,没有经过打造的VIM,也只能算是一只非常有潜力的0级宠物,经 ...

  3. 快速学习C语言三: 开发环境, VIM配置, TCP基础,Linux开发基础,Socket开发基础

    上次学了一些C开发相关的工具,这次再配置一下VIM,让开发过程更爽一些. 另外再学一些linux下网络开发的基础,好多人学C也是为了做网络开发. 开发环境 首先得有个Linux环境,有时候家里机器是W ...

  4. centos vim配置高亮语法和格式化粘贴

    centos vim配置高亮语法和格式化粘贴 设置vim别名和高亮grep词语 echo -e "\nalias vi=vim\nalias grep='grep --color'\n&qu ...

  5. vim配置方法

    /etc/vimrc (公共的) ~/.vimrc (私人的) rpm -qa|grep vim 这个命令,如何vim已经正确安装,则会显示上面三个包的名称 全部安装 yum -y install v ...

  6. VIM配置相关记录

    把一直使用中的vim配置做个GIT入库管理,也把之前积累在机器上的文档,做个汇总. https://github.com/wujuguang/kyvim 1. 安装完整版vim vi和vim的区别?在 ...

  7. Vim配置及说明——IDE编程环境

    Vim配置及说明——IDE编程环境 Vim配置及说明——IDE编程环境 1.基本及字体 2.插件管理 3.主题风格 4.窗口设置 5.目录树导航 6.标签导航 7.taglist 8.多文档编辑 9. ...

  8. 超强vim配置

    在网上找vim的配置,自己配置的特别丑 安装起来也超级方便. #!/bin/bash echo "安装将花费一定时间,请耐心等待直到安装完成^_^" if which apt-ge ...

  9. vim配置及插件安装管理(超级详细)

    1 写在前面   Linux下编程一直被诟病的一点是: 没有一个好用的IDE, 但是听说Linux牛人, 黑客之类的也都不用IDE. 但是对我等从Windows平台转移过来的Coder来说, 一个好用 ...

随机推荐

  1. 【剑指offer】删除链表中重复的节点,C++实现(链表)

    0.简介       本文是牛客网<剑指offer>笔记. 1.题目 在一个排序的链表中,存在重复的结点,请删除该链表中重复的结点,重复的结点不保留,返回链表头指针.例如,链表1-> ...

  2. 455. Assign Cookies Add to List

    Assume you are an awesome parent and want to give your children some cookies. But, you should give e ...

  3. poj2374 Fence Obstacle Course[线段树+DP]

    https://vjudge.net/problem/POJ-2374 吐槽.在这题上面磕了许久..英文不好题面读错了qwq,写了个错的算法搞了很久..A掉之后瞥了一眼众多julao题解,**,怎么想 ...

  4. poj2411 Mondriaan's Dream[简单状压dp]

    $11*11$格子板上铺$1*2$地砖方案.以前做过?权当复习算了,毕竟以前学都是浅尝辄止的..常规题,注意两个条件:上一行铺竖着的则这一行同一位一定要铺上竖的,这一行单独铺横的要求枚举集合中出现连续 ...

  5. centos安装yum源

    网易(163)yum源是国内最好的yum源之一 ,无论是速度还是软件版本,都非常的不错,将yum源设置为163yum,可以提升软件包安装和更新的速度,同时避免一些常见软件版本无法找到.具体设置方法如下 ...

  6. 根据VM的TAG开停机

    公有云一个非常大的优势,就是可以根据需求进行开停机.由于计费是按时进行的,从而实现节省成本. Azure上用脚本按时开停机已经有很多部署的案例.本文将介绍采用VM Tag中规定的时间进行开停机的脚本. ...

  7. Quartz 定时任务(含Redis)

    一  定时任务基础: MQ:Message Queue消息队列服务器:MSMQ.ActiveMQ.Redis等项目任务:确定邮件的发送,重置密码的发送(发送可能会很慢,而且有可能还需要重试),用消息队 ...

  8. Admin.Admin/Login --- 后台项目中的管理员及登录模块

    管理员模块: using System; using System.Collections.Generic; using System.Linq; using System.Web; using Sy ...

  9. POJ3104(二分搜索)

    Drying Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 13057   Accepted: 3358 Descripti ...

  10. Python内置函数:read()

    文章转载于:http://blog.csdn.net/sxingming/article/details/51337768(博主:快递小哥) 1> >>> f=open(r&q ...