2020-01-26 17:50:05 +01:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
mkIf (elem "emacs::web-mode" config.machine.pkgs) {
|
2021-11-07 16:05:02 +01:00
|
|
|
programs.emacs.init.usePackage = {
|
|
|
|
web-mode = {
|
|
|
|
enable = true;
|
|
|
|
# bind = {};
|
|
|
|
mode = [
|
|
|
|
''("\\.html\\'" . web-mode)''
|
|
|
|
''("\\.css\\'" . web-mode)''
|
|
|
|
''("\\.html?\\'" . web-mode)''
|
|
|
|
''("\\.phtml\\'" . web-mode)''
|
|
|
|
''("\\.tpl\\.php\\'" . web-mode)''
|
|
|
|
''("\\.[agj]sp\\'" . web-mode)''
|
|
|
|
''("\\.as[cp]x\\'" . web-mode)''
|
|
|
|
''("\\.erb\\'" . web-mode)''
|
|
|
|
''("\\.mustache\\'" . web-mode)''
|
|
|
|
''("\\.djhtml\\'" . web-mode)''
|
|
|
|
];
|
|
|
|
config = ''
|
|
|
|
(setq web-mode-engines-alist
|
|
|
|
'(("php" . "\\.phtml\\'")
|
|
|
|
("blade" . "\\.blade\\."))
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
js2-mode = {
|
|
|
|
enable = true;
|
2021-11-25 22:13:28 +01:00
|
|
|
mode = [
|
|
|
|
''("\\.js\\'" . js2-mode)''
|
|
|
|
];
|
2021-11-07 16:05:02 +01:00
|
|
|
};
|
2021-11-25 22:13:28 +01:00
|
|
|
typescript-mode = {
|
2021-11-07 16:05:02 +01:00
|
|
|
enable = true;
|
2021-11-25 22:13:28 +01:00
|
|
|
hook = lib.optional (elem "emacs::lsp" config.machine.pkgs)
|
|
|
|
''(typescript-mode . (lambda () (lsp)))'';
|
|
|
|
mode = [
|
|
|
|
''("\\.ts\\'" . typescript-mode)''
|
2021-11-07 16:05:02 +01:00
|
|
|
];
|
|
|
|
};
|
2021-11-25 22:13:28 +01:00
|
|
|
# tide = {
|
|
|
|
# enable = true;
|
|
|
|
# after = [ "typescript-mode" "company" "flycheck" ];
|
|
|
|
# hook = [
|
|
|
|
# "(typescript-mode . tide-setup)"
|
|
|
|
# "(typescript-mode . tide-hl-identifier-mode)"
|
|
|
|
# "(before-save . tide-format-before-save)"
|
|
|
|
# ];
|
|
|
|
# config = ''
|
|
|
|
# (flycheck-mode +1)
|
|
|
|
# (setq flycheck-check-syntax-automatically '(save mode-enabled))
|
|
|
|
# (setq company-tooltip-align-annotations t)
|
|
|
|
# '';
|
|
|
|
# };
|
2021-11-07 16:05:02 +01:00
|
|
|
impatient-mode = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
simple-httpd = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2020-01-26 17:50:05 +01:00
|
|
|
};
|
|
|
|
}
|