Ubuntu Sublime Text 配置

Ubuntu Sublime Text 配置

使用Vim模式

  1. 在上方的首选项里点击 “ 设置 ”

  1. 在右侧代码栏里加入这份代码:
"ignored_packages": [],

  1. 保存,在首选项中打开快捷键设置

  1. 改为以下代码:
[
  { "keys": ["k", "j"], "command": "exit_insert_mode",
  "context":
  [
      { "key": "setting.command_mode", "operand": false },
      { "key": "setting.is_widget", "operand": false }
  ]
  },
]

保存,完工

编译系统

  1. 点击此处

  1. 改为以下代码:
/*{
	"cmd" : ["gnome-terminal -x bash -c \"g++ $file_name -o ${file_base_name} -lm -Wall; ./${file_base_name}; exec bash\""],
	"selector" :  "source.c, source.c++",
	"shell":true,
	"working_dir" : "$file_path"
}*/
{
	"encoding": "utf-8",
	"working_dir": "$file_path",
	"shell_cmd": "g++ \"$file_name\" -std=c++14 -o \"$file_base_name\"",
	"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
	"selector": "source.c++",
	"variants": 
	[
		{    
			"name": "Run",
			"shell_cmd": "g++ '$file' -std=c++14 -o '$file_base_name' && gnome-terminal -x bash -c \"'${file_path}/${file_base_name}';read -p '\nPress any key to continue...'\""
		}
	]
}

保存为 “build_and_run”

  1. 最后如上一幅图,选中 “build_and_run”
大功告成!

猜你喜欢

转载自blog.csdn.net/onlyfirer/article/details/127132873
今日推荐