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. loj #6216. 雪花挂饰

    (今天碰到的题怎么这么小清新 $n$ 个不相同的点,$q$ 组询问,每次给定 $l,r$,问在 $n$ 个点中,选出 $x$ 个点 $(x \in [l,r])$,用边连起来,能构成多少种不同的树 $ ...

  2. Java继承与接口

    public class test { public static void main(String[] args) { // TODO Auto-generated method stub B b= ...

  3. Java 输入参数并求和

    题目要求: 输入若干的参数,编写一个程序求出参数的和: 程序流程: 代码: 例子:

  4. 1110. Complete Binary Tree (25)

    Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each in ...

  5. The Salt Master has rejected this minion's public key!

    salt查看日志: salt --log-level=all "10.199.165.244" state.highstate 进入调试模式: salt-minion -l deb ...

  6. Oracle 文件

    参数文件 跟踪文件 告警文件 数据文件 临时文件 控制文件 重做日志文件 密码文件 闪回日志 dum文件 数据泵文件 1参数文件 Parameter file:告诉oracle实例在那里可以找到控制文 ...

  7. Py修行路 Pandas 模块基本用法

    pandas 安装方法:pip3 install pandas pandas是一个强大的Python数据分析的工具包,它是基于NumPy构建的模块. pandas的主要功能: 具备对其功能的数据结构D ...

  8. appium python版api

    打印上下文 driver.contexts 打印当前上下文 driver.context driver.current_context 切换上下文 driver.switch_to.context(' ...

  9. spring @Resource与@Autowired注解详解

    具有依赖关系的Bean对象,利用下面任意一种注解都可以实现关系注入: 1)@Resource (默认首先按名称匹配注入,然后类型匹配注入) 2)@Autowired/@Qualifier (默认按类型 ...

  10. gridcontrol 添加行号

    private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndic ...