Saltar al contenido principal

Plastic SCM

Traducción Beta No Oficial

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

Qué hace

Muestra información de Plastic SCM cuando estás en un repositorio de Plastic. También funciona en subcarpetas. Para máxima compatibilidad, asegúrate de tener actualizado tu ejecutable cm (por ejemplo, cuando la información de rama o estado es incorrecta).

Configuración de ejemplo

{
"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
}
}

Icono de Plastic SCM

Si quieres usar el icono de Plastic SCM en el segmento, ¡ayúdanos a impulsarlo en este issue dando un like! icon

Opciones

Obtención de información

Como múltiples llamadas a cm pueden ralentizar el prompt, por defecto no obtenemos información adicional. Puedes establecer la siguiente propiedad en true para habilitar la obtención de información extra (y poblar la plantilla).

NameTypeDefaultDescription
fetch_statusbooleanfalsefetch the local changes
native_fallbackbooleanfalsewhen 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_formatsmap[string]stringa 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

Iconos

Rama

NameTypeDefaultDescription
branch_iconstring\uE0A0the icon to use in front of the git branch name
mapped_branchesobjectcustom glyph/text for specific branches. You can use * at the end as a wildcard character for matching
branch_templatestringa template to format that branch name. You can use {{ .Branch }} as reference to the original branch name

Selector

NameTypeDefaultDescription
commit_iconstring\uF417icon/text to display before the commit context (detached HEAD)
tag_iconstring\uF412icon/text to display before the tag context

Plantilla (info)

plantilla predeterminada
 {{ .Selector }}

Propiedades

NameTypeDescription
.Selectorstringthe current selector context (branch/changeset/label)
.Behindboolthe current workspace is behind and changes are incoming
.StatusStatuschanges in the workspace (see below)
.MergePendingboolif 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)

Estado

NameTypeDescription
.Unmergedintnumber of unmerged changes
.Deletedintnumber of deleted changes
.Addedintnumber of added changes
.Modifiedintnumber of modified changes
.Movedintnumber of moved changes
.Changedbooleanif the status contains changes or not
.Stringstringa string representation of the changes above

Los cambios locales usan la siguiente sintaxis:

IconDescription
xUnmerged
-Deleted
+Added
~Modified
vMoved