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. 关于 freetds pymssql 的安装部署

    关于 freetds pymssql 的安装部署一.安装: (freetds-0.91 pymssql 2.0.1) 如果要在linux机器 连mysqlsever 1.需要安装freetds./co ...

  2. HihoCoder1403 后缀数组一·重复旋律1

    后缀数组一·重复旋律 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi平时的一大兴趣爱好就是演奏钢琴.我们知道一个音乐旋律被表示为长度为 N 的数构成的数列. 小Hi ...

  3. object.observe数据绑定

    object.observe方法格式如下: object.observe(object,callback) 监听object对象,当该对象有新增或更新或删除等操作,就会触发callback,就实现了双 ...

  4. CF884D:Boxes And Balls

    浅谈\(Huffman\)树:https://www.cnblogs.com/AKMer/p/10300870.html 题目传送门:https://codeforces.com/problemset ...

  5. Azure VNet介绍

    Azure VNet的介绍 VNet是Azure云中逻辑隔离的虚拟网络.它包含两个含义: Azure的用户可以在VNet中创建自己的各种资源,感觉想自己的数据中心中一样; 在一个VNet中创建的资源和 ...

  6. 三层自动生成 完整源代码(for oracle)

    using Oracle.DataAccess.Client; using System; using System.Collections.Generic; using System.Compone ...

  7. 【转】 Pro Android学习笔记(八十):服务(5):访问远程服务

    目录(?)[-] Client的AIDL文件 Client的代码 建立连接 请求服务 断开连接 文章转载只能用于非商业性质,且不能带有虚拟货币.积分.注册等附加条件.转载须注明出处:http://bl ...

  8. dirs命令

    dirs命令显示当前目录栈中的所有记录(不带参数的dirs命令显示当前目录栈中的记录).dirs始终显示当然目录, 再是堆栈中的内容:即使目录堆栈为空, dirs命令仍然只显示当然目录. 语法 dir ...

  9. 天梯L2-001. 紧急救援(25分)

    L2-001. 紧急救援 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国 ...

  10. HTML5一些元素的整理

    address元素: 定义和用法 <address> 标签定义文档或文章的作者/拥有者的联系信息. 如果 <address> 元素位于 <body> 元素内,则它表 ...