• Stars
    star
    953
  • Rank 47,957 (Top 1.0 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ”ฆ [Vim script] JSX and TSX syntax pretty highlighting for vim.

vim-jsx-pretty

The React syntax highlighting and indenting plugin for vim. Also supports the typescript tsx file.

Features

  • ๐Ÿ“ฆ Support JSX highlighting and indenting out of the box. No dependencies.
  • ๐Ÿ’ฏ Fully implemented the JSX syntax specification. https://github.com/facebook/jsx
  • โœจ Support React syntax highlighting and indenting for JSX and typescript TSX files.
  • ๐Ÿท Support JSX syntax highlighting and indenting inside the tagged template string.
  • ๐ŸŽจ Support highlighting the close tag separately from the open tag (set let g:vim_jsx_pretty_highlight_close_tag = 1 in your vimrc).
  • ๐Ÿ’ช Many more corner test cases covered.
  • ๐Ÿ’… Reasonable syntax highlight groups, easy for customization.

Demo

Syntax

vim-jsx-pretty
(add colorful config)
vim-jsx-pretty
vim-jsx-pretty colorful vim-jsx-pretty

Auto indent

Auto indent demo

Support typescript

typescript demo

Installation

vim-plug https://github.com/junegunn/vim-plug

your ~/.vimrc:

  • No dependencies

    Plug 'maxmellon/vim-jsx-pretty'
  • with: yuezk/vim-js (Recommended but not required)

    Plug 'yuezk/vim-js'
    Plug 'maxmellon/vim-jsx-pretty'
  • if you want to highlight tsx files.

    Plug 'HerringtonDarkholme/yats.vim'
    " or Plug 'leafgarland/typescript-vim'
    Plug 'maxmellon/vim-jsx-pretty'
  • Execute command in vim:

    :so ~/.vimrc
    :PlugInstall

Using Vim8's package manager

mkdir -p ~/.vim/pack/vim-jsx-pretty/start
cd $_
git clone [email protected]:MaxMEllon/vim-jsx-pretty.git

For Neovim

mkdir -p ~/.local/share/nvim/site/vim-jsx-pretty/start
cd $_
git clone [email protected]:MaxMEllon/vim-jsx-pretty.git

โš ๏ธ Work with vim-polyglot

Since vim-polyglot has already embedded this plugin, if you have installed vim-polyglot, you don't need to install this plugin anymore. But the bugfix for this plugin may not ship in vim-polyglot in time.

If you still want to use this plugin, make sure that you put this plugin ahead of vim-polyglot, and add let g:polyglot_disabled = ['jsx'] to your vimrc.

Syntax group list

name place
jsxElement <tag id="sample">text</tag>
~~~~~~~~~~~~~~~~~~~~~~~~~~~
jsxTag <tag id="sample">
~~~~~~~~~~~~~~~~~
jsxTagName <tag id="sample">
_~~~_____________
jsxComponentName <Capitals>
_~~~~~~~~_
jsxAttrib <tag id="sample">
_____~~__________
jsxEqual <tag id="sample">
_______~_________
jsxString <tag id="sample">
________~~~~~~~~_
jsxCloseTag </tag>
~~~~~~
jsxCloseString <tag />
_____~~
jsxDot <Parent.Child>
_______~______
jsxNamespace <foo:bar>
____~____
jsxPunct <tag></tag>
~___~~~___~

Configuration

name default description
g:vim_jsx_pretty_disable_js 0 Disable the syntax highlighting for js files
g:vim_jsx_pretty_disable_tsx 0 Disable the syntax highlighting for tsx files
g:vim_jsx_pretty_template_tags ['html', 'jsx'] highlight JSX inside the tagged template string, set it to [] to disable this feature
g:vim_jsx_pretty_highlight_close_tag 0 highlight the close tag separately from the open tag
g:vim_jsx_pretty_colorful_config 0 colorful config flag

Colorful style (vim-javascript only)

let g:vim_jsx_pretty_colorful_config = 1 " default 0

Inspiration

LICENSE

MIT

More Repositories

1

redux-action-timing-middleware

๐Ÿ”ฅ A redux middleware is inject marker to performance profile.
JavaScript
31
star
2

kajitsu

๐Ÿน blog ๐Ÿน
TypeScript
30
star
3

ink-checkbox-list

Checkbox list for ink.
JavaScript
13
star
4

vim-shiny

๐Ÿ”ฆ [Vim script] A plugin goal is user friendly highlight.
Vim Script
13
star
5

.dotfiles

๐Ÿ”ง my configuration files ( .zshrc , .tmux.conf , etc... )
Shell
11
star
6

simplayer

A sound player module is not depend on native extension for node.
JavaScript
9
star
7

babel-plugin-transform-isNil

[DEPLECATED] RIP ๐Ÿ’™ Replace the comparing of null or undefined with isNil ๐Ÿ…ฑ๏ธ
JavaScript
8
star
8

react-addons-deep-compare

deep compare addons for react.js
JavaScript
7
star
9

.vim

:vim:
Vim Script
6
star
10

comelon

[UNMAINTAINED] ๐Ÿ“บ nicolive comment viewer
JavaScript
4
star
11

NLP100knock

๐Ÿ” ่‡ช็„ถ่จ€่ชžๅ‡ฆ็†๐Ÿ’ฏๆœฌใƒŽใƒƒใ‚ฏ
Ruby
4
star
12

fx5

A CLI is a JSON5 processing tool by node.js
JavaScript
4
star
13

hydreducer

A library is provide the reducer for Selective Hydration based on react hooks.
TypeScript
4
star
14

slide-syncronizer

A application provide a sync pages of presentation slides.
JavaScript
4
star
15

nyaovim-nicolive-comment-viewer

๐Ÿฑ [JS,VimL] nicolive comment viewer on Nyaovim ๐Ÿถ
HTML
3
star
16

introduction-agreed

JavaScript
3
star
17

kagawa-udon-awesome

๐Ÿฒ Umai udon tabetai. tabetakunai?
Python
3
star
18

seiryuu

[WIP] ๐Ÿ’จ "seiryuu" is a timeline watcher of twitter like comment in nicovideo.
TypeScript
3
star
19

teratail-cli

Teratail (Japanese Q&A site for programer) command line viewer.
Shell
3
star
20

react16-babel7-webpack4-boilerplate

ใ‚‚ใ† webpack ใฎ migrate ใฏใ“ใ‚Šใ”ใ‚Šใ  ๐Ÿ˜ก
JavaScript
2
star
21

LEMP

[JS] ๐ŸŽต Llightweight Electron Music Player ๐ŸŽต
JavaScript
2
star
22

GithubSignature

๐Ÿ’ณ Signature of Github with react
CSS
2
star
23

react-tiny-linkify

A library convert to anchor tag from text children as react component. (< 1KB)
TypeScript
2
star
24

yarn_completion

yarn command completion for zsh
Shell
2
star
25

todo-mvc-rn

TypeScript
2
star
26

InfoExpr2

๐Ÿซ 2015 : ๆƒ…ๅ ฑ็’ฐๅขƒๅฎŸ้จ“2 ๐Ÿ’ฅ๐Ÿ”นโžฐ Bonguu!
Java
2
star
27

slide-synchronizer-as-a-service

Ruby
2
star
28

array-set

create array as set from two arrays. like as intersection, union, and defference set.
TypeScript
2
star
29

vim-fzy-quick-cmd

A plugin to find user command by fzy within vim.
Vim Script
1
star
30

react-simple-slider

React.js simple slider UI plugin.
JavaScript
1
star
31

bash-common-functions

Shell
1
star
32

slack-user-status-trigger

Shell
1
star
33

maxmellon

1
star
34

bench-lh

JavaScript
1
star
35

TIL

Today I Learned
Shell
1
star
36

vim-playbook

This playbook is for setup of vim (clpum) and vimrc to hosts.
1
star
37

OODEX

OODEX is a Exercise System of Team Development and OOP for Beginner Java Engineer. (WIP)
Ruby
1
star
38

quick-timing

TypeScript
1
star
39

udon.io

Ruby
1
star
40

DarkNess

๐Ÿ”ฅ ๅคง้‡ใฎ็”ปๅƒใ‚’zipใง็ฐกๅ˜ใซใ‚ขใƒƒใƒ—ใƒญใƒผใƒ‰ใงใ, ใ‚นใƒˆใƒฌใ‚นใƒ•ใƒชใƒผใซ้–ฒ่ฆงใงใใ‚‹ใ‚ตใƒผใƒ“ใ‚น
Ruby
1
star
41

udon-dou

๐Ÿฒ ใ†ใฉใ‚“ใ‚’ๆฅตใ‚ใ—้“
Ruby
1
star
42

Ramda.vim

[WIP] Support your functional programming by Vim script.
Vim Script
1
star
43

.vim-old

[UNMAINTAINED] change over to next repository.
Vim Script
1
star
44

next-drop-console

JavaScript
1
star
45

bench-2021-08-19

JavaScript
1
star
46

plantuml-parser

wip
TypeScript
1
star
47

babel-preset-maxmellon

JavaScript
1
star
48

music.nyaovim

๐Ÿฑ ๐ŸŽต [JS,VimL] embedded simple mp3 player for Nyaovim ๐ŸŽต ๐Ÿถ
JavaScript
1
star
49

poipoi

๐Ÿ“ csvใฝใ„ใฝใ„ใ™ใ‚‹ใ‚„ใค๏ผ
CSS
1
star
50

hanami-de-ohanami

This project is tutorial the hanami of WAF.
Ruby
1
star
51

utility-types

@maxmellon/utility-types
TypeScript
1
star
52

infinite-scroll-demo

JavaScript
1
star
53

react-native-websock-sample

react-native/redux/hard-reducer/redux-saga/flow/socket.io example
JavaScript
1
star
54

ita

"ita"(ๆฟ) is todo manager in cli.
JavaScript
1
star
55

AigisCapture

๐ŸŽฎ ๅƒๅนดๆˆฆไบ‰ใ‚ขใ‚คใ‚ฎใ‚นใฎ็”ป้ขใฎใ‚นใ‚ฏใƒชใƒผใƒณใ‚ทใƒงใƒƒใƒˆใ‚’็ด ๆ—ฉใๅ–ใ‚‹ใŸใ‚ใฎใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณ
C#
1
star
56

circular-array

A modules is circular array data structure, compatible with `Array`.
TypeScript
1
star
57

portfolio-next

JavaScript
1
star
58

theta-server

RICOH THETA Web API Wrapper.
JavaScript
1
star
59

isugo

1
star
60

vdom

TypeScript
1
star
61

slide-syncronizer-server

for slide syncronizer
JavaScript
1
star
62

ms2-calcurator

TypeScript
1
star