How to edit file from less
+3
−1
MWE
touch d
less d
# jump to editing d without leaving less
Question
Is there a way to edit a file from viewing it in less
?
Jumping straight into Vim would be preferred, but an answer for emacs as well would be thorough.
1 answer
+4
−0
Works for me
The following users marked this post as Works for me:
User | Comment | Date |
---|---|---|
mcp | (no comment) | Jul 22, 2022 at 18:34 |
You can edit the file you see in less by pressing v
. From the man page:
v Invokes an editor to edit the current file being viewed. The
editor is taken from the environment variable VISUAL if defined,
or EDITOR if VISUAL is not defined, or defaults to "vi" if nei‐
ther VISUAL nor EDITOR is defined. See also the discussion of
LESSEDIT under the section on PROMPTS below.
1 comment thread