Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [filetype-javascript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
62 views

How can I execute mjs files (node.js modules) inside Vim with the terminal command?

Let's say I have a pure node.js file.js as the following: const fs = require('fs') console.log("Hello World") If I execute it inside Vim with :%terminal node it works perfectly fine. I see ...
user avatar
  • 375
0 votes
1 answer
36 views

How to set prettier indents?

I have set tabstop to 4. But when I use prettier, it defaults my indentations to 2 spaces. How do I change this? I am using the coc prettier extension. const thing = () => { var hi = 1; //...
user avatar
  • 75
1 vote
0 answers
41 views

Why doesn't the syntax foldmethod not work even though syntax highlighting works?

Started editing a JavaScript file, did :set filetype=javascript (correct syntax highlighting kicked in), then set foldmethod=syntax, and naively expected that folding should automatically work, but ...
user avatar
  • 308
0 votes
1 answer
244 views

vim-test :TestSuite return message Not a test file

It's a really simple setup. I'm actually following along with the modern vim book. (I've been using vim emulation on IDEs for years and want to fully dive in). Anyway, my project structure is: ...
user avatar
  • 111
0 votes
0 answers
128 views

Let .js files be recognized as .jsx files?

I just figured out how to combine those creepy plugins to work together to achieve the following auto-indent: before / after pressing o: But then this only works on file extension .jsx as shown above,...
user avatar
  • 731
3 votes
0 answers
871 views

Cannot set g:ale_fixers in ALE config on vim

I'm trying to config ALE in my vim and can't config the fixers, them aren't showing on ALEInfo. I'm setting the config for typescript files (with and without react) with prettier and eslint. What i'm ...
user avatar
1 vote
0 answers
224 views

Javascript syntax-highlight for JsDoc comments

I now use plugin vim-javascript just to have a nice syntax highlight for JsDoc comments in my Javascript files. vim-javascript provides nice colors highlight but it conflict with all parentheses ...
user avatar
1 vote
1 answer
253 views

Unable to use conceal with vim-javascript plugin

editor: NVIM v0.4.3 I have the following syntax file at ~/.config/nvim/after/syntax/javascript.vim syntax clear javaScriptFunction syntax match javaScriptFunction /\<module.exports\>/ ...
user avatar
1 vote
0 answers
72 views

Expanding region/selection for javascript

is there a way to configure https://github.com/terryma/vim-expand-region (or any other plugin) to work with js,jsx,ts,tsx files? I'm new to vim, I'm not sure what to do. The mentioned plugin is not ...
user avatar
  • 121
2 votes
2 answers
3k views

VIM How to enable .ts .tsx .js (for front-end) code highlight?

I have .vimrc plugins " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'nanotech/jellybeans.vim' " ...
user avatar
1 vote
0 answers
217 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 ...
user avatar
  • 111
0 votes
1 answer
272 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 ...
user avatar
  • 825
1 vote
0 answers
413 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 ...
user avatar
  • 446
1 vote
1 answer
181 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 ...
user avatar
3 votes
1 answer
114 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 ...
user avatar
0 votes
1 answer
127 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 ...
user avatar
  • 125
1 vote
0 answers
33 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 ...
user avatar
0 votes
2 answers
569 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. ...
user avatar
  • 667
1 vote
1 answer
419 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 ...
user avatar
  • 2,830
3 votes
1 answer
276 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 ...
user avatar
  • 131
2 votes
1 answer
418 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 ...
user avatar
  • 1,643
1 vote
0 answers
181 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 ...
user avatar
15 votes
2 answers
9k 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 ...
user avatar
  • 1,549
1 vote
2 answers
773 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 ...
user avatar
  • 331
2 votes
1 answer
432 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 ...
user avatar
  • 121
5 votes
1 answer
744 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),...
user avatar
1 vote
1 answer
336 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.
user avatar
  • 306
1 vote
1 answer
84 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?
user avatar
  • 3,081
1 vote
1 answer
799 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?
user avatar
0 votes
0 answers
181 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("...
user avatar
  • 2,212
2 votes
1 answer
91 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?
user avatar
12 votes
4 answers
10k 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/...
user avatar
  • 2,319
7 votes
2 answers
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 ...
user avatar
  • 2,319
0 votes
2 answers
577 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 ...
user avatar
1 vote
1 answer
414 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:...
user avatar
  • 2,319
3 votes
1 answer
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 ...
user avatar
  • 797
4 votes
1 answer
694 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,...
user avatar