diff options
author | Martin Kühl <martin.kuehl@gmail.com> | 2015-11-20 16:42:33 +0100 |
---|---|---|
committer | sin <sin@2f30.org> | 2015-11-26 13:37:03 +0000 |
commit | d1ed0cff118a07327b3b237ea65836f5c673acbb (patch) | |
tree | af0753ee09bbf1d5e0edc9227566594f0eb7d328 /config.def.h | |
parent | d1d086d91edd89e5a8edcc3349488b3ed89f8c9d (diff) | |
download | nnn-d1ed0cff118a07327b3b237ea65836f5c673acbb.tar.gz |
Support commands specified by environment variables
Specifying commands by name in config.h means that
every time one switches ones editor (for example),
one has to modify every config.h file referencing that editor
and then recompile every corresponding program.
This change adds a string `env` for specifying an environment
variable to `struct key` and uses it to optionally specify the
command to run on SEL_{RUN,RUNARG}.
The `run` string is used as a fallback when the environment variable
has not been specified or is not set.
It also updates `config.def.h` to demonstrate this new capability.
Diffstat (limited to 'config.def.h')
-rw-r--r-- | config.def.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/config.def.h b/config.def.h index 39c1799..beae17d 100644 --- a/config.def.h +++ b/config.def.h @@ -62,8 +62,9 @@ struct key bindings[] = { { 't', SEL_MTIME }, { CONTROL('L'), SEL_REDRAW }, /* Run command */ - { '!', SEL_RUN, "sh" }, - { 'z', SEL_RUN, "top" }, + { 'z', SEL_RUN, "top" }, + { '!', SEL_RUN, "sh", "SHELL" }, /* Run command with argument */ - { 'e', SEL_RUNARG, "vi" }, + { 'e', SEL_RUNARG, "vi", "EDITOR" }, + { 'p', SEL_RUNARG, "less", "PAGER" }, }; |