Return the current working branch.
| Parameters: | status_colors (bool) – determines whether repository status will be used to determine highlighting. Default: False. |
|---|
Highlight groups used: branch_clean, branch_dirty, branch.
Divider highlight group used: branch:divider.
List all buffers in segment_info format
Specifically generates a list of segment info dictionaries with buffer and bufnr keys set to buffer-specific ones, window, winnr and window_id keys unset.
Sets segment mode to either buf (for current buffer) or nc (for all other buffers).
Show buffer number
| Parameters: | show_current (bool) – If False do not show current window number. |
|---|
Return file directory (head component of the file path).
| Parameters: |
|
|---|
Return file encoding/character set.
| Returns: | file encoding/character set or None if unknown or missing file encoding |
|---|
Divider highlight group used: background:divider.
Return file format (i.e. line ending type).
| Returns: | file format or None if unknown or missing file format |
|---|
Divider highlight group used: background:divider.
Return file name (tail component of the file path).
| Parameters: |
|
|---|
Highlight groups used: file_name_no_file or file_name, file_name.
Return the protocol part of the file.
Protocol is the part of the full filename just before the colon which starts with a latin letter and contains only latin letters, digits, plus, period or hyphen (refer to RFC3986 for the description of URI scheme). If there is no such a thing None is returned, effectively removing segment.
Note
Segment will not check whether there is // just after the colon or if there is at least one slash after the scheme. Reason: it is not always present. E.g. when opening file inside a zip archive file name will look like zipfile:/path/to/archive.zip::file.txt. file_scheme segment will catch zipfile part here.
Return file size in &encoding.
| Parameters: |
|
|---|---|
| Returns: | file size or None if the file isn’t saved or if the size is too big to fit in a number |
Return file type.
| Returns: | file type or None if unknown file type |
|---|
Divider highlight group used: background:divider.
Return the VCS status for this buffer.
Highlight groups used: file_vcs_status.
Return the cursor position in the file as a percentage.
| Parameters: | gradient (bool) – highlight the percentage with a color gradient (by default a green to red gradient) |
|---|
Highlight groups used: line_percent_gradient (gradient), line_percent.
Return the current vim mode.
| Parameters: | override (dict) – dict for overriding default mode strings, e.g. { 'n': 'NORM' } |
|---|
Return a comma-separated list of modified buffers.
| Parameters: |
|
|---|
Return a file modified indicator.
| Parameters: | text (string) – text to display if the current buffer is modified |
|---|
Return a paste mode indicator.
| Parameters: | text (string) – text to display if paste mode is enabled |
|---|
Return the position of the current view in the file as a percentage.
| Parameters: |
|
|---|
Highlight groups used: position_gradient (gradient), position.
Return a read-only indicator.
| Parameters: | text (string) – text to display if the current buffer is read-only |
|---|
Show one text if there is only one tab and another if there are many
Mostly useful for tabline to indicate what kind of data is shown there.
| Parameters: |
|
|---|
Highlight groups used: single_tab, many_tabs.
List all tab pages in segment_info format
Specifically generates a list of segment info dictionaries with window, winnr, window_id, buffer and bufnr keys set to tab-local ones and additional tabpage and tabnr keys.
Sets segment mode to either tab (for current tab page) or nc (for all other tab pages).
Works best with vim-7.4 or later: earlier versions miss tabpage object and thus window objects are not available as well.
Show tabpage number
| Parameters: | show_current (bool) – If False do not show current tabpage number. This is default because tabnr is by default only present in tabline. |
|---|
Return the line number for trailing whitespaces
It is advised not to use this segment in insert mode: in Insert mode it will iterate over all lines in buffer each time you happen to type a character which may cause lags. It will also show you whitespace warning each time you happen to type space.
Highlight groups used: trailing_whitespace or warning.
Return current visual column with concealed characters ingored
| Parameters: | gradient (bool) – Determines whether it should show textwidth-based gradient (gradient level is virtcol * 100 / textwidth). |
|---|
Highlight groups used: virtcol_current_gradient (gradient), virtcol_current or col_current.
Return the current visual selection range.
| Parameters: |
|
|---|
All texts are format strings which are passed the following parameters:
| Parameter | Description |
|---|---|
| sline | Line number of the first line of the selection |
| eline | Line number of the last line of the selection |
| scol | Column number of the first character of the selection |
| ecol | Column number of the last character of the selection |
| svcol | Virtual column number of the first character of the selection |
| secol | Virtual column number of the last character of the selection |
| rows | Number of lines in the selection |
| cols | Number of columns in the selection |
| vcols | Number of virtual columns in the selection |