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 ...
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 ...
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.
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('.'))
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.
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 ...
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 (...
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 ...
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.
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, ...
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' ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
1
vote
'filetype plugin indent on' breaks indention
What if you just enable the filetype plugin?
filetype plugin on
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 ...
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 ...
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 ...
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.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
filetype-javascript × 45syntax-highlighting × 9
indentation × 7
neovim × 6
filetype-html × 5
vimrc × 3
comments × 3
vimscript × 2
autocompletion × 2
microsoft-windows × 2
formatting × 2
ctags × 2
plugin-syntastic × 2
lsp × 2
filetype-typescript × 2
key-bindings × 1
command-line × 1
terminal × 1
autocmd × 1
colorscheme × 1
cursor-motions × 1
external-command × 1
folding × 1
plugin-system × 1
filetype × 1