Switch Script
A Sublime Text 2 plugin for switching between header and implementation scripts.
Details
Installs
- Total 396
- Win 158
- Mac 122
- Linux 116
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 | Apr 6 | Apr 5 | Apr 4 | Apr 3 | Apr 2 | Apr 1 | Mar 31 | Mar 30 | Mar 29 | Mar 28 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
SwitchScript is a plugin for the Sublime Text 2 editor that adds support for switching between header and source files according to specified extensions within the current active directory tree. This editor ability is very helpful for working with projects that contain a large number of files (eg. C++ projects with .cpp and .hpp and files).
The plugin is flexible to support different project structures, and it makes no assumptions about where your files are stored so long as they're all under one root; the active folder you've opened in the editor.
Options
You can configure SwitchScript in the key bindings file where you bind the command to a key. These are the default options:
defaults = {
# A list of all the directories that contain source and/or header files
"paths": ['.', 'include', 'src'],
# Folders specified in excluded_paths will not be traversed
"excluded_paths": ['.git', '.svn', '.hg'],
# Define the extensions you'd like to switch between here
"header_extensions": ['h', 'hpp', 'hh', 'hxx'],
"source_extensions": ['c', 'cpp', 'cc', 'cxx', 'm', 'mm'],
# Useful for debugging
"logging_enabled": False
}
What they mean:
paths
: SwitchScript will first attempt to find a matching file (based on the active file's name and extension) in the file's directory, if that fails, it will look in theinclude
folder, and then insrc
.excluded_paths
contains names of folders that will not be traversed or searchedheader_extensions
andsource_extensions
specify the extensions of files to switch between.logging_enabled
toggles logging; useful if you need to debug the plugin or want to submit a bug
A Sample Configuration
This is a my configuration:
{ "keys": ["ctrl+alt+up"],
"command": "switch_script",
"args": {
"options": {
"paths": [".", "include", "src", "funky"]
}
}
}
I use Ctrl+Alt+Up to switch between files. I've added the funky
folder to the paths because I have a funny project which headers are set in funny_project/include/funky/some_class.hpp
but the source files are in funny_project/src/some_class.cpp
; manually specifying the path will allow SwitchScript to match those two.
Troubleshooting
The plugin has been tested only on Linux (Arch x86_64) so far. If you come across any bugs or issues on other platforms (or on Linux) you can open a GitHub issue in this repository or email me directly: net.amireh[@]ahmad