mirror of
https://github.com/larstvei/dot-emacs.git
synced 2024-11-26 07:28:31 +00:00
Added some bindings and added an advise to mu4e.
This commit is contained in:
parent
8f6f8558e7
commit
83f5c247fe
20
init.el
20
init.el
@ -214,7 +214,11 @@ PACKAGE is installed and the current version is deleted."
|
||||
|
||||
;; Register file types that can be handled by ImageMagick.
|
||||
(when (fboundp 'imagemagick-register-types)
|
||||
(imagemagick-register-types))))
|
||||
(imagemagick-register-types))
|
||||
|
||||
;; Overwrite the native 'compose-mail' binding to 'mu4e'.
|
||||
(global-set-key (kbd "C-x m") 'mu4e)
|
||||
))
|
||||
|
||||
(add-hook 'text-mode-hook 'turn-on-flyspell)
|
||||
|
||||
@ -267,6 +271,13 @@ PACKAGE is installed and the current version is deleted."
|
||||
(whitespace-cleanup)
|
||||
(untabify beg (if (< end (point-max)) end (point-max)))))
|
||||
|
||||
(defadvice mu4e (after show-only-mu4e (background) activate)
|
||||
"When evoking the mu4e command, delete all other windows. If
|
||||
BACKGROUND is non-nil we don't want to change the functions
|
||||
behaviour."
|
||||
(unless background
|
||||
(delete-other-windows)))
|
||||
|
||||
(global-set-key (kbd "C-'") 'er/expand-region)
|
||||
(global-set-key (kbd "C-;") 'er/contract-region)
|
||||
|
||||
@ -278,6 +289,10 @@ PACKAGE is installed and the current version is deleted."
|
||||
|
||||
(global-set-key (kbd "C-c SPC") 'ace-jump-mode)
|
||||
|
||||
(global-set-key (kbd "<M-S-up>") 'move-text-up)
|
||||
(global-set-key (kbd "<M-S-down>") 'move-text-down)
|
||||
|
||||
(global-set-key (kbd "C-c s") 'ispell-word)
|
||||
(global-set-key (kbd "C-c t") 'org-agenda-list)
|
||||
(global-set-key (kbd "C-x k") 'kill-this-buffer)
|
||||
(global-set-key (kbd "C-x C-r") 'recentf-ido-find-file)
|
||||
@ -287,9 +302,6 @@ PACKAGE is installed and the current version is deleted."
|
||||
(global-set-key (kbd "C-c d") 'duplicate-thing)
|
||||
(global-set-key (kbd "<C-tab>") 'tidy)
|
||||
|
||||
(global-set-key (kbd "<M-S-up>") 'move-text-up)
|
||||
(global-set-key (kbd "<M-S-down>") 'move-text-down)
|
||||
|
||||
(defadvice eval-last-sexp (around replace-sexp (arg) activate)
|
||||
"Replace sexp when called with a prefix argument."
|
||||
(if arg
|
||||
|
34
init.org
34
init.org
@ -403,7 +403,11 @@
|
||||
|
||||
;; Register file types that can be handled by ImageMagick.
|
||||
(when (fboundp 'imagemagick-register-types)
|
||||
(imagemagick-register-types))))
|
||||
(imagemagick-register-types))
|
||||
|
||||
;; Overwrite the native 'compose-mail' binding to 'mu4e'.
|
||||
(global-set-key (kbd "C-x m") 'mu4e)
|
||||
))
|
||||
#+END_SRC
|
||||
|
||||
** Flyspell
|
||||
@ -510,6 +514,18 @@
|
||||
(untabify beg (if (< end (point-max)) end (point-max)))))
|
||||
#+END_SRC
|
||||
|
||||
When browsing mail with =mu4e= I find it best not to have other windows
|
||||
visible.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle yes
|
||||
(defadvice mu4e (after show-only-mu4e (background) activate)
|
||||
"When evoking the mu4e command, delete all other windows. If
|
||||
BACKGROUND is non-nil we don't want to change the functions
|
||||
behaviour."
|
||||
(unless background
|
||||
(delete-other-windows)))
|
||||
#+END_SRC
|
||||
|
||||
** Key bindings
|
||||
|
||||
Bindings for [[https://github.com/magnars/expand-region.el][expand-region]].
|
||||
@ -539,9 +555,17 @@
|
||||
(global-set-key (kbd "C-c SPC") 'ace-jump-mode)
|
||||
#+END_SRC
|
||||
|
||||
Bindings for =move-text=.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle yes
|
||||
(global-set-key (kbd "<M-S-up>") 'move-text-up)
|
||||
(global-set-key (kbd "<M-S-down>") 'move-text-down)
|
||||
#+END_SRC
|
||||
|
||||
Bind some native Emacs functions.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle yes
|
||||
(global-set-key (kbd "C-c s") 'ispell-word)
|
||||
(global-set-key (kbd "C-c t") 'org-agenda-list)
|
||||
(global-set-key (kbd "C-x k") 'kill-this-buffer)
|
||||
(global-set-key (kbd "C-x C-r") 'recentf-ido-find-file)
|
||||
@ -556,13 +580,6 @@
|
||||
(global-set-key (kbd "<C-tab>") 'tidy)
|
||||
#+END_SRC
|
||||
|
||||
Bindings for =move-text=.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp :tangle yes
|
||||
(global-set-key (kbd "<M-S-up>") 'move-text-up)
|
||||
(global-set-key (kbd "<M-S-down>") 'move-text-down)
|
||||
#+END_SRC
|
||||
|
||||
** Advice
|
||||
|
||||
An advice can be given to a function to make it behave differently. This
|
||||
@ -787,4 +804,3 @@
|
||||
#+BEGIN_SRC emacs-lisp :tangle yes
|
||||
(add-to-list 'auto-mode-alist '("\\.m$" . octave-mode))
|
||||
#+END_SRC
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user