首页 > 编程语言 > 详细

Windows下的gvim简单配置python运行

时间:2019-05-13 19:49:05      阅读:197      评论:0      收藏:0      [点我收藏+]

set guifont=Consolas:h14        "设置字体的
set tabstop=4                   "tab设置的
color Solarized                 "我选的配色方案(Solarized可以换成你colors文件中任意一个文件的名字)
set nu                          "显示行号
set ai                          "自动缩进
set si                          "智能缩进 
set guioptions-=T               "是不要工具栏
set nobackup                    "不产生~文件 



"一键运行代码

function CheckPythonSyntax()
    let mp = &makeprg
    let ef = &errorformat
    let exeFile = expand("%:t")
    setlocal makeprg=python\ -
    set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
    silent make %
    copen
"   set efm 是设置quickfix的errorformat,以便vim识别 
"  makeprg 是vim内置的编译命令,可以通过更改来实现编译对应类型文件。具体可参考vim官方说明文件。
"  copen是打开quickfix,n用来设置quichfix窗口大小,如 cope5。在错误描述上回车,可以直接跳转到错误行。
    let &makeprg     = mp 
    let &errorformat = ef 
endfunction
"一个是普通模式下,一个是插入模式下
au filetype python map <f5>  :w <cr>:call CheckPythonSyntax() <cr>
au filetype python imap <f5> <esc> :w <cr>:call CheckPythonSyntax() <cr></cr></cr></esc></f5></cr></cr></f5>

 

配色下载地址  https://github.com/altercation/vim-colors-solarized/tree/master/colors,将下载的solarized.vim放到.Vim\vim81\colors中

 

Windows下的gvim简单配置python运行

原文:https://www.cnblogs.com/wanshuduner/p/10857873.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!