zoukankan      html  css  js  c++  java
  • compile c cpp with cl.exe in vim

    1 touch a clc.bat

    @echo off
    set f1=%1
    set f2=%f1:.c=%
    :: Load compilation environment
    call "C:UsersadministratorAppDataLocalProgramsCommonMicrosoftVisual C++ for Python9.0vcvarsall.bat"
    :: Invoke compiler with any options passed to this batch file
    "C:UsersadministratorAppDataLocalProgramsCommonMicrosoftVisual C++ for Python9.0VCincl.exe" %f1%  
    echo --------------------------------------------------------------------------------------
    %f2%
    

    2 touch a clcpp.bat

    @echo off
    set f1=%1
    set f2=%f1:.cpp=%
    :: Load compilation environment
    call "C:UsersadministratorAppDataLocalProgramsCommonMicrosoftVisual C++ for Python9.0vcvarsall.bat"
    :: Invoke compiler with any options passed to this batch file
    "C:UsersadministratorAppDataLocalProgramsCommonMicrosoftVisual C++ for Python9.0VCincl.exe" %f1%
    echo -----------------------------------------------------------------------
    %f2%
    

    3 add clc.bat clcpp.bat to env

    4 _vimrc

    autocmd filetype c nnoremap <F5> :w! <bar> exec '!clc '.shellescape('%')<CR>
    autocmd filetype cpp nnoremap <F5> :w! <bar> exec '!clcpp '.shellescape('%')<CR>
    
  • 相关阅读:
    BZOJ 3330 分数
    FR #11题解
    BZOJ 1857 传送带
    BZOJ 4757 Building a Tall Barn
    FR #10题解
    BZOJ 4393 Fruit Feast
    BZOJ 3126 Photo
    BZOJ 1312 Hard Life
    BZOJ 2039 employ人员雇佣
    Count SIN Numbers
  • 原文地址:https://www.cnblogs.com/otfsenter/p/7728897.html
Copyright © 2011-2022 走看看