Skip to content
This repository was archived by the owner on May 2, 2024. It is now read-only.

Commit ae9f2c3

Browse files
committed
Change environmentVariable to name
1 parent d7800c5 commit ae9f2c3

File tree

30 files changed

+478
-502
lines changed

30 files changed

+478
-502
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ const plugin: Fig.Plugin = {
222222
{
223223
// How should this appear in ~/.zshrc?
224224
type: "environmentVariable",
225-
environmentVariable: "ZSH_THEME",
225+
name: "ZSH_THEME",
226226

227227
// How should this appear for the end user?
228228
displayName: "Theme"

index.d.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ declare namespace Fig {
9898
/** The default value of the multiselect field */
9999
default: T;
100100
/** A list of options to display in the multiselect field */
101-
options: Suggestions<S | { option: S, description: string }>;
101+
options: Suggestions<S | { option: S, displayName?: string, description?: string }>;
102102
}
103103
: never;
104104

@@ -109,7 +109,7 @@ declare namespace Fig {
109109
/** The default value of the select field */
110110
default: T;
111111
/** A list of options to display in the select field */
112-
options: Suggestions<T | { option: T, description: string }>;
112+
options: Suggestions<T | { option: T, displayName?: string; description?: string }>;
113113
};
114114

115115
type TextUI<T> = {
@@ -175,8 +175,7 @@ declare namespace Fig {
175175
type EnvironmentVariableItemForType<V, U extends UIType> = ConfigurationInterface &
176176
UI<V, U> & {
177177
type: "environmentVariable";
178-
environmentVariable: string;
179-
name?: string;
178+
name: string;
180179
compile?: DotfileCompiler<V, CompiledEnvironmentVariable>;
181180
// Syntactic sugar to compile as environment variable vs shell variable.
182181
export?: boolean;

plugins/autoenv_zpm-zsh/README.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,3 @@ source $(dirname $0)/.env*
7373

7474
If you don't use [zpm](https://github.com/zpm-zsh/zpm), install it manually and activate it before this plugin.
7575
If you use zpm you don’t need to do anything
76-
77-
78-
## Installation
79-
80-
### Using [zpm](https://github.com/zpm-zsh/zpm)
81-
82-
Add `zpm load zpm-zsh/autoenv` into `.zshrc`
83-
84-
### Using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
85-
86-
Execute `git clone https://github.com/zpm-zsh/autoenv ~/.oh-my-zsh/custom/plugins/autoenv`. Add `autoenv` into plugins array in `.zshrc`
87-
88-
### Using [antigen](https://github.com/zsh-users/antigen)
89-
90-
Add `antigen bundle zpm-zsh/autoenv` into `.zshrc`
91-
92-
### Using [zgen](https://github.com/tarjoilija/zgen)
93-
94-
Add `zgen load zpm-zsh/autoenv` into `.zshrc`
95-

plugins/autoenv_zpm-zsh/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const plugin: Fig.Plugin = {
1212
github: "zpm-zsh/autoenv",
1313
license: ["GPL-3.0"],
1414
shells: ["zsh"],
15-
categories: ["Other"],
15+
categories: ["Productivity Hack"],
1616
keywords: [
1717
"zsh",
1818
"plugin",

plugins/enhancd/index.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,56 +46,56 @@ const plugin: Fig.Plugin = {
4646
},
4747
configuration: [
4848
{
49-
name: "Command name",
49+
displayName: "Command name",
5050
description: "Change the command name of enhancd `cd`",
5151
type: "environmentVariable",
52-
environmentVariable: "ENHANCD_COMMAND",
52+
name: "ENHANCD_COMMAND",
5353
interface: "text",
5454
default: "cd",
5555
},
5656
{
57-
name: "Filter executable",
57+
displayName: "Filter executable",
5858
description:
5959
"Specify the path of 3rd party filtering executable, like `fzf` or `peco`",
6060
additionalDetails:
6161
"The ENHANCD_FILTER is an environment variable. It looks exactly like the PATH variable containing with many different filters concatenated using '`:`'.",
6262
type: "environmentVariable",
63-
environmentVariable: "ENHANCD_FILTER",
63+
name: "ENHANCD_FILTER",
6464
interface: "text",
6565
default: "",
6666
},
6767
{
68-
name: "Shell hook after cd",
68+
displayName: "Shell hook after cd",
6969
description: "You can run any commands after changing directory.",
7070
additionalDetails:
7171
"(e.g. Setting this value to `ls` will trigger behavior similiar to `cd && ls`)",
7272
type: "environmentVariable",
73-
environmentVariable: "ENHANCD_HOOK_AFTER_CD",
73+
name: "ENHANCD_HOOK_AFTER_CD",
7474
interface: "text",
7575
default: "",
7676
},
7777
{
78-
name: "Using Fuzzy Match",
78+
displayName: "Using Fuzzy Match",
7979
type: "environmentVariable",
80-
environmentVariable: "ENHANCD_USE_FUZZY_MATCH",
80+
name: "ENHANCD_USE_FUZZY_MATCH",
8181
interface: "toggle",
8282
default: true,
8383
},
8484
{
8585
displayName: "Double Dot (cd ..)",
8686
configuration: [
8787
{
88-
name: "Disable filtering on double dot (..)",
88+
displayName: "Disable filtering on double dot (..)",
8989
description:
9090
"If you don't want to use the interactive filter, when specifing a double dot (`..`)",
9191
type: "environmentVariable",
92-
environmentVariable: "ENHANCD_DISABLE_DOT",
92+
name: "ENHANCD_DISABLE_DOT",
9393
interface: "toggle",
9494
default: false,
9595
compile: (value) => (value ? "1" : "0"),
9696
},
9797
{
98-
name: "Double dot behavior",
98+
displayName: "Double dot behavior",
9999
description: "You can customize the double-dot (`..`) argument",
100100
additionalDetails: `
101101
If you set this variable any but \`..\`, it gives you the _double-dot_ behavior with that argument; i.e. upward search of directory hierarchy.
@@ -104,7 +104,7 @@ const plugin: Fig.Plugin = {
104104
In other words, you can keep original \`cd ..\` behavior by this option.
105105
`,
106106
type: "environmentVariable",
107-
environmentVariable: "ENHANCD_DOT_ARG",
107+
name: "ENHANCD_DOT_ARG",
108108
interface: "text",
109109
default: "..",
110110
},
@@ -114,17 +114,17 @@ const plugin: Fig.Plugin = {
114114
displayName: "Hyphen (cd -)",
115115
configuration: [
116116
{
117-
name: "Disable filtering on hyphen",
117+
displayName: "Disable filtering on hyphen",
118118
description:
119119
"If you don't want to use the interactive filter, when specifing a hyphen as the argument to `cd`",
120120
type: "environmentVariable",
121-
environmentVariable: "ENHANCD_DISABLE_HYPHEN",
121+
name: "ENHANCD_DISABLE_HYPHEN",
122122
interface: "toggle",
123123
default: false,
124124
compile: (value) => (value ? "1" : "0"),
125125
},
126126
{
127-
name: "Hyphen behavior",
127+
displayName: "Hyphen behavior",
128128
description: "You can customize the hyphen (-) argument for enha.",
129129
additionalDetails: `
130130
If you set this variable any but \`-\`, it gives you the _hyphen_ behavior with that argument; i.e. backward search of directory-change history.
@@ -133,17 +133,17 @@ const plugin: Fig.Plugin = {
133133
In other words, you can keep original \`cd -\` behavior by this option.
134134
`,
135135
type: "environmentVariable",
136-
environmentVariable: "ENHANCD_HYPHEN_ARG",
136+
name: "ENHANCD_HYPHEN_ARG",
137137
interface: "text",
138138
default: "-",
139139
},
140140
{
141-
name: "Number of history entries",
141+
displayName: "Number of history entries",
142142
description: `You can customize the number of rows by "cd -"`,
143143
additionalDetails:
144144
"This value is passed to `head` comand as `-n` option.",
145145
type: "environmentVariable",
146-
environmentVariable: "ENHANCD_HYPHEN_NUM",
146+
name: "ENHANCD_HYPHEN_NUM",
147147
interface: "text",
148148
default: 10,
149149
},
@@ -153,17 +153,17 @@ const plugin: Fig.Plugin = {
153153
displayName: "No argument - 'cd '",
154154
configuration: [
155155
{
156-
name: "Disable filtering on HOME",
156+
displayName: "Disable filtering on HOME",
157157
description:
158158
"If you don't want to use the interactive filter when you call `cd` without an argument",
159159
type: "environmentVariable",
160-
environmentVariable: "ENHANCD_DISABLE_HOME",
160+
name: "ENHANCD_DISABLE_HOME",
161161
interface: "toggle",
162162
default: false,
163163
compile: (value) => (value ? "1" : "0"),
164164
},
165165
{
166-
name: "ENHANCD_HOME_ARG",
166+
displayName: "ENHANCD_HOME_ARG",
167167
description:
168168
"You can customize to trigger the argumentless `cd` behavior by giving the string specified by this environment variable as an argument.",
169169
additionalDetails: `
@@ -173,7 +173,7 @@ const plugin: Fig.Plugin = {
173173
In other words, you can keep original behavior of \`cd\` with no argument by this option.
174174
`,
175175
type: "environmentVariable",
176-
environmentVariable: "ENHANCD_HOME_ARG",
176+
name: "ENHANCD_HOME_ARG",
177177
interface: "text",
178178
default: "",
179179
},
@@ -183,19 +183,19 @@ const plugin: Fig.Plugin = {
183183
displayName: "Completions",
184184
configuration: [
185185
{
186-
name: "Completion Keybinding",
186+
displayName: "Completion Keybinding",
187187
type: "environmentVariable",
188188
additionalDetails: "Default is Tab (`^I`)",
189-
environmentVariable: "ENHANCD_COMPLETION_KEYBIND",
189+
name: "ENHANCD_COMPLETION_KEYBIND",
190190
interface: "text",
191191
default: "^I",
192192
},
193193
{
194-
name: "Completion Behavior",
194+
displayName: "Completion Behavior",
195195
type: "environmentVariable",
196196
additionalDetails:
197197
"See [#90](https://github.com/b4b4r07/enhancd/issues/90).",
198-
environmentVariable: "ENHANCD_COMPLETION_BEHAVIOR",
198+
name: "ENHANCD_COMPLETION_BEHAVIOR",
199199
interface: "select",
200200
default: "default",
201201
options: ["default", "list", "history"],

plugins/kube-ps1/index.ts

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ const plugin: Fig.Plugin = {
2929
configuration: [
3030
{
3131
name: "KUBE_PS1_BINARY",
32-
environmentVariable: "KUBE_PS1_BINARY",
3332
default: "kubectl",
3433
description: "Default Kubernetes binary",
3534
type: "environmentVariable",
3635
interface: "text",
3736
},
3837
{
3938
name: "KUBE_PS1_NS_ENABLE",
40-
environmentVariable: "KUBE_PS1_NS_ENABLE",
4139
default: true,
4240
description:
4341
"Display the namespace. If set to false, this will also disable KUBE_PS1_DIVIDER",
@@ -46,15 +44,13 @@ const plugin: Fig.Plugin = {
4644
},
4745
{
4846
name: "KUBE_PS1_PREFIX",
49-
environmentVariable: "KUBE_PS1_PREFIX",
5047
default: "(",
5148
description: "Prompt opening character",
5249
type: "environmentVariable",
5350
interface: "text",
5451
},
5552
{
5653
name: "KUBE_PS1_SYMBOL_ENABLE",
57-
environmentVariable: "KUBE_PS1_SYMBOL_ENABLE",
5854
default: true,
5955
description:
6056
"Display the prompt Symbol. If set to false, this will also disable KUBE_PS1_SEPARATOR",
@@ -63,7 +59,6 @@ const plugin: Fig.Plugin = {
6359
},
6460
{
6561
name: "KUBE_PS1_SYMBOL_PADDING",
66-
environmentVariable: "KUBE_PS1_SYMBOL_PADDING",
6762
default: true,
6863
description:
6964
"Adds a space (padding) after the symbol to prevent clobbering prompt characters",
@@ -72,78 +67,70 @@ const plugin: Fig.Plugin = {
7267
},
7368
{
7469
name: "KUBE_PS1_SYMBOL_DEFAULT",
75-
environmentVariable: "KUBE_PS1_SYMBOL_DEFAULT",
7670
default: "⎈",
7771
description: "Default prompt symbol. Unicode \u2388",
7872
type: "environmentVariable",
7973
interface: "text",
8074
},
8175
{
8276
name: "KUBE_PS1_SYMBOL_USE_IMG",
83-
environmentVariable: "KUBE_PS1_SYMBOL_USE_IMG",
8477
default: false,
8578
description: "☸️ , Unicode \u2638 as the prompt symbol",
8679
type: "environmentVariable",
8780
interface: "toggle",
8881
},
8982
{
9083
name: "KUBE_PS1_SEPARATOR",
91-
environmentVariable: "KUBE_PS1_SEPARATOR",
9284
default: "|",
9385
description: "Separator between symbol and context name",
9486
type: "environmentVariable",
9587
interface: "text",
9688
},
9789
{
9890
name: "KUBE_PS1_DIVIDER",
99-
environmentVariable: "KUBE_PS1_DIVIDER",
10091
default: ":",
10192
description: "Separator between context and namespace",
10293
type: "environmentVariable",
10394
interface: "text",
10495
},
10596
{
10697
name: "KUBE_PS1_SUFFIX",
107-
environmentVariable: "KUBE_PS1_SUFFIX",
10898
default: ")",
10999
description: "Prompt closing character",
110100
type: "environmentVariable",
111101
interface: "text",
112102
},
113-
// { name: "KUBE_PS1_CLUSTER_FUNCTION", environmentVariable: "KUBE_PS1_CLUSTER_FUNCTION", default: "", description: "Function to customize how cluster is displayed", type: "function", interface: "text"},
114-
// { name: "KUBE_PS1_NAMESPACE_FUNCTION", environmentVariable: "KUBE_PS1_NAMESPACE_FUNCTION", default: "", description: "Function to customize how namespace is displayed", type: "environmentVariable", interface: "text"},
103+
// { name: "KUBE_PS1_CLUSTER_FUNCTION", name: "KUBE_PS1_CLUSTER_FUNCTION", default: "", description: "Function to customize how cluster is displayed", type: "function", interface: "text"},
104+
// { name: "KUBE_PS1_NAMESPACE_FUNCTION", name: "KUBE_PS1_NAMESPACE_FUNCTION", default: "", description: "Function to customize how namespace is displayed", type: "environmentVariable", interface: "text"},
115105
{
116106
displayName: "Colors",
117107
description:
118108
"Colors must be black, red, green, yellow, blue, magenta, cyan or a number between 0 and 256. Set the variable to an empty string if you do not want color for each prompt section",
119109
configuration: [
120-
// { name: "KUBE_PS1_PREFIX_COLOR", environmentVariable: "KUBE_PS1_PREFIX_COLOR", default: null, description: "Set default color of the prompt prefix", type: "environmentVariable", interface: "text"},
110+
// { name: "KUBE_PS1_PREFIX_COLOR", name: "KUBE_PS1_PREFIX_COLOR", default: null, description: "Set default color of the prompt prefix", type: "environmentVariable", interface: "text"},
121111
{
122112
name: "KUBE_PS1_SYMBOL_COLOR",
123-
environmentVariable: "KUBE_PS1_SYMBOL_COLOR",
124113
default: "blue",
125114
description: "Set default color of the Kubernetes symbol",
126115
type: "environmentVariable",
127116
interface: "text",
128117
},
129118
{
130119
name: "KUBE_PS1_CTX_COLOR",
131-
environmentVariable: "KUBE_PS1_CTX_COLOR",
132120
default: "red",
133121
description: "Set default color of the context",
134122
type: "environmentVariable",
135123
interface: "text",
136124
},
137-
// { name: "KUBE_PS1_SUFFIX_COLOR", environmentVariable: "KUBE_PS1_SUFFIX_COLOR", default: null, description: "Set default color of the prompt suffix", type: "environmentVariable", interface: "text"},
125+
// { name: "KUBE_PS1_SUFFIX_COLOR", name: "KUBE_PS1_SUFFIX_COLOR", default: null, description: "Set default color of the prompt suffix", type: "environmentVariable", interface: "text"},
138126
{
139127
name: "KUBE_PS1_NS_COLOR",
140-
environmentVariable: "KUBE_PS1_NS_COLOR",
141128
default: "cyan",
142129
description: "Set default color of the namespace",
143130
type: "environmentVariable",
144131
interface: "text",
145132
},
146-
// { name: "KUBE_PS1_BG_COLOR", environmentVariable: "KUBE_PS1_BG_COLOR", default: null, description: "Set default color of the prompt background", type: "environmentVariable", interface: "text"},
133+
// { name: "KUBE_PS1_BG_COLOR", name: "KUBE_PS1_BG_COLOR", default: null, description: "Set default color of the prompt background", type: "environmentVariable", interface: "text"},
147134
],
148135
},
149136
{

0 commit comments

Comments
 (0)