Plastic SCM
Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →
Description
Affiche les informations de Plastic SCM lorsqu'il se trouve dans un dépôt Plastic. Fonctionne également pour les sous-dossiers.
Pour une compatibilité maximale, assurez-vous que votre exécutable cm est à jour
(par exemple lorsque les informations de branche ou d'état sont incorrectes).
Exemple de configuration
- json
- yaml
- toml
{
"type": "plastic",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#193549",
"background": "#ffeb3b",
"background_templates": [
"{{ if .MergePending }}#006060{{ end }}",
"{{ if .Changed }}#FF9248{{ end }}",
"{{ if and .Changed .Behind }}#ff4500{{ end }}",
"{{ if .Behind }}#B388FF{{ end }}"
],
"template": "{{ .Selector }}{{ if .Status.Changed }} {{ end }}{{ .Status.String }}",
"options": {
"fetch_status": true
}
}
type: plastic
style: powerline
powerline_symbol:
foreground: "#193549"
background: "#ffeb3b"
background_templates:
- "{{ if .MergePending }}#006060{{ end }}"
- "{{ if .Changed }}#FF9248{{ end }}"
- "{{ if and .Changed .Behind }}#ff4500{{ end }}"
- "{{ if .Behind }}#B388FF{{ end }}"
template: "{{ .Selector }}{{ if .Status.Changed }} {{ end }}{{ .Status.String }}"
options:
fetch_status: true
type = "plastic"
style = "powerline"
powerline_symbol = ""
foreground = "#193549"
background = "#ffeb3b"
background_templates = [ "{{ if .MergePending }}#006060{{ end }}", "{{ if .Changed }}#FF9248{{ end }}", "{{ if and .Changed .Behind }}#ff4500{{ end }}", "{{ if .Behind }}#B388FF{{ end }}" ]
template = "{{ .Selector }}{{ if .Status.Changed }} {{ end }}{{ .Status.String }}"
[options]
fetch_status = true
Icône Plastic SCM
Si vous souhaitez utiliser l'icône de Plastic SCM dans le segment, merci de soutenir sa mise en œuvre en ajoutant un like à ce problème !
Options
Récupération des informations
Comme plusieurs appels à cm peuvent ralentir l'expérience de l'invite de commande, nous ne récupérons pas les informations par défaut.
Vous pouvez activer cette propriété sur true pour récupérer des informations supplémentaires (et peupler le modèle).
| Name | Type | Default | Description |
|---|---|---|---|
fetch_status | boolean | false | fetch the local changes |
native_fallback | boolean | false | when set to true and cm.exe is not available when inside a WSL2 shared Windows drive, we will fallback to the native cm executable to fetch data. Not all information can be displayed in this case |
status_formats | map[string]string | a key, value map allowing to override how individual status items are displayed. For example, "status_formats": { "Added": "Added: %d" } will display the added count as Added: 1 instead of +1. See the Status section for available overrides |
Icônes
Branche
| Name | Type | Default | Description |
|---|---|---|---|
branch_icon | string | \uE0A0 | the icon to use in front of the git branch name |
mapped_branches | object | custom glyph/text for specific branches. You can use * at the end as a wildcard character for matching | |
branch_template | string | a template to format that branch name. You can use {{ .Branch }} as reference to the original branch name |
Sélecteur
| Name | Type | Default | Description |
|---|---|---|---|
commit_icon | string | \uF417 | icon/text to display before the commit context (detached HEAD) |
tag_icon | string | \uF412 | icon/text to display before the tag context |
Modèle (info)
{{ .Selector }}
Propriétés
| Name | Type | Description |
|---|---|---|
.Selector | string | the current selector context (branch/changeset/label) |
.Behind | bool | the current workspace is behind and changes are incoming |
.Status | Status | changes in the workspace (see below) |
.MergePending | bool | if a merge is pending and needs to be committed (known issue: when no file is left after a Change/Delete conflict merge, the MergePending property is not set) |
État
| Name | Type | Description |
|---|---|---|
.Unmerged | int | number of unmerged changes |
.Deleted | int | number of deleted changes |
.Added | int | number of added changes |
.Modified | int | number of modified changes |
.Moved | int | number of moved changes |
.Changed | boolean | if the status contains changes or not |
.String | string | a string representation of the changes above |
Les modifications locales utilisent la syntaxe suivante :
| Icon | Description |
|---|---|
x | Unmerged |
- | Deleted |
+ | Added |
~ | Modified |
v | Moved |