私はこの記事を見つけた:私は、任意の関数の外(ただし(defun dotspacemacs/user-init() ...)
前)私の.spacemacsファイルにコードのこの部分を追加 http://blog.binchen.org/posts/easy-indentation-setup-in-emacs-for-web-development.html
:
(defun my-setup-indent (n)
;; java/c/c++
(setq c-basic-offset n)
;; web development
(setq coffee-tab-width n) ; coffeescript
(setq javascript-indent-level n) ; javascript-mode
(setq js-indent-level n) ; js-mode
(setq js2-basic-offset n) ; js2-mode, in latest js2-mode, it's alias of js-indent-level
(setq web-mode-markup-indent-offset n) ; web-mode, html tag in html file
(setq web-mode-css-indent-offset n) ; web-mode, css in html file
(setq web-mode-code-indent-offset n) ; web-mode, js code in html file
(setq css-indent-offset n) ; css-mode
)
とラインに
を追加しました
(my-setup-indent 2) ; indent 2 spaces width
(defun dotspacemacs/user-init() ...)
には、
(defun dotspacemacs/user-init()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init', before layer configuration
executes.
This function is mostly useful for variables that need to be set
before packages are loaded. If you are unsure, you should try in setting them in
`dotspacemacs/user-config' first."
(my-setup-indent 2) ; indent 2 spaces width
)
これを行う方法を少し良く説明できますか?申し訳ありませんが、私はspacemacsの新人です – aviggiano
@aviggianoあなたは 'SPC'' SPC'を押して、 'helm'(または' ivy')バッファに 'customize-variable'と打ち込んで、その項目を選択してEnterを押してください。 。新しいバッファに 'standard-indent'と入力してEnterを押します。新しいウィンドウで変数をデフォルトの '4'から' 2'に変更し、 'Apply and Save'をクリックします。 –