ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

C++Namespace​Tool

by myurtoglu ST2/ST3 Trending

Simple C++ namespace refactoring package for Sublime Text 2 & 3

Details

Installs

  • Total 8K
  • Win 4K
  • OS X 1K
  • Linux 3K
Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4
Windows 4 5 7 7 3 3 5 5 5 4 5 6 1 4 6 4 7 2 0 6 5 5 6 2 5 4 5 4 8 5 6 4 5 6 5 6 9 4 2 3 3 4 3 3 6 3
OS X 2 2 2 0 2 0 0 2 2 1 2 2 1 1 3 2 1 1 2 1 1 3 3 0 0 1 0 0 0 1 1 0 1 1 2 2 2 0 1 0 2 2 0 1 2 0
Linux 2 4 4 2 1 5 4 3 1 3 4 0 6 3 2 4 1 5 2 5 3 3 6 5 3 1 5 2 5 7 3 1 3 3 4 2 1 0 0 2 1 2 2 5 0 3

Readme

Source
raw.​githubusercontent.​com

C++NamespaceTool is a simple C++ namespace refactoring package for Sublime Text 2 & 3.

Installation

C++NamespaceTool can be installed using Package Control with the Install Package option.

Description

In C++ programming, writing using namespace std is considered a bad practice. The preferred way is to either explicitly state somewhere at the top which functions, classes, and types are used with using namespace::word statements or to explicitly type the namespace (usually std) at each occurence of the word. Sometimes, starting with one of the options, the programmer may want to convert to the other option. C++NamespaceTool is designed with the goal of automating this task.

Usage

The shortcut is Ctrl-Shift-R on all platforms (Right-click->Refactor namespace should also appear and do exactly the same work when C++ files are open). When using statements are selected, activating the tool will convert the selected using statements to inline namespace::word format. When inline namespace::word items are selected, activating the tool will convert all occurences of the selected items into just word and put a using statement at the top of the file.

Example usage:

Using the keyboard shortcut:

Using the right-click context menu:

Configuration

You can add namespaces besides std (warning: sub-namespaces are not supported at the moment), and file extensions for the right-click menu item to appear (most frequently seen file extensions are already in the configuration file) here: Preferences -> Package Settings -> C++NamespaceTool->Settings.

You can also change the shortcut key here: Preferences -> Package Settings -> C++NamespaceTool->Key Bindings.

Contact

You can leave bug reports, feature requests, or comments using the issues section.

Thanks!

Thank you for your interest in this package!