Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
moqsien committed Dec 28, 2024
1 parent 6624bc4 commit 51e87e3
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 40 deletions.
63 changes: 43 additions & 20 deletions src/content/docs/starts/completions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,46 @@ title: Shell completions.
description: Setup shell completions for vmr.
---

import { Tabs, TabItem, Aside } from "@astrojs/starlight/components";

## Setup completions for diffrent shells.

<Tabs>
<TabItem label="Powershell" icon="seti:shell">
vmr completion powershell >>
.\Documents\WindowsPowerShell\vmr_completions.ps1 # Add following line to
powershell profile at $HOME\Documents\WindowsPowerShell\profile.ps1:
Import-Module -Name "$HOME\Documents\WindowsPowerShell\vmr_completions.ps1"
</TabItem>
<TabItem label="Bash" icon="seti:shell">
vmr completion bash >> ~/vmr_completions.sh # Add following line to bash
profile at $HOME/.bashrc: source $HOME/vmr_completions.sh
</TabItem>
<TabItem label="zsh" icon="seti:shell">
vmr completion zsh >> ~/vmr_completions.sh # Add following line to zsh
profile at $HOME/.zshrc: source $HOME/vmr_completions.sh
</TabItem>
</Tabs>
## Setup shell completions for vmr.

### Setup for Windows Powershell

- Save vmr auto-completion script to Powershell script file.

```bash
vmr completion powershell >> \Documents\WindowsPowerShell\vmr_completions.ps1
```

- Add the line below to Powershell profile file($HOME\Documents\WindowsPowerShell\profile.ps1)

```bash
Import-Module -Name "$HOME\Documents\WindowsPowerShell\vmr_completions.ps1"
```

## Setup for bash

- Save vmr auto-completion script to bash script file.

```bash
vmr completion bash >> ~/vmr_completions.sh
```

- Add the line below to bash profile file($HOME/.bashrc)

```bash
source $HOME/vmr_completions.sh
```

## Setup for zsh

- Add the line below to zsh profile file($HOME/.zshrc)

```bash
vmr completion zsh >> ~/vmr_completions.sh
```

- Add the line below to zsh profile file($HOME/.zshrc)

```bash
source $HOME/vmr_completions.sh
```
61 changes: 41 additions & 20 deletions src/content/docs/zh-cn/starts/completions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,46 @@ title: vmr命令行自动补全.
description: 为vmr设置命令行自动补全.
---

import { Tabs, TabItem, Aside } from "@astrojs/starlight/components";

## 设置命令行自动补全.

<Tabs>
<TabItem label="Powershell" icon="seti:shell">
vmr completion powershell >>
.\Documents\WindowsPowerShell\vmr_completions.ps1 #
将下面一行命令添加到Powershell的profile文件中($HOME\Documents\WindowsPowerShell\profile.ps1):
Import-Module -Name "$HOME\Documents\WindowsPowerShell\vmr_completions.ps1"
</TabItem>
<TabItem label="Bash" icon="seti:shell">
vmr completion bash >> ~/vmr_completions.sh #
将下面一行命令添加到Bash的profile文件中($HOME/.bashrc): source
$HOME/vmr_completions.sh
</TabItem>
<TabItem label="zsh" icon="seti:shell">
vmr completion zsh >> ~/vmr_completions.sh #
将下面一行命令添加到zsh的profile文件中($HOME/.zshrc): source
$HOME/vmr_completions.sh
</TabItem>
</Tabs>
### Windows Powershell 下设置 VMR 命令自动补全

- 将 VMR 命令行自动补全脚本保存到 powershell 脚本中

```bash
vmr completion powershell >> \Documents\WindowsPowerShell\vmr_completions.ps1
```

- 将下面一行命令添加到 Powershell 的 profile 文件($HOME\Documents\WindowsPowerShell\profile.ps1)中

```bash
Import-Module -Name "$HOME\Documents\WindowsPowerShell\vmr_completions.ps1"
```

## MacOS/Linux bash 下设置 VMR 命令自动补全

- 将 VMR 命令行自动补全脚本保存到 bash 脚本中

```bash
vmr completion bash >> ~/vmr_completions.sh
```

- 将下面一行命令添加到 bash 的 profile 文件($HOME/.bashrc)中

```bash
source $HOME/vmr_completions.sh
```

## MacOS/Linux zsh 下设置 VMR 命令自动补全

- 将 VMR 命令行自动补全脚本保存到 bash 脚本中

```bash
vmr completion zsh >> ~/vmr_completions.sh
```

- 将下面一行命令添加到 bash 的 profile 文件($HOME/.bashrc)中

```bash
source $HOME/vmr_completions.sh
```

0 comments on commit 51e87e3

Please sign in to comment.