Skip to main content

Plastic SCM

Whatโ€‹

Display Plastic SCM information when in a plastic repository. Also works for subfolders. For maximum compatibility, make sure your cm executable is up-to-date (when branch or status information is incorrect for example).

Sample Configurationโ€‹

{
"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 }}",
"properties": {
"fetch_status": true,
"branch_max_length": 25,
"truncate_symbol": "โ€ฆ"
}
}

Plastic SCM Iconโ€‹

If you want to use the icon of Plastic SCM in the segment, then please help me push the icon in this issue by leaving a like! icon

Propertiesโ€‹

Fetching informationโ€‹

As doing multiple cm calls can slow down the prompt experience, we do not fetch information by default. You can set the following property to true to enable fetching additional information (and populate the template).

NameTypeDefaultDescription
fetch_statusbooleanfalsefetch the local changes
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

Iconsโ€‹

Branchโ€‹

NameTypeDefaultDescription
branch_iconstring\uE0A0the icon to use in front of the git branch name
full_branch_pathbooltruedisplay the full branch path: _/main/fix-001_ instead of _fix-001_
branch_max_lengthint0the max length for the displayed branch name where 0 implies full length
truncate_symbolstringthe icon to display when a branch name is truncated

Selectorโ€‹

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

Template (info)โ€‹

default template
{{ .Selector }}

Propertiesโ€‹

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)

Statusโ€‹

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

Local changes use the following syntax:

IconDescription
xUnmerged
-Deleted
+Added
~Modified
vMoved