22
questions
1
vote
1
answer
465
views
Go to definition emacs evil with xref-js2
I'm trying to switch to emacs from vim. I've installed js2-mode, xref-js2 and evil of course. And when I try to go to definition with M-. I get the message: "Previous command was not evil repeat:..." ...
3
votes
1
answer
447
views
Use flycheck for indent settings in js2-mode
I'm on Emacs 25.2 with js2-mode and flycheck/eslint enabled.
Currenty pressing tab (or newline) will indent as per js2-mode-js-indent-level.
I would like for it to be dynamic to match flycheck/...
0
votes
0
answers
674
views
How emacs js2-mode jump to definition open in other window?
In js2-mode, M-. runs the command js2-jump-to-definition, this works great. But I want it go to the definition in other window. I find the code js2-jump-to-definition in Github.
What is the easiest ...
1
vote
0
answers
27
views
Special indentation style for Emacs and javascript
Running js2-mode for emacs, I need a way to alter the indentation style to look like this:
var test = ["Test",
"Asdfasdf"
];
Rather than the default:
var test = ["Test",
"Asdfasdf"
...
20
votes
3
answers
4k
views
how to disable js2-mode syntax checking globally in spacemacs
Since im using eslint, syntax checking from js-mode is redundant to me. so how to turn it off globally instead of toggling on and off?
I configured eslint not to check for semicolons, but js2-mode ...
0
votes
1
answer
158
views
Emacs js2-mode Syntax Error
I am using emacs (js2-mode) for coding javaScript. Here is a simple code snippet where emacs always shows me a syntax error:
<script>
var x = function (a, b)
{
return a * b;
...
5
votes
2
answers
1k
views
How to disable auto-indentation on newline in js2-mode?
I'm editing React .jsx files, and I don't want to indent on newline, how to disable it?
0
votes
1
answer
168
views
Returning values in functions that don't need to return a value
I'm trying out js2-mode, which is a kind of javascript IDE in emacs. One of the features is syntax error highlighting and style warnings. Since turning it on, I've noticed that I'm getting this one ...
34
votes
3
answers
12k
views
How do I set indent to 2 spaces in js2-mode?
I have this at the end of my .emacs:
(setq-default indent-tabs-mode nil)
(setq tab-stop-list (number-sequence 2 120 2))
It works fine in other modes – whenever I tab, it adds two spaces. But in js2-...
4
votes
0
answers
1k
views
js2 auto complete not working on emacs
I started using Emacs a couple weeks ago. I installed js2-mode on emacs and works like a charm, but now I would like to have autocompletion when working in there.
I already installed ac-js2-mode, but ...
2
votes
2
answers
406
views
How to trim trailing whitespace in js2-mode in emacs
Trimming trailing whitespace works fine on all non-JS files. I've got these lines in my .emacs:
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(add-hook 'before-save-hook 'whitespace-...
4
votes
0
answers
122
views
Can Emacs js2-mode be forced into not indenting top-level JS when the file is wrapped in a module function?
A lot of JS code I work with contains files that are defined with the following indentation:
define("my_module", function() {
// top-level code is not indented because the whole file
// is wrapped ...
1
vote
1
answer
651
views
What does "extern" mean in JavaScript?
I just started to use js2-mode in Emacs, and I found some variables like js2-global-externs and js2-additional-externs. The doc string says it is "A list of any extern names you'd like to consider ...
1
vote
2
answers
128
views
The js2-mode.el compilation error
I am getting an error when I compile js2-mode.el using byte-compile-file command in emacs.
js2-mode.el:6778:21:Error: Lisp nesting exceeds `max-lisp-eval-depth'
How do I get rid of this?
14
votes
3
answers
6k
views
Using Node.js with JS-comint in Emacs
I use Emacs 24.2. I've installed js-comint and js-mode from MELPA, executed run-js, and now in REPL instead of > sign i have this gibberish:
^[[1G> ^[[0K^[[3G
The REPL itself in Inferior ...