安装sublime-text3和常见的环境配置

1.ubuntu安装sublime-text 

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

sudo apt-get install apt-transport-https

echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
 
sudo apt-get update


sudo apt-get install sublime-text

2.Ubuntu中安装最新版的yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -


echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
 
sudo apt-get update && sudo apt-get install yarn

3.配置c++编译运行环境:

        安装gnome:

        sudo apt-get remove gnome-terminal && sudo apt-get install gnome-terminal

        建立build文件:

{
    "cmd": ["g++ ${file} -o ${file_base_name}"], 
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++,source.cpp,source.cxx",
    "shell": true,
    "variants":
    [
        {
            "name": "Run",
            "cmd": ["${file_path}/${file_base_name}"]
        },
        {
            "name": "RunInShell",
            "cmd": ["gnome-terminal -x bash -c '${file_path}/${file_base_name};read' "]
        }
    ]

建立f10快捷键运行:

 { "keys": ["f10"], "command": "build","args": {"variant": "RunInShell"} },

 

windows下可以建立如下的c++配置文件:

{
    "cmd": ["g++", "${file}", "-fexec-charset=gbk", "-o", "${file_path}/${file_base_name}"],
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++",
    "variants":
    [
        {
            "name": "Run",
            "cmd": ["cmd", "/c", "g++", "${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & pause"]
        }
    ]
}

 

4.配置python运行环境,建立python3 bulid文件:

{
    "cmd": ["/usr/bin/python3","-u","$file"],#注可以用type python得到python的解释路径
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",
}

sublime不能从自带的终端输入,所以input之类的函数无法使用,可以安装插件sublimerepl.安装好了以后可以点击菜单栏tools-sublimerepl-python-run current file,会新弹出一个标签页面,就可以交互用input(),为了方便可以设置快键键,在preferences-key binds-user中输入如下代码:

 { "keys": ["f5"], "caption": "SublimeREPL:Python",   
                      "command": "run_existing_window_command", "args":  
                      {  
                           "id": "repl_python_run",  
                           "file": "config/Python/Main.sublime-menu"  
                      }   
    },

5.设置编码字体:打开Preferences - settings,加上

"default_encoding": "UTF-8", "font_size": 16.0, "tab_size": 4,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值