Skip to content

Instantly share code, notes, and snippets.

@shikishima
Created October 28, 2020 04:58
Show Gist options
  • Select an option

  • Save shikishima/96af9358ca5272b96e9cfc99c8834c25 to your computer and use it in GitHub Desktop.

Select an option

Save shikishima/96af9358ca5272b96e9cfc99c8834c25 to your computer and use it in GitHub Desktop.
tramp-modeでサーバー上のファイルでformat-allをかけた時、prettierの設定ファイルを使う
(advice-add 'format-all--buffer-easy :around #'tt/format-all/prettier-config)
(defun tt/format-all/prettier-config (orig executable &rest args)
;; tramp-modeでprettier使用時にローカルのconfigを読み込ませる
(when (and (string-match "prettier" executable) (tramp-tramp-file-p (buffer-file-name)))
(setq args (append (list "--config" (tt/nice-path "~/.prettierrc")) args))
(apply orig executable args)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment