The great config remake.
I decided to go back to the basics with this one. Only the packages I think I *REALLY* need (or want) are left, the rest are replaced by the built-in alternatives or even better, removed.
This commit is contained in:
@@ -7,45 +7,6 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defun my-resize-margins-to-fill ()
|
||||
"Set the current buffer margins so that its width is equal to the fill
|
||||
column."
|
||||
(interactive)
|
||||
(let ((margin-size (/ (- (frame-width) fill-column) 2)))
|
||||
(set-window-margins nil margin-size margin-size)))
|
||||
|
||||
(defun my-reset-margins ()
|
||||
"Removes margins from the current buffer."
|
||||
(interactive)
|
||||
(set-window-margins nil nil nil))
|
||||
|
||||
(defun my-insert-buffer-name ()
|
||||
"Inserts the name of the current buffer at point."
|
||||
(interactive)
|
||||
(let ((name (buffer-name)))
|
||||
(insert name)))
|
||||
|
||||
(defun my-create-org-fc-word-card ()
|
||||
"Inserts and initialzes an org-fc double card with a word and its
|
||||
translation at point."
|
||||
(interactive)
|
||||
(let* ((engw (read-from-minibuffer "Enter English word: "))
|
||||
(rusw (read-from-minibuffer "Enter Russian word: ")))
|
||||
(insert "* " engw)
|
||||
(newline)
|
||||
(insert rusw)
|
||||
(previous-line)
|
||||
(org-fc-type-double-init)))
|
||||
|
||||
(keymap-set org-mode-map "C-c C-n" 'my-create-org-fc-word-card)
|
||||
|
||||
(setq margins-map (make-sparse-keymap))
|
||||
(keymap-set margins-map "f" 'my-resize-margins-to-fill)
|
||||
(keymap-set margins-map "r" 'my-reset-margins)
|
||||
|
||||
(keymap-set mode-specific-map "C-m" margins-map)
|
||||
(keymap-set mode-specific-map "b" 'my-insert-buffer-name)
|
||||
|
||||
(defun my-preview-macro-expansion (arg)
|
||||
"Previews the expansion of a macro in a temporary window.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user