notepad++是一款轻量级的编辑器,因为很常用,所以我习惯把经常用到的语言都配置到上面去,可以直接编译运行单文件,很方便。
1. gcc & g++
编译命令:
gcc:
cmd /k gcc -Wall -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" & PAUSE & EXIT
g++:
cmd /k g++ -Wall -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" & PAUSE & EXIT
运行命令:
cmd /k "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT
2. java
编译命令:
cmd /k javac "$(CURRENT_DIRECTORY)\$(NAME_PART).java" & PAUSE & EXIT
运行命令:
cmd /k cd "$(CURRENT_DIRECTORY)" & java "$(NAME_PART)" & PAUSE & EXIT
以上是单个java文件没有包的情况下。
下面给出一种有打包情况下的命令:
编译命令:
cmd /k cd "$(CURRENT_DIRECTORY)" & javac -d . "$(NAME_PART).java" & PAUSE & EXIT
运行命令:
cmd /k cd "$(CURRENT_DIRECTORY)" & java "$(NAME_PART)" & PAUSE & EXIT
如果是在Windows系统下,因为系统默认编码是GBK,所以编译时需要指明编码格式:
cmd /k javac -encoding utf-8 "$(CURRENT_DIRECTORY)\$(NAME_PART).java" & PAUSE & EXIT
3. python
运行命令:
python2:
cmd /k cd "$(CURRENT_DIRECTORY)" & py -2 "$(FULL_CURRENT_PATH)" & PAUSE & EXIT
python3:
cmd /k cd "$(CURRENT_DIRECTORY)" & py -3 "$(FULL_CURRENT_PATH)" & PAUSE & EXIT
在windows系统下如果同时装了python2和python3,使用pip会比较麻烦,这里提供一个命令区分pip2和pip3:
py -2 -m pip
py -3 -m pip