加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Windows下的gvim简单配置python运行

发布时间:2020-12-14 02:02:07 所属栏目:Windows 来源:网络整理
导读:set guifont=Consolas:h14 ? ? ? ?"设置字体的 set tabstop=4 ? ? ? ? ? ? ? ? ? "tab设置的 color Solarized ? ? ? ? ? ? ? ? "我选的配色方案(Solarized可以换成你colors文件中任意一个文件的名字) set nu ? ? ? ? ? ? ? ? ? ? ? ? ?"显示行号 set ai ?

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?-u?
????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放到.Vimvim81colors中

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读