-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial version - some are still broken
- Loading branch information
Showing
70 changed files
with
1,652 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# config.nu | ||
|
||
let carapace_completer = {|spans| | ||
if "TARGET" in $env { | ||
^$env.TARGET _carapace nushell ...$spans | from json | ||
} | ||
} | ||
|
||
$env.config = { | ||
completions: { | ||
case_sensitive: false # set to true to enable case-sensitive completions | ||
quick: true # set this to false to prevent auto-selecting completions when only one remains | ||
partial: true # set this to false to prevent partial filling of the prompt | ||
algorithm: "prefix" # prefix or fuzzy | ||
external: { | ||
enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow | ||
max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options | ||
completer: $carapace_completer # check 'carapace_completer' above as an example | ||
} | ||
use_ls_colors: true # set this to true to enable file/path/directory completions using LS_COLORS | ||
} | ||
|
||
menus: [ | ||
{ | ||
name: completion_menu | ||
only_buffer_difference: false | ||
marker: "| " | ||
type: { | ||
layout: columnar | ||
columns: 4 | ||
col_width: 20 # Optional value. If missing all the screen width is used to calculate column width | ||
col_padding: 2 | ||
} | ||
style: { | ||
text: white | ||
selected_text: {attr: r} | ||
description_text: white_dimmed | ||
} | ||
} | ||
] | ||
} | ||
|
||
source ~/.config/nushell/starship.nu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Nushell Environment Config File | ||
|
||
$env.PROMPT_COMMAND_RIGHT = '' | ||
|
||
$env.ENV_CONVERSIONS = { | ||
"PATH": { | ||
from_string: { |s| $s | split row (char esep) | path expand --no-symlink } | ||
to_string: { |v| $v | path expand --no-symlink | str join (char esep) } | ||
} | ||
"Path": { | ||
from_string: { |s| $s | split row (char esep) | path expand --no-symlink } | ||
to_string: { |v| $v | path expand --no-symlink | str join (char esep) } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# this file is both a valid | ||
# - overlay which can be loaded with `overlay use starship.nu` | ||
# - module which can be used with `use starship.nu` | ||
# - script which can be used with `source starship.nu` | ||
export-env { $env.STARSHIP_SHELL = "nu"; load-env { | ||
STARSHIP_SESSION_KEY: (random chars -l 16) | ||
PROMPT_MULTILINE_INDICATOR: ( | ||
^/usr/bin/starship prompt --continuation | ||
) | ||
# Does not play well with default character module. | ||
# TODO: Also Use starship vi mode indicators? | ||
PROMPT_INDICATOR: "" | ||
PROMPT_COMMAND: {|| | ||
# jobs are not supported | ||
( | ||
^/usr/bin/starship prompt | ||
--cmd-duration $env.CMD_DURATION_MS | ||
$"--status=($env.LAST_EXIT_CODE)" | ||
--terminal-width (term size).columns | ||
) | ||
} | ||
|
||
config: ($env.config? | default {} | merge { | ||
render_right_prompt_on_last_line: true | ||
}) | ||
|
||
PROMPT_COMMAND_RIGHT: {|| | ||
( | ||
^/usr/bin/starship prompt | ||
--right | ||
--cmd-duration $env.CMD_DURATION_MS | ||
$"--status=($env.LAST_EXIT_CODE)" | ||
--terminal-width (term size).columns | ||
) | ||
} | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: vhs template | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
topic: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
vhs: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
container: ghcr.io/carapace-sh/vhs | ||
env: | ||
RC_BASH: "ln -sf /carapace/example/example /usr/local/bin/example" | ||
RC_NUSHELL_ENV: "mkdir ~/.cache/\nexample _carapace nushell | save --force ~/.cache/example.nu" | ||
RC_NUSHELL: "source ~/.cache/example.nu\n$$env.config.completions.external.completer = $$example_completer" | ||
steps: | ||
- name: shallow clone | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: example | ||
path: /usr/local/bin/ | ||
|
||
- run: chmod +x /usr/local/bin/example | ||
|
||
- name: vhs | ||
run: | | ||
cd docs/src/development/vhs/${{ inputs.topic }} | ||
ls *.tape | xargs -n1 vhs | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.topic }} | ||
path: | | ||
docs/src/development/vhs/${{ inputs.topic }}/ | ||
!docs/src/development/vhs/${{ inputs.topic }}/*.tape | ||
retention-days: 1 | ||
|
||
- name: check | ||
run: | | ||
git diff | ||
[ -z "$(git status --porcelain)" ] # clean workspace unless .ascii files changed | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
RC_BASH="ln -sf /carapace/example/example /usr/local/bin/example" | ||
RC_NUSHELL_ENV="mkdir ~/.cache/\nexample _carapace nushell | save --force ~/.cache/example.nu" | ||
RC_NUSHELL="source ~/.cache/example.nu\n$$env.config.completions.external.completer = $$example_completer" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# VHS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Require example | ||
|
||
Set Theme "Snazzy" | ||
Set FontFamily "JetBrains Mono" | ||
Set FontSize 30 | ||
Set Width 1400 | ||
Set Height 300 | ||
Set Padding 0 | ||
|
||
Set Shell "bash" | ||
|
||
Hide | ||
Type@10ms "source <(example _carapace bash)" Enter | ||
Type@10ms "clear" Enter | ||
Show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Double Quote | ||
|
||
- bash | ||
![](./doubleQuote/out/doubleQuote.bash.gif) | ||
- elvish | ||
![](./doubleQuote/out/doubleQuote.elvish.gif) | ||
- fish | ||
![](./doubleQuote/out/doubleQuote.fish.gif) | ||
- nushell | ||
![](./doubleQuote/out/doubleQuote.nushell.gif) | ||
- oil | ||
![](./doubleQuote/out/doubleQuote.oil.gif) | ||
- powershell | ||
![](./doubleQuote/out/doubleQuote.powershell.gif) | ||
- xonsh | ||
![](./doubleQuote/out/doubleQuote.xonsh.gif) | ||
- zsh | ||
![](./doubleQuote/out/doubleQuote.zsh.gif) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Source ../bash.tape | ||
|
||
Output out/doubleQuote.bash.gif | ||
Output out/doubleQuote.bash.ascii | ||
|
||
Type `example "ac"` Sleep 1 Tab@1 | ||
|
||
Sleep 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Source ../elvish.tape | ||
|
||
Output out/doubleQuote.elvish.gif | ||
Output out/doubleQuote.elvish.ascii | ||
|
||
Type `example "ac"` Sleep 1 Tab@1 | ||
|
||
Sleep 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Source ../fish.tape | ||
|
||
Output out/doubleQuote.fish.gif | ||
Output out/doubleQuote.fish.ascii | ||
|
||
Type `example "ac"` Sleep 1 Tab@1 | ||
|
||
Sleep 2 |
8 changes: 8 additions & 0 deletions
8
docs/src/development/vhs/doubleQuote/doubleQuote.nushell.tape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Source ../nushell.tape | ||
|
||
Output out/doubleQuote.nushell.gif | ||
Output out/doubleQuote.nushell.ascii | ||
|
||
Type `example "ac"` Sleep 1 Tab@1 | ||
|
||
Sleep 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Source ../oil.tape | ||
|
||
Output out/doubleQuote.oil.gif | ||
Output out/doubleQuote.oil.ascii | ||
|
||
Type `example "ac"` Sleep 1 Tab@1 | ||
|
||
Sleep 2 |
8 changes: 8 additions & 0 deletions
8
docs/src/development/vhs/doubleQuote/doubleQuote.powershell.tape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Source ../powershell.tape | ||
|
||
Output out/doubleQuote.powershell.gif | ||
Output out/doubleQuote.powershell.ascii | ||
|
||
Type `example "ac"` Sleep 1 Tab@1 | ||
|
||
Sleep 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Source ../xonsh.tape | ||
|
||
Output out/doubleQuote.xonsh.gif | ||
Output out/doubleQuote.xonsh.ascii | ||
|
||
Type `example "ac"` Sleep 1 Tab@1 | ||
|
||
Sleep 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Source ../zsh.tape | ||
|
||
Output out/doubleQuote.zsh.gif | ||
Output out/doubleQuote.zsh.ascii | ||
|
||
Type `example "ac"` Sleep 1 Tab@1 | ||
|
||
Sleep 2 |
40 changes: 40 additions & 0 deletions
40
docs/src/development/vhs/doubleQuote/out/doubleQuote.bash.ascii
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
> | ||
|
||
|
||
|
||
|
||
|
||
|
||
──────────────────────────────────────────────────────────────────────────────── | ||
> example "ac" | ||
|
||
|
||
|
||
|
||
|
||
|
||
──────────────────────────────────────────────────────────────────────────────── | ||
> example "ac" | ||
|
||
|
||
|
||
|
||
|
||
|
||
──────────────────────────────────────────────────────────────────────────────── | ||
> example action | ||
|
||
|
||
|
||
|
||
|
||
|
||
──────────────────────────────────────────────────────────────────────────────── | ||
> example action | ||
|
||
|
||
|
||
|
||
|
||
|
||
──────────────────────────────────────────────────────────────────────────────── |
Oops, something went wrong.