summaryrefslogtreecommitdiff
path: root/emacs/inits/70-global-keybinds.el
blob: 92ae2fe14ed0ffdd7c2bba46ed1bb074d6f85018 (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
;; Time-stamp: <2019-08-25 21:44:55 (tslil@basingstoke)>

(setq time-stamp-active t
      time-stamp-line-limit 3
      time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u@%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 "<f11>") 'notmuch)
(global-set-key (kbd "C-x m") 'eshell)
(global-set-key (kbd "C-c c") 'shell)
(global-set-key (kbd "C-x e") 'eval-expression)

(global-set-key (kbd "M-i") 'indent-region)

(global-set-key (kbd "C-v") 'delete-indentation)