powerline_mem_segment


Ⅰ. 插件描述

Ⅱ. 基本信息

创建日期:  2015-06-30
使用用户:  1
Github星:  9
插件作者:  Mads Kalør

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'mkaloer/powerline-mem-segment'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'mkaloer/powerline-mem-segment'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'mkaloer/powerline-mem-segment'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/mkaloer/powerline_mem_segment

Ⅳ. 文档说明

# Powerline Memory Segment
Segment for Powerline showing the current memory usage in percent or absolute values.

Installation

pip install powerline-mem-segment

Usage

To apply the segment, add the following to the Powerline configuration file:

{
    "function": "powerlinemem.mem_usage.mem_usage"
}

For a percentage status, use the mem_usage_percent callable:

{
    "function": "powerlinemem.mem_usage.mem_usage_percent"
}

The format can be configured using the format argument:

{
    "function": "powerlinemem.mem_usage.mem_usage_percent",
    "priority": 50,
    "args": {
        "format": "Mem: %d%%"
    }
}

The type of memory to use can be configured by passing the desired psutil attribute name as the mem_type argument (the default is "used"):

{
    "function": "powerlinemem.mem_usage.mem_usage",
    "priority": 50,
    "args": {
        "mem_type": "active"
    }
}

The short form of size units (i.e. "K", "M", "G"...) can be used by passing the short argument (the default is False):

{
    "function": "powerlinemem.mem_usage.mem_usage",
    "args": {
        "short": true
    }
}

One or two highlight groups named mem_usage and mem_usage_gradient have to be defined in the colorscheme json file. For example:

"mem_usage":                 { "fg": "gray8", "bg": "gray0", "attrs": [] },
"mem_usage_gradient":        { "fg": "green_yellow_orange_red", "bg": "gray0", "attrs": [] }

Dependencies

The only dependency is psutil.

添加新评论