install.fairie/dotfiles/.vim/plugged/vim-devicons/pythonx/vim_devicons/powerline/segments.py
Git E2E Dev Test Username e30fca43b3 git subrepo clone (merge) https://github.com/ryanoasis/vim-devicons.git ./dotfiles/.vim/plugged/vim-devicons
subrepo:
  subdir:   "dotfiles/.vim/plugged/vim-devicons"
  merged:   "71f239af2"
upstream:
  origin:   "https://github.com/ryanoasis/vim-devicons.git"
  branch:   "master"
  commit:   "71f239af2"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:31 -04:00

28 lines
884 B
Python

# -*- coding: utf-8 -*-
# vim:se fenc=utf8 noet:
from __future__ import (unicode_literals, division, absolute_import, print_function)
try:
import vim
except ImportError:
vim = {}
from powerline.bindings.vim import (vim_get_func, buffer_name)
from powerline.theme import requires_segment_info
@requires_segment_info
def webdevicons(pl, segment_info):
webdevicons = vim_get_func('WebDevIconsGetFileTypeSymbol')
name = buffer_name(segment_info)
return [] if not webdevicons else [{
'contents': webdevicons(name),
'highlight_groups': ['webdevicons', 'file_name'],
}]
@requires_segment_info
def webdevicons_file_format(pl, segment_info):
webdevicons_file_format = vim_get_func('WebDevIconsGetFileFormatSymbol')
return [] if not webdevicons_file_format else [{
'contents': webdevicons_file_format(),
'highlight_groups': ['webdevicons_file_format', 'file_format'],
}]