I want to be able to toggle soft-wrapped lines in org-mode. My .emacs
file has this code:
;;;;;;;;;;;;;;
;; Org Mode ;;
;;;;;;;;;;;;;;
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-iswitchb)
;; Start-up with soft-wrap enabled
(setq org-startup-truncated nil) ; This works
;; Toggle soft-wrap with super-q
(define-key org-mode-map "s-q" 'toggle-truncate-lines) ; This doesn't
I would like to map it to something like super-q
or F7
. Is there something wrong with my syntax? Neither works.
(setq truncate-lines nil)
equals wrap.(setq truncate-lines t)
equals don't wrap. You can make a function(defun () "doc-string" (interactive) (message "This is my function))
. You can make a keyboard shortcut . . . . Have fun exploring the possibilities and enjoy your Emacs experience. If you want to break words at word-boundaries at the window edge, then useword-wrap t
(global-set-key (kbd "s-q") 'toggle-truncate-lines)
seems to work for toggling it, but I'm not sure if that is the best way.truncate-lines
and the optionalword-wrap
. You may also enjoy usingM-x visual-line-mode
to toggle on and off.