None of those hooks will apply because the buffer (and its mode) has already been created long before your add-hook happens.
I suggest you add
to your ~/.emacs instead.
This same or similar question was previously asked on stackoverflow: https://stackoverflow.com/questions/24838516/how-to-set-paragraph-spacing-in-emacs Here is a regurgitation of my prior answer:
The following code alters the visual display by adding an additional new visual line, but does not actually add new lines to the current document:
(aset (or ...
I've had this in my init.el for a while:
(defun highlight-visual-line ()
(cons (progn (beginning-of-visual-line) (point))
(progn (end-of-visual-line) (point)))))
(setq hl-line-range-function 'highlight-visual-line)
This is assuming you use (global-hl-line-mode 1) to achieve that highlighting. I probably posted this as an ...
There is no built-in functionality to provide line numbers based on visual lines. First of all, compared to buffer lines (e.g. \n, \r\n), visual lines need to get recounted on every window width-change, which can bring Emacs down to its knees. Compared to normal buffer lines, visual lines are only second-class citizens in that regard.
However, the old linum-...
I've FINALLY got solution for this, but there is not related with line numbers.
All what I've done is just set another functions to j, k for evil. And it works almost perfect.
God, I'm sooo happy now.
There is solution for spacemacs
Thanks to @DoMiNeLa10's advice. I tried to add a local hook for text-scale-mode, it does work.
(defun my/text-scale-mode-hook ()
The docs for global-visual-line-mode say:
If called from Lisp, toggle the mode if ARG is ‘toggle’.
Enable the mode if ARG is nil, omitted, or is a positive number.
Disable the mode if ARG is a negative number.
I've figured it out! You can use save-excursion to get the position of the n-th visual line
(defun get-visual-line-start (n)
"Get the character position of the 'nth' visual line, serving as the visual line number."
; (end-of-visual-line) ; for the end of the line instead
I have found a way after exploring all evil- functions:
My first idea was to use:
But it leaves the buffer in insert mode with no possibility to go back to normal mode.
Edit: I have come to another way of doing it:
;; .spacemacs file
(defun my/function (beg end)
;; To work with visual selection:
The doc string of whitespace-newline-mode (C-h f whitespace-newline-mode) 'includes:
(whitespace-newline-mode &optional ARG)
Toggle newline visualization (Whitespace Newline mode).
With a prefix argument ARG, enable Whitespace Newline mode if ARG
is positive, and disable it otherwise.
If called from Lisp, also enables the mode if ARG is ...
This is commonly referred to as "code foldlng" or just "folding". There are several packages that implement this behavior, and each one displays folded and foldable code in their own way, which may not be graphical. Remember, Emacs has deep roots in text, and graphic bells are whistles are still "new". Your favorite search engine should help you out, but ...
If you are on the develop branch - check to see if an adaptive-wrap is installed by checking if the corresponding folder is actually in your ~/.emacs.d/elpa/26.2/develop directory (modulo versions). If it is missing, then install it by editing your .spacemacs file and adding it to the dotspacemacs-additional-packages in defun dotspacemacs/layers.
Then, the ...