js2-mode

Font-lock and disable js2-mode parsing node shebang line

旧巷老猫 提交于 2021-01-29 14:22:51
问题 How can I treat the a shebang line of the form #! /usr/bin/env node As a comment line, when using js2-mode ? I've tried a couple things, one as a modification of something Stefan proposed on another thread (can't find it now), eg. a modification to the syntax-propertize-rules , (defalias 'my-js2-syntax-propertize-shebang (syntax-propertize-rules ("\\`\\(#\\)!.*/[^ \t\n]+" (1 "!")))) (defun my-js2-hook () (add-function :before (local 'syntax-propertize-rules) #'my-js2-syntax-propertize-shebang

Using Node.js with JS-comint in Emacs

╄→гoц情女王★ 提交于 2020-01-09 07:14:31
问题 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 Javascript mode works just fine, just the > sign is changed. If you enter unfinished expression, it even prints ^[[1G... ^[[0K^[[5G . The ^[ are system characters, that are not copied with copy-paste, i add them for you to have an idea. In my init-file: (require 'js-comint) (setq inferior-js-program-command

How do I get js2-mode to use spaces instead of tabs in Emacs?

Deadly 提交于 2019-12-03 14:57:06
问题 I am using js2-mode to edit Javascript in Emacs, but I can't seem to get it to stop using tabs instead of spaces for indentation. My other modes work fine, just having issues w/ js2. 回答1: Do you have (setq-default indent-tabs-mode nil) in your .emacs? It works fine for me in emacs 23.0.60.1 when I do that. js2-mode uses the standard emacs function indent-to, which respects indent-tabs-mode, to do its indenting. 回答2: Add this to your .emacs file somewhere after you load js2 mode: (setq js2

How do I get js2-mode to use spaces instead of tabs in Emacs?

為{幸葍}努か 提交于 2019-12-03 04:39:36
I am using js2-mode to edit Javascript in Emacs, but I can't seem to get it to stop using tabs instead of spaces for indentation. My other modes work fine, just having issues w/ js2. Do you have (setq-default indent-tabs-mode nil) in your .emacs? It works fine for me in emacs 23.0.60.1 when I do that. js2-mode uses the standard emacs function indent-to, which respects indent-tabs-mode, to do its indenting. john_fries Add this to your .emacs file somewhere after you load js2 mode: (setq js2-mode-hook '(lambda () (progn (set-variable 'indent-tabs-mode nil)))) On my copy of GNU Emacs 24.2.1,

Using Node.js with JS-comint in Emacs

帅比萌擦擦* 提交于 2019-11-27 21:23:29
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 Javascript mode works just fine, just the > sign is changed. If you enter unfinished expression, it even prints ^[[1G... ^[[0K^[[5G . The ^[ are system characters, that are not copied with copy-paste, i add them for you to have an idea. In my init-file: (require 'js-comint) (setq inferior-js-program-command "nodejs") In terminal calling nodejs produces working REPL. Why prompt behaves this way? What should i