首页 > 其他分享 >sublime配置运行go

sublime配置运行go

时间:2023-10-10 23:14:00浏览次数:31  
标签:配置 name cmd base file go path sublime

     

          在安装codeblocks-20.03mingw-setup, 添加系统环境变量path :  C:\Program Files\CodeBlocks\MinGW\bin 之后,在sublime中, 打开 Preferences --> Browser packages 后,打开User目录,添加如下内容新文件,保存为gcc.sublime-build,就可以编译运行c.

{
    "cmd": ["gcc","${file}","-o", "${file_path}/${file_base_name}"],
    "file_regex":"^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir":"${file_path}",
    "selector": "source.c",
    "encoding":"cp936",
    "variants":
    [
        {
            "name": "Run",
            "cmd": ["cmd","/c", "gcc", "${file}", "-o", "${file_path}/${file_base_name}","&&", "cmd", "/c","${file_path}/${file_base_name}"]
        },
        {
            "name":"RunInCommand",
            "cmd": ["cmd","/c", "gcc", "${file}","-o","${file_path}/${file_base_name}", "&&","start", "cmd", "/c","${file_path}/${file_base_name} & pause"]
         }
    ]
}

 

    类似地,在安装go1.20.4.windows-amd64 设置环境变量后,添加新文件,内容如下保存为go.sublime-build, 

{
    "cmd": ["go", "run", "$file_name"], 
    "file_regex": "^[ ]*File \"(…*?)\", line ([0-9]*)", 
    "working_dir": "$file_path", 
    "selector": "source.go" ,
     "variants":
    [
        {
            "name": "Run",
            "cmd": ["go", "run", "$file_name"]
        }
    ]
}

     打开Preferences --> key Bings, 添加如下配置

[
       {"keys":["f5"], "command": "build", "args":{"variant": "Run"}},

       {"keys":["f6"], "command": "build", "args":{"variant": "RunInCommand"}}    
]

     设置c /  go的运行快捷键为F5。

 

标签:配置,name,cmd,base,file,go,path,sublime
From: https://www.cnblogs.com/wallywl/p/17755979.html

相关文章

  • Django-setting配置不当引起的Session反序列化
    Django-setting配置不当引起的Session反序列化在复现ez_py这道题的时候,翻到了p神19年写的一篇文章:https://www.leavesongs.com/PENETRATION/code-breaking-2018-python-sandbox.html,特此做了下笔记漏洞成因漏洞成因位于目标配置文件settings.py下关于这两个配置项SESSION_EN......
  • Linux学习记录(六):系统安装与配置
    一、系统安装安装Linux系统(Ubuntu16.04/18.04LTS)LTSmeansLong-termsupport虚拟机安装:VMWare+ISO系统镜像文件WSL(WindowsSubsystemforLinux)二、系统配置可选项:更换软件源安装依赖项安装gcc和cmakeforcpp安装依赖项forCV三、SSH使用场景:本地VSCode......
  • WSL2 配置过程及常用命令
    01WSL2安装1.1启动WSL以管理员身份启动Terminal运行如下命令dism.exe/online/enable-feature/featurename:Microsoft-Windows-Subsystem-Linux/all/norestart1.2启动虚拟机平台以管理员身份启动Terminal运行如下命令dism.exe/online/enable-feature/feat......
  • gvm安装及go版本管理
    目录Github官方地址MacOSX要求红帽/Centos多版本管理Githubgvm安装环境变量常用命令安装GoGithubhttps://github.com/golang/go官方地址https://go.dev/dl/MacOSX要求xcode-select--installbrewupdatebrewinstallmercurial红帽/Centossudoyuminstall......
  • QECon大会亮相产品,更合适的企业级测试平台:RunnerGo
    在当今这个数字化时代,应用程序的性能至关重要。一款可靠的性能测试工具,能够为企业带来无数的好处。最近,一款名为RunnerGo的开源性能测试工具备受瞩目。本文将详细介绍RunnerGo的特点、优势以及如何解决性能测试中的痛点。 RunnerGo产品介绍RunnerGo是一款由国内开发者自主研......
  • golang之gRPC
    相关链接:grpc:https://grpc.io/docs/languages/go/quickstart/ protobuf:https://protobuf.dev/programming-guides/proto3/ protobuf语法: 示例:syntax="proto3";//声明请求参数messageSearchRequest{stringquery=1;int32page=2;int32pag......
  • go下载第三方代码
    Go更新国内下载源执行命令进行第三方代码下载gogethttps://github.com/chromedp/chromedp提示访问超时 通过下面的命令替换成国内源echo"exportGOPROXY=https://goproxy.cn">>~/.profilesource~/.profile再次下载的时候就没有问题了gogetgithub.com/chromedp/......
  • QECon大会亮相产品,全栈测试平台推荐:RunnerGo
    最近在gitee上看见一款获得GVP(最有价值开源项目)的测试平台RunnerGo,看他们官网介绍包含了接口测试、性能测试、自动化测试。知道他们有saas版可以试用,果断使用了一下,对其中场景管理和性能测试印象深刻,之后也在公司自己安装使用,接下来和大家介绍一下RunnerGo的整体使用情况。登录后......
  • Go - Resizing an Image
    Problem: Youwanttoresizeanimage,makingitlargerorsmaller.Solution: Convertanimagetoagridofpixelsasthesourceandcreateanewimagewiththeresizeddimensions.Usethenearestneighborinterpolationalgorithmtofigureoutthecoloro......
  • Go - Converting an Image to Grayscale
    Problem: Youwanttoconverttheimagetograyscale.Solution: Convertanimagetoagridofpixels.Takeeachpixelinthegridandconvertittoagraypixelaccordingtotherelativeluminanceformula.Convertthegridofpixelsbackintoanimageto......