GNU bug report logs - #77438
[FEATURE REQUEST] Freely positioning the cursor anywhere in the buffer (Vim’s virtualedit=all Equivalent in Emacs)

Previous Next

Package: emacs;

Reported by: James Cherti <contact <at> jamescherti.com>

Date: Tue, 1 Apr 2025 20:03:02 UTC

Severity: wishlist

Full log


Message #8 received at 77438 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: James Cherti <contact <at> jamescherti.com>
Cc: 77438 <at> debbugs.gnu.org
Subject: Re: bug#77438: [FEATURE REQUEST] Freely positioning the cursor
 anywhere
 in the buffer (Vim’s virtualedit=all Equivalent in
 Emacs)
Date: Wed, 02 Apr 2025 14:39:50 +0300
> Date: Tue, 1 Apr 2025 16:02:39 -0400
> From: James Cherti <contact <at> jamescherti.com>
> 
> Implementing an Emacs equivalent of Vim's `set virtualedit=all`
> feature would be interesting, especially for editing
> indentation-sensitive file types like YAML or Python.
> 
> In Vim, the `set virtualedit=all` setting allows the cursor to move
> freely to any position in the text, even beyond the end of lines and
> after the last line of the file. This differs from the default
> behavior, where the cursor is constrained to valid text positions.
> 
> Unlike Vim's `virtualedit=all` mode, Emacs' quarter-plane,
> picture-mode, and artist-mode packages insert actual spaces into the
> buffer. In contrast, Vim’s `set virtualedit=all` allows the cursor to
> be placed in positions where no text exists, but real spaces are not
> added until a character is typed.
> 
> This distinction is important because, in `virtualedit=all`, the
> absence of real spaces ensures that the undo/redo history remains
> unaffected by cursor movements alone.

Can't one do this using overlays instead of inserting spaces?

But eventually, you'd need to insert spaces, if you actually type
something wherever you move cursor.  So maybe an easier way is to use
picture-mode after forcing undo to not record some commands for a
period.  (Not that I understand why not touching the undo history is
such a big deal.)




This bug report was last modified 75 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.