Majorly re-organize modules

- Split large modules into smaller parts (e.g. siren-text-manipulation)
- Organize modules into high level groups:
  - completion
  - core
  - editor
  - languages
  - linting
  - misc
  - navigation
  - projects
  - spelling
  - text-editing
  - version-control
  - windows
  - workspaces
This commit is contained in:
2018-05-20 17:31:11 +01:00
parent 3b07c4cfbf
commit 87a86191db
118 changed files with 592 additions and 463 deletions

View File

@@ -0,0 +1,33 @@
;;; siren-coffee.el --- jimeh's Emacs Siren: coffee-mode configuration.
;;; Commentary:
;; Basic configuration for coffee-mode.
;;; Code:
(use-package coffee-mode
:mode "\\.coffee\\'"
:interpreter "coffee"
:hook (coffee-mode . siren-coffee-mode-setup)
:init
(defun siren-coffee-mode-setup ()
;; remove the "Generated by CoffeeScript" header
(add-to-list 'coffee-args-compile "--no-header")
;; Update the already compiled js on save
(and (buffer-file-name)
(file-exists-p (buffer-file-name))
(file-exists-p (coffee-compiled-file-name (buffer-file-name)))
(coffee-cos-mode t))
(setq tab-width 2)
(highlight-indentation-current-column-mode)
(subword-mode +1))
:config
(setq coffee-tab-width 2))
(provide 'siren-coffee)
;;; siren-coffee.el ends here

View File

@@ -0,0 +1,37 @@
;;; siren-conf.el --- jimeh's Emacs Siren: conf-mode configuration.
;;; Commentary:
;; Basic configuration for conf-mode.
;;; Code:
(require 'siren-fci)
(require 'siren-flyspell)
(require 'siren-linum)
(require 'siren-prog-mode)
(require 'siren-flycheck)
(require 'siren-highlight-indentation)
(require 'siren-highlight-symbol)
(require 'siren-smartparens)
(use-package conf-mode
:mode "Procfile\\'" "\\.conf\\'" "\\.cfg\\'"
:hook (conf-mode . siren-conf-mode-setup)
:init
(defun siren-conf-mode-setup ()
(siren-prog-mode-setup)
(setq tab-width 2)
(fci-mode)
(flycheck-mode)
(flyspell-prog-mode)
(highlight-indentation-current-column-mode)
(highlight-indentation-set-offset 2)
(highlight-symbol-mode)
(linum-mode)
(smartparens-mode)))
(provide 'siren-conf)
;;; siren-conf.el ends here

View File

@@ -0,0 +1,26 @@
;;; siren-css.el --- jimeh's Emacs Siren: css-mode configuration.
;;; Commentary:
;; Basic configuration for css-mode.
;;; Code:
(require 'siren-rainbow)
(use-package css-mode
:mode "\\.css\\'"
:hook (css-mode-hook . siren-css-mode-setup)
:config
(setq css-indent-offset 2)
:init
(defun siren-css-mode-setup ()
(setq tab-width 2)
(highlight-indentation-current-column-mode +1)
(rainbow-mode +1)))
(provide 'siren-css)
;;; siren-css.el ends here

View File

@@ -0,0 +1,38 @@
;;; siren-cucumber.el --- jimeh's Emacs Siren: feature-mode configuration.
;;; Commentary:
;; Basic configuration for feature-mode.
;;; Code:
(require 'siren-fci)
(require 'siren-flyspell)
(require 'siren-linum)
(require 'siren-prog-mode)
(require 'siren-flycheck)
(require 'siren-highlight-indentation)
(require 'siren-highlight-symbol)
(require 'siren-smartparens)
(use-package feature-mode
:mode "\\.feature\\'"
:interpreter "cucumber"
:hook (feature-mode . siren-feature-mode-setup)
:init
(defun siren-feature-mode-setup ()
(siren-prog-mode-setup)
(setq tab-width 2)
(fci-mode)
(flycheck-mode)
(flyspell-prog-mode)
(highlight-indentation-current-column-mode)
(highlight-indentation-set-offset 2)
(highlight-symbol-mode)
(linum-mode)
(smartparens-mode)))
(provide 'siren-cucumber)
;;; siren-cucumber.el ends here

View File

@@ -0,0 +1,18 @@
;;; siren-dockerfile.el --- jimeh's Emacs Siren: dockerfile-mode configuration.
;;; Commentary:
;; Basic configuration for dockerfile-mode.
;;; Code:
(use-package dockerfile-mode
:mode "Dockerfile.*\\'"
:hook (dockerfile-mode . siren-dockerfile-mode-setup)
:init
(defun siren-dockerfile-mode-setup ()
(subword-mode +1)))
(provide 'siren-dockerfile)
;;; siren-dockerfile.el ends here

View File

@@ -0,0 +1,42 @@
;;; siren-emacs-lisp.el --- jimeh's Emacs Siren: emacs-lisp-mode configuration.
;;; Commentary:
;; Basic configuration for emacs-lisp-mode.
;;; Code:
(require 'siren-lisp)
(defun siren-recompile-elc-on-save ()
"Recompile your elc when saving an elisp file."
(add-hook 'after-save-hook
(lambda ()
(when (and
(string-prefix-p siren-dir (file-truename buffer-file-name))
(file-exists-p (byte-compile-dest-file buffer-file-name)))
(emacs-lisp-byte-compile)))
nil t))
(defun siren-conditional-emacs-lisp-checker ()
"Don't check doc style in Emacs Lisp test files."
(let ((file-name (buffer-file-name)))
(when (and file-name (string-match-p ".*-tests?\\.el\\'" file-name))
(setq-local flycheck-checkers '(emacs-lisp)))))
(defun siren-emacs-lisp-mode-setup ()
"Sensible defaults for `emacs-lisp-mode'."
(highlight-indent-guides-mode)
;; (run-hooks 'siren-lisp-coding-hook)
;; (eldoc-mode +1)
;; (siren-recompile-elc-on-save)
;; (rainbow-mode +1)
;; (setq mode-name "EL")
;; (siren-conditional-emacs-lisp-checker)
)
(add-hook 'emacs-lisp-mode-hook #'siren-emacs-lisp-mode-setup)
(add-to-list 'auto-mode-alist '("Cask\\'" . emacs-lisp-mode))
(provide 'siren-emacs-lisp)
;;; siren-emacs-lisp.el ends here

View File

@@ -0,0 +1,17 @@
;;; siren-gitconfig.el --- jimeh's Emacs Siren: gitconfig-mode configuration.
;;; Commentary:
;; Basic configuration for gitconfig-mode.
;;; Code:
(use-package gitconfig-mode
:mode "\\.gitconfig" "gitconfig\\'" "\\.git\\\/config"
:hook (gitconfig-mode . siren-gitconfig-mode-setup)
:init
(defun siren-gitconfig-mode-setup ()))
(provide 'siren-gitconfig)
;;; siren-gitconfig.el ends here

View File

@@ -0,0 +1,17 @@
;;; siren-gitignore.el --- jimeh's Emacs Siren: gitignore-mode configuration.
;;; Commentary:
;; Basic configuration for gitignore-mode.
;;; Code:
(use-package gitignore-mode
:mode "\\.gitignore" "gitignore\\'"
:hook (gitignore-mode . siren-gitignore-mode-setup)
:init
(defun siren-gitignore-mode-setup ()))
(provide 'siren-gitignore)
;;; siren-gitignore.el ends here

View File

@@ -0,0 +1,125 @@
;;; siren-golang.el --- jimeh's Emacs Siren: go-mode configuration.
;;; Commentary:
;; Basic configuration for go-mode.
;;; Code:
(require 'siren-company)
(require 'siren-flycheck)
(require 'siren-folding)
(require 'siren-projectile)
(use-package go-mode
:mode "\\.go\\'"
:interpreter "go"
:commands go-mode
:bind (:map go-mode-map
("RET" . newline-and-indent)
("C-h f" . godoc-at-point))
:hook
(go-mode . siren-go-mode-setup)
:init
(defun siren-go-mode-setup ()
;; Prefer goimports to gofmt if installed
(let ((goimports (executable-find "goimports")))
(when goimports
(setq gofmt-command goimports)))
;; gofmt on save
(add-hook 'before-save-hook 'gofmt-before-save nil t)
(highlight-symbol-mode -1)
(hs-minor-mode 1)
(hideshowvis-enable)
(whitespace-toggle-options '(tabs))
(setq tab-width 4)
(subword-mode +1))
:config
(message "loading go-mode")
(when (memq window-system '(mac ns))
(exec-path-from-shell-copy-env "GOPATH"))
(define-key 'help-command (kbd "G") 'godoc)
;; Ignore go test -c output files
(add-to-list 'completion-ignored-extensions ".test"))
(use-package company-go
:defer t
:after go-mode
:hook (go-mode . siren-company-go-setup)
:init
(defun siren-company-go-setup ()
(set (make-local-variable 'company-backends) '(company-go))
(company-mode +1)))
(use-package go-eldoc
:defer t
:diminish eldoc-mode
:commands go-eldoc-setup
:hook (go-mode . go-eldoc-setup))
(use-package go-guru
:after go-mode
:bind (:map go-mode-map
("C-c C-j" . go-guru-definition)
("C-c b" . pop-tag-mark))
:hook (go-mode . siren-go-guru-setup)
:init
(defun siren-go-guru-setup ()
(setq go-guru-hl-identifier-idle-time 0.1)
(go-guru-hl-identifier-mode 1))
:config
(custom-set-faces
'(go-guru-hl-identifier-face ((t (:background "gray30"))))))
(use-package go-rename
:after go-mode
:bind (:map go-mode-map
("C-c ." . go-rename)))
(use-package gotest
:after go-mode
:bind (:map go-mode-map
("C-c , a" . go-test-current-project)
("C-c , v" . go-test-current-file)
("C-c , s" . go-test-current-test)
("C-c , c" . go-test-current-coverage)
("C-c , b" . go-test-current-benchmark)
("C-c , B" . go-test-current-project-benchmarks)
("C-c , r" . go-run)))
(use-package go-projectile
:after go-mode
:hook (go-mode . siren-go-projectile-setup)
:init
(defun siren-go-projectile-setup ()
;; prevent go-projectile from screwing up GOPATH
(setq go-projectile-switch-gopath 'never)))
(use-package flycheck-gometalinter
:defer t
:after go-mode
:commands flycheck-gometalinter-setup
:hook (flycheck-mode . flycheck-gometalinter-setup)
:init
(setq flycheck-gometalinter-fast t
flycheck-gometalinter-tests t
flycheck-gometalinter-vendor t))
(use-package go-playground
:commands go-playground)
(provide 'siren-golang)
;;; siren-golang.el ends here

View File

@@ -0,0 +1,20 @@
;;; siren-haml.el --- jimeh's Emacs Siren: haml-mode configuration.
;;; Commentary:
;; Basic configuration for haml-mode.
;;; Code:
(use-package haml-mode
:mode "\\.haml\\'" "\\.hamlc\\'"
:hook (haml-mode . siren-haml-mode-setup)
:init
(defun siren-haml-mode-setup ()
(setq tab-width 2)
(highlight-indentation-set-offset 2)
(highlight-indentation-current-column-mode +1)))
(provide 'siren-haml)
;;; siren-haml.el ends here

View File

@@ -0,0 +1,42 @@
;;; siren-js.el --- jimeh's Emacs Siren: js-mode configuration.
;;; Commentary:
;; Basic configuration for js-mode.
;;; Code:
(require 'siren-prettier-js)
(require 'siren-folding)
(use-package js-mode
:ensure nil ;; loaded from emacs built-ins
:mode
"\\.js\\'"
"\\.pac\\'"
"node"
:hook
(js-mode . siren-js-mode-setup)
:init
(defun siren-js-mode-setup ()
"Default tweaks for `js-mode'."
(let ((width 2))
(setq js-indent-level width
indent-level width
tab-width width))
(prettier-js-mode)
(company-mode +1)
(subword-mode +1)
(hs-minor-mode 1)
(highlight-indentation-current-column-mode)
(hideshowvis-enable)
(let ((map js-mode-map))
(define-key map (kbd "C-j") 'newline-and-indent)
(define-key map (kbd "C-c C-h") 'siren-toggle-hiding))))
(provide 'siren-js)
;;; siren-js.el ends here

View File

@@ -0,0 +1,36 @@
;;; siren-json.el --- jimeh's Emacs Siren: json-mode configuration.
;;; Commentary:
;; Basic configuration for json-mode.
;;; Code:
(require 'siren-eslintd-fix)
(require 'siren-folding)
(use-package json-mode
:mode "\\.json\\'"
:requires (flycheck highlight-indentation omnifmt hideshowvis)
:bind (:map json-mode-map
("C-j" . newline-and-indent)
("C-c C-h" . siren-toggle-hiding))
:hook
(json-mode . siren-json-mode-setup)
:init
(defun siren-json-mode-setup ()
"Default tweaks for `json-mode'."
(let ((width 2))
(setq js-indent-level width)
(setq json-reformat:indent-width width)
(setq tab-width width)
(highlight-indentation-set-offset width))
(setq flycheck-checker 'json-jsonlint)))
(provide 'siren-json)
;;; siren-js.el ends here

View File

@@ -0,0 +1,26 @@
;;; siren-jsx.el --- jimeh's Emacs Siren: .jsx file configuration
;;; Commentary:
;; Basic configuration for dealing with .jsx files.
;;; Code:
(require 'siren-prettier-js)
(use-package rjsx-mode
:mode "components\\/.*\\.js\\'"
:hook (rjsx-mode . siren-rjsx-mode-setup)
:init
(defun siren-rjsx-mode-setup ()
(prettier-js-mode +1)
(company-mode +1)
(subword-mode +1)
(hs-minor-mode +1)
(highlight-indentation-current-column-mode +1)
(hideshowvis-enable)))
(provide 'siren-jsx)
;;; siren-jsx.el ends here

View File

@@ -0,0 +1,29 @@
;;; siren-lisp.el --- jimeh's Emacs Siren: lisp-mode configuration.
;;; Commentary:
;; Basic configuration for lisp-mode.
;;; Code:
(require 'siren-highlight-indent-guides)
;; Lisp configuration
(define-key read-expression-map (kbd "TAB") 'completion-at-point)
;; wrap keybindings
(define-key lisp-mode-shared-map (kbd "M-(") (siren-wrap-with "("))
;; FIXME: Pick terminal-friendly binding.
;;(define-key lisp-mode-shared-map (kbd "M-[") (siren-wrap-with "["))
(define-key lisp-mode-shared-map (kbd "M-\"") (siren-wrap-with "\""))
;; a great lisp coding hook
(defun siren-lisp-coding-hook ())
;; interactive modes don't need whitespace checks
(defun siren-interactive-lisp-coding-hook ()
(highlight-indent-guides-mode)
(whitespace-mode -1))
(provide 'siren-lisp)
;;; siren-lisp.el ends here

View File

@@ -0,0 +1,22 @@
;;; siren-lua.el --- jimeh's Emacs Siren: lua-mode configuration.
;;; Commentary:
;; Basic configuration for lua-mode.
;;; Code:
(use-package lua-mode
:hook
(lua-mode . siren-lua-mode-setup)
:init
(defun siren-lua-mode-setup ()
(setq lua-indent-level 2
whitespace-action '(auto-cleanup))
(highlight-indentation-current-column-mode)
(subword-mode +1)))
(provide 'siren-lua)
;;; siren-lua.el ends here

View File

@@ -0,0 +1,23 @@
;;; siren-makefile.el --- jimeh's Emacs Siren: makefile-mode configuration.
;;; Commentary:
;; Basic configuration for makefile-mode.
;;; Code:
(use-package make-mode
:ensure nil ;; loaded from emacs built-ins
:hook
(makefile-mode-hook . siren-makefile-mode-setup)
:init
(add-to-list 'siren-indent-sensitive-modes 'makefile-mode)
(defun siren-makefile-mode-setup ()
(subword-mode +1)
(setq tab-width 4)
(highlight-indentation-set-offset 4)
(highlight-indentation-current-column-mode)))
(provide 'siren-makefile)
;;; siren-makefile.el ends here

View File

@@ -0,0 +1,45 @@
;;; siren-markdown.el --- jimeh's Emacs Siren: markdown-mode configuration.
;;; Commentary:
;; Basic configuration for markdown-mode.
;;; Code:
(require 'siren-fci)
(require 'siren-flyspell)
(require 'siren-linum)
(require 'siren-smartparens)
(use-package markdown-mode
:mode
"\\.md"
"\\.mkd"
"\\.mkdn"
"\\.mdown"
"\\.markdown"
:bind (:map markdown-mode-map
("C-c p" . markdown-preview))
:hook
(markdown-mode . siren-markdown-mode-setup)
:init
(defun siren-markdown-mode-setup ()
(setq markdown-asymmetric-header t
whitespace-action nil)
(auto-fill-mode)
(fci-mode)
(flyspell-mode)
(linum-mode t)
(smartparens-mode +1)
(subword-mode))
:config
(setq markdown-command "redcarpet")
(custom-set-faces '(markdown-code-face ((t nil)))))
(provide 'siren-markdown)
;;; siren-markdown.el ends here

View File

@@ -0,0 +1,43 @@
;;; siren-org-mode.el --- jimeh's Emacs Siren: org-mode configuration.
;;; Commentary:
;; Basic configuration for org-mode.
;;; Code:
(require 'siren-fci)
(require 'siren-flyspell)
(require 'siren-linum)
(require 'siren-smartparens)
(use-package org-mode
:ensure nil ;; loaded from emacs built-ins
:hook (org-mode-hook . siren-org-mode-setup)
:init
(defun siren-org-mode-setup ()
(setq org-export-backends '(ascii html icalendar latex md confluence)
fill-column 80
whitespace-action '(auto-cleanup))
(linum-mode t)
(flyspell-mode)
(fci-mode)
(smartparens-mode +1)
(visual-line-mode +1)
(whitespace-mode +1)
(let ((map org-mode-map))
(define-key map (kbd "M-[") 'org-promote-subtree)
(define-key map (kbd "M-]") 'org-demote-subtree)
(define-key map (kbd "M-p") 'org-metaup)
(define-key map (kbd "M-n") 'org-metadown)
(define-key map (kbd "C-M-n") 'outline-next-visible-heading)
(define-key map (kbd "C-M-p") 'outline-previous-visible-heading))))
(use-package org-mouse
:ensure nil ;; loaded from emacs built-ins
:after org-mode)
(provide 'siren-org-mode)
;;; siren-org-mode.el ends here

View File

@@ -0,0 +1,29 @@
;;; siren-php.el --- jimeh's Emacs Siren: php-mode configuration.
;;; Commentary:
;; Basic configuration for php-mode.
;;; Code:
(require 'siren-folding)
(require 'siren-highlight-indentation)
(require 'siren-rainbow)
(use-package php-mode
:interpreter "php"
:mode "\\.php\\'" "\\.inc\\'" "\\.module\\'"
:hook
(php-mode . siren-php-mode-setup)
:init
(defun siren-php-mode-setup ()
(rainbow-mode +1)
(company-mode +1)
(subword-mode +1)
(highlight-indentation-current-column-mode)
(hs-minor-mode 1)
(hideshowvis-enable)))
(provide 'siren-php)
;;; siren-php.el ends here

View File

@@ -0,0 +1,25 @@
;;; siren-plantuml.el --- jimeh's Emacs Siren: plantuml-mode configuration.
;;; Commentary:
;; Basic configuration for plantuml-mode.
;;; Code:
(require 'siren-highlight-indentation)
(use-package plantuml-mode
:mode "\\.uml\\'"
:hook
(plantuml-mode . siren-plantuml-mode-setup)
:init
(defun siren-plantuml-mode-setup ()
(setq tab-width 2
plantuml-jar-path "/usr/local/opt/plantuml/libexec/plantuml.jar")
(highlight-indentation-set-offset 2)
(highlight-indentation-current-column-mode)))
(provide 'siren-plantuml)
;;; siren-plantuml.el ends here

View File

@@ -0,0 +1,24 @@
;;; siren-prog-mode.el --- jimeh's Emacs Siren: defaults for programming modes
;;; Commentary:
;; Basic configuration shared across all programming languages.
;;; Code:
(use-package prog-mode
:ensure nil ;; loaded from emacs built-ins
:hook
(prog-mode . siren-prog-mode-setup)
:init
(defun siren-prog-mode-setup ()
"Default coding hook, useful with any programming language."
(setq fill-column 80
whitespace-action '(auto-cleanup))
(visual-line-mode +1)
(whitespace-mode +1)))
(provide 'siren-prog-mode)
;;; siren-prog-mode.el ends here

View File

@@ -0,0 +1,154 @@
;;; siren-ruby.el --- jimeh's Emacs Siren: ruby-mode configuration.
;;; Commentary:
;; Basic configuration for ruby-mode.
;;; Code:
(require 'siren-company)
(require 'siren-folding)
(require 'siren-highlight-indentation)
(require 'siren-smartparens)
(require 'siren-toggle-quotes)
(require 'smartparens-ruby)
(use-package ruby-mode
:ensure nil ;; loaded from emacs built-ins
:interpreter "ruby"
:mode
"Appraisals\\'"
"Berksfile\\'"
"Capfile\\'"
"Gemfile\\'"
"Guardfile\\'"
"Podfile\\'"
"Puppetfile\\'"
"Rakefile\\'"
"Thorfile\\'"
"Vagrantfile\\'"
"\\.cap\\'"
"\\.gemspec\\'"
"\\.jbuilder\\'"
"\\.podspec\\'"
"\\.rabl\\'"
"\\.rake\\'"
"\\.ru\\'"
"\\.thor\\'"
"\\.rb\\'"
:bind (:map ruby-mode-map
("C-j" . newline-and-indent)
("RET" . newline-and-indent)
("C-c C-l" . goto-line)
("C-M-f" . sp-ruby-forward-sexp)
("C-M-b" . sp-ruby-backward-sexp))
:hook
(ruby-mode . siren-ruby-mode-setup)
:init
(defun siren-ruby-mode-setup ()
(setq c-tab-always-indent nil
ruby-align-chained-calls t
ruby-insert-encoding-magic-comment t
ruby-use-smie t
tab-width 2)
(company-mode +1)
(hs-minor-mode 1)
(hideshowvis-enable)
(highlight-indentation-current-column-mode)
(subword-mode +1))
:config
;; We never want to edit Rubinius bytecode
(add-to-list 'completion-ignored-extensions ".rbc")
;; Set up hs-mode (HideShow) for Ruby
(add-to-list 'hs-special-modes-alist
`(ruby-mode
,(rx (or "def" "class" "module" "do" "if" "case")) ;; Block start
,(rx (or "end")) ;; Block end
,(rx (or "#" "=begin")) ;; Comment start
ruby-forward-sexp nil))
;; Make company-mode play nice
(push 'ruby-mode company-dabbrev-code-modes))
(use-package inf-ruby
:defer t
:hook
(ruby-mode . inf-ruby-minor-mode)
(compilation-filter . inf-ruby-auto-enter)
:config
(unbind-key "C-c C-r" inf-ruby-minor-mode-map))
(use-package robe
:defer t
:bind (:map robe-mode-map
("C-c C-j" . robe-jump)
("C-c b". pop-tag-mark))
:hook (ruby-mode . robe-mode)
:init
(eval-after-load 'company
'(push 'company-robe company-backends))
:config
;; Unbind keys used by siren-expand-region module
(unbind-key "M-." robe-mode-map)
(unbind-key "M-," robe-mode-map))
(use-package rspec-mode
:defer t
:hook (rspec-mode . siren-rspec-mode-setup)
:init
(defun siren-rspec-mode-setup ()
(setq compilation-scroll-output t
rspec-primary-source-dirs '("app")
rspec-use-spring-when-possible nil))
:config
(rspec-install-snippets))
(use-package rubocopfmt
:ensure nil ;; loaded from vendor
:commands (rubocopfmt rubocopfmt-mode)
:bind (:map ruby-mode-map
("C-c C-f" . rubocopfmt))
:hook (ruby-mode . rubocopfmt-mode))
(use-package ruby-compilation
:defer t)
(use-package ruby-refactor
:defer t
:hook
(ruby-mode . ruby-refactor-mode)
(ruby-refactor . siren-ruby-refactor-setup)
:init
(setq ruby-refactor-keymap-prefix (kbd "C-c C-="))
(defun siren-ruby-refactor-setup ()
(setq ruby-refactor-add-parens t)))
(use-package ruby-tools
:defer t
:diminish ruby-tools-mode
:bind (:map ruby-tools-mode-map
("C-'" . toggle-quotes))
:hook (ruby-mode . ruby-tools-mode))
(use-package seeing-is-believing
:defer t
:commands seeing-is-believing)
(use-package yari
:defer t
:init
(define-key 'help-command (kbd "R") 'yari))
(provide 'siren-ruby)
;;; siren-ruby.el ends here

View File

@@ -0,0 +1,56 @@
;;; siren-rust.el --- jimeh's Emacs Siren: rust-mode configuration.
;;; Commentary:
;; Basic configuration for rust-mode.
;;; Code:
(require 'siren-folding)
(require 'siren-highlight-indentation)
(use-package rust-mode
:mode "\\.rs\\'"
:interpreter "rust"
:commands rust-mode
:bind (:map rust-mode-map
("RET" . newline-and-indent))
:hook
(rust-mode . siren-rust-mode-setup)
:init
(defun siren-rust-mode-setup ()
(setq rust-format-on-save t)
(hs-minor-mode 1)
(hideshowvis-enable)
(highlight-indentation-current-column-mode)
(subword-mode +1)))
(use-package cargo
:hook (rust-mode . cargo-minor-mode))
(use-package flycheck-rust
:after rust-mode
:hook (flycheck-mode . flycheck-rust-setup))
(use-package racer
:requires rust-mode company
:commands racer-mode
:bind (:map rust-mode-map
("TAB" . company-indent-or-complete-common))
:hook
(rust-mode . racer-mode)
(racer-mode . eldoc-mode)
(racer-mode . siren-racer-mode-setup)
:config
(defun siren-racer-mode-setup ()
(setq company-tooltip-align-annotations t)))
(use-package rust-playground)
(provide 'siren-rust)
;;; siren-rust.el ends here

View File

@@ -0,0 +1,24 @@
;;; siren-sass.el --- jimeh's Emacs Siren: sass-mode configuration.
;;; Commentary:
;; Basic configuration for sass-mode.
;;; Code:
(require 'siren-css)
(use-package sass-mode
:mode "\\.sass\\'"
:hook (sass-mode . siren-sass-mode-setup)
:init
(defun siren-sass-mode-setup ()
(siren-css-mode-css))
:config
;; turn off annoying auto-compile on save
(setq sass-compile-at-save nil))
(provide 'siren-sass)
;;; siren-sass.el ends here

View File

@@ -0,0 +1,24 @@
;;; siren-scss.el --- jimeh's Emacs Siren: scss-mode configuration.
;;; Commentary:
;; Basic configuration for scss-mode.
;;; Code:
(require 'siren-css)
(use-package scss-mode
:mode "\\.scss\\'"
:hook (scss-mode-hook . siren-scss-mode-setup)
:init
(defun siren-scss-mode-setup ()
(siren-css-mode-setup))
:config
;; turn off annoying auto-compile on save
(setq scss-compile-at-save nil))
(provide 'siren-scss)
;;; siren-scss.el ends here

View File

@@ -0,0 +1,29 @@
;;; siren-sh.el --- jimeh's Emacs Siren: sh-mode configuration.
;;; Commentary:
;; Basic configuration for sh-mode.
;;; Code:
(require 'siren-highlight-indentation)
(use-package sh-script
:ensure nil ;; loaded from emacs built-ins
:hook
(sh-mode-hook . siren-sh-mode-setup)
:init
(defun siren-sh-mode-setup ()
(setq tab-width 2
sh-basic-offset 2
sh-indentation 2
whitespace-action '(auto-cleanup))
(subword-mode +1)
(highlight-indentation-set-offset 2)
(highlight-indentation-current-column-mode)
(define-key sh-mode-map (kbd "RET") 'newline-and-indent)))
(provide 'siren-sh)
;;; siren-sh.el ends here

View File

@@ -0,0 +1,20 @@
;;; siren-slim.el --- jimeh's Emacs Siren: slim-mode configuration.
;;; Commentary:
;; Basic configuration for slim-mode.
;;; Code:
(require 'siren-highlight-indentation)
(use-package slim-mode
:mode "\\.slim\\'"
:hook (slim-mode-hook . siren-slim-mode-hook)
:init
(defun siren-slim-mode-setup ()
(highlight-indentation-current-column-mode)))
(provide 'siren-slim)
;;; siren-slim.el ends here

View File

@@ -0,0 +1,17 @@
;;; siren-text-mode.el --- jimeh's Emacs Siren: text-mode configuration.
;;; Commentary:
;; Basic configuration for text-mode.
;;; Code:
(use-package text-mode
:ensure nil ;; loaded from emacs built-ins
:hook (text-mode . siren-text-mode-setup)
:init
(defun siren-text-mode-setup ()
(setq fill-column 80)))
(provide 'siren-text-mode)
;;; siren-text-mode.el ends here

View File

@@ -0,0 +1,38 @@
;;; siren-thrift.el --- jimeh's Emacs Siren: thrift-mode configuration.
;;; Commentary:
;; Basic configuration for thrift-mode.
;;; Code:
(require 'siren-fci)
(require 'siren-flyspell)
(require 'siren-linum)
(require 'siren-prog-mode)
(require 'siren-flycheck)
(require 'siren-highlight-indentation)
(require 'siren-highlight-symbol)
(require 'siren-smartparens)
(use-package thrift
:mode "\\.thrift\\'"
:hook (thrift-mode-hook . siren-thrift-mode-setup)
:init
(defun siren-thrift-mode-setup ()
(siren-prog-mode-setup)
(setq tab-width 2)
(fci-mode)
(flycheck-mode)
(flyspell-prog-mode)
(highlight-indentation-current-column-mode)
(highlight-indentation-set-offset 2)
(highlight-symbol-mode)
(linum-mode)
(smartparens-mode)
(subword-mode +1)))
(provide 'siren-thrift)
;;; siren-thrift.el ends here

View File

@@ -0,0 +1,46 @@
;;; siren-web-mode.el --- jimeh's Emacs Siren: web-mode configuration.
;;; Commentary:
;; Basic configuration for web-mode.
;;; Code:
(require 'siren-company)
(require 'siren-fci)
(require 'siren-folding)
(require 'siren-highlight-indentation)
(use-package web-mode
:mode
"\\.html\\'"
"\\.html.erb\\'"
:bind (:map web-mode-map
("C-j" . newline-and-indent)
("C-c C-h" . siren-toggle-hiding))
:hook
(web-mode-hook . siren-web-mode-setup)
:init
(defun siren-web-mode-mode-setup ()
"Default tweaks for `web-mode'."
(setq tab-width 2)
(company-mode +1)
(fci-mode -1)
(hideshowvis-enable)
(hs-minor-mode +1)
(highlight-indentation-current-column-mode)
(highlight-indentation-set-offset 2)
(subword-mode +1))
:config
(setq web-mode-code-indent-offset 2
web-mode-css-indent-offset 2
web-mode-markup-indent-offset 2
web-mode-sql-indent-offset 2))
(provide 'siren-web-mode)
;;; siren-web-mode.el ends here

View File

@@ -0,0 +1,39 @@
;;; siren-yaml.el --- jimeh's Emacs Siren: yaml-mode configuration.
;;; Commentary:
;; Basic configuration for yaml-mode.
;;; Code:
(require 'siren-fci)
(require 'siren-flyspell)
(require 'siren-highlight-indentation)
(require 'siren-linum)
(require 'siren-prog-mode)
(require 'siren-smartparens)
(use-package yaml-mode
:mode "\\.yml\\'" "\\.yaml\\'"
:bind (:map yaml-mode-map
("RET" . newline-and-indent))
:hook
(yaml-mode . siren-yaml-mode-setup)
:init
(defun siren-yaml-mode-setup ()
(siren-prog-mode-setup)
(setq tab-width 2
whitespace-action '(auto-cleanup))
(fci-mode)
(flyspell-mode)
(highlight-indentation-current-column-mode)
(highlight-indentation-set-offset 2)
(linum-mode t)
(smartparens-mode +1)
(subword-mode +1)))
(provide 'siren-yaml)
;;; siren-yaml.el ends here