Skip to content

Plugin with some utilities (like extract partial render, rename tag, select self close tags) to folks who work with JSX on Vim.

License

Notifications You must be signed in to change notification settings

samuelsimoes/vim-jsx-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-jsx-utils

Plugin with some utilities to folks who work with JSX on Vim.

⚠️ This plugin only expose a set of functions. You need create your own mappings to this, like:

nnoremap <leader>ja :call JSXEncloseReturn()<CR>
nnoremap <leader>ji :call JSXEachAttributeInLine()<CR>
nnoremap <leader>je :call JSXExtractPartialPrompt()<CR>
nnoremap <leader>jc :call JSXChangeTagPrompt()<CR>
nnoremap vat :call JSXSelectTag()<CR>

⚠️ All functions must be invoked on the first component line.

Installation

You can install this plugin with Pathogen, Vundle and other plugin loaders.

Functions

JSXSelectTag

Select the whole tag, like vat, but with a little improvement to select self-closing tags.

JSXEncloseReturn

Put the current tag on a return statement with parenthesis.

JSXEachAttributeInLine

Put each tag attribute's on its own line to better readability.

JSXExtractPartialPrompt

⚠️ Only ES6 classes

Extract some tag on its own method on a ES6 class.

JSXChangeTagPrompt

Change the tag name


Samuel Simões ~ @samuelsimoes ~ Blog

About

Plugin with some utilities (like extract partial render, rename tag, select self close tags) to folks who work with JSX on Vim.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published