Closed amithm7 closed 7 months ago
nb
previously used $EDITOR
internally, so the value in .nbrc
was originally intended to override the environment value. In recent versions there is a new $NB_EDITOR
variable that can be used, so this should work:
NB_EDITOR=code nb e file.md
So, I believe all variables in .nbrc
override environment variables.
That would mean everything set by nb set
can't be overridden!!! (or is there a way?)
This gets a little confusing:
Edit the note with \<editor>, overriding the editor specified in the
$EDITOR
environment variable.
Usage:
nb edit ([<notebook>:][<folder-path>/][<id> | <filename> | <title>])
[-c <content> | --content <content>] [--edit]
[-e <editor> | --editor <editor>] [--overwrite] [--prepend]
Options:
-e, --editor <editor> Edit the note with <editor>, overriding the editor
specified in the `$EDITOR` environment variable.
That would mean everything set by nb settings can't be overridden!!! (or is there a way?)
This only applies to $EDITOR
when set through nb set
. Other variables set through nb set
use the environment value when available. This is part of why the $NB_EDITOR
variable was added. The behavior is confusing because this particular setting is intended to override the environment variable.
This should be working now, and further improvements were made as part of #303. Let me know if you run into any more issues with it. Thanks!
Say, EDITOR is set to
vim
.And I would want to open a specific file only in VS code.
doesn't seem to work, it would still open in
vim
.