Add specific configuration for internet.ee projects
This commit is contained in:
parent
571182c9c1
commit
6bffa6e47f
3 changed files with 23 additions and 11 deletions
|
|
@ -115,6 +115,13 @@
|
||||||
(column-enforce-mode -1)
|
(column-enforce-mode -1)
|
||||||
(column-enforce-mode 1))
|
(column-enforce-mode 1))
|
||||||
|
|
||||||
|
(defun set-width-100 ()
|
||||||
|
"Set line length to 100 columns."
|
||||||
|
(interactive)
|
||||||
|
(setq column-enforce-column 100)
|
||||||
|
(column-enforce-mode -1)
|
||||||
|
(column-enforce-mode 1))
|
||||||
|
|
||||||
(defun set-width-80 ()
|
(defun set-width-80 ()
|
||||||
"Set line length to 80 columns."
|
"Set line length to 80 columns."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,10 @@
|
||||||
"Setup editor for Ruby."
|
"Setup editor for Ruby."
|
||||||
|
|
||||||
;; Indentation and line length
|
;; Indentation and line length
|
||||||
(set-width-80)
|
(if (string-match-p "internetee/" (buffer-file-name))
|
||||||
|
(set-width-100)
|
||||||
|
(set-width-80))
|
||||||
|
|
||||||
(set-indent 2)
|
(set-indent 2)
|
||||||
(setq ruby-deep-indent-paren nil)
|
(setq ruby-deep-indent-paren nil)
|
||||||
|
|
||||||
|
|
@ -23,10 +26,7 @@
|
||||||
(setq ruby-deep-indent-paren nil)
|
(setq ruby-deep-indent-paren nil)
|
||||||
|
|
||||||
;; Do not insert encoding comments
|
;; Do not insert encoding comments
|
||||||
(setq ruby-insert-encoding-magic-comment nil)
|
(setq ruby-insert-encoding-magic-comment nil))
|
||||||
|
|
||||||
;; Use web-mode for erb
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)))
|
|
||||||
|
|
||||||
;;========== Rspec config =========================
|
;;========== Rspec config =========================
|
||||||
(defun rspec-ruby-mode-config ()
|
(defun rspec-ruby-mode-config ()
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,17 @@
|
||||||
;;========== Editor config =========================
|
;;========== Editor config =========================
|
||||||
(defun editor-config-web ()
|
(defun editor-config-web ()
|
||||||
"Editor configuration for Web."
|
"Editor configuration for Web."
|
||||||
(set-indent 2)
|
|
||||||
(set-width-120)
|
(set-width-120)
|
||||||
|
|
||||||
|
(if (string-match-p "internetee/" (buffer-file-name))
|
||||||
|
((set-indent 4)
|
||||||
|
(setq web-mode-markup-indent-offset 4)
|
||||||
|
(setq web-mode-code-indent-offset 4)
|
||||||
|
(setq css-indent-offset 4))
|
||||||
|
((set-indent 2)
|
||||||
(setq web-mode-markup-indent-offset 2)
|
(setq web-mode-markup-indent-offset 2)
|
||||||
(setq web-mode-code-indent-offset 2)
|
(setq web-mode-code-indent-offset 2)
|
||||||
(setq css-indent-offset 2))
|
(setq css-indent-offset 2))))
|
||||||
|
|
||||||
;;========== Code completion =======================
|
;;========== Code completion =======================
|
||||||
(defun completion-config-web ()
|
(defun completion-config-web ()
|
||||||
|
|
@ -24,8 +29,8 @@
|
||||||
company-files))))
|
company-files))))
|
||||||
|
|
||||||
;;========== Hooks =================================
|
;;========== Hooks =================================
|
||||||
(add-hook 'html-mode-hook 'editor-config-web)
|
;; Use web-mode for erb
|
||||||
(add-hook 'html-mode-hook 'completion-config-web)
|
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
|
||||||
|
|
||||||
(add-hook 'web-mode-hook 'editor-config-web)
|
(add-hook 'web-mode-hook 'editor-config-web)
|
||||||
(add-hook 'web-mode-hook 'completion-config-web)
|
(add-hook 'web-mode-hook 'completion-config-web)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue