Questions tagged [filetype-javascript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
29 views

Neovim highlight syntax region inside typescript tagged template literal

I am having trouble fixing a syntax plugin for Vim. I've found a bug in a plugin that has not been touched in a fair amount of time. I want to address it myself but I believe I am lacking in a lot of ...
0
votes
1answer
34 views

I want to save my typescript file, and immediately run tsc myfile.ts from inside vim. What is the best way to accomplish this?

I am building a daemon, and nodemon currently monitors a file called server.js, which is compiled from the file I am working on, server.ts In order to compile server.ts, after saving with :w, I need ...
1
vote
0answers
38 views

Smart and auto indent not indenting as expected for JSX

I'm trying to figure out how to get vim to correctly indent the next line in a JSX block. Currently when I press enter, the cursor goes slightly behind where it should be. In the example below, my ...
1
vote
1answer
50 views

Sophisticated autocompletion in Vim in a VScode manner

I'm currently switching to Vim as my main text editing tool and I try to investigate if it is possible to make Vim behave like VScode when it comes to autocompletion. I got really used to the way ...
3
votes
1answer
44 views

How to manually install pangloss JavaScript plugin?

If possible, I would prefer to not start using a package manager for now. I'm trying to manually install this plugin for editing JS files: https://github.com/pangloss/vim-javascript I have looked ...
0
votes
1answer
23 views

'filetype plugin indent on' breaks indention [closed]

Using vim 8.*, I am using these plugins: html5.vim polymer-ide.vim supertab vim-javascript In my vimrc.local file if I enable filetype plugin indent on it breaks my javaScript indention but makes the ...
1
vote
0answers
21 views

My C like Comments include markdown, can I have vim highlight those in my JavaScript (Node.js) code? [duplicate]

I write a lot of C/C++ and get highlighting for my Doxygen docs in my comments. It's not perfect, but it sure helps avoiding many very simple mistakes on the spot. To handle that, I simply have the ...
0
votes
2answers
192 views

Is there a workflow to preview javascript/html/css projects inside the browser? [closed]

Is there a way to preview js/html/css projects inside a browser, just like the Atom-Live-Server. So, I am after a server-client way of doing this, I mean in realtime as the files are being edited. ...
1
vote
1answer
193 views

Enabling Syntax in Vim Creates Lag

I was trying to learn javascript the other day and was using emacs as I have been trying to learn emacs as well. But after sometimes my left wrist started to hurt(as one's does) so I switched to ...
2
votes
0answers
93 views

How can I change Javascript syntax to higlight objects?

I am trying to emulate the Atom JavaScript syntax highlighting in vim, but there are a few things missing. Namely, I'd like to highlight objects and their chains in red. It'd be dandy if I could ...
2
votes
1answer
299 views

Configure JavaScript indentation to indent keys object literals

I'm using vim version 8.0 on OS X (installed through Homebrew) and it keeps indenting object literals wrong. The first key and only the first key is flush with the previous line. All subsequent keys ...
1
vote
0answers
150 views

Indentation in three piece comments in javascript

I use Vim 7.4.2149 and the plugin pangloss/vim-javascript for js indentation. I need to get comments like: /* * */ But instead I get: /* * * */ I'm not really interested in syntax ...
13
votes
2answers
7k views

How to auto fix common linting errors reported via syntastic?

I started using syntastic plugin with vim to report lint errors in my javascript code. I also integrated eslint with syntastic, and it shows me nice errors, warnings in case they are present as per ...
1
vote
1answer
287 views

How do I get matchit to work with '/>' (self-closed tags)?

I really like to jump from one <el> to the end of </el> with matchit. I am using it for jsx, but it does not seem to work if I have an element that is declared with />, does anybody ...
2
votes
1answer
248 views

Minimal to effort to have a JS beautifier on vim

My research hints that there is no way to have a JS file properly formatted without going through installations. I wonder whether there is a minimal effort way of doing it in vim. What are your ...
5
votes
1answer
664 views

Vim auto indentation

I am using Vim with Pathogen, vim-jsx, and vim-javascript. I have trouble getting the correct indentation. When I am breaking one line that is too long into several pieces (without adding new blocks),...
1
vote
1answer
257 views

How to pass a parameter to JSHint with Syntastic

I need to pass a paramter (-extract) to the jshint syntax checker such that it extracts JavaScript from HTML before checking. Unfortunatly I have no idea how to do that for syntastic.
1
vote
1answer
68 views

Is there a way to tab through fields and values in a JSON file in VIM?

Is there a way to tab through fields and values in a json file in VIM as you would form fields on a web form?
1
vote
1answer
780 views

Is it possible to get tag navigation that works with RequireJS?

Are there any features/plugins/external tools which can be used to get tag navigation that understands RequireJS imports?
0
votes
0answers
174 views

Using single quotes blows up syntax formatting in .js

Just noticed that using single quotes in javascript blows up automatic formatting sometimes: See the public/sass/*.sass line: Double quotes: gulp.task('compile-sass', function(){ gulp .src("...
2
votes
1answer
86 views

How to jump to the location which [I points to?

I've installed node plugin, which give possibility to display all lines that contain the keyword under the cursor using [I hotkey. It looks like this: Is there possibility to jump to them?
11
votes
4answers
6k views

How can I run javascript directly and show the output?

I'm just doing some testing with JavaScript language feature with no DOM manipulation. So I'm editing a js file and I'm wondering how to simply run it and show the console output? I installed the moll/...
7
votes
2answers
2k views

How to view javascript tags in vim using tagbar + jsctags + tern_for_vim + ctags_exuberant?

I'm writing javascript code using vim and I really like to have outline view for the current javascript file I'm editing. I find tagbar is the popular plugin for this purpose. And on its wiki, for ...
0
votes
2answers
561 views

Ternjs plugin is not working as expected

I installed ternjs_for_vim plugin but can't figure out how to use it properly. RTFM didn't help. What I get is list random JS-methods in the omni-completion. But things like completing for Node.JS ...
1
vote
1answer
322 views

Why vim-jsbeautify cannot find module?

I'm using vim in cygwin, I want to use https://github.com/maksimr/vim-jsbeautify to format my javascript code. but whenever I use :call JsBeautify(), there's an error thrown: E117: Unknown function:...
3
votes
1answer
1k views

How can I get syntax highlighting to support multiline JavaScript strings?

Currently I have JavaScript (.js) files that contain multiline strings. Vim's syntax highlighting does not seem to support these, as seen in the image below: Anything below the first line is not ...
4
votes
1answer
553 views

How can I specify a command-line command with options as an equalprg?

I am trying to set up the Node.js version of js-beautify as an equalprg command when I am editing a JavaScript file, so that the Vim = indent commands reflow my JavaScript at the same time. Initially,...