summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2017-03-07 03:48:58 (GMT)
committerAssaf Gordon <assafgordon@gmail.com>2017-03-07 03:51:01 (GMT)
commit5eb60f048a4463c9b3cedb4ff1115431c7e62054 (patch)
tree738e5c4966cff5a3cdf667a9b469ea09459526c7
parent210baa0ddb70eaf6622162de867730fe4dbc0bb7 (diff)
downloaddot-files-5eb60f048a4463c9b3cedb4ff1115431c7e62054.zip
dot-files-5eb60f048a4463c9b3cedb4ff1115431c7e62054.tar.gz
dot-files-5eb60f048a4463c9b3cedb4ff1115431c7e62054.tar.bz2
emacs: add concat-lines (C-c J) and FlySpell (F8)
-rw-r--r--emacs36
1 files changed, 35 insertions, 1 deletions
diff --git a/emacs b/emacs
index 0e92241..2366b1b 100644
--- a/emacs
+++ b/emacs
@@ -13,7 +13,8 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(browse-url-browser-function (quote browse-url-chromium))
- '(markdown-command "pandoc -f markdown -t html"))
+ '(markdown-command "pandoc -f markdown -t html")
+ '(package-selected-packages (quote (markdown-mode markdown-mode+ markdown-toc bm))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@@ -118,3 +119,36 @@
(setq mac-command-modifier 'control)
(global-set-key [kp-delete] 'delete-char) ;; sets fn-delete to be right-delete
)
+
+; Concatenate lines like VIM (pull next line up)
+; instead of Emacs's M-^ (move current line up)
+; Shortcut: C-c j
+; http://stackoverflow.com/a/33005183
+(defun concat-lines ()
+ (interactive)
+ (next-line)
+ (join-line)
+ (delete-horizontal-space))
+(defun concat-lines2 (arg)
+ (interactive "p")
+ (end-of-line)
+ (delete-char 1)
+ (delete-horizontal-space)
+ (insert " "))
+(global-set-key (kbd "C-c j") 'concat-lines2)
+
+
+;; FlySpell
+;; https://www.emacswiki.org/emacs/FlySpell
+;; easy spell check
+(global-set-key (kbd "<f8>") 'ispell-word)
+(global-set-key (kbd "C-S-<f8>") 'flyspell-mode)
+(global-set-key (kbd "C-M-<f8>") 'flyspell-buffer)
+(global-set-key (kbd "C-<f8>") 'flyspell-check-previous-highlighted-word)
+(defun flyspell-check-next-highlighted-word ()
+ "Custom function to spell check next highlighted word"
+ (interactive)
+ (flyspell-goto-next-error)
+ (ispell-word)
+ )
+(global-set-key (kbd "M-<f8>") 'flyspell-check-next-highlighted-word)