11# Shell Completions for lychee
22
3- This directory contains shell completion scripts for lychee, enabling tab-completion for commands, options, and arguments in your shell.
3+ This directory contains shell completion scripts for lychee.
4+ It unlocks tab-completion for commands, options, and arguments in your shell!
45
56## Quick Reference
67
@@ -14,11 +15,7 @@ lychee --generate complete-powershell # PowerShell
1415lychee --generate complete-zsh # Zsh
1516```
1617
17- ## Automatic Installation
18-
19- If you installed lychee through a package manager (Homebrew, apt, etc.), shell completions should already be installed and working.
20-
21- ## Manual Installation
18+ ## Installation
2219
2320### Bash
2421
@@ -43,67 +40,6 @@ sudo lychee --generate complete-bash > /usr/share/bash-completion/completions/ly
4340lychee --generate complete-bash > $( brew --prefix) /etc/bash_completion.d/lychee
4441```
4542
46- ### Elvish
47-
48- ``` bash
49- dir=" ${XDG_CONFIG_HOME:- $HOME / .config} /elvish/lib"
50- mkdir -p " $dir "
51- lychee --generate complete-elvish > " $dir /lychee.elv"
52- ```
53-
54- Then add the following to your ` ~/.elvish/rc.elv ` :
55- ``` elvish
56- use lychee
57- ```
58-
59- ### Fish
60-
61- ** User installation:**
62- ``` bash
63- dir=" ${XDG_CONFIG_HOME:- $HOME / .config} /fish/completions"
64- mkdir -p " $dir "
65- lychee --generate complete-fish > " $dir /lychee.fish"
66- ```
67-
68- Fish will automatically load the completions on next shell start.
69-
70- ** System-wide installation:**
71- ``` bash
72- # On Linux
73- sudo lychee --generate complete-fish > /usr/share/fish/vendor_completions.d/lychee.fish
74-
75- # On macOS with Homebrew
76- lychee --generate complete-fish > $( brew --prefix) /share/fish/vendor_completions.d/lychee.fish
77- ```
78-
79- ### PowerShell
80-
81- ** Windows:**
82-
83- Generate the completion file:
84- ``` powershell
85- lychee --generate complete-powershell | Out-File -Encoding UTF8 _lychee.ps1
86- ```
87-
88- Then add to your PowerShell profile:
89- ``` powershell
90- # Find your profile location
91- echo $PROFILE
92-
93- # Add this line to your profile
94- . C:\Path\To\_lychee.ps1
95- ```
96-
97- ** Linux/macOS with PowerShell:**
98- ``` bash
99- lychee --generate complete-powershell > ~ /.config/powershell/_lychee.ps1
100- ```
101-
102- Add to your profile (` ~/.config/powershell/Microsoft.PowerShell_profile.ps1 ` ):
103- ``` powershell
104- . ~/.config/powershell/_lychee.ps1
105- ```
106-
10743### Zsh
10844
10945** Recommended approach:**
@@ -138,31 +74,37 @@ source <(lychee --generate complete-zsh)
13874
13975Note: This is easier to set up but slower, adding startup time to your shell.
14076
141- ## Pre-generated Files
142-
143- This directory contains pre-generated completion files for convenience:
77+ ### Fish
14478
145- | File | Shell | Description |
146- | ------| -------| -------------|
147- | ` lychee.bash ` | Bash | Bash completion script |
148- | ` lychee.elv ` | Elvish | Elvish completion module |
149- | ` lychee.fish ` | Fish | Fish completion script |
150- | ` _lychee.ps1 ` | PowerShell | PowerShell completion script |
151- | ` _lychee ` | Zsh | Zsh completion function |
79+ ** User installation:**
80+ ``` bash
81+ dir=" ${XDG_CONFIG_HOME:- $HOME / .config} /fish/completions"
82+ mkdir -p " $dir "
83+ lychee --generate complete-fish > " $dir /lychee.fish"
84+ ```
15285
153- These files are regenerated automatically as part of the release process and can be copied directly to your completion directory .
86+ Fish will automatically load the completions on next shell start .
15487
155- ## Troubleshooting
88+ ** System-wide installation:**
89+ ``` bash
90+ # On Linux
91+ sudo lychee --generate complete-fish > /usr/share/fish/vendor_completions.d/lychee.fish
15692
157- ### Completions not working after installation
93+ # On macOS with Homebrew
94+ lychee --generate complete-fish > $( brew --prefix) /share/fish/vendor_completions.d/lychee.fish
95+ ```
15896
159- ** Bash: ** Make sure you've sourced your ` ~/.bashrc ` or started a new shell session.
97+ ### Elvish
16098
161- ** Fish:** Fish loads completions automatically. Try ` fish_update_completions ` or restart your shell.
99+ ``` bash
100+ dir=" ${XDG_CONFIG_HOME:- $HOME / .config} /elvish/lib"
101+ mkdir -p " $dir "
102+ lychee --generate complete-elvish > " $dir /lychee.elv"
103+ ```
162104
163- ** Zsh: ** Ensure the directory is in your ` $fpath ` and you've run ` compinit ` . Check with :
164- ``` zsh
165- echo $fpath
105+ Then add the following to your ` ~/.elvish/rc.elv ` :
106+ ``` elvish
107+ use lychee
166108```
167109
168110** PowerShell:** Verify your execution policy allows running scripts:
@@ -178,3 +120,31 @@ After upgrading lychee, regenerate completions to get the latest options:
178120``` bash
179121lychee --generate complete-< your-shell> > < completion-file>
180122```
123+
124+ ### PowerShell
125+
126+ ** Windows:**
127+
128+ Generate the completion file:
129+ ``` powershell
130+ lychee --generate complete-powershell | Out-File -Encoding UTF8 _lychee.ps1
131+ ```
132+
133+ Then add to your PowerShell profile:
134+ ``` powershell
135+ # Find your profile location
136+ echo $PROFILE
137+
138+ # Add this line to your profile
139+ . C:\Path\To\_lychee.ps1
140+ ```
141+
142+ ** Linux/macOS with PowerShell:**
143+ ``` bash
144+ lychee --generate complete-powershell > ~ /.config/powershell/_lychee.ps1
145+ ```
146+
147+ Add to your profile (` ~/.config/powershell/Microsoft.PowerShell_profile.ps1 ` ):
148+ ``` powershell
149+ . ~/.config/powershell/_lychee.ps1
150+ ```
0 commit comments