Comments (15)
It doesn't look like the syntax highlighting is on for you either. Did you follow all the installation instructions? If you're using the default settings, did you make sure to use the .jsx extension for your filename?
from vim-jsx.
The file is named react.jsx and my status bar tells me that "javascript.jsx" is being used.
The syntax highlighting may look weird because I'm running vim on a virtual machine that I'm ssh-ed into. I'm also using ConEmu on top of that.
I'm using pathogen, so I just cloned the repo into my ~/.vim/bundle folder. Is there something additional I need to do?
from vim-jsx.
Unless your VM -> emulator workflow gives you fewer than the standard eight terminal colors, you should at least have some amount of highlighting for the JSX components. It's possible the default XML syntax highlighting on your machine is not good?
There are a number of other things besides just cloning into ~/.vim/bundle that you need to doโe.g., set up pathogen, do syntax enable, etc., but if you see "javascript.jsx" as the language, you probably did those things correctly.
If you send me gists or pastes or other links to your code and your ~/.vimrc, I'll have a look when I get a chance.
from vim-jsx.
I installed the vim-javascript highlighting which fixed it.
I appreciate the help!
https://github.com/pangloss/vim-javascript
from vim-jsx.
_> Please read the README fully next time :]
from vim-jsx.
It might be helpful to include the dependencies in the installation instructions. A lot of people just skip ahead to that.
from vim-jsx.
Actually, I think that this was a bug at some point in vim-javascript. I followed the install instructions a month ago and had this problem. Today, I just pulled the latest head for both vim-jsx and vim-javascript and it's fixed.
from vim-jsx.
Yeah I thought I already had vim-javascript installed. I guess when I
re-cloned it fixed the problem.
On Oct 22, 2015 5:00 PM, "Justin Huff" [email protected] wrote:
Actually, I think that this was a bug at some point in vim-javascript. I
followed the install instructions a month ago and had this problem. Today,
I just pulled the latest head for both vim-jsx and vim-javascript and it's
fixed.โ
Reply to this email directly or view it on GitHub
#63 (comment).
from vim-jsx.
I've just installed vim-jsx
and vim-javascript
(with Pathogen, so have the latest version of both) on Vim 7.3 (the version that ships with Mac OS X Yosemite).
I've got broken indentation in .js
files, and have let g:jsx_ext_required = 0
in my .vimrc
. Removing the vim-jsx
bundle and restarting Vim lead to indentation working properly again.
from vim-jsx.
Do you have a small example where the indentation breaks?
from vim-jsx.
Yes, this does it:
function() {
var f = 1;
}
If I position my cursor after the semicolon on line 2 and hit enter, it ends up in column 1 on line 3.
The code then looks like this:
function() {
var f = 1;
}
I just discovered something interesting, that may or may not be useful. Line 2 was outdented when I positioned the cursor at the end of an existing line and pressed return. If I delete and then re-write line 2 without leaving insert mode and press enter, line 2 isn't outdented (but the cursor still ends up in column 1 of line 3).
from vim-jsx.
I can't repro. Can you provide the git hashes for both vim-jsx and pangloss/vim-javascript?
from vim-jsx.
Thanks for trying. I've got c6d0fd7 and pangloss/vim-javascript@1d8c267.
from vim-jsx.
Does the problem persist if you disable all other plugins you have in your Pathogen bundle? If soโcan you send me a gist of your ~/.vimrc?
from vim-jsx.
You were on the right lines. I found I had some old ~/.vim/indent/{html,javascript}.vim
files from 2011 that must have been interfering.
Deleting them got everything working beautifully. Sorry for the spam, and cheers for the plugin!
from vim-jsx.
Related Issues (20)
- Incorrect highlight in *.js files HOT 1
- Comments inside XML tags are not colored properly HOT 2
- jsx indenting breaks when changing colorscheme HOT 1
- Support ES6 template literals HOT 2
- Wrong indentation when omitting semicolon
- jsx omni completion HOT 3
- the plugin isn't working for me HOT 2
- Highlighting with Template literals in JSX is broken with junegunn/rainbow_parentheses.vim HOT 3
- Vim - adding new syntax hl rule does not work inside method definitions in component class HOT 1
- Backticks with curly braces in JSX break highlighting HOT 8
- Recent update breaks YouCompleteMe file path completion HOT 2
- Indenting when pasting text HOT 1
- Plugin confuses non-React .js filetype with .jsx
- Break Tags Not Right HOT 3
- Syntax (or filetype) not working properly HOT 2
- Turn off indentation portion of the plugin. HOT 2
- Setting filetype to 'javascript.jsx' is not good idea HOT 4
- My jsx isn't highlighted HOT 2
- Broken auto indentation HOT 7
- JSX syntax highlighting breaks after running `:Vex` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-jsx.