vim中调试python配置

看前面的帖子,安装coc

然后vimrc中添加这段

复制代码
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => python settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""------F5 run python-file------
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
    exec "w"
    if &filetype == 'python'
        exec "!python %"
    endif
endfunc
"------End------
let python_highlight_all=1
autocmd Filetype python set tabstop=4
autocmd Filetype python set softtabstop=4
autocmd Filetype python set shiftwidth=4
autocmd Filetype python set textwidth=79
autocmd Filetype python set expandtab
autocmd Filetype python set autoindent
autocmd Filetype python set fileformat=unix
autocmd Filetype python set foldmethod=indent
autocmd Filetype python set foldlevel=99

set updatetime=100
复制代码

按下f5键就可以运行python啦

 

posted on   风中狂笑  阅读(339)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示