vimrc 我的专属vim配置
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配置的更多相关文章
- acm的ubuntu (ubuntu16.04 安装指南,chrome安装,vim配置,git设置和github,装QQ)
日常手贱把ubuntu14.04更新到了16.04,然后就game over了.mdzz,不然泥萌也看不到这篇博客了=.= 然后花了些时间重装了一个16.04版的,原来那个14.04的用可以用,就是动 ...
- VIM配置与管理
VIM是写代码的神器,个人觉得比sublime更强,详情http://zh.wikipedia.org/wiki/Vim.如果用网游做类比,没有经过打造的VIM,也只能算是一只非常有潜力的0级宠物,经 ...
- 快速学习C语言三: 开发环境, VIM配置, TCP基础,Linux开发基础,Socket开发基础
上次学了一些C开发相关的工具,这次再配置一下VIM,让开发过程更爽一些. 另外再学一些linux下网络开发的基础,好多人学C也是为了做网络开发. 开发环境 首先得有个Linux环境,有时候家里机器是W ...
- centos vim配置高亮语法和格式化粘贴
centos vim配置高亮语法和格式化粘贴 设置vim别名和高亮grep词语 echo -e "\nalias vi=vim\nalias grep='grep --color'\n&qu ...
- vim配置方法
/etc/vimrc (公共的) ~/.vimrc (私人的) rpm -qa|grep vim 这个命令,如何vim已经正确安装,则会显示上面三个包的名称 全部安装 yum -y install v ...
- VIM配置相关记录
把一直使用中的vim配置做个GIT入库管理,也把之前积累在机器上的文档,做个汇总. https://github.com/wujuguang/kyvim 1. 安装完整版vim vi和vim的区别?在 ...
- Vim配置及说明——IDE编程环境
Vim配置及说明——IDE编程环境 Vim配置及说明——IDE编程环境 1.基本及字体 2.插件管理 3.主题风格 4.窗口设置 5.目录树导航 6.标签导航 7.taglist 8.多文档编辑 9. ...
- 超强vim配置
在网上找vim的配置,自己配置的特别丑 安装起来也超级方便. #!/bin/bash echo "安装将花费一定时间,请耐心等待直到安装完成^_^" if which apt-ge ...
- vim配置及插件安装管理(超级详细)
1 写在前面 Linux下编程一直被诟病的一点是: 没有一个好用的IDE, 但是听说Linux牛人, 黑客之类的也都不用IDE. 但是对我等从Windows平台转移过来的Coder来说, 一个好用 ...
随机推荐
- HihoCoder1337 动态第k大(treap)
描述 小Ho:小Hi,之前你不是讲过Splay和Treap么,那么还有没有更简单的平衡树呢? 小Hi:但是Splay和Treap不是已经很简单了么? 小Ho:是这样没错啦,但是Splay和Treap和 ...
- LeetCode Predict the Winner
原题链接在这里:https://leetcode.com/problems/predict-the-winner/description/ 题目: Given an array of scores t ...
- LeetCode Relative Ranks
原题链接在这里:https://leetcode.com/problems/relative-ranks/#/description 题目: Given scores of N athletes, f ...
- ipad与iphone的屏幕分辨率
1.ipad分辨率,iphone 6 iPhone设备 尺寸 分辨率 点iPhone 3和3s 3.5英寸 (320×480) 3 ...
- 日志管理系统ELK6.2.3
https://www.jianshu.com/p/88f2cbedcc2a 写在前面 刚毕业工作的时候,处理日志喜欢自己写脚本抓取数据分析日志,然后在zabbix上展示出来.但是开发要看日志的时候, ...
- MySQL 数据库备份种类以及常用备份工具汇总
1,数据库备份种类 按照数据库大小备份,有四种类型,分别应用于不同场合,下面简要介绍一下: 1.1完全备份 这是大多数人常用的方式,它可以备份整个数据库,包含用户表.系统表.索引.视图和存储过程等所有 ...
- el表达式对js方法的传值
我常用于在jsp页面遍历集合和分页中的页面跳转事件. jsp: <!-- 引入jstl --> <%@ taglib prefix="c" uri="h ...
- Java-API-POI-Excel:XSSFWorkbook Documentation
ylbtech-Java-API-POI:XSSFWorkbook Documentation 1.返回顶部 1. org.apache.poi.xssf.usermodel Class XSSFWo ...
- Tortoisesvn 如何在资源管理器中断开连接
你在这个文件夹下打开“工具—文件夹选项—查看”,勾选“显示隐藏的文件夹”选项,可以看到在SVN所在的文件夹下面, 有一个.svn文件夹,把它删除了,刷新一下就可以了.
- java restful response 万能类
import java.util.HashMap; import java.util.Map; public class ResponseData { private final String mes ...