lightline-onedark


Ⅰ. 插件描述

A lightline.vim theme for onedark.vim colorscheme

Ⅱ. 基本信息

创建日期:  2016-09-03
使用用户:  1
Github星:  6
插件作者:  Dai Truong

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'novadev94/lightline-onedark-lives-by-it'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'novadev94/lightline-onedark-lives-by-it'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'novadev94/lightline-onedark-lives-by-it'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/novadev94/lightline-onedark

Ⅳ. 文档说明

# lightline-onedark

This is an itchyny/lightline.vim theme for joshdick/onedark.vim with extra support for bling/bufferline.vim integration.

All the used color codes are extracted from the original joshdick/onedark.vim theme, so the appearance should look consistent.

Screenshot

onedark

Installation

  1. You can install this manually by putting it under $VIM folder or using any package manager of your choice (vim-plug, Vundle, Pathogen, NeoBundle,...)
  2. Add this theme to your lightline configuration in your .vimrc using the theme name onedark.

    • If you haven't had your customized lightline configuration yet
    let g:lightline.colorscheme = 'onedark'
    • If you've already had one
    let g:lightline = {
      \ 'colorscheme': 'onedark',
      \
    }

Configuration

Available Options

  • g:lightline#onedark#disable_bold_style _(Default - 0)_: Do not use bold style.

bufferline.vim integration

Some customizations are also added to support integration with bling/bufferline.vim. Other than the default tabsel, you can use bufsel (selected buffer) and tabsep (separator between tabs & buffers) in your lightline component_type.

See Example for more details.

Example

This is extracted from my own .vimrc. This also shows the integration with bufferline.

If you have some problems of buffers on tab line not switching properly. Please checkout my fork here NovaDev94/bufferline.

let g:bufferline_echo = 0
let g:bufferline_modified = ' ✱'
let g:bufferline_show_bufnr = 0
let g:bufferline_unnamed_buffer = '[No Name]'
let g:bufferline_separator = ' '
let g:bufferline_active_buffer_left = ''
let g:bufferline_active_buffer_right = ''

let g:lightline =
  \ {
  \   'colorscheme': 'onedark',
  \   'tabline': {
  \     'left': [ [ 'tabs', 'tablinesep', 'bufferline'] ],
  \     'right': [ [ 'folder' ] ]
  \   },
  \   'tab': {
  \     'active': [ 'tabnum' ],
  \     'inactive': [ 'tabnum' ]
  \   },
  \   'component_expand': {
  \     'bufferline': 'MyBufferline',
  \     'tablinesep': 'MyTablineSep'
  \   },
  \   'component_type': {
  \     'bufferline': 'bufsel',
  \     'tablinesep': 'tabsep'
  \   },
  \   'tabline_subseparator': { 'left': '', 'right': '' },
  \   'tabline_separator': { 'left': '', 'right': '' },
  \ }

function! MyTablineSep()
  return tabpagenr('$') > 1 ? ['', '●', ''] : ''
endfunction

function! MyBufferline()
  call bufferline#refresh_status()
  let buffers = [
    \   g:bufferline_status_info.before,
    \   g:bufferline_status_info.current,
    \   g:bufferline_status_info.after
    \ ]
  call map(buffers, 's:strip(v:val)')
  return buffers
endfunction

添加新评论