Files
.emacs.d/modules/languages/siren-js.el
Jim Myhrberg 8ed4a4e6f5 refactor: Visual indentation guides
- Switch from highlight-indentation package to highlight-indent-guides.
- Activate visual indentation in a prog-mode hook, rather than doing
  within each individual major mode. It was already done within all
  major modes based on prog-mode anyway.
- Add new siren-display-indetation module and function as a central way
  to enable visual indetation guides. This makes switching the
  underlying package at some point in the future much easier.
2020-01-26 18:53:44 +00:00

42 lines
842 B
EmacsLisp

;;; siren-js.el --- jimeh's Emacs Siren: js-mode configuration.
;;; Commentary:
;; Basic configuration for js-mode.
;;; Code:
(require 'siren-prettier-js)
(require 'siren-folding)
(use-package js-mode
:ensure nil ;; loaded from emacs built-ins
:mode
"\\.js\\'"
"\\.pac\\'"
:hook
(js-mode . siren-js-mode-setup)
:init
(defun siren-js-mode-setup ()
"Default tweaks for `js-mode'."
(let ((width 2))
(setq js-indent-level width
indent-level width
tab-width width))
(prettier-js-mode)
(company-mode +1)
(lsp)
(subword-mode +1)
(hs-minor-mode 1)
(hideshowvis-enable)
(let ((map js-mode-map))
(define-key map (kbd "C-j") 'newline-and-indent)
(define-key map (kbd "C-c C-h") 'siren-toggle-hiding))))
(provide 'siren-js)
;;; siren-js.el ends here