2015年4月14日星期二

2015-04-12 系统维护日志

evernote代码高亮的实现
  1. oschina在线代码着色高亮(推荐)
  2. Online syntax highlighting
  3. 马克飞象(收费,高阶功能)

使用camscanner扫描文档并发送至evernote,有WP版,支持图片拍摄、压缩、剪裁、后期、OCR,效果不错,有免费计划。另有『名片全能王』,未使用过。
构建基于SublimeText3+GCC的编译环境
  1. 下载MinGW
  2. 配置环境变量
    1. 设置环境变量。右击我的电脑,点属性->高级->环境变量。然后在PATH里加入C:\MinGW\bin; 记得,如果里面还有其他的变量,记得要加个分号啊,分号得在英文输入模式下输入的。
    2. 新建LIBRARY_PATH变量,如果有的话,在值中加入C:\MinGW\lib; 这是标准库的位置。 
    3. 新建C_INCLUDEDE_PATH变量,值设为C:\MinGW\include;
    4. 下面就是要判断一下我们的MinGW是否安装成功,直接运行cmd命令行,输入g++ -v
  1. 添加对中文的支持
7-zip打开 .\Sublime\Packages\C++.sublime-package,编辑C++.sublime-buid,添加一行代码
"encoding":"cp936",
保存即可生效。

取代system("pause")
  • For C
#include <conio.h>
getchar()
  • For C++
cin.get()

Sublime C++ Building Configuration

  • C++Builder
{
     "cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
     "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
     "working_dir": "${file_path}",
     "selector": "source.c, source.c++",
     "shell": true,
     "variants":
     [
          {
               "name": "Run",
               "cmd": [ "start", "${file_path}/${file_base_name}.exe"]
          }
     ]
}

  • C++Builder-2
{
"cmd": ["g++", "${file}", "-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" : ["${file_path}/${file_base_name}"]
}
]
}

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

  • C++SingleFile
{
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"encoding":"cp936",

"variants":
[
{
"name": "Run",
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
}
]

}

没有评论:

发表评论