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 10K
  • Win 5K
  • OS X 2K
  • Linux 3K
May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7
Windows 7 5 0 11 5 2 3 7 2 2 1 6 4 3 4 3 2 4 3 1 1 3 2 3 7 3 6 8 2 1 6 8 3 2 4 2 4 5 3 2 5 2 5 4 5 3
OS X 2 3 0 2 1 3 0 3 1 2 0 2 5 0 2 2 1 1 0 0 1 1 0 0 1 1 0 0 1 2 0 1 0 1 1 1 1 0 1 0 3 1 1 1 1 0
Linux 2 2 1 4 2 3 2 0 3 1 0 8 1 3 1 4 4 1 4 0 0 5 4 1 4 2 2 4 5 0 2 0 3 3 2 0 2 2 0 3 0 5 4 1 3 2

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!