From 5f2b301a8df5410962519d2b7e9a977b03e75977 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 12 Feb 2016 20:58:37 -0800 Subject: [emacs] Split the config into 'core' and 'modes'. Separate the modules that are 'core' (e.g.: related to editing, manipulating text, and so on) and the 'modes' (e.g.: related to syntax, langage support, etc). --- emacs.d/modes/cfg-puppet.el | 5 +++++ emacs.d/modes/cfg-thrift.el | 5 +++++ emacs.d/modes/cfg-yaml.el | 5 +++++ emacs.d/modes/lang-c.el | 8 ++++++++ emacs.d/modes/lang-go.el | 25 +++++++++++++++++++++++++ emacs.d/modes/lang-markdown.el | 10 ++++++++++ emacs.d/modes/lang-python.el | 7 +++++++ emacs.d/modes/lang-scheme.el | 6 ++++++ emacs.d/modes/lang-shell.el | 3 +++ 9 files changed, 74 insertions(+) create mode 100644 emacs.d/modes/cfg-puppet.el create mode 100644 emacs.d/modes/cfg-thrift.el create mode 100644 emacs.d/modes/cfg-yaml.el create mode 100644 emacs.d/modes/lang-c.el create mode 100644 emacs.d/modes/lang-go.el create mode 100644 emacs.d/modes/lang-markdown.el create mode 100644 emacs.d/modes/lang-python.el create mode 100644 emacs.d/modes/lang-scheme.el create mode 100644 emacs.d/modes/lang-shell.el (limited to 'emacs.d/modes') diff --git a/emacs.d/modes/cfg-puppet.el b/emacs.d/modes/cfg-puppet.el new file mode 100644 index 0000000..5c1185a --- /dev/null +++ b/emacs.d/modes/cfg-puppet.el @@ -0,0 +1,5 @@ +(use-package puppet-mode + :ensure t + :mode ("\\.pp$" . puppet-mode)) + +(provide 'cfg-puppet) diff --git a/emacs.d/modes/cfg-thrift.el b/emacs.d/modes/cfg-thrift.el new file mode 100644 index 0000000..4f491c2 --- /dev/null +++ b/emacs.d/modes/cfg-thrift.el @@ -0,0 +1,5 @@ +(use-package thrift + :ensure t + :defer t) + +(provide 'cfg-thrift) diff --git a/emacs.d/modes/cfg-yaml.el b/emacs.d/modes/cfg-yaml.el new file mode 100644 index 0000000..7dc74e0 --- /dev/null +++ b/emacs.d/modes/cfg-yaml.el @@ -0,0 +1,5 @@ +(use-package yaml-mode + :ensure t + :defer t) + +(provide 'cfg-yaml) diff --git a/emacs.d/modes/lang-c.el b/emacs.d/modes/lang-c.el new file mode 100644 index 0000000..9b4f357 --- /dev/null +++ b/emacs.d/modes/lang-c.el @@ -0,0 +1,8 @@ +(use-package google-c-style + :ensure t + :defer t + :config + (progn + (setq c-basic-offset 2))) + +(provide 'lang-c) diff --git a/emacs.d/modes/lang-go.el b/emacs.d/modes/lang-go.el new file mode 100644 index 0000000..8d81f2c --- /dev/null +++ b/emacs.d/modes/lang-go.el @@ -0,0 +1,25 @@ +(use-package go-mode + :ensure t + :defer t + :config + (progn + (bind-key "C-c C-f" 'gofmt go-mode-map) + (bind-key "C-c h" 'godoc go-mode-map) + (bind-key "C-c C-g" 'go-goto-imports go-mode-map) + (bind-key "C-c C-r" 'go-remove-unused-imports go-mode-map)) + :init + (progn (add-hook 'go-mode-hook (lambda () + (go-eldoc-setup) + (add-hook 'before-save-hook 'gofmt-before-save) + (set (make-local-variable 'company-backends) '(company-go)))))) + +(use-package go-eldoc + :ensure t + :defer t + :init (add-hook 'go-mode-hook 'go-eldoc-setup)) + +(use-package company-go + :ensure t + :defer t) + +(provide 'lang-go) diff --git a/emacs.d/modes/lang-markdown.el b/emacs.d/modes/lang-markdown.el new file mode 100644 index 0000000..f4f544d --- /dev/null +++ b/emacs.d/modes/lang-markdown.el @@ -0,0 +1,10 @@ +(use-package markdown-mode + :ensure t + :mode ("\\.\\(m\\(ark\\)?down\\|md\\)$" . markdown-mode) + :config + (progn + (let ((preferred-markdown-impl "peg-markdown")) + (when (executable-find preferred-markdown-impl) + (setq markdown-command preferred-markdown-impl))))) + +(provide 'lang-markdown) diff --git a/emacs.d/modes/lang-python.el b/emacs.d/modes/lang-python.el new file mode 100644 index 0000000..b22ce16 --- /dev/null +++ b/emacs.d/modes/lang-python.el @@ -0,0 +1,7 @@ +(use-package python + :mode ("BUILD\\|(\\.\\(py\\|aurora\\))$" . python-mode) + :config + (progn + (setq python-indent-offset 2))) + +(provide 'lang-python) diff --git a/emacs.d/modes/lang-scheme.el b/emacs.d/modes/lang-scheme.el new file mode 100644 index 0000000..1f0dec3 --- /dev/null +++ b/emacs.d/modes/lang-scheme.el @@ -0,0 +1,6 @@ +(use-package geiser + :config + (setq geiser-active-implementations '(racket)) + :ensure t) + +(provide 'lang-scheme) diff --git a/emacs.d/modes/lang-shell.el b/emacs.d/modes/lang-shell.el new file mode 100644 index 0000000..aa3fab5 --- /dev/null +++ b/emacs.d/modes/lang-shell.el @@ -0,0 +1,3 @@ +(setq-default + sh-basic-offset 2 + sh-indentation 2) -- cgit 1.4.1