Skip to main content
13 votes

How to auto fix common linting errors reported via syntastic?

As mentioned in the comments be aware of the consequences this modification has to you work environment (know exactly which eslint rules you use to "fix" things). To answer your question: adding the ...
JepZ's user avatar
  • 231
7 votes

How to auto fix common linting errors reported via syntastic?

The solution given in Jepz's answer didn't completely work for me. eslint was correctly called with the --fix option. However, maybe it's because of internals that have changed, but it seems like ...
Jerska's user avatar
  • 171
7 votes

How can I run javascript directly and show the output?

I think Codi is what you are looking for. It supports JavaScript and some other languages.
Tae's user avatar
  • 2,145
5 votes

How can I run javascript directly and show the output?

No plugin required! You can run node with the shell command :! Run the entire file with :!/usr/local/bin/node % Run the current line with :exec '!/usr/local/bin/node' '-e' shellescape(getline('.'))
Nate's user avatar
  • 151
5 votes

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

I tried to use augroup SyntaxSettings autocmd! autocmd BufNewFile,BufRead *.tsx set filetype=typescript augroup END and it works.
Oleg Ovcharenko's user avatar
4 votes
Accepted

How to manually install pangloss JavaScript plugin?

TL;DR Use :h packages You will need the plugin code (github is easiest, though if you just have a copy of the source tree lying around, that works too) A brief history of time managing plugins1 I ...
D. Ben Knoble's user avatar
  • 27.3k
4 votes

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

The best thing to do is enable filetype detection: filetype on Vim defaults to setting .tsx files as typescriptreact (8.1.2100 for me at least). To enable filetype-plugins and indent scripts (...
D. Ben Knoble's user avatar
  • 27.3k
3 votes

Are there color variables for various programming languages?

A "color scheme" is not language-specific. Every file will use the same color scheme. Here's an old question with some good answers on creating your own color scheme, though, if that's ...
MDeBusk's user avatar
  • 461
2 votes

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

Instead of using the above config, you can easily use a< from visual mode to select around closing tag, i< to select inner a closing tag.
lehanh's user avatar
  • 121
2 votes
Accepted

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

What you are looking for has nothing to do with Vim or any editor you are using, you want a tool like grunt.js. Grunt is a task runner that you can configure to do a lot of things automatically, ...
statox's user avatar
  • 50.4k
2 votes

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

The usual way to compile from Vim is to use :make. From :h :make: :mak[e][!] [arguments] 1. All relevant |QuickFixCmdPre| autocommands are executed. 2. If the 'autowrite' ...
muru's user avatar
  • 25.1k
2 votes

How do I get these IntelliSense™ features in Vim?

One of my favorite sentences from Vim's :help is from :help new-omni-completion: This could also be called "intellisense", but that is a trademark. There's no IntelliSense™ but there's ...
Friedrich's user avatar
  • 2,815
1 vote

How to hightlight javascript variable that is not defined or notify about any exists?

As suggested by @Heptite this is typically provided by an LSP server. A popular LSP bridge for Vim is coc.nvim. A popular LSP server for javascript is tsserver. After installing coc.nvim you can run ...
Vivian De Smedt's user avatar
1 vote
Accepted

How do I get these IntelliSense™ features in Vim?

You could be interested by snippet plugins that inserts boilerplate code by hitting small shortcuts. For html and css emmet-vim is a good candidate. Once you are familiar with snippet a popular ...
Vivian De Smedt's user avatar
1 vote
Accepted

How to set prettier indents?

For anyone who is facing a similar issue, when you use the prettier extension via coc-prettier, you need to put the configuration options inside the coc-settings.json file. To solve my issue of ...
Vinn's user avatar
  • 791
1 vote
Accepted

vim-test :TestSuite return message Not a test file

So I found the issue and a workaround. The issue is on Windows the path separator is \ and not / as is written in the code. There is also a Windows in jasmine.vim when using the jasmine executable ...
Geoff's user avatar
  • 111
1 vote
Accepted

Sophisticated autocompletion in Vim in a VScode manner

What you want is to use a Language Server through the Language Server Protocol (LSP). Read more about it on Wikipedia or on the official website. As the Wikipedia article points out: The Language ...
filbranden's user avatar
  • 29.6k
1 vote

'filetype plugin indent on' breaks indention

What if you just enable the filetype plugin? filetype plugin on
padawin's user avatar
  • 1,333
1 vote

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

Atom is the only editor I know of that has that capability built-in. You'll need to bring in third party tools. I did some research on a related topic some time back as I was looking for real-time ...
B Layer's user avatar
  • 20k
1 vote
Accepted

Enabling Syntax in Vim Creates Lag

Vim-polyglot vim-polyglot contains what it calls 'language packs', which are sets of syntax, ftplugin, and other files that 'enhance' the experience of working with a particular language. These files ...
D. Ben Knoble's user avatar
  • 27.3k
1 vote

How can I change Javascript syntax to higlight objects?

Try plugin https://github.com/jaxbot/semantic-highlight.vim (see also the article). To install (with Plug plugin manager), set in .vimrc Plug 'jaxbot/semantic-highlight.vim' Default colors fight ...
Giorgio Robino's user avatar
1 vote
Accepted

Configure JavaScript indentation to indent keys object literals

As of 2016-12-16, the javascript.vim indenter will break if you set nomagic. The current workaround is to not use set nomagic.
Greg Nisbet's user avatar
  • 1,889

Only top scored, non community-wiki answers of a minimum length are eligible