C++
f7 或者 ctrl + B 一键保存,编译(C++14),运行
ubuntu 16.04(注意加 -lpthread 选项)
{
"encoding": "utf-8",
"working_dir": "$file_path",
"shell_cmd": "g++ -std=c++14\"$file_name\" -lpthread -o \"$file_base_name\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.c++",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ -std=c++14 '$file' -lpthread -o '$file_base_name' && gnome-terminal -x bash -c \"'${file_path}/${file_base_name}';read -p '\nYHL make it !'\""
}
]
}
windows 下
{
"working_dir": "$file_path",
"cmd": "g++ -Wall -std=c++14 -fexec-charset=GBK \"$file_name\" -o \"$file_base_name\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.c, source.cpp",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ -Wall -std=c++11 -fexec-charset=GBK \"$file\" -o \"$file_base_name\" && start cmd /c \"\"${file_path}/${file_base_name}\" & pause\""
}
]
}
Ubuntu 16.04 Boost.asio
{
"encoding": "utf-8",
"working_dir": "$file_path",
"shell_cmd": "g++ -std=c++11\"$file_name\" -llog4cpp -lpthread -lboost_system -lboost_thread -lboost_filesystem -I/usr/local/include/boost -L/usr/local/lib -o \"$file_base_name\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.c++",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ -std=c++11 '$file' -llog4cpp -lpthread -lboost_system -lboost_filesystem -I/usr/local/include/boost -L/usr/local/lib -o '$file_base_name' && gnome-terminal -x bash -c \"'${file_path}/${file_base_name}';read -p '\nYHL make it !'\""
}
]
}
// -lboost_system -I/usr/local/include/boost -L/usr/local/lib -lboost_thread -
ubuntu 16.04 + opencv + boost + log4cpp
{
"encoding": "utf-8" ,
"working_dir": "$file_path",
"shell_cmd": "g++ -std=c++14 \"$file_name\" -llog4cpp -lpthread -lboost_system -o \"$file_base_name\" `pkg-config --cflags --libs opencv`",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.c++, source.hpp, source.c, source.cc",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ -std=c++14 '$file' -llog4cpp -lpthread -lboost_system -o '$file_base_name' `pkg-config --cflags --libs opencv` && gnome-terminal -x bash -c \"'${file_path}/${file_base_name}';read -p '\n\nYHL make it !'\""
}
]
}
Ubuntu 16.04 C++ 调用 python 混合编程
{
"encoding": "utf-8" ,
"working_dir": "$file_path",
"shell_cmd": "g++ -std=c++14 \"$file_name\" -L/usr/lib -lpython3.5m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -o \"$file_base_name\" `pkg-config --cflags --libs opencv`",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.c++, source.hpp, source.c, source.cc",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ -std=c++14 '$file' -L/usr/lib -lpython3.5m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -o '$file_base_name' `pkg-config --cflags --libs opencv` && gnome-terminal -x bash -c \"'${file_path}/${file_base_name}';read -p '\n\nYHL make it !'\""
}
]
}
Java
ctrl + shift + B | ctrl + B | f7
{
"shell_cmd": "ECHO Compiling $file_base_name.java & ECHO ============Out============ & javac -encoding UTF-8 \"$file\" & java \"$file_base_name\"",
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"working_dir": "${file_path}",
"selector": "source.java",
"encoding":"gbk",
"variants":[
{
"name":"编译",
"shell_cmd": "ECHO Compiling $file_base_name.java & javac -d . -encoding UTF-8 \"$file\"",
},
{
"name":"运行当前类",
"shell_cmd":" java \"$file_base_name\" "
},
{
"name":"cmd中运行",
"shell_cmd":" start cmd /c \"javac -encoding UTF-8 \"$file\" & java \"$file_base_name\" & pause \""
}
]
}
Python
Ubuntu 16.04 python
{
"encoding": "utf-8",
"working_dir": "$file_path",
"shell_cmd": "/usr/bin/python3 -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"variants":
[
{
"name": "Run",
"shell_cmd": "gnome-terminal -x bash -c \"python3 '${file}';read -p '\nYHL make it !'\""
}
]
}
ctrl + B | f7
{
"encoding": "utf-8",
"working_dir": "$file_path",
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"variants":
[
{
"name": "Run",
"shell_cmd": "start cmd /c \"python -u \"$file\" & pause\"",
}
]
}