This commit is contained in:
Thomas von Dein
2017-07-11 21:15:32 +02:00
parent fae70fb394
commit c443bda869
2 changed files with 677 additions and 632 deletions

50
.emacs
View File

@@ -1,4 +1,4 @@
;; Toms Emacs Config - portable - version (20170711.01) -*-emacs-lisp-*- ;; Toms Emacs Config - portable - version (20170711.02) -*-emacs-lisp-*-
;; * Introduction ;; * Introduction
;; This is my emacs config, it is more than twenty years old. It ;; This is my emacs config, it is more than twenty years old. It
@@ -47,7 +47,6 @@
;; - fixed tabs ;; - fixed tabs
;; - reorganized keys ;; - reorganized keys
;; - added new goto line func ;; - added new goto line func
;; - rm open-line-below
;; 20160421.01: ;; 20160421.01:
;; - added smex ;; - added smex
@@ -523,6 +522,10 @@
;; - fixed kill-all-buffers: restore scratch after killing all buffers ;; - fixed kill-all-buffers: restore scratch after killing all buffers
;; - do not ask to save abbrevs on exit anymore ;; - do not ask to save abbrevs on exit anymore
;; - reformat changelog ;; - reformat changelog
;; - rm open-line-below
;; 20170711.02:
;; - fixed POD abbrevs, added way to move point after expansion
;; ** TODO ;; ** TODO
@@ -550,7 +553,7 @@
;; My emacs config has a version (consisting of a timestamp with a ;; My emacs config has a version (consisting of a timestamp with a
;; serial), which I display in the mode line. So I can clearly see, if ;; serial), which I display in the mode line. So I can clearly see, if
;; I'm using an outdated config somewhere. ;; I'm using an outdated config somewhere.
(defvar tvd-emacs-version "20170711.01") (defvar tvd-emacs-version "20170711.02")
;; -------------------------------------------------------------------------------- ;; --------------------------------------------------------------------------------
@@ -1013,6 +1016,8 @@ to next buffer otherwise."
(with-current-buffer (get-buffer-create "*text*") (with-current-buffer (get-buffer-create "*text*")
(text-mode)) (text-mode))
(setq initial-buffer-choice '(get-buffer "*text*"))
;; * Global Key Bindings ;; * Global Key Bindings
;; -------------------------------------------------------------------------------- ;; --------------------------------------------------------------------------------
;; ** c-h != delete ;; ** c-h != delete
@@ -2021,8 +2026,6 @@ col1, col2"
;; Source: [[https://github.com/renormalist/emacs-pod-mode][emacs-pod-mode]] ;; Source: [[https://github.com/renormalist/emacs-pod-mode][emacs-pod-mode]]
(require 'pod-mode) (require 'pod-mode)
(require 'cc-mode)
(add-to-list 'auto-mode-alist '("\\.pod$" . pod-mode)) (add-to-list 'auto-mode-alist '("\\.pod$" . pod-mode))
(add-hook 'pod-mode-hook 'font-lock-mode) (add-hook 'pod-mode-hook 'font-lock-mode)
@@ -2053,6 +2056,16 @@ col1, col2"
(interactive) (interactive)
(tvd-outline-emphasize ?C)) (tvd-outline-emphasize ?C))
;; enhance abbrevs and jump into expanded area to the
;; $ character (if it exists), which it also removes
(setq tvd-abbrev-pos 0)
(advice-add 'expand-abbrev :before
'(lambda () (setq tvd-abbrev-pos (point))))
(advice-add 'expand-abbrev :after
'(lambda ()
(when (re-search-backward "\\$" (- tvd-abbrev-pos 0))
(delete-char 1))))
;; pod mode config ;; pod mode config
(add-hook 'pod-mode-hook (add-hook 'pod-mode-hook
(lambda () (lambda ()
@@ -2064,14 +2077,19 @@ col1, col2"
(setq outline-heading-alist '(("=head1" . 1) (setq outline-heading-alist '(("=head1" . 1)
("=head2" . 2) ("=head2" . 2)
("=head3" . 3) ("=head3" . 3)
("=head4" . 4))) ("=head4" . 4)
("=over" . 5)
("=item" . 6)
("=begin" . 5)
("=pod" . 5)
))
;; outline alone, however, works well ;; outline alone, however, works well
(outline-minor-mode) (outline-minor-mode)
;; my own abbrevs for POD using mode-specific abbrev table ;; my own abbrevs for POD using mode-specific abbrev table
(c-define-abbrev-table 'pod-mode-abbrev-table '( (define-abbrev-table 'pod-mode-abbrev-table '(
("=o" "=over\n\n=item\n\n=back\n\n") ("=o" "=over\n\n=item *$\n\n=back\n\n")
("=i" "=item ") ("=i" "=item ")
("=h1" "=head1 ") ("=h1" "=head1 ")
("=h2" "=head2 ") ("=h2" "=head2 ")
@@ -2080,20 +2098,20 @@ col1, col2"
("=c" "=cut") ("=c" "=cut")
("=b" "=begin") ("=b" "=begin")
("=e" "=end") ("=e" "=end")
("b" "B<>") ("b" "B<$>")
("c" "C<>") ("c" "C<$>")
("l" "L<>") ("l" "L<$>")
("i" "I<>") ("i" "I<$>")
("e" "E<>") ("e" "E<$>")
("f" "F<>")) ("f" "F<$>"))
"POD mode abbreviations, see .emacs") "POD mode abbreviations, see .emacs")
(abbrev-table-put pod-mode-abbrev-table :case-fixed t) (abbrev-table-put pod-mode-abbrev-table :case-fixed t)
(abbrev-table-put pod-mode-abbrev-table :system t) (abbrev-table-put pod-mode-abbrev-table :system t)
;; enable abbreviations ;; enable abbreviations
(setq local-abbrev-table pod-mode-abbrev-table (setq local-abbrev-table pod-mode-abbrev-table)
abbrev-mode t) (abbrev-mode 1)
;; POD easy formatting ;; POD easy formatting
(local-set-key (kbd "C-c b") 'pod-bold) (local-set-key (kbd "C-c b") 'pod-bold)

1249
emacs.html

File diff suppressed because it is too large Load Diff