开发者

cant tab what ever i want in emacs indentation mode

开发者 https://www.devze.com 2023-02-24 05:40 出处:网络
in javascript and html mode emacs cant make good indentation and all i want is make it better by hand but when use tab only use self indentation and not listen what i say :D

in javascript and html mode emacs cant make good indentation and all i want is make it better by hand but when use tab only use self indentation and not listen what i say :D

what can i do?

now

<html>
    <body>
      HTTP 404 ERROR !!
    </body>
</htm开发者_如何学Pythonl>

what i want

<html>
    <body>
                                  HTTP 404 ERROR !!
    </body>
</html>

only example


Some modes offer "bouncing" indentation, where TAB will toggle the indentation level between a few alternatives. An example for javascript is js2-mode. I'm not aware of a more general solution.

However, note that if TAB is getting intercepted by the major mode's keymap, you can still insert a literal TAB character using C-q TAB. That is probably all you need.


If you don't want TAB to do indentation, you can bind it to just insert tabs.

(add-hook 'html-mode-hook
   (lambda () (define-key html-mode-map (kbd "TAB") 'self-insert-command)))
0

精彩评论

暂无评论...
验证码 换一张
取 消