sinetoami / lightline-dimfocus.vim

Vim Plugin: simple way to customize lightline when a window is inactive.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lightline-dimfocus.vim

Inspired to extend the focusing event on lightline.vim plugin. Provides a simple way to customize the statusline and tabline when a window is inactive.

Requirements

Installation

Use your favorite plugin manager, and add to your .vimrc:

call dein#add('itchyny/lightline.vim')
call dein#add('sinetoami/lightline-dimfocus.vim')

Run :so % and :call dein#install().

Plug 'itchyny/lightline.vim'
Plug 'sinetoami/lightline-hunks.vim'

Run :so % and :PlugInstall.

Configuration

This plugin will attach to a coloscheme defined by the lightline.colorscheme variable.

g:lightline#dimfocus#blur [dictionary]

Defines the colorscheme to inactive windows. Will use the lightline.vim colorscheme style convention.

"" colorscheme style convention predefined by lightline.vim:
let s:palette.{mode}.{where} = [ [{guifg}, {guibg}, {ctermfg}, {ctermbg}, {fontstyle}}], ... ]

For more information, see :help lightline.

  1. The lightline-dimfocus.vim provide these components to customize:
  • {mode}
    • options: normal, tabline.
  • {where}
    • normal mode: left, right;
    • tabline mode: tabsel, left.
  • {gui(fg|bg)}
    • hexadecimal color number.
  • {cterm(fg|bg)}
    • decimal color number.
  • {fontstyle} - [optional]
    • bold, italic, underline or a combination of two or three of them. [optional]
  1. Needs to define the g:lightline#dimfocus#blur variable to active dim event to a inactive window.

Example

"" Defining a basic colorscheme
let s:lgray = ['#929192', 255]
let s:mgray = ['#221f22', 232]
let s:dgray = ['#19181A', 232]
let s:green = ['#a9dc76', 148]

"" Setting the g:lightline#dimfocus#blur variable:
let g:lightline#dimfocus#blur = 
\{
\ 'tabline': {
\   'left': [ [s:lgray[0], s:dgray[0], s:lgray[1], s:dgray[1]] ],
\   'tabsel': [ [s:lgray[0], s:mgray[0], s:lgray[1], s:mgray[1], 'bold'] ],
\ },
\ 'normal': {
\   'left': [ 
\     [s:lgray[0], s:mgray[0], s:lgray[1], s:mgray[1], 'bold'], 
\     [s:lgray[0], s:mgray[0], s:lgray[1], s:mgray[1]], 
\   ],
\   'right': [ 
\     [s:lgray[0], s:mgray[0], s:mgray[1], s:mgray[1], 'bold'], 
\     [s:lgray[0], s:mgray[0], s:lgray[1], s:mgray[1]], 
\     [s:lgray[0], s:dgray[0], s:lgray[1], s:dgray[1]] 
\    ],
\ },
\}

g:lightline#dimfocus#enabled

Set this variable if you want to disable this plugin. Default is 1.

Contributing

  • To ask about the contents of the configuration, send me a feedback, request features or report bugs, please open a GitHub issue.
  • Open a pull-request if you want to improve this plugin. I will glad to see your idea.

Self-Promotion

Do you like this plugin? Come on:

  • Star and follow the repository on GitHub.
  • Follow me on

License

MIT License

About

Vim Plugin: simple way to customize lightline when a window is inactive.

License:MIT License


Languages

Language:Vim Script 100.0%