mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-12 13:33:50 -05:00
be configurable
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
" Version: 0.0
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2013/08/22 06:03:02.
|
||||
" Last Change: 2013/08/22 09:00:36.
|
||||
" =============================================================================
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
@@ -45,7 +45,7 @@ function! lightline#init()
|
||||
let g:lightline._mode_ = {
|
||||
\ 'n' : 'normal', 'i' : 'insert', 'R' : 'replace', 'v' : 'visual', 'V' : 'visual',
|
||||
\ 'c' : 'command', '': 'visual', 's' : 'select', 'S' : 'select', '': 'select', }
|
||||
let g:lightline.component = get(g:lightline, 'component', {
|
||||
let g:lightline._component = {
|
||||
\ 'mode': '%{lightline#mode()}',
|
||||
\ 'filename': '%t',
|
||||
\ 'modified': '%M',
|
||||
@@ -54,10 +54,18 @@ function! lightline#init()
|
||||
\ 'filetype': '%{strlen(&filetype)?&filetype:"no ft"}',
|
||||
\ 'percent': '%3p%%',
|
||||
\ 'lineinfo': '%3l:%-2v',
|
||||
\ 'fugitive': '%{fugitive#head()}' })
|
||||
let g:lightline.component_length = get(g:lightline, 'component_length', {
|
||||
\ 'fugitive': '%{fugitive#head()}' }
|
||||
let g:lightline.component = get(g:lightline, 'component', {})
|
||||
for [k, v] in items(g:lightline._component)
|
||||
let g:lightline.component[k] = get(g:lightline.component, k, v)
|
||||
endfor
|
||||
let g:lightline._component_length = {
|
||||
\ 'modified': '(&modified||!&modifiable)',
|
||||
\ 'fugitive': 'strlen(fugitive#head())' })
|
||||
\ 'fugitive': 'strlen(fugitive#head())' }
|
||||
let g:lightline.component_length = get(g:lightline, 'component_length', {})
|
||||
for [k, v] in items(g:lightline._component_length)
|
||||
let g:lightline.component_length[k] = get(g:lightline.component_length, k, v)
|
||||
endfor
|
||||
let g:lightline.separator = get(g:lightline, 'separator', {})
|
||||
let g:lightline.separator.left = get(g:lightline.separator, 'left', '')
|
||||
let g:lightline.separator.right = get(g:lightline.separator, 'right', '')
|
||||
@@ -98,7 +106,7 @@ function! lightline#mode()
|
||||
endfunction
|
||||
|
||||
function! s:term(l)
|
||||
return len(a:l) == 5 && type(a:l[4]) == 1 ? 'term='.a:l[4] : ''
|
||||
return len(a:l) == 5 && type(a:l[4]) == 1 ? 'term='.a:l[4].' cterm='.a:l[4] : ''
|
||||
endfunction
|
||||
function! lightline#highlight(mode)
|
||||
let d = has_key(g:lightline.palette, a:mode) ? a:mode : 'normal'
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
" Version: 0.0
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2013/08/22 05:31:02.
|
||||
" Last Change: 2013/08/22 08:28:55.
|
||||
" =============================================================================
|
||||
|
||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}}
|
||||
let s:p.normal.left = [ ['#0000ff', '#ffffff', 21, 231 ], [ '#ffffff', '#0000ff', 231, 21 ], [ '#ffffff', '#0000ff', 231, 21 ] ]
|
||||
let s:p.normal.left = [ ['#0000ff', '#ffffff', 21, 231, 'bold' ], [ '#ffffff', '#0000ff', 231, 21 ], [ '#ffffff', '#0000ff', 231, 21 ] ]
|
||||
let s:p.normal.right = [ [ '#303030', '#d0d0d0', 236, 252 ], [ '#303030', '#8a8a8a', 236, 245 ], [ '#bcbcbc', '#585858', 250, 240 ] ]
|
||||
let s:p.inactive.right = [ [ '#121212', '#606060', 233, 241 ], [ '#121212', '#3a3a3a', 233, 237 ], [ '#121212', '#262626', 233, 235 ], [ '#121212', '#262626', 233, 235 ] ]
|
||||
let s:p.inactive.left = s:p.inactive.right[1:]
|
||||
let s:p.insert.left = [ ['#005f00', '#ffffff', 22, 231 ], [ '#ffffff', '#005f00', 231, 22 ], [ '#ffffff', '#005f00', 231, 22 ] ]
|
||||
let s:p.replace.left = [ [ '#af0000', '#ffffff', 124, 231 ], [ '#ffffff', '#af0000', 231, 124 ], [ '#ffffff', '#af0000', 231, 124 ] ]
|
||||
let s:p.visual.left = [ [ '#5f00ff', '#ffffff', 57, 231 ], [ '#ffffff', '#5f00ff', 231, 57 ], [ '#ffffff', '#5f00ff', 231, 57 ] ]
|
||||
let s:p.insert.left = [ ['#005f00', '#ffffff', 22, 231, 'bold' ], [ '#ffffff', '#005f00', 231, 22 ], [ '#ffffff', '#005f00', 231, 22 ] ]
|
||||
let s:p.replace.left = [ [ '#af0000', '#ffffff', 124, 231, 'bold' ], [ '#ffffff', '#af0000', 231, 124 ], [ '#ffffff', '#af0000', 231, 124 ] ]
|
||||
let s:p.visual.left = [ [ '#5f00ff', '#ffffff', 57, 231, 'bold' ], [ '#ffffff', '#5f00ff', 231, 57 ], [ '#ffffff', '#5f00ff', 231, 57 ] ]
|
||||
let s:p.normal.middle = [ [ '#ffffff', '#303030', 231, 236 ] ]
|
||||
let s:p.inactive.middle = [ [ '#303030', '#121212', 236, 233 ] ]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user