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

C++Namespace​Tool

by myurtoglu ST2/ST3

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

Details

Installs

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

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!