Skip to main content

Questions tagged [filetype-javascript]

Questions about the javascript file type

Filter by
Sorted by
Tagged with
0 votes
2 answers
87 views

How do I get these IntelliSense™ features in Vim?

Previously I used MS Visual Studio Code, which has this very nice feature called IntelliSense™. It works extremely well with HTML, CSS, and Javascript. You can type ! and the html boilerplate would be ...
Tux's user avatar
  • 11
0 votes
0 answers
29 views

Strange auto indent in Javascript in HTML

When writing Javascript in HTML, vim insists on autoindenting like this: if( dur.match(/:/) ) { let xs = dur.split(":") if( xs.length > 3 ) ...
John Allsup's user avatar
0 votes
0 answers
197 views

How to disable tsserver check on JS file

I am a newbie to neovim, so please bear with me. I am using Mason to configure my LSP servers. For Javascript I use tsserver. However I am getting error/hint 'Could not find declaration file for ...
Petr Bělecký's user avatar
0 votes
1 answer
1k views

How can I easily configure my Neovim to provide a vs code like javascript, html & CSS autocomplete, intellisence & highlighting?

I am new to Neovim & overwhelmed by the extremely huge number of ways to configure it, which take hours & have no surity of working for me, as I am using Neovim on my Android via termux (for ...
Ayush Samantaray's user avatar
0 votes
1 answer
56 views

Can't input dot and method in html?

Here is the test.html file which in editing status: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </...
newview's user avatar
  • 301
0 votes
2 answers
247 views

Are there color variables for various programming languages? [closed]

I know, in Vim I can get a list with variables for color themes with the command :hi. But there are not the programming languages I need. Is there a way to get specific color variables for JavaScript, ...
Manny's user avatar
  • 1
0 votes
1 answer
2k views

Incorrect autocomplete with Javascript using nvim-lspconfig

My lspconfig works fine with typescript files, but not with Javascript. Autocomplete shows .constructor and other standard props/methods instead of the expected ones defined on the type This happens ...
paulodiovani's user avatar
1 vote
1 answer
3k 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 ...
raylight's user avatar
  • 545
0 votes
1 answer
3k 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; //...
Vinn's user avatar
  • 781
1 vote
0 answers
454 views

Why does 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 ...
toraritte's user avatar
  • 400
0 votes
1 answer
643 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: ...
Geoff's user avatar
  • 111
0 votes
0 answers
281 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,...
NeoZoom.lua's user avatar
  • 1,530
3 votes
0 answers
1k 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 ...
Wallace Coelho's user avatar
2 votes
0 answers
451 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 ...
Giorgio Robino's user avatar
1 vote
1 answer
506 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\>/ ...
Rashid Shaikh's user avatar
1 vote
0 answers
106 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 ...
Stav Alfi's user avatar
  • 121
2 votes
2 answers
4k 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' " ...
Oleg Ovcharenko's user avatar
1 vote
0 answers
431 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 ...
andykais's user avatar
  • 111
0 votes
1 answer
550 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 ...
Anon's user avatar
  • 885
2 votes
2 answers
699 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 ...
425nesp's user avatar
  • 576
1 vote
1 answer
296 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 ...
Vladislav Kovechenkov's user avatar
3 votes
1 answer
153 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 ...
user3745384's user avatar
0 votes
1 answer
145 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 ...
dman's user avatar
  • 143
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 ...
Alexis Wilke's user avatar
0 votes
2 answers
625 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. ...
mbilyanov's user avatar
  • 717
1 vote
1 answer
485 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 ...
3N4N's user avatar
  • 5,774
3 votes
1 answer
332 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 ...
alexcs's user avatar
  • 131
2 votes
1 answer
482 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 ...
Greg Nisbet's user avatar
  • 1,859
1 vote
0 answers
191 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 ...
user101285's 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 ...
WitVault's user avatar
  • 1,729
1 vote
2 answers
1k 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 ...
philolo1's user avatar
  • 331
2 votes
1 answer
618 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 ...
Ely's user avatar
  • 121
5 votes
1 answer
804 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),...
Samvel Avanesov's user avatar
1 vote
1 answer
369 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.
ap0's user avatar
  • 326
1 vote
1 answer
112 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?
leeand00's user avatar
  • 3,601
1 vote
1 answer
803 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?
Jordan Eldredge's user avatar
1 vote
0 answers
185 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("...
firedev's user avatar
  • 2,422
2 votes
1 answer
94 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?
Alexander Myshov's user avatar
13 votes
4 answers
12k 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/...
Aaron Shen's user avatar
  • 2,529
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 ...
Aaron Shen's user avatar
  • 2,529
0 votes
2 answers
584 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 ...
Alexander Myshov's user avatar
1 vote
1 answer
444 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:...
Aaron Shen's user avatar
  • 2,529
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 ...
Greg's user avatar
  • 867
4 votes
1 answer
786 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,...
Andrew Ferrier's user avatar