Separate more languages

This commit is contained in:
Maciej Szlosarczyk 2017-08-28 23:01:39 +03:00
parent 4073c40b2c
commit daa26bbc3b
No known key found for this signature in database
GPG key ID: 0D4EEACF63D4262E
7 changed files with 97 additions and 59 deletions

View file

@ -1,4 +1,4 @@
;;; Ruby -- summary
;;; Elisp -- summary
;;; Commentary:
;;; Code:
@ -21,4 +21,6 @@
;;========== Hooks =================================
(add-hook 'emacs-lisp-mode-hook 'editor-config-elisp)
(add-hook 'emacs-lisp-mode-hook 'completion-config-elisp)
(provide 'elisp)
;;; elisp.el ends here

26
languages/elixir.el Normal file
View file

@ -0,0 +1,26 @@
;;; Elixir -- summary
;;; Commentary:
;;; Code:
;;========== Editor config =========================
(defun editor-config-elixir ()
"Editor configuration for Elixir."
(set-indent 2)
(set-width-80)
(ruby-end-mode 1))
;;========== Code completion =======================
(defun completion-config-elixir ()
"Code completion and inspection for Elixir."
(alchemist-mode 1)
(company-mode 1)
(set (make-local-variable 'company-backends)
'((alchemist-company company-capf company-dabbrev-code company-yasnippet
company-files))))
;;========== Hooks =================================
(add-hook 'elixir-mode-hook 'editor-config-elixir)
(add-hook 'elixir-mode-hook 'completion-config-elixir)
(provide 'elixir)
;;; elixir.el ends here

28
languages/rust.el Normal file
View file

@ -0,0 +1,28 @@
;;; Rust -- summary
;;; Commentary:
;;; Code:
;;========== Editor config =========================
(defun editor-config-rust ()
"Editor configuration for Rust."
(set-indent 4)
(set-width-99))
;;========== Code completion =======================
(defun completion-config-rust ()
"Code completion and inspection for Rust."
(racer-mode 1)
(company-mode 1)
(flycheck-mode 1)
(flymake-mode)
(set (make-local-variable 'company-backends)
'((company-racer company-capf company-dabbrev-code company-yasnippet
company-files))))
;;========== Hooks =================================
(add-hook 'rust-mode-hook 'editor-config-rust)
(add-hook 'rust-mode-hook 'completion-config-rust)
(provide 'rust)
;;; rust.el ends here

31
languages/web.el Normal file
View file

@ -0,0 +1,31 @@
;;; Web -- summary
;;; Commentary:
;;; Code:
(require 'web-mode)
;;========== Editor config =========================
(defun editor-config-web ()
"Editor configuration for Web."
(set-indent 2)
(set-width-120)
(setq web-mode-markup-indent-offset 2)
(setq web-mode-code-indent-offset 2)
(setq css-indent-offset 2))
;;========== Code completion =======================
(defun completion-config-web ()
"Code completion and inspection for Web."
(company-mode 1)
(flycheck-mode 1)
(flymake-mode)
(set (make-local-variable 'company-backends)
'((company-capf company-dabbrev-code company-yasnippet
company-files))))
;;========== Hooks =================================
(add-hook 'html-mode-hook 'editor-config-web)
(add-hook 'html-mode-hook 'completion-config-web)
(provide 'web)
;;; web.el ends here