我的vim配置文件

因为不会用github,所以放在这里,心情不好就来看看。
都是非常基础的功能,写点小程序用。

windows版

syntax on
set backspace=indent,eol,start
set nu si ci ai mouse=a sw=4 sts=4 ts=4
set hlsearch incsearch
colorscheme desert
set guifont=Consolas:h14
set report=0 showmatch cursorline
set guioptions-=m
set guioptions-=T
nmap<F3> : vs %<.in <CR>
nmap<F4> : ! %< < %<.in <CR>
nmap<F5> : ! java %< < %<.in <CR>
nmap<F6> : vs %<.out <CR>
"nmap<F9> : !g++ % -o %< <CR>
"nmap<F10> : ! %< <CR>


nmap w,  :vertical resize -5<CR>
nmap w.  :vertical resize +5<CR>

map <F9> :call InitCompile()<CR>
func! InitCompile()
	exec "w"
	if &filetype == 'c'
		exec "!g++ -std=c++11 -static -m32 % -o %<"
	elseif &filetype == 'cpp'
		exec "!g++ -std=c++11 % -o %<"
	elseif &filetype == 'java' 
		exec "!javac %" 
	endif
endfunc

map <F10> :call CompileRunGcc()<CR>
func! CompileRunGcc()
	if &filetype == 'c'
		exec "! %<"
	elseif &filetype == 'cpp'
		exec "! %<"
	elseif &filetype == 'java' 
		exec "! java %<"
	endif
endfunc

" 语言设置
"gvim内部编码
set encoding=utf-8 
"设置终端编码为gvim内部编码encoding
let &termencoding=&encoding
"当前编辑的文件编码
set fileencoding=utf-8
"gvim打开支持编码的文件
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set langmenu=zh_CN.UTF-8
"解决consle输出乱码
language messages zh_cn.utf-8   
"菜单栏中文
source $VIMRUNTIME/delmenu.vim 
source $VIMRUNTIME/menu.vim

"树形目录开关
map <F12>
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值