mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
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:
15
modules/text-editing/siren-expand-region.el
Normal file
15
modules/text-editing/siren-expand-region.el
Normal file
@@ -0,0 +1,15 @@
|
||||
;;; siren-expand-region.el --- jimeh's Emacs Siren: expand-region
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Configuration for expand-region
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package expand-region
|
||||
:bind
|
||||
("M-." . er/expand-region)
|
||||
("M-," . er/contract-region))
|
||||
|
||||
(provide 'siren-expand-region)
|
||||
;;; siren-expand-region.el ends here
|
||||
14
modules/text-editing/siren-goto-chg.el
Normal file
14
modules/text-editing/siren-goto-chg.el
Normal file
@@ -0,0 +1,14 @@
|
||||
;;; siren-goto-chg.el --- jimeh's Emacs Siren: goto-chg configuration.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for goto-chg.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package goto-chg
|
||||
:bind (("C-." . goto-last-change)
|
||||
("C-," . goto-last-change-reverse)))
|
||||
|
||||
(provide 'siren-goto-chg)
|
||||
;;; siren-goto-chg.el ends here
|
||||
16
modules/text-editing/siren-move-dup.el
Normal file
16
modules/text-editing/siren-move-dup.el
Normal file
@@ -0,0 +1,16 @@
|
||||
;;; siren-move-dup.el --- jimeh's Emacs Siren: move-dup
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Configuration for move-dup
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package move-dup
|
||||
:bind
|
||||
("M-p" . md/move-lines-up)
|
||||
("M-n" . md/move-lines-down)
|
||||
("C-x C-d" . md/duplicate-down))
|
||||
|
||||
(provide 'siren-move-dup)
|
||||
;;; siren-move-dup.el ends here
|
||||
30
modules/text-editing/siren-multiple-cursors.el
Normal file
30
modules/text-editing/siren-multiple-cursors.el
Normal file
@@ -0,0 +1,30 @@
|
||||
;;; siren-multiple-cursors.el --- jimeh's Emacs Siren: multiple-cursors configuration.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for multiple-cursors.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package multiple-cursors
|
||||
:bind
|
||||
("C-x C-@" . mc/edit-lines) ;; Terminal
|
||||
("M-/" . mc/mark-next-like-this)
|
||||
("M-m" . mc/mark-previous-like-this)
|
||||
("C-c M-/" . mc/mark-all-like-this)
|
||||
("M-RET" . set-rectangular-region-anchor)
|
||||
|
||||
:config
|
||||
(setq mc/edit-lines-empty-lines 'ignore)
|
||||
|
||||
;; Make alt-<click> add additional cursors
|
||||
(global-unset-key (kbd "M-<down-mouse-1>")) ;; must unset key first
|
||||
(global-set-key (kbd "M-<mouse-1>") 'mc/add-cursor-on-click))
|
||||
|
||||
;; Allows searching forward/back (C-s/C-r) searching with multiple cursors.
|
||||
(use-package phi-search
|
||||
:config
|
||||
(setq phi-search-limit 3000))
|
||||
|
||||
(provide 'siren-multiple-cursors)
|
||||
;;; siren-multiple-cursors.el ends here
|
||||
24
modules/text-editing/siren-randomize-region.el
Normal file
24
modules/text-editing/siren-randomize-region.el
Normal file
@@ -0,0 +1,24 @@
|
||||
;;; siren-randomize-region.el --- jimeh's Emacs Siren: randomize-region
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Helper command to randomize the order of lines in region. Shamelessly ripped
|
||||
;; from: https://www.emacswiki.org/emacs/RandomizeBuffer
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defun randomize-region (beg end)
|
||||
"Randomize lines in region from BEG to END."
|
||||
(interactive "*r")
|
||||
(let ((lines (split-string
|
||||
(delete-and-extract-region beg end) "\n")))
|
||||
(when (string-equal "" (car (last lines 1)))
|
||||
(setq lines (butlast lines 1)))
|
||||
(apply 'insert
|
||||
(mapcar 'cdr
|
||||
(sort (mapcar
|
||||
(lambda (x) (cons (random) (concat x "\n"))) lines)
|
||||
(lambda (a b) (< (car a) (car b))))))))
|
||||
|
||||
(provide 'siren-randomize-region)
|
||||
;;; siren-randomize-region.el ends here
|
||||
17
modules/text-editing/siren-smart-shift.el
Normal file
17
modules/text-editing/siren-smart-shift.el
Normal file
@@ -0,0 +1,17 @@
|
||||
;;; siren-smart-shift.el --- jimeh's Emacs Siren: smart-shift
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Configuration for smart-shift
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package smart-shift
|
||||
:bind
|
||||
("C-c [" . smart-shift-left)
|
||||
("C-c ]" . smart-shift-right)
|
||||
("M-[" . smart-shift-left)
|
||||
("M-]" . smart-shift-right))
|
||||
|
||||
(provide 'siren-smart-shift)
|
||||
;;; siren-smart-shift.el ends here
|
||||
56
modules/text-editing/siren-smartparens.el
Normal file
56
modules/text-editing/siren-smartparens.el
Normal file
@@ -0,0 +1,56 @@
|
||||
;;; siren-smartparens.el --- jimeh's Emacs Siren: smartparens configuration.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for smartparens.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package smartparens
|
||||
:defer t
|
||||
:diminish smartparens-mode
|
||||
:bind (:map smartparens-mode-map
|
||||
("C-M-t" . sp-transpose-sexp)
|
||||
("C-M-r" . sp-transpose-sexp-reverse)
|
||||
("C-M-f" . sp-forward-sexp)
|
||||
("C-M-b" . sp-backward-sexp)
|
||||
("C-M-a" . sp-beginning-of-sexp)
|
||||
("C-M-e" . sp-end-of-sexp)
|
||||
("C-M-]" . sp-forward-slurp-sexp)
|
||||
("C-M-[" . sp-forward-barf-sexp)
|
||||
("C-M-." . sp-forward-slurp-sexp)
|
||||
("C-M-," . sp-forward-barf-sexp)
|
||||
("s->" . sp-forward-slurp-sexp)
|
||||
("s-<" . sp-forward-barf-sexp)
|
||||
("M-|" . sp-split-sexp)
|
||||
("M-t" . sp-backward-up-sexp)
|
||||
("C-<backspace>" . sp-backward-kill-sexp)
|
||||
("C-<delete>" . sp-kill-sexp))
|
||||
|
||||
:hook
|
||||
(prog-mode . smartparens-mode)
|
||||
|
||||
:config
|
||||
;; smart pairing for all
|
||||
(require 'smartparens-config)
|
||||
|
||||
(defun sp-transpose-sexp-reverse ()
|
||||
(interactive)
|
||||
(sp-transpose-sexp -1))
|
||||
|
||||
(defalias 'rw 'sp-rewrap-sexp)
|
||||
(show-smartparens-global-mode +1)
|
||||
|
||||
(setq sp-base-key-bindings 'paredit
|
||||
sp-autoskip-closing-pair 'always
|
||||
sp-hybrid-kill-entire-symbol nil)
|
||||
|
||||
(custom-set-faces
|
||||
'(sp-pair-overlay-face ((t (:inherit nil)))))
|
||||
|
||||
(sp-pair "{" nil :post-handlers
|
||||
'(((lambda (&rest _ignored)
|
||||
(siren-smart-open-line-above)) "RET"))))
|
||||
|
||||
(provide 'siren-smartparens)
|
||||
;;; siren-smartparens.el ends here
|
||||
19
modules/text-editing/siren-sort-symbols.el
Normal file
19
modules/text-editing/siren-sort-symbols.el
Normal file
@@ -0,0 +1,19 @@
|
||||
;;; siren-sort-symbols.el --- jimeh's Emacs Siren: sort-symbols.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Helper command to sort symbols in region. Shamelessly ripped from:
|
||||
;; https://www.emacswiki.org/emacs/SortWords
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defun sort-symbols (reverse beg end)
|
||||
"Sort symbols in region alphabetically, in REVERSE if negative.
|
||||
See `sort-symbols'."
|
||||
(interactive "*P\nr")
|
||||
(sort-regexp-fields reverse "\\(\\sw\\|\\s_\\)+" "\\&" beg end))
|
||||
|
||||
(defalias 'ss 'sort-symbols)
|
||||
|
||||
(provide 'siren-sort-symbols)
|
||||
;;; siren-sort-symbols.el ends here
|
||||
24
modules/text-editing/siren-sort-words.el
Normal file
24
modules/text-editing/siren-sort-words.el
Normal file
@@ -0,0 +1,24 @@
|
||||
;;; siren-sort-words.el --- jimeh's Emacs Siren: sort-words.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Helper command to sort words in region. Shamelessly ripped from:
|
||||
;; https://www.emacswiki.org/emacs/SortWords
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defun sort-words (reverse beg end)
|
||||
"Sort words in region alphabetically, in REVERSE if negative.
|
||||
Prefixed with negative \\[universal-argument], sorts in reverse.
|
||||
|
||||
The variable `sort-fold-case' determines whether alphabetic case
|
||||
affects the sort order.
|
||||
|
||||
See `sort-regexp-fields'."
|
||||
(interactive "*P\nr")
|
||||
(sort-regexp-fields reverse "\\w+" "\\&" beg end))
|
||||
|
||||
(defalias 'sw 'sort-words)
|
||||
|
||||
(provide 'siren-sort-words)
|
||||
;;; siren-sort-words.el ends here
|
||||
13
modules/text-editing/siren-string-inflection.el
Normal file
13
modules/text-editing/siren-string-inflection.el
Normal file
@@ -0,0 +1,13 @@
|
||||
;;; siren-string-inflection.el --- jimeh's Emacs Siren: defaults for string-inflection
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for string-inflections.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package string-inflection
|
||||
:bind ("C-c C-." . string-inflection-cycle))
|
||||
|
||||
(provide 'siren-string-inflection)
|
||||
;;; siren-string-inflection.el ends here
|
||||
32
modules/text-editing/siren-toggle-comments.el
Normal file
32
modules/text-editing/siren-toggle-comments.el
Normal file
@@ -0,0 +1,32 @@
|
||||
;;; siren-toggle-comments.el --- jimeh's Emacs Siren: toggle-comments
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Allows to toggle comments for current line or selected region. Shamelessly
|
||||
;; ripped from textmate.el: https://github.com/defunkt/textmate.el
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defmacro allow-line-as-region-for-function (orig-function)
|
||||
`(defun ,(intern (concat (symbol-name orig-function) "-or-line"))
|
||||
()
|
||||
,(format "Like `%s', but acts on the current line if mark is not active."
|
||||
orig-function)
|
||||
(interactive)
|
||||
(if mark-active
|
||||
(call-interactively (function ,orig-function))
|
||||
(save-excursion
|
||||
;; define a region (temporarily) -- so any C-u prefixes etc. are preserved.
|
||||
(beginning-of-line)
|
||||
(set-mark (point))
|
||||
(end-of-line)
|
||||
(call-interactively (function ,orig-function))))))
|
||||
|
||||
(unless (fboundp 'comment-or-uncomment-region-or-line)
|
||||
(allow-line-as-region-for-function comment-or-uncomment-region))
|
||||
|
||||
(global-set-key (kbd "C-c /") 'comment-or-uncomment-region-or-line)
|
||||
(global-set-key (kbd "C-c C-/") 'comment-or-uncomment-region-or-line)
|
||||
|
||||
(provide 'siren-toggle-comments)
|
||||
;;; siren-toggle-comments.el ends here
|
||||
13
modules/text-editing/siren-toggle-quotes.el
Normal file
13
modules/text-editing/siren-toggle-quotes.el
Normal file
@@ -0,0 +1,13 @@
|
||||
;;; siren-toggle-quotes.el --- jimeh's Emacs Siren: toggle-quotes.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration of toggle-quotes.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package toggle-quotes
|
||||
:bind (("C-'" . toggle-quotes)))
|
||||
|
||||
(provide 'siren-toggle-quotes)
|
||||
;;; siren-toggle-quotes.el ends here
|
||||
18
modules/text-editing/siren-yasnippet.el
Normal file
18
modules/text-editing/siren-yasnippet.el
Normal file
@@ -0,0 +1,18 @@
|
||||
;;; siren-yasnippet.el --- jimeh's Emacs Siren: yasnippet configuration.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for yasnippet.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package yasnippet-snippets)
|
||||
|
||||
(use-package yasnippet
|
||||
:demand
|
||||
:diminish yas-minor-mode
|
||||
:config
|
||||
(yas-global-mode t))
|
||||
|
||||
(provide 'siren-yasnippet)
|
||||
;;; siren-yasnippet.el ends here
|
||||
Reference in New Issue
Block a user