Vim segments

powerline.segments.vim.branch(status_colors=False)[source]

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.

powerline.segments.vim.col_current()[source]

Return the current cursor column.

powerline.segments.vim.file_directory(shorten_home=False, shorten_cwd=True, shorten_user=True)[source]

Return file directory (head component of the file path).

Parameters:
  • shorten_user (bool) – shorten $HOME directory to ~/
  • shorten_cwd (bool) – shorten current directory to ./
  • shorten_home (bool) – shorten all directories in /home/ to ~user/ instead of /home/user/.
powerline.segments.vim.file_encoding(segment_info)[source]

Return file encoding/character set.

Returns:file encoding/character set or None if unknown or missing file encoding

Divider highlight group used: background:divider.

powerline.segments.vim.file_format(segment_info)[source]

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.

powerline.segments.vim.file_name(no_file_text=u'[No file]', display_no_file=False)[source]

Return file name (tail component of the file path).

Parameters:
  • display_no_file (bool) – display a string if the buffer is missing a file name
  • no_file_text (str) – the string to display if the buffer is missing a file name

Highlight groups used: file_name_no_file or file_name, file_name.

powerline.segments.vim.file_size(si_prefix=False, suffix=u'B')[source]

Return file size in &encoding.

Parameters:
  • suffix (str) – string appended to the file size
  • si_prefix (bool) – use SI prefix, e.g. MB instead of MiB
Returns:

file size or None if the file isn’t saved or if the size is too big to fit in a number

powerline.segments.vim.file_type(segment_info)[source]

Return file type.

Returns:file type or None if unknown file type

Divider highlight group used: background:divider.

powerline.segments.vim.file_vcs_status()[source]

Return the VCS status for this buffer.

Highlight groups used: file_vcs_status.

powerline.segments.vim.line_current()[source]

Return the current cursor line.

powerline.segments.vim.line_percent(gradient=False)[source]

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.

powerline.segments.vim.mode(override=None)[source]

Return the current vim mode.

Parameters:override (dict) – dict for overriding default mode strings, e.g. { 'n': 'NORM' }
powerline.segments.vim.modified_buffers(join_str=u', ', text=u'+ ')[source]

Return a comma-separated list of modified buffers.

Parameters:
  • text (str) – text to display before the modified buffer list
  • join_str (str) – string to use for joining the modified buffer list
powerline.segments.vim.modified_indicator(text=u'+')[source]

Return a file modified indicator.

Parameters:text (string) – text to display if the current buffer is modified
powerline.segments.vim.paste_indicator(text=u'PASTE')[source]

Return a paste mode indicator.

Parameters:text (string) – text to display if paste mode is enabled
powerline.segments.vim.position(gradient=False, position_strings={u'top': u'Top', u'all': u'All', u'bottom': u'Bot'})[source]

Return the position of the current view in the file as a percentage.

Parameters:
  • position_strings (dict) – dict for translation of the position strings, e.g. {"top":"Oben", "bottom":"Unten", "all":"Alles"}
  • gradient (bool) – highlight the percentage with a color gradient (by default a green to red gradient)

Highlight groups used: position_gradient (gradient), position.

powerline.segments.vim.readonly_indicator(text=u'\ue0a2')[source]

Return a read-only indicator.

Parameters:text (string) – text to display if the current buffer is read-only
powerline.segments.vim.virtcol_current(gradient=True)[source]

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.

powerline.segments.vim.visual_range()[source]

Return the current visual selection range.

Returns a value similar to showcmd.

powerline.segments.vim.window_title()[source]

Return the window title.

This currently looks at the quickfix_title window variable, which is used by Syntastic and Vim itself.

It is used in the quickfix theme.

Previous topic

Shell segments

This Page