安装sublime 3

  1. sudo add-apt-repository ppa:webupd8team/sublime-text-3
  2. sudo apt-get update
  3. sudo apt-get install sublime-text-installer

package control安装

ctrl + `(1旁边的波浪线)

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

插件安装

插件安装方法: ctrl + shift + p

sublime具体插件: https://packagecontrol.io/search

插件名称 简介
Emmet 前端开发神器
sublimeLinter 代码检测工具
SideBarEnhancements 侧边栏
SyncedSideBar 实时更新侧边栏的内容
BracketHighlighter 高亮
SublimeCodeIntel 代码自动补全
Alignment 代码自动对齐
DocBlockr 代码自动注释
ConvertToUTF8 解决中文乱码问题
All AutoComplete 让代码自动完成的匹配从所有打开的文件里去匹配
C++11 添加c++11语法支持
C++ Completes c++语法支持
C++ Snippets c++相关代码片段
C++ NamespaceTool 自动添加命名空间
C++YouCompleteMe c++语法
Markdown Preview mkd预览
MarkdownEditing mkd编辑

ubuntu配置SublimeClang

cd ~./config/sublime-text-3/Packages
git clone --recursive https://github.com/quarnster/SublimeClang SublimeClang
cd SublimeClang
git pull && git submodule foreach --recursive git pull origin master // 拷贝libclang.so到internals文件夹
sudo apt-get install libclang-3.5
ldconfig -p | grep clang
cp /usr/lib/i386-linux-gnu/libclang-3.5.so ~/.config/sublime-text-3/Packages/SublimeClang/internals/libclang.so // 手动编译出libcache.so
cd src
mkdir build
cd build
cmake ..
make

重启sublime即可

配置sublimeClang: perference -> package setting ->sublimeClang ->setting user

{
"show_output_panel": false,
"dont_prepend_clang_includes": false,
"inhibit_sublime_completions": false, "options":
[
"-std=c++11",
"-isystem", "/usr/include",
"-isystem", "/usr/include/c++/*",
"-isystem", "/usr/include/c++/4.8",
"-isystem", "/usr/include/c++/4.8/*",
"-isystem", "/usr/include/boost",
"-isystem", "/usr/include/boost/**",
"-isystem", "/usr/lib/gcc/x86_64-linux-gnu/4.8/include",
"-isystem", "/usr/lib/gcc/x86_64-linux-gnu/4.8/include/*"
]
}

根据自己的实际的库安装的位置进行配置

Cscope配置(代码调用查看)

  1. sudo apt-get install cscope
  2. perference -> package control -> install package -> cscope
  3. perference -> package settings -> CscopeSublime ->setting user
  4. 右键点击工程->选择Cscope: rebuild database

我的配置

{
// All options in here can also be specified in your user settings
// with the prefix "CscopeSublime_".
// For example if you have
//
// {
// "CscopeSublime_display_outline": false
// }
//
// in your user settings, this will override the settings specified
// in this file. // Whether or not to draw an outline around the matched symbol in the lookup results
"display_outline": true, // Whether to prompt the user to edit/confirm the symbol before searching
"prompt_before_searching": true, // The "cscope" program executable name. If needed, you can change this
// in your user settings to be the full path to the cscope executable.
// If you leave this as the default (just "cscope"), then your system
// $PATH (or %PATH% for Windows users) will be searched.
//
// Linux and OS X example: "executable": "/usr/bin/cscope"
// Windows example: "executable": "C:\\cscope\\cscope.exe"
"executable": "cscope", // A location for the cscope database - this will be used in preference to any 'found' database
"database_location": "/home/hhf/workspace/cscope.out"
}

Ctags

  1. 下载ctags: http://ctags.sourceforge.net/
  2. perference -> package control -> install package -> ctags
    1. 右键点击工程->选择ctags: rebuild tags

导入工程

  1. Project -> Add Floder to Project -> 选择你的工程
  2. Project -> Save project as -> 找个地方存你的工程文件
  3. Edit Project 写入自己的配置文件

我的配置

{
"folders":
[
{
"follow_symlinks": true,
"path": "/home/hhf/workspace/firmware/main"
}
], "settings":
{
"sublimeclang_options":
[
"-I/home/hhf/workspace/firmware/main",
"-I/home/hhf/workspace/firmware/main/include",
"-I/home/hhf/workspace/firmware/main/json",
"-I/home/hhf/workspace/firmware/main/main",
"-I/home/hhf/workspace/firmware/main/util",
"-I/home/hhf/workspace/firmware/main/speech",
"-I/home/hhf/workspace/firmware/main/main/Skills",
]
}
}

这个要根据自己工程的实际路径进行配置, 不然就找不到相关的头文件路径

适配eclipse的快捷键

[
/**
* 适配eclipse快捷键
*
* 下面这位仁兄早就有了这个想法
* Eclipse shortcuts for Sublime Text 2
* http://icoloma.blogspot.com/2011/10/eclipse-shortcuts-for-sublime-text-2.html
*/
{ "keys": ["alt+."], "command": "auto_complete" },
{ "keys": ["ctrl+i"], "command": "reindent" },
// 当前行和下面一行交互位置
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
// 删除整行
{ "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
// 光标移动到指定行
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
// 快速定位到选中的文字
{ "keys": ["ctrl+k"], "command": "find_under_expand_skip" },
// { "keys": ["ctrl+shift+x"], "command": "swap_case" },
{ "keys": ["ctrl+shift+x"], "command": "upper_case" },
{ "keys": ["ctrl+shift+y"], "command": "lower_case" },
// 在当前行的下一行插入空行(这时鼠标可以在当前行的任一位置, 不一定是最后)
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
// 当前文件中的关键字(方便快速查找内容)
{ "keys": ["ctrl+alt+o"], "command": "show_overlay", "args": {"overlay": "goto", "text": "#"} },
// 文件内查找/替换
{ "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "replace"} },
// 全局查找/替换, 在查询结果中双击跳转到匹配位置
{"keys": ["ctrl+h"], "command": "show_panel", "args": {"panel": "find_in_files"} },
]

sublime 本身的一些快捷键

快捷键 作用
ctrl + p 快速打开文件
ctrl + r 本文件中函数列表
ctrl + shift + p 快速打开安装包

最新文章

  1. SpringMVC 返回json
  2. 多页面打印--web print
  3. 使用Areas(区域)分离ASP.NET MVC 项目
  4. FKCL-OS——自主的操作系统
  5. Swift代码实现加载WEBVIEW
  6. poj 3278 Catch That Cow (bfs搜索)
  7. AngularJS vs. jQuery,看看谁更胜一筹
  8. asp.net C# 实现阿里大鱼和云片网短信接口类
  9. spring boot部署系统--morphling简介
  10. CSS 背景图像 填充部分元素示例
  11. python_redis简介与安装和使用
  12. tar (child): bzip2: Cannot exec: No such file or directory报错
  13. Flask请求流程超清大图
  14. sklearn LDA降维算法
  15. js便签笔记(5)——Dean Edwards大牛的跨浏览器AddEvent()设计(不知道是不是jQuery事件系统的原型)
  16. 12th 本周工作量及进度统计
  17. QT学习笔记9:QTableWidget的用法总结
  18. 使用vue.js实现checkbox的全选和多个的删除功能
  19. Ubuntu12.04下apache服务器的安装也配置
  20. Redis-stat is not found

热门文章

  1. 找工作-——网络IO
  2. NSArray用法
  3. 类方法,实例方法,静态方法,@property的应用
  4. KMeans的数据压缩
  5. tomcat solr 限制ip
  6. 关于javaScript事件委托的那些事
  7. JAVAWeb SSH框架 上传文件,如2007的EXCEL
  8. 错误:Tomcat version 7.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 and 6 Web
  9. SQL标量值函数:返回汉字拼音首拼
  10. 通俗地讲,Netty 能做什么?