Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alextes/vim-arrow-shorthand
Vim script to help convert JavaScript arrow function shorthand
https://github.com/alextes/vim-arrow-shorthand
Last synced: 2 days ago
JSON representation
Vim script to help convert JavaScript arrow function shorthand
- Host: GitHub
- URL: https://github.com/alextes/vim-arrow-shorthand
- Owner: alextes
- Created: 2021-05-31T12:28:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-31T12:40:10.000Z (over 3 years ago)
- Last Synced: 2025-01-01T10:17:55.552Z (6 days ago)
- Language: Vim script
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Arrow Shorthand
- This plugin is currently broken. Arrow functions can take many forms if whitespace is relevant, which it naturally is with a plugin like this.
- I do use some of the logic in the plugin myself as the most common case is still quite common, and converting to and from shorthand syntax many keystrokes.
- If you have ideas on how to write this plugin to cover at least 80% of arrow function shorthand conversions do open an issue!## Use
For now I have two bindings that convert _to_ and _from_ arrow function shorthand.
```vimrc
nmap sht dwDsurround{f(%$x%
nmap shf YSurround%{jireturn
```Note these mappings relpy on [vim-surround](https://github.com/tpope/vim-surround) by @tpope.