From a1fc383e6ff514660a1fce87a8a867205823da04 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 29 Jul 2021 11:52:14 +0530 Subject: [PATCH] Cleanup the previous PR --- docs/glossary.rst | 11 +++++++++++ kitty/options/definition.py | 10 ++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/glossary.rst b/docs/glossary.rst index 68526c8e9..118117ac1 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -53,6 +53,17 @@ Variables that influence kitty behavior directory lookup mechanism see, :option:`kitty --config`. +.. envvar:: VISUAL + + Controls what program kitty uses as an editor, when, for instance, opening + kitty.conf in response to :sc:`edit_config_file` + + +.. envvar:: EDITOR + + Same as :envvar:`VISUAL`. Used if :envvar:`VISUAL` is not set. + + Variables that kitty sets when running child programs .. envvar:: KITTY_WINDOW_ID diff --git a/kitty/options/definition.py b/kitty/options/definition.py index dfcecea80..953a0fb1c 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -2418,11 +2418,13 @@ starts in interactive mode and reads its startup rc files. opt('editor', '.', long_text=''' The console editor to use when editing the kitty config file or similar tasks. -The default value of . means to use the environment variables :envvar:`VISUAL` +The default value of ``.`` means to use the environment variables :envvar:`VISUAL` and :envvar:`EDITOR` in that order. Note that these environment variables have -to be set when kitty starts, so if they're set in shell startup scripts but -kitty is launched directly from your desktop, kitty will not see them. In -that case you're better off naming your favorite editor here. +to be set when kitty starts, so if they're only set in shell startup scripts, but +kitty is launched directly from your desktop, kitty will not see them. kitty does try +to read the values from the shell as well, but this process is not entirely robust since +there are a myriad different shells out there. In that case you're better off naming +your favorite editor here. ''' )