diff --git a/.gitmodules b/.gitmodules index 8ac246e..71004b4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ [submodule "stuff/go-mode.el"] path = stuff/go.el url = https://github.com/dominikh/go-mode.el.git -[submodule "stuff/dockerfile-mode"] - path = stuff/dockerfile-mode - url = https://github.com/spotify/dockerfile-mode -[submodule "stuff/sass-mode"] - path = stuff/sass-mode - url = https://github.com/nex3/sass-mode diff --git a/configs/modes.el b/configs/modes.el index c092bc6..065dc93 100644 --- a/configs/modes.el +++ b/configs/modes.el @@ -28,8 +28,72 @@ (require 'edje-mode) (add-to-list 'auto-mode-alist '("\\.edc$" . edje-mode)) +;; web-mode +(require 'web-mode) +(add-to-list 'auto-mode-alist '("\\.svelte$" . web-mode)) +(setq web-mode-code-indent-offset 4) +(setq web-mode-css-indent-offset 4) +(setq web-mode-markup-indent-offset 4) +(setq web-mode-script-padding 4) +(setq web-mode-style-padding 4) +(setq web-mode-void-elements + '("area" "base" "br" "command" "embed" "hr" "img" "input" "keygen" + "link" "meta" "param" "source" "track" "wbr" "tmpl_var")) + +;; Vue.js-mode +(require 'vue-mode) +(add-to-list 'auto-mode-alist '("\\.vue$" . vue-mode)) +;(setq mmm-js-mode-enter-hook (lambda () (setq syntax-ppss-table nil))) +;(setq mmm-typescript-mode-enter-hook (lambda () (setq syntax-ppss-table nil))) +(defun fix-mmm-syntax () + (save-restriction + (setq-local syntax-ppss-table typescript-mode-syntax-table) + )) +(add-hook 'mmm-typescript-mode-enter-hook 'fix-mmm-syntax) +(setq js-indent-level 2) +(setq vue-html-extra-indent 2) +(setq-default indent-tabs-mode nil) + +(add-hook 'mmm-mode-hook + (lambda () + (set-face-background 'mmm-default-submode-face nil) + (add-to-list 'sgml-tag-alist '("b-col" \n ("cols" "6") ("sm" "6") ("md" "6") ("lg" "6") ("xl" "6") ("offset" "6") ("offset-sm" "6") ("offset-md" "6") ("offset-lg" "6") ("offset-xl" "6") ("order" "1") ("order-sm" "1") ("order-md" "1") ("order-lg" "1") ("order-xl" "1") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-container" \n ("fluid") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-row" \n ("no-gutters") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-form-row" \n ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-alert" \n ("variant" "info") ("dismissible") ("dismiss-label" "Close") ("show") ("fade") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-badge" \n ("href" "#") ("rel" "") ("target" "_self") ("active") ("disabled") ("to" "") ("append") ("replace") ("event" "click") ("active-class" "") ("exact") ("exact-active-class" "") ("router-tag" "a") ("no-prefetch") ("tag" "span") ("variant" "info") ("pill") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-breadcrumb" \n ("items" "") (":items" "{}") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-button" \n ("href" "#") ("rel" "") ("target" "_self") ("active") ("disabled") ("to" "") ("append") ("replace") ("event" "click") ("active-class" "") ("exact") ("exact-active-class" "") ("router-tag" "a") ("no-prefetch") ("block") ("size" "sm") ("variant" "info") ("type" "button") ("tag" "button") ("pill") ("squared") ("pressed") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-button-group" \n ("vertical") ("size" "sm") ("tag" "div") ("aria-role" "group") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-button-toolbar" \n ("justify") ("key-nav") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-calendar" \n ("id" "") ("value" "") ("value-as-date") ("initial-date" "") ("disabled") ("readonly") ("min" "") ("max" "") ("date-disabled-fn" "") ("start-weekday" "0") ("locale" "") ("direction" "") ("selected-variant" "primary") ("today-variant" "") ("no-highlight-today") ("date-info-fn" "") ("width" "270px") ("block") ("hide-header") ("show-decade-nav") ("hidden") ("aria-controls" "") ("role-description" "") ("label-prev-decade" "Previous decade") ("label-prev-year" "Previous year") ("label-prev-month" "Previous month") ("label-current-month" "Current month") ("label-next-month" "Next month") ("label-next-year" "Next year") ("label-next-decade" "Next decade") ("label-today" "Today") ("label-selected" "Selected date") ("label-no-date-selected" "No date selected") ("label-calendar" "Calendar") ("label-nav" "Calendar navigation") ("label-help" "Use cursor keys to navigate calendar dates") ("date-format-options" "{}") ("weekday-header-format" "short") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-form" \n ("id" "") ("inline") ("novalidate") ("validated") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-form-text" \n ("id" "") ("tag" "small") ("inline") ("text-variant" "muted") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-form-invalid-feedback" \n ("id" "") ("tag" "small") ("tooltip") ("force-show") ("state") ("aria-live" "") ("role" "") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-form-valid-feedback" \n ("id" "") ("tag" "small") ("tooltip") ("force-show") ("state") ("aria-live" "") ("role" "") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-form-datalist" \n (":options" "{}") ("value-field" "value") ("text-field" "text") ("html-field" "html") ("disabled-field" "disabled") ("id" "") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-form-input" \n ("id" "") ("name" "") ("disabled") ("required") ("form" "") ("autofocus") ("size" "sm") ("state") ("value" "") ("aria-invalid") ("readonly") ("plaintext") ("autocomplete" "") ("placeholder" "") ("formatter" "") ("lazy-formatter") ("trim") ("number") ("lazy") ("debounce" "0") ("type" "text") ("no-wheel") ("min" "") ("max" "") ("step" "") ("list" "{}") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-input-group" \n ("id" "") ("size" "sm") ("prepend" "") ("prepend-html" "") ("append" "") ("append-html" "") ("tag" "div") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-input-group-prepend" \n ("id" "") ("tag" "div") ("is-text") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-input-group-append" \n ("id" "") ("tag" "div") ("is-text") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-input-group-text" \n ("tag" "div") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-input-group-addon" \n ("id" "") ("tag" "div") ("is-text") ("append") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-nav" \n ("tag" "ul") ("fill") ("justified") ("align" "") ("tabs") ("pills") ("vertical") ("small") ("card-header") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-nav-item" \n ("href" "") ("rel" "") ("target" "") ("active") ("disabled") ("to" "") ("append") ("replace") ("event" "") ("active-class" "") ("exact") ("exact-active-class" "") ("router-tag" "a") ("no-prefetch") ("link-attrs" "{}") ("link-classes" "") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-nav-text" \n ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-nav-form" \n ("id" "") ("novalidate") ("validated") ("form-class" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-nav-item-dropdown" \n ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-navbar" \n ("tag" "nav") ("type" "light") ("variant" "") ("toggleable") ("fixed" "") ("sticky") ("print") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-navbar-nav" \n ("tag" "ul") ("fill") ("justified") ("align" "") ("small") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-navbar-brand" \n ("href" "#") ("ref" "") ("target" "_self") ("active") ("disabled") ("to" "") ("replace") ("event" "click") ("active-class" "") ("exact") ("exact-active-class" "") ("router-tag" "a") ("no-prefetch") ("tag" "div") ("v-model" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-navbar-toggle" \n ("label" "") ("target" "") ("v-if" "") ("v-for" ""))) + (add-to-list 'sgml-tag-alist '("b-spinner" \n ("type" "border") ("label" "") ("variant" "primary") ("small") ("role" "status") ("tag" "span") ("v-if" "") ("v-for" ""))) + ) + ) + ;; Org-mode -(require 'org-install) +;(require 'org-install) (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) (define-key global-map "\C-cl" 'org-store-link) (define-key global-map "\C-ca" 'org-agenda) @@ -57,8 +121,3 @@ ; (add-to-list 'flymake-allowed-file-name-masks ; '("\\.py\\'" flymake-pyflakes-init))) ;(add-hook 'find-file-hook 'flymake-find-file-hook) - -;; mmm-mode -(add-hook 'mmm-mode-hook - (lambda () - (set-face-background 'mmm-default-submode-face nil))) diff --git a/init.el b/init.el index 40ba2b3..affc0c2 100644 --- a/init.el +++ b/init.el @@ -3,6 +3,18 @@ ;; ;; Made by Némunaire +(require 'package) +(add-to-list 'package-archives + '("MELPA Stable" . "http://stable.melpa.org/packages/") t) + +;; Added by Package.el. This must come before configurations of +;; installed packages. Don't delete this line. If you don't want it, +;; just comment it out by adding a semicolon to the start of the line. +;; You may delete these explanatory comments. +(package-initialize) + +(setq flymake-allowed-file-name-masks nil) + (defun may-load (path) "Load a file if it exists." (when (file-readable-p path) @@ -42,7 +54,6 @@ (require 'my-layout) (require 'my-lisp-mode) (require 'my-python-mode) -(require 'vue-mode) ;; load my configuration files (toc:load-config-file '("key-binding"