blob: 866cdd2bb9f02e34b0652402525fa99fa3f9ad5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
;; Time-stamp: <2024-07-13 15h08 CEST (471b3659)>
(setq time-stamp-active t
time-stamp-line-limit 3
time-stamp-format "%Y-%02m-%02d %02Hh%02M %Z (%s)")
(add-hook 'before-save-hook #'time-stamp)
(defun insert-timestamp ()
(interactive)
(save-excursion
(goto-char (point-min))
(unless (search-forward "Time-stamp: "
(line-beginning-position (1+ time-stamp-line-limit))
t)
(goto-char (point-min))
(newline)
(beginning-of-line 0)
(comment-dwim nil)
(insert (concat "Time-stamp: " "<>"))
(newline))
(time-stamp)))
(global-set-key (kbd "C-x t") 'insert-timestamp)
(global-set-key (kbd "C-z") 'nil)
(use-package eterm-256color
:ensure
:defer
:config
(add-hook 'term-mode-hook #'eterm-256color-mode)
(global-set-key (kbd "C-c c") 'ansi-term))
(global-set-key (kbd "C-x e") 'eval-expression)
(global-set-key (kbd "M-i") 'indent-region)
;; -----------------------------------------------------------------------------
;; Killing
(global-set-key (kbd "C-c C-k") 'kill-whole-line)
(global-set-key (kbd "M-z") 'zap-up-to-char)
(defun better-backward-kill-word (arg)
(interactive "p")
(if (region-active-p) (kill-region 0 0 t)
(backward-kill-word arg)))
(global-set-key (kbd "M-h") 'better-backward-kill-word)
(global-set-key (kbd "M-<Backspace>") 'better-backward-kill-word)
;; -----------------------------------------------------------------------------
;; Line entry
(defun vi-open-line-below ()
"Insert a newline below the current line and put point at beginning."
(interactive)
(unless (eolp)
(end-of-line))
(newline-and-indent))
(global-set-key (kbd "M-o") 'vi-open-line-below)
;; -----------------------------------------------------------------------------
;; Zoom! Enhance!
(global-set-key (kbd "M-C-+") 'text-scale-increase)
(global-set-key (kbd "M-C--") 'text-scale-decrease)
|