Skip to content

Commit

Permalink
refactor(vi_mode): move vi_mode to external section
Browse files Browse the repository at this point in the history
Moves vi_mode to external section: https://github.com/spaceship-prompt/spaceship-vi-mode

BREAKING CHANGE: vi_mode section is not include in core anymore

close #586
  • Loading branch information
denysdovhan committed May 30, 2022
1 parent 3f8bb1e commit 9ce611b
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 101 deletions.
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -118,7 +118,6 @@ Spaceship is a minimalistic, powerful and extremely customizable [Zsh][zsh-url]
- `` - charging;
- `` - discharging;
- `` - fully charged.
- Current Vi-mode mode ([with handy aliases for temporarily enabling](./docs/options.md#vi-mode-vi_mode)).
- Optional exit-code of last command ([how to enable](./docs/options.md#exit-code-exit_code)).
- Optional time stamps 12/24hr in format ([how to enable](./docs/options.md#time-time)).
- Execution time of the last command if it exceeds the set threshold.
Expand Down
3 changes: 1 addition & 2 deletions docs/index.md
Expand Up @@ -35,15 +35,14 @@ features:
- Clever hostname, username and prompt character displaying.
- Current Git and Mercurial repo statuses.
- Indicator for jobs in the background ``.
- Current version of Node.js ``, Ruby `💎`, Elm `🌳`, Elixir `💧`, Swift `🐦`, Xcode `🛠`, Go `🐹`, PHP `🐘`, Rust `𝗥`, Haskell `λ`, Julia ``, Python `🐍`, Conda `🅒`, .NET SDK `.NET`, Ember.js `🐹`.
- Current version of Node.js ``, Ruby `💎`, Elm `🌳`, Elixir `💧`, Swift `🐦`, Xcode `🛠`, Go `🐹`, PHP `🐘`, Rust `𝗥`, Haskell `λ`, Julia ``, Python `🐍`, Conda `🅒`, .NET SDK `.NET`.
- Package version, if there's is a package in current directory `📦`.
- Current Docker version and connected machine `🐳`.
- Current Amazon Web Services (AWS) profile `☁️` ([Using named profiles](http://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html)).
- Current Google Cloud Platform gcloud active configuration `☁️`.
- Current Kubectl context `☸️`.
- Current Terraform workspace `🛠`.
- Current battery level and status.
- Current Vi-mode mode ([with handy aliases for temporarily enabling](./options.md#vi-mode-vi_mode)).
- Execution time of the last command if it exceeds the set threshold.

Want more features? Please, [open an issue](https://github.com/spaceship-prompt/yspaceship-prompt/issues/new/choose) or send pull request.
Expand Down
7 changes: 3 additions & 4 deletions docs/index.uk.md
Expand Up @@ -9,15 +9,15 @@ hero:
install_button: Початок роботи
source_button: Вихідний код
features:
-
-
title: Охайний та простий
image: /assets/what-is-needed.svg
description: Командний рядок не перевантажений, а показує тільки те, що вам потрібно в даний момент (поточна директорія, гілка git тощо).
-
-
title: Просто встановлюється
image: /assets/out-of-the-box.svg
description: The prompt works right after installation without any additional configuration. install it and use it.
-
-
title: Легко налаштовується
image: /assets/configurable.svg
description: Командний рядок не потребує конфігурації, однак надає зрозумілий та простий інтерфейс для налаштувань.
Expand All @@ -44,7 +44,6 @@ features:
- Поточний контекст Kubectl `☸️`.
- Поточна робоча область Terraform `🛠`.
- Поточний рівень заряду батареї та її статус.
- Поточний режим Vi-mode ([з зручними аліасами для тимчасово ввімкнення/вимкнення](./options.md#vi-mode-vi_mode)).
- Час виконання останньої команди, якщо він перевищує встановлене значення.

Want more features? Please, [open an issue](https://github.com/spaceship-prompt/yspaceship-prompt/issues/new/choose) or send pull request.
Expand Down
7 changes: 3 additions & 4 deletions docs/index.zh.md
Expand Up @@ -9,15 +9,15 @@ hero:
install_button: 快速上手
source_button: 源代码
features:
-
-
title: 清晰而简洁
image: /assets/what-is-needed.svg
description: 该提示符不臃肿,它只显示当前您需要的内容 (当前目录,git 分支,等等)。
-
-
title: 轻松设定
image: /assets/out-of-the-box.svg
description: 提示符在安装后即可正常工作,没有任何附加配置。 安装并使用它。
-
-
title: 可配置
image: /assets/configurable.svg
description: 该提示符是零配置的,但如果需要自定义的话,它将提供一个易于自定义的接口。
Expand All @@ -44,7 +44,6 @@ features:
- 当前 Kubectl 环境 `☸️`
- 当前的 Terraform 工作区 `🛠`
- 当前电池电量和状态。
- 当前 Vi-mode 模式([暂时启用的方便标识](./options.md#vi-mode-vi_mode))。
- 如果超过设定阈值,上一个命令的执行时间

需要更多功能? 请 [提出 issue](https://github.com/spaceship-prompt/spaceship-prompt/issues/new/choose),描述你的问题,我们将乐意帮助你。
Expand Down
11 changes: 1 addition & 10 deletions docs/troubleshooting.md
Expand Up @@ -28,14 +28,6 @@ This is not an issue with Spaceship prompt. Spaceship uses Unicode symbols to re

In case Unicode symbols aren't supported, you can replace them to those that are compatible with your terminal with `SPACESHIP_*_SYMBOL` options. Check out [Options](./options.md) page for more information.

## What is the `[I]` before prompt character ?

That's [`vi_mode`](https://spaceship-prompt.sh/options/#vi-mode-vi_mode) section indicating `insert` mode. You can disable that with following line in your configuration,

```
SPACESHIP_VI_MODE_SHOW=false
```

## Why is my prompt slow?

Spaceship may work slower in big repositories since status checkings are quite a heavy operation. In this case, try to avoid having many uncommitted files.
Expand All @@ -47,7 +39,7 @@ Using `grep` to fetch package version wasn't returning accurate information. So

Prompt also may slow down because of loading of unused sections. Spaceship loads only sections mentioned in `SPACESHIP_PROMPT_ORDER` or `SPACESHIP_RPROMPT_ORDER`. If you think some sections might be useless for you, try to disable them by omitting their names in order options.

In the example below, `time`, `package`, `xcode`, `julia`, `docker`, and `vi_mode` sections are disabled so that they won't be loaded at all.
In the example below, `time`, `package`, `xcode`, `julia` and `docker` sections are disabled so that they won't be loaded at all.

```zsh
# Just comment a section if you want to disable it
Expand Down Expand Up @@ -82,7 +74,6 @@ SPACESHIP_PROMPT_ORDER=(
exec_time # Execution time
line_sep # Line break
battery # Battery level and status
# vi_mode # Vi-mode indicator (Disabled)
jobs # Background jobs indicator
exit_code # Exit code section
char # Prompt character
Expand Down
11 changes: 1 addition & 10 deletions docs/troubleshooting.uk.md
Expand Up @@ -28,14 +28,6 @@ This is not an issue with Spaceship prompt. Spaceship uses Unicode symbols to re

In case Unicode symbols aren't supported, you can replace them to those that are compatible with your terminal with `SPACESHIP_*_SYMBOL` options. Check out [Options](./options.md) page for more information.

## What is the `[I]` before prompt character ?

That's [`vi_mode`](https://spaceship-prompt.sh/options/#vi-mode-vi_mode) section indicating `insert` mode. You can disable that with following line in your configuration,

```
SPACESHIP_VI_MODE_SHOW=false
```

## Why is my prompt slow?

Spaceship may work slower in big repositories since status checkings are quite a heavy operation. In this case, try to avoid having many uncommitted files.
Expand All @@ -44,7 +36,7 @@ Using `grep` to fetch package version wasn't returning accurate information. So

Prompt also may slow down because of loading of unused sections. Spaceship loads only sections mentioned in `SPACESHIP_PROMPT_ORDER` or `SPACESHIP_RPROMPT_ORDER`. If you think some sections might be useless for you, try to disable them by omitting their names in order options.

In the example below, `time`, `package`, `xcode`, `julia`, `docker` and `vi_mode` sections are disabled so that they won't be loaded at all.
In the example below, `time`, `package`, `xcode`, `julia` and `docker` sections are disabled so that they won't be loaded at all.

```zsh
# Just comment a section if you want to disable it
Expand Down Expand Up @@ -79,7 +71,6 @@ SPACESHIP_PROMPT_ORDER=(
exec_time # Execution time
line_sep # Line break
battery # Battery level and status
# vi_mode # Vi-mode indicator (Disabled)
jobs # Background jobs indicator
exit_code # Exit code section
char # Prompt character
Expand Down
11 changes: 1 addition & 10 deletions docs/troubleshooting.zh.md
Expand Up @@ -28,14 +28,6 @@ hide:

如果不支持 Unicode 符号,您可以用 `SPACESHIP_*_SYMBOL` 选项替换它们与您终端兼容。 查看 [选项](./options.zh.md) 页面以获取更多信息。

## 提示符之前的 `[I]` 是什么?

那是 [`vi_mode`](https://spaceship-prompt.sh/options/#vi-mode-vi_mode) 模块表示 `插入` 模式。 您可以在您的配置中用以下行禁用此功能:

```
SPACESHIP_VI_MODE_SHOW=false
```

## 为什么我的提示符很慢?

由于状态检查是相当繁重的操作,空间飞船在大仓库中Spaceship可能较慢。 在这种情况下,试图避免有许多未提交的文件。
Expand All @@ -44,7 +36,7 @@ SPACESHIP_VI_MODE_SHOW=false

由于未使用的模块加载,提示符也可能变慢。 Spaceship只装载 `SPACESHIP_PROPT_ORDER``SPACESHIP_RPROPT_ORDER` 中提到的模块。 如果你认为某些模块对你来说可能毫无用处,试图通过在排序选项中省略它们的名字来禁用它们。

在下面的示例中, `time`, `package`, `xcode`, `julia`, `docker`, `vi_mode` 模块被禁用,根本不会被加载。
在下面的示例中, `time`, `package`, `xcode`, `julia`, 和 `docker` 模块被禁用,根本不会被加载。

```zsh
# 如果你想禁用仅仅需要将模块注释
Expand Down Expand Up @@ -79,7 +71,6 @@ SPACESHIP_PROMPT_ORDER=(
exec_time # Execution time
line_sep # Line break
battery # Battery level and status
# vi_mode # Vi-mode indicator (Disabled)
jobs # Background jobs indicator
exit_code # Exit code section
char # Prompt character
Expand Down
1 change: 0 additions & 1 deletion lib/utils.zsh
Expand Up @@ -46,7 +46,6 @@ spaceship::is_section_async() {
exec_time
async
line_sep
vi_mode
jobs
exit_code
char
Expand Down
58 changes: 0 additions & 58 deletions sections/vi_mode.zsh

This file was deleted.

8 changes: 7 additions & 1 deletion spaceship.zsh
Expand Up @@ -74,7 +74,6 @@ if [ -z "$SPACESHIP_PROMPT_ORDER" ]; then
async # Async jobs indicator
line_sep # Line break
battery # Battery level and status
vi_mode # Vi-mode indicator
jobs # Background jobs indicator
exit_code # Exit code section
char # Prompt character
Expand Down Expand Up @@ -138,6 +137,13 @@ spaceship::deprecated SPACESHIP_PYENV_SUFFIX "Use %BSPACESHIP_PYTHON_SUFFIX%b in
spaceship::deprecated SPACESHIP_PYENV_SYMBOL "Use %BSPACESHIP_PYTHON_SYMBOL%b instead"
spaceship::deprecated SPACESHIP_PYENV_COLOR "Use %bSPACESHIP_PYTHON_COLOR%b instead"

spaceship::deprecated SPACESHIP_VI_MODE_SHOW "vi-mode is now an external section: github.com/spaceship-prompt/spaceship-vi-mode"
spaceship::deprecated SPACESHIP_VI_MODE_PREFIX "vi-mode is now an external section: github.com/spaceship-prompt/spaceship-vi-mode"
spaceship::deprecated SPACESHIP_VI_MODE_SUFFIX "vi-mode is now an external section: github.com/spaceship-prompt/spaceship-vi-mode"
spaceship::deprecated SPACESHIP_VI_MODE_INSERT "vi-mode is now an external section: github.com/spaceship-prompt/spaceship-vi-mode"
spaceship::deprecated SPACESHIP_VI_MODE_NORMAL "vi-mode is now an external section: github.com/spaceship-prompt/spaceship-vi-mode"
spaceship::deprecated SPACESHIP_VI_MODE_COLOR "vi-mode is now an external section: github.com/spaceship-prompt/spaceship-vi-mode"

# ------------------------------------------------------------------------------
# SETUP
# Setup requirements for prompt
Expand Down

0 comments on commit 9ce611b

Please sign in to comment.