Sublime Text C++ Mac

Sublime Text 2(Hereinafter referred to as Subl)Is a very powerful cross platform code editor. It needs some configuration to make it more powerful.
The configurations involved in this article are as follows:

Sublime Text will put it in the right path by default. Once you click save, close the file so that you’re back on your scratch.py file. Now go to Tools - Build System, and select Python3 (or whatever you named your Build System). If you don’t see your new build system, you may have to quit Sublime Text and reopen it. Note: Sublime text editor is available for Linux, Windows, and Mac. If you purchase the pro version, you need a single license to run it on any of the systems you own. Even, you can use the free version which is more than sufficient in your learning phase.

  • Set Subl to support command line startup
  • Install package control to enable the Subl to support the installation of plug-ins
  • Install ctags and ctags plug-in to make Subl support function definition jump

Next, let’s introduce them one by one.

Set Subl to support command line startup

Subl is easy to use, but no matter how easy an editor is, if it does not support starting from the command line, it is basically useless for programmers, especially under Mac and Linux.
In fact, Subl already contains a command-line tool called Subl (it’s not abbreviated here, it’s really called Subl), which is installed in the following directory with the program

Sublime

~/bin/subl

However, this tool does not establish a symbolic link to the Subl program, so running this program cannot open the Subl program. You need to execute the following command to establish a symbolic link.

ln -s “/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl” ~/bin/subl

Sublime Text C++ Mac

So you can call the Subl from the command line. This method comes from the official website of Subl. If I don’t speak clearly, you can see the original text,The original address is here
Example: if test. C exists, open test. C. if it does not exist, create a test. C open in the buffer

subl text.c

Example: open SRC folder

subl src

If you are prompted that the Subl cannot be found, you can echo $path to see if ~ / bin is not included in the environment variable. If not, open ~ /. Bash_ Profile, enter:

export PATH=~/bin:$PATH

After completing the configuration of command line startup, Subl is a great code editor.

Install package control

Package control is the plug-in manager of Subl. For Subl, it is equivalent to brew under Mac, yum and apt get under Linux.
The way it is installed feels a little geek.

  1. Press Ctrl + ` to call up the console
  2. Paste the following Python script into the bottom input box and press enter

    import urllib2,os;pf=’Package Control.sublime-package’;ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),’wb’).write(urllib2.urlopen(‘http://sublime.wbond.net/‘+pf.replace(‘ ‘,’%20’)).read())

  3. Restart Subl

  4. Press Shift + CMD + P to call up the command box and enter install. You can see the package control: install package option in the drop-down box, indicating that the installation is OK

Install ctags and ctags plug-ins

After having package control, it is very easy to install ctags plug-in. Just press Shift + CMD + P to call up the command box, enter install to find the package control: install package option, and press enter. After a while, a search box will pop up, fill in ctags, find ctags, and press enter to install it.

The ctags plug-in is installed, but it will take a lot of trouble to install ctags. First install the package manager brew.
The installation method is to enter the following commands on the command line. Be careful not to bring sudo

ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)”

After installation, enter brew doctor as prompted to check the environment and solve the prompted alarm. In particular, we need to solve the problem that / usr / local / bin is not in the front of the path. Otherwise, we may run ctags installed with brew instead of the system itself.
After everything is done, you can install ctags.

brew install ctags

After installation, you can enter the SRC directory where the source code is located and execute

ctags -R -f .tags

Then open the directory with Subl

subl src

At this time, you can move the cursor over the function name, press Shift + Ctrl +. To jump to the definition, and press Shift + Ctrl + to jump back.

Well, that’s it. I’ll continue to add if there’s anything else in the future.

Browse

C/C++/C#/Java code formatter/beautifier with AStyle.

Details

Installs

Sublime Text 3 C++ Mac

  • Total119K
  • Win65K
  • Mac23K
  • Linux31K
Aug 31Aug 30Aug 29Aug 28Aug 27Aug 26Aug 25Aug 24Aug 23Aug 22Aug 21Aug 20Aug 19Aug 18Aug 17Aug 16Aug 15Aug 14Aug 13Aug 12Aug 11Aug 10Aug 9Aug 8Aug 7Aug 6Aug 5Aug 4Aug 3Aug 2Aug 1Jul 31Jul 30Jul 29Jul 28Jul 27Jul 26Jul 25Jul 24Jul 23Jul 22Jul 21Jul 20Jul 19Jul 18Jul 17
Windows3423529333947363120242840333142313547245148312834233831365924394525284027262533382531423634
Mac17935104322376941061686591656129109875108812112266711754
Linux1121346611127667151741261416515101010957111310881412118101014101051211713

Readme

Source
raw.​githubusercontent.​com

Description

SublimeAStyleFormatter is a simple code formatter plugin for Sublime Text.It provides ability to format C, C++, Cuda-C++, OpenCL, Arduino, C#, and Java files.

NOTE: Syntax files required to be installed separately for Cuda-C++ and OpenCL.

Donation

If you find my work useful, please consider buying me a cup of coffee, alldonations are much appreciated :)

Installation

With the Package Control plugin

C++

The easiest way to install SublimeAStyleFormatter is through Package Control.

Once you have Package Control installed, restart Sublime Text.

  1. Bring up the Command Palette (Ctrl+Shift+Pon Windows and Linux. ++P on OS X).
  2. Type “Install” and select “Package Control: Install Package”.
  3. Select “SublimeAStyleFormatter” from list.

Sublime Text C++ Compiler

The advantage of using Package Control is that it will keep SublimeAStyleFormatter up to date.

Manual Install

Without Git:

Download the latest source code,and extract it to the Packages directory.

With Git:

Type the following command in your Sublime Text 2 or Sublime Text 3 Packages directory:

git clone git://github.com/timonwong/SublimeAStyleFormatter.git

The “Packages” directory is located at:

Sublime Text 2

  • Windows: %APPDATA%Sublime Text 2Packages
  • Linux: ~/.config/sublime-text-2/Packages/
  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/

Sublime Text 3

  • Windows: %APPDATA%Sublime Text 3Packages
  • Linux: ~/.config/sublime-text-3/Packages/
  • OS X: ~/Library/Application Support/Sublime Text 3/Packages/

Usage

C++

Sublime Text C++ Compiler Mac

Key Bindings

The default key bindings for this plugin:

Windows, Linux:

  • Ctrl+Alt+F: Format current file.
  • Ctrl+K, Ctrl+F: Format current selection.

OSX:

  • Ctrl+Alt+F: Format current file.
  • +K, +F: Format current selection.

Command Palette

Open the command palette, it appears as SublimeAStyleFormatter: Format Current File andSublimeAStyleFormatter Format Current Selection.

Settings

Per-project Settings

Before starting, you may want to have a look at SublimeAStyleFormatter.sublime-settings.

To edit your project setting, select Project/Edit Project from main menu. A project setting containsper-project settings for SublimeAStyleFormatter should look like this:

For example, if you don't want to inherit the default settings, instead, use your own astylerc file forC and C++ individually, then your project setting might look like this:

What's New

License

Mac Sublime Text 3 C++ 配置

This plugin is using MIT License:

Credits

Artistic Style - A Free, Fast and Small Automatic Formatter for C, C++, C#,and Java Source Code.

Licensed under GNU Lesser General Public License version 3.0

Sublime Text C++ Code Completion

Donors