mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
chore: cleanup code
This commit is contained in:
parent
38b7687b5c
commit
9dc9a1fe1b
7 changed files with 1517 additions and 1621 deletions
|
|
@ -247,6 +247,27 @@ create a new one."
|
|||
(python-shell-send-region (region-beginning) (region-end))
|
||||
(python-shell-switch-to-shell))
|
||||
|
||||
(defun swarsel/prefix-block (start end)
|
||||
(interactive "r")
|
||||
(save-excursion
|
||||
(goto-char start)
|
||||
(setq start (line-beginning-position))
|
||||
(goto-char end)
|
||||
(setq end (line-end-position))
|
||||
(let ((common-prefix (save-excursion
|
||||
(goto-char start)
|
||||
(if (re-search-forward "^\\([^.\n]+\\)\\." end t)
|
||||
(match-string 1)
|
||||
(error "No common prefix found")))))
|
||||
(save-excursion
|
||||
(goto-char start)
|
||||
(insert common-prefix " = {\n")
|
||||
(goto-char (+ end (length common-prefix) 6))
|
||||
(insert "};\n")
|
||||
(goto-char start)
|
||||
(while (re-search-forward (concat "^" (regexp-quote common-prefix) "\\.") end t)
|
||||
(replace-match ""))))))
|
||||
|
||||
;; Make ESC quit prompts
|
||||
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
||||
|
||||
|
|
@ -475,6 +496,9 @@ create a new one."
|
|||
(set-face-attribute 'highlight-indent-guides-stack-even-face nil :background "gray40")
|
||||
(set-face-attribute 'highlight-indent-guides-stack-odd-face nil :background "gray50"))
|
||||
|
||||
(use-package aggressive-indent)
|
||||
(global-aggressive-indent-mode 1)
|
||||
|
||||
(setq mouse-wheel-scroll-amount
|
||||
'(1
|
||||
((shift) . 5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue