This extension provides camel-case navigation to the Visual Studio Code editor.
It works by adding four extension methods to the IDE which override the default actions for the left and right arrow keys.
- MoveCamelLeftCommand (Ctrl+Left)
- MoveCamelRightCommand (Ctrl+Right)
- ExtendCamelLeftCommand (Ctrl+Shift+Left)
- ExtendCamelRightCommand (Ctrl+Shift+Right)
Since VS Code v1.25, camel-case navigation has been built into VS Code natively. To achieve match the default functionality provided by this extension, please add teh following commands to your keybindings.json file.
[
{
"key":"ctrl+left",
"command": "cursorWordPartLeft"
},
{
"key":"ctrl+shift+left",
"command": "cursorWordPartLeftSelect"
},
{
"key":"ctrl+right",
"command": "cursorWordPartRight"
},
{
"key":"ctrl+shift+right",
"command": "cursorWordPartRightSelect"
},
]I will keep maintaining this repository for the foreseeable future, but it is unlikely that I will implement any feature updates at this point.
You can install the latest version of the extension is available on the Visual Studio Marketplace here.
Alternatively, open Visual Studio code, press Ctrl+P and type:
ext install camelcasenavigation
A new feature in version 1.0.2 is toggle mode. By using the command camelcasenavigation.toggleCamelMode, you can turn camel case navigation on or off. When camel case navigation is off, the arrow keys revert to their default behaviour.
This command is not currently mapped to a default keybinding. To map it to a default keybinding add the following to your keybindings.json file:
{
"key": "ctrl+shift+l",
"command": "maptz.camelcasenavigation.toggleCamelMode"
}
The extension provides configuration settings, allowing you to turn on or off features. Create a settings in your vscode settings file (either user or workspace) that conforms to the following specification:
"maptz.camelcasenavigation": {
"allowToggleMode" : true, //Allows you to use toggle mode
"isCamelNavigationOnByDefault" : true //When toggle mode is on, determines whether Camel Navigation is on (true) or off (false) when the application starts.
}
The source code is available on GitHub here.
- Fixed
console.logissue.
- Updated configuration settings.
- Added deprecated messages for the previous command names.
- There is a breaking change in this version. The commands exposed by the extension has been renamed, so any hotkeys need to be updated.
Extensions were previously named extension.[command-name], but this has now been changed to camelcasenavigation.[command-name].
You will need to update any custom keyboard hotkeys you have re-assigned to match the new command names:
- maptz.camelcasenavigation.deleteCamelLeftCommand
- maptz.camelcasenavigation.deleteCamelRightCommand
- maptz.camelcasenavigation.extendCamelLeftCommand
- maptz.camelcasenavigation.extendCamelRightCommand
- maptz.camelcasenavigation.moveCamelLeftCommand
- maptz.camelcasenavigation.moveCamelRightCommand
- maptz.camelcasenavigation.toggleCamelMode
So your keybindings might look like this:
{
"key": "ctrl+j",
"command": "maptz.camelcasenavigation.deleteCamelRightCommand",
"when": "editorTextFocus"
}
- Added ability to toggle camel mode on or off.
- Updated npm dependencies.
- This version is bumped to an official version.
- Fixed a bug that prevented the selection from scrolling into view when the cursor moves out of view.
- Added a feature for interface definitions in CSharp and Typescript modes. By default an interface definition like
ISomeThingis treated as three camel parts:I-Some-Thing. This feature can be turned off by setting "maptz.camelCaseNavigation.csharpmode" tofalsein your user settings.
