mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
Move code folding stuff into a module
This commit is contained in:
@@ -42,26 +42,6 @@ Position the cursor at it's beginning, according to the current mode."
|
||||
(interactive)
|
||||
(other-window -1))
|
||||
|
||||
(defun siren-toggle-hiding (column)
|
||||
"Toggle hiding/showing blocks via hs-mode.
|
||||
|
||||
Borrowed from: http://www.emacswiki.org/emacs/HideShow"
|
||||
(interactive "P")
|
||||
(if hs-minor-mode
|
||||
(if (condition-case nil
|
||||
(hs-toggle-hiding)
|
||||
(error t))
|
||||
(hs-show-all))
|
||||
(siren-toggle-selective-display column)))
|
||||
|
||||
(defun siren-toggle-selective-display (column)
|
||||
"Helper function for `siren-toggle-hiding'."
|
||||
(interactive "P")
|
||||
(set-selective-display
|
||||
(or column
|
||||
(unless selective-display
|
||||
(1+ (current-column))))))
|
||||
|
||||
(defun siren-rename-file-and-buffer ()
|
||||
"Rename the current buffer and file it is visiting.
|
||||
|
||||
|
||||
38
modules/siren-folding.el
Normal file
38
modules/siren-folding.el
Normal file
@@ -0,0 +1,38 @@
|
||||
;;; siren-folding.el --- jimeh's Emacs Siren: folding configuration.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for folding code.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(siren-require-packages '(hideshowvis))
|
||||
|
||||
(require 'hideshowvis)
|
||||
|
||||
(defun siren-toggle-hiding (column)
|
||||
"Toggle hiding/showing blocks via hs-mode.
|
||||
|
||||
Borrowed from: http://www.emacswiki.org/emacs/HideShow"
|
||||
(interactive "P")
|
||||
(if hs-minor-mode
|
||||
(if (condition-case nil
|
||||
(hs-toggle-hiding)
|
||||
(error t))
|
||||
(hs-show-all))
|
||||
(siren-toggle-selective-display column)))
|
||||
|
||||
(defun siren-toggle-selective-display (column)
|
||||
"Helper function for `siren-toggle-hiding'."
|
||||
(interactive "P")
|
||||
(set-selective-display
|
||||
(or column
|
||||
(unless selective-display
|
||||
(1+ (current-column))))))
|
||||
|
||||
;; Keybindings
|
||||
(global-set-key (kbd "C-=") 'siren-toggle-selective-display)
|
||||
(global-set-key (kbd "C-c C-h") 'siren-toggle-hiding)
|
||||
|
||||
(provide 'siren-folding)
|
||||
;;; siren-folding.el ends here
|
||||
@@ -34,10 +34,6 @@
|
||||
;; Toggle auto-fill-mode.
|
||||
(global-set-key (kbd "C-c q") 'auto-fill-mode)
|
||||
|
||||
;; Custom HideShow toggles
|
||||
(global-set-key (kbd "C-=") 'siren-toggle-selective-display)
|
||||
(global-set-key (kbd "C-\\") 'siren-toggle-hiding)
|
||||
|
||||
;; undo/redo via undo-tree
|
||||
(global-set-key (kbd "M--") 'undo-tree-undo)
|
||||
(global-set-key (kbd "M-_") 'undo-tree-redo)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
(subword-mode +1)
|
||||
(hs-minor-mode 1)
|
||||
(highlight-indentation-current-column-mode)
|
||||
(hideshowvis-enable)
|
||||
|
||||
(let ((map js2-mode-map))
|
||||
(define-key map (kbd "C-j") 'newline-and-indent)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
(subword-mode +1)
|
||||
(hs-minor-mode 1)
|
||||
(highlight-indentation-current-column-mode)
|
||||
(hideshowvis-enable)
|
||||
|
||||
(let ((map json-mode-map))
|
||||
(define-key map (kbd "C-j") 'newline-and-indent)
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
(subword-mode +1)
|
||||
(rubocop-mode 1)
|
||||
(highlight-indentation-current-column-mode)
|
||||
(hideshowvis-enable)
|
||||
|
||||
(let ((map ruby-mode-map))
|
||||
(define-key map (kbd "C-j") 'newline-and-indent)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
(hs-minor-mode 1)
|
||||
(highlight-indentation-set-offset 2)
|
||||
(highlight-indentation-current-column-mode)
|
||||
(hideshowvis-enable)
|
||||
|
||||
(let ((map web-mode-map))
|
||||
(define-key map (kbd "C-j") 'newline-and-indent)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
(require 'siren-company)
|
||||
(require 'siren-dired)
|
||||
(require 'siren-exec-path-from-shell)
|
||||
(require 'siren-folding)
|
||||
(require 'siren-full-ack)
|
||||
(require 'siren-github)
|
||||
(require 'siren-global-keybindings)
|
||||
|
||||
Reference in New Issue
Block a user