evil
evil copied to clipboard
'evil-respect-visual-line-mode' should also change other normal mode commands
Issue type
- Enhancement request
Environment
Emacs version: GNU Emacs 26.2 (build 1, x86_64-apple-darwin18.5.0, NS appkit-1671.40 Version 10.14.4 (Build 18E226)) of 2019-04-18
Operating System: macOS Mojave 10.14.5
Evil version: Evil version evil-git-4ac94f9
Evil installation type: straight.el
Graphical/Terminal: Graphical
Reproduction steps
- Start Emacs
- Enable
visual-line-mode
. - Set
evil-respect-visual-line-mode
to non-nil value. - Write a very long line so that visually appears to be 2 or more lines.
- Suppose you want to change the current line, either by doing
cc
,dd
or insert at the beginning withI
. - All visual lines are affected by the command.
Expected behavior
- Only the visual line in which the command is executed should be affected.
-
dd
should delete the current visual line, not all lines. -
cc
should change the current visual line, not all lines. -
I
should insert at the beginning of the current visual line, not at the beginning of paragraph (which is in fact a single "physical" line). -
A
should insert at the end of the current visual line, not at the end of paragraph ("physical" long line appears to be a paragraph). -
V
should select the current visual line, not all visual paragraph.
-
Actual behavior
- All the commands affect the whole paragraph as if it were a single line, which in fact it is a single line but by setting
evil-respect-visual-line-mode
I would expect for evil to treat them as visual lines. -
evil-respect-visual-line-mode
only affects motion commands, it should affectI
,A
,cc
,dd
,V
also.
Looks like #1171 partially fixes this issue.
Apologies for chiming in on an old issue, but I thought this was something worth noting. In native Vim, I
and A
cannot operate on the visual line. The sort of behaviour that evil-respect-visual-line-mode
is trying to achieve is often done with swapping gj
and j
etc, e.g. via vim-pencil. This means that native vimmers who prefer wrapped lines with visual line movement will not be expecting I
and A
to append to the visual line. If the goal is to emulate vim as accurately as possible, this may be an important consideration. (Personally, I support all of this issue except changing the behaviour of I
and A
)
For anyone with the same problem, there is a workaroud for this using general.el
(general-evil-setup t)
(general-nmap "c" (general-key-dispatch 'evil-change
"c" 'my-evil-change-whole-line))
(general-vmap "c" 'evil-change))