Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aliariff/vscode-auto-add-brackets
Automatically add complete brackets when writing interpolated string
https://github.com/aliariff/vscode-auto-add-brackets
hacktoberfest vscode vscode-extension
Last synced: 3 months ago
JSON representation
Automatically add complete brackets when writing interpolated string
- Host: GitHub
- URL: https://github.com/aliariff/vscode-auto-add-brackets
- Owner: aliariff
- License: mit
- Created: 2018-07-19T17:09:24.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-07-19T04:42:25.000Z (over 1 year ago)
- Last Synced: 2024-08-01T21:57:30.720Z (7 months ago)
- Topics: hacktoberfest, vscode, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=aliariff.auto-add-brackets
- Size: 1.3 MB
- Stars: 10
- Watchers: 2
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vscode-auto-add-brackets
[![Test](https://github.com/aliariff/vscode-auto-add-brackets/actions/workflows/test.yaml/badge.svg)](https://github.com/aliariff/vscode-auto-add-brackets/actions/workflows/test.yaml)
[![Release](https://github.com/aliariff/vscode-auto-add-brackets/actions/workflows/release.yaml/badge.svg)](https://github.com/aliariff/vscode-auto-add-brackets/actions/workflows/release.yaml)This extension will automatically add complete brackets when writing interpolated string.
This solution inspired from sublime text behaviour.
![Demo GIF](https://drive.google.com/uc?export=view&id=1kqZT4yOlKl_gyGOYuwzNSfy6BFRpl4SQ)
## Language Support
By default the following languages are enabled:
- Coffeescript
- Crystal
- Dart
- Elixir
- Embedded Crystal
- ERB
- Groovy
- Haml
- Javascript
- Javascript React
- Javascript Vue
- Kotlin
- Ruby
- Scala
- Slim
- Typescript
- Typescript React### Adding other languages
You can enable other languages yourself by doing the following:
```json
{
// VSCode settings ..."auto.languages": {
// The key is the languageId for the language (see notes)
"typescript": {
// Symbol used for string interpolations in the language
"symbol": "$",
// Type of quotes that surround strings that can be interpolated in the language
"stringWrapper": "`"
},
"ruby": {
"symbol": "#",
"stringWrapper": "\""
}
}
}
```> note that the key in the configuration object should be a [languageId](https://code.visualstudio.com/docs/languages/identifiers) supported by VSCode
Then add the keybind for the language:
```json
{
// Keybindings ...{
"command": "auto.addInterpolation",
"key": "shift+3",
"when": "editorTextFocus && editorLangId == 'YOUR_LANGUAGE_ID'"
},
}
```> If you are a Vim mode user you should also add `vim.mode != 'Normal' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine'` to your "when" clause
## Known Issues:
- If you are using a non-US keyboard layout, read this [solution](https://github.com/aliariff/vscode-auto-add-brackets/issues/9#issuecomment-548724717).
## Related issues:
[vscode-ruby/#200](https://github.com/rubyide/vscode-ruby/issues/200)
[vscode-ruby/#210](https://github.com/rubyide/vscode-ruby/issues/210)
## Credits
Icons made by [Icon Monk](https://www.flaticon.com/authors/icon-monk) from [www.flaticon.com](https://www.flaticon.com)
is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0)