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来说, 一个好用 ...
随机推荐
- 爬虫利器 Puppeteer
http://wintersmilesb101.online/2017/03/24/use-phantomjs-dynamic/ 一起学爬虫 Node.js 爬虫篇(三)使用 PhantomJS ...
- 五、Jmeter--关联(正则表达式)
一.什么时候需要关联? 1. 服务器返回的动态变化而且对业务有影响的需要关联. 2. 回放脚本看是否正确,检查下脚本,是否有动态数据影响 3. 一大串字符串,每次请求参数是否有变化 4. 可以找开发问 ...
- Ext.window.Window
var win = Ext.create("Ext.window.Window", { id: "myWin", title: "示例窗口" ...
- POJ2456(最大化最小值)
Aggressive cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10728 Accepted: 5288 ...
- 机器学习:衡量线性回归法的指标(MSE、RMSE、MAE、R Squared)
一.MSE.RMSE.MAE 思路:测试数据集中的点,距离模型的平均距离越小,该模型越精确 # 注:使用平均距离,而不是所有测试样本的距离和,因为距离和受样本数量的影响 1)公式: MSE:均方误差 ...
- SQL中得到最后一个“-”后面的字符串
declare @str varchar(50) set @str='-'+'1-9-3-2'--前面加个'-'防止没有'-'出错 select REVERSE(SUBSTRING(REVERSE(@ ...
- python的ftp上传和下载
# -*- coding: utf- -*- import os import ftplib USER_NAME = "" PASSWORD = "" SERV ...
- javascript——屏蔽右键快捷菜单
JS: function menufalse(){ return false; } document.oncontextmenu = menufalse; //禁用快捷菜单 Jquery: $(&qu ...
- leetcode479
public class Solution { public int LargestPalindrome(int n) { ) ; , n) - ; ; v > max / ; v--) { S ...
- 安卓如何将TXT文件写到特定路径
其实就一个方法,就不贴所有代码了. /** * 写入文件方法 * @param content */ public static void write(String content) { try { ...