安装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旁边的波浪线)

  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

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

重启sublime即可

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

  1. {
  2. "show_output_panel": false,
  3. "dont_prepend_clang_includes": false,
  4. "inhibit_sublime_completions": false,
  5. "options":
  6. [
  7. "-std=c++11",
  8. "-isystem", "/usr/include",
  9. "-isystem", "/usr/include/c++/*",
  10. "-isystem", "/usr/include/c++/4.8",
  11. "-isystem", "/usr/include/c++/4.8/*",
  12. "-isystem", "/usr/include/boost",
  13. "-isystem", "/usr/include/boost/**",
  14. "-isystem", "/usr/lib/gcc/x86_64-linux-gnu/4.8/include",
  15. "-isystem", "/usr/lib/gcc/x86_64-linux-gnu/4.8/include/*"
  16. ]
  17. }

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

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

我的配置

  1. {
  2. // All options in here can also be specified in your user settings
  3. // with the prefix "CscopeSublime_".
  4. // For example if you have
  5. //
  6. // {
  7. // "CscopeSublime_display_outline": false
  8. // }
  9. //
  10. // in your user settings, this will override the settings specified
  11. // in this file.
  12. // Whether or not to draw an outline around the matched symbol in the lookup results
  13. "display_outline": true,
  14. // Whether to prompt the user to edit/confirm the symbol before searching
  15. "prompt_before_searching": true,
  16. // The "cscope" program executable name. If needed, you can change this
  17. // in your user settings to be the full path to the cscope executable.
  18. // If you leave this as the default (just "cscope"), then your system
  19. // $PATH (or %PATH% for Windows users) will be searched.
  20. //
  21. // Linux and OS X example: "executable": "/usr/bin/cscope"
  22. // Windows example: "executable": "C:\\cscope\\cscope.exe"
  23. "executable": "cscope",
  24. // A location for the cscope database - this will be used in preference to any 'found' database
  25. "database_location": "/home/hhf/workspace/cscope.out"
  26. }

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 写入自己的配置文件

我的配置

  1. {
  2. "folders":
  3. [
  4. {
  5. "follow_symlinks": true,
  6. "path": "/home/hhf/workspace/firmware/main"
  7. }
  8. ],
  9. "settings":
  10. {
  11. "sublimeclang_options":
  12. [
  13. "-I/home/hhf/workspace/firmware/main",
  14. "-I/home/hhf/workspace/firmware/main/include",
  15. "-I/home/hhf/workspace/firmware/main/json",
  16. "-I/home/hhf/workspace/firmware/main/main",
  17. "-I/home/hhf/workspace/firmware/main/util",
  18. "-I/home/hhf/workspace/firmware/main/speech",
  19. "-I/home/hhf/workspace/firmware/main/main/Skills",
  20. ]
  21. }
  22. }

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

适配eclipse的快捷键

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

sublime 本身的一些快捷键

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

把sublime3打造成c++开发环境的更多相关文章

  1. sublime3 配置go的开发环境

    配置go的环境变量:https://studygolang.com/articles/4910 配置sublime:https://studygolang.com/articles/4938

  2. CentOS6.5配置python开发环境之一:CentOS图形化界面显示

    这两天在配置centos系统下python的开发环境和工具. 刚用centos,做做记录可以方便以后有需要的人...查资料确实挺麻烦的 centos6.5 sublime3 python27 subl ...

  3. 在win10系统环境下,安装配置sublime 3,构建python和vue.js开发环境(插件)

    原文转载自「刘悦的技术博客」https://v3u.cn/a_id_131 疫情当下,最近一直在用mac下的虚拟机运行win10系统,由于在线人数过多,直播授课的时候使用vscode的时候内存暴涨,于 ...

  4. Angular2入门系列教程1-使用Angular-cli搭建Angular2开发环境

    一直在学Angular2,百忙之中抽点时间来写个简单的教程. 2016年是前端飞速发展的一年,前端越来越形成了(web component)组件化的编程模式:以前Jquery通吃一切的田园时代一去不复 ...

  5. 构建一个基本的前端自动化开发环境 —— 基于 Gulp 的前端集成解决方案(四)

    通过前面几节的准备工作,对于 npm / node / gulp 应该已经有了基本的认识,本节主要介绍如何构建一个基本的前端自动化开发环境. 下面将逐步构建一个可以自动编译 sass 文件.压缩 ja ...

  6. 总结:Mac前端开发环境的搭建(配置)

    新年新气象,在2016年的第一天,我入手了人生中第一台自己的电脑(大一时好友赠送的电脑在一次无意中烧坏了主板,此后便不断借用别人的或者网站的).macbook air,身上已无分文...接下来半年的房 ...

  7. 在Ubuntu下搭建ASP.NET 5开发环境

    在Ubuntu下搭建ASP.NET 5开发环境 0x00 写在前面的废话 年底这段时间实在太忙了,各种事情都凑在这个时候,没时间去学习自己感兴趣的东西,所以博客也好就没写了.最近工作上有个小功能要做成 ...

  8. Linux安装LAMP开发环境及配置文件管理

    Linux主要分为两大系发行版,分别是RedHat和Debian,lamp环境的安装和配置也会有所不同,所以分别以CentOS 7.1和Ubuntu 14.04做为主机(L) Linux下安装软件,最 ...

  9. Angular企业级开发(2)-搭建Angular开发环境

    1.集成开发环境 个人或团队开发AngularJS项目时,有很多JavaScript编辑器可以选择.使用优秀的集成开发环境(Integrated Development Environment)能节省 ...

随机推荐

  1. mac下安装node

    学着使用homebrew进行安装,发现很是方便. homebrew是mac下的一款管理安装的工具. 1. 安装homebrew 使用mac自带的ruby下载安装: ruby -e "$(cu ...

  2. Poj1207 The 3n + 1 problem(水题(数据)+陷阱)

    一.Description Problems in Computer Science are often classified as belonging to a certain class of p ...

  3. freeMaker的工具类

    package com.ek.util; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import jav ...

  4. 【转】 Pro Android学习笔记(二二):用户界面和控制(10):自定义Adapter

    目录(?)[-] 设计Adapter的布局 代码部分 Activity的代码 MyAdapter的代码数据源和构造函数 MyAdapter的代码实现自定义的adapter MyAdapter的代码继续 ...

  5. 如何将OpenTSDB源码导入eclipse

    OpenTSDB的官网上介绍了如何将OpenTSDB源码导入eclipse,官方链接,但步骤超级繁琐,还有一个简便方法,下面以导入OpenTSDB2.0.0为例. 1. 下载OpenTSDB2.0.0 ...

  6. sql 查看表结构

    sqlserver 查看表结构 exec sp_help @TableName --得到表信息.字段,索引.constraint. exec sp_pkeys @TableName --得到主键. e ...

  7. wdatePicker时间控件的使用

    wdatePicker时间控件的使用 1.引用wdatePicker控件的js <seript src="../../js/My97DatePicker/wdatePicker.js& ...

  8. qt程序异常结束crashed

    今天调试以前写的opencv的程序发现每次一点运行就报错误 Starting D:\Qt\QProjects\build-HelloWorld-lian-Debug\debug\HelloWorld. ...

  9. 菜鸟攻城狮1(JAVA程序设计)

    1.JAVA是一个完整的平台,有一个庞大的库,提供了可重复利用的代码功能块,安全性,跨操作系统的可以移植性,自动垃圾回收机制 2.JAVA设计者白皮书:简单性.面向对象.网络技能.健壮性.安全性.体系 ...

  10. sharepoint 2013 创建母版页

    一.创建新的母版页, 并添加了新的样式表 1.从CodePlex 上获得Starter Master Pages for SharePoint 2010 或复制以下母版代码 <%@Master  ...