mirror of
https://github.com/amix/vimrc
synced 2025-07-07 00:15:00 +08:00
Updated plugins, also experimenting with a new font
The font is IBM Plex Mono: https://ibm.github.io/type/
This commit is contained in:
@ -21,7 +21,6 @@ env:
|
||||
- VIM_VERSION=8.0.0000
|
||||
- VIM_VERSION=7.4
|
||||
- VIM_VERSION=7.3
|
||||
- VIM_VERSION=7.2.051
|
||||
|
||||
script:
|
||||
- export PATH=$HOME/vim-$VIM_VERSION/bin:$PATH
|
||||
|
@ -47,8 +47,8 @@ landscape is my colorscheme, which is a high-contrast cui-supported colorscheme,
|
||||
|
||||
## Why yet another clone of powerline?
|
||||
+ [vim-powerline](https://github.com/Lokaltog/vim-powerline) is a nice plugin, but deprecated.
|
||||
+ [powerline](https://github.com/Lokaltog/powerline) is a nice plugin, but difficult to configure.
|
||||
+ [vim-airline](https://github.com/bling/vim-airline) is a nice plugin, but it uses too much functions of other plugins, which should be done by users in `.vimrc`.
|
||||
+ [powerline](https://github.com/powerline/powerline) is a nice plugin, but difficult to configure.
|
||||
+ [vim-airline](https://github.com/vim-airline/vim-airline) is a nice plugin, but it uses too much functions of other plugins, which should be done by users in `.vimrc`.
|
||||
|
||||
## Spirit of this plugin
|
||||
+ Minimalism. The core script is very small to achive enough functions as a statusline plugin.
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Filename: autoload/lightline.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2017/08/21 08:19:52.
|
||||
" Last Change: 2017/11/11 13:29:26.
|
||||
" =============================================================================
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
@ -105,7 +105,7 @@ let s:_lightline = {
|
||||
\ 'paste': '%{&paste?"PASTE":""}', 'readonly': '%R', 'charvalue': '%b', 'charvaluehex': '%B',
|
||||
\ 'spell': '%{&spell?&spelllang:""}', 'fileencoding': '%{&fenc!=#""?&fenc:&enc}', 'fileformat': '%{&ff}',
|
||||
\ 'filetype': '%{&ft!=#""?&ft:"no ft"}', 'percent': '%3p%%', 'percentwin': '%P',
|
||||
\ 'lineinfo': '%3l:%-2v', 'line': '%l', 'column': '%c', 'close': '%999X X '
|
||||
\ 'lineinfo': '%3l:%-2v', 'line': '%l', 'column': '%c', 'close': '%999X X ', 'winnr': '%{winnr()}'
|
||||
\ },
|
||||
\ 'component_visible_condition': {
|
||||
\ 'modified': '&modified||!&modifiable', 'readonly': '&readonly', 'paste': '&paste', 'spell': '&spell'
|
||||
@ -267,7 +267,7 @@ function! lightline#highlight(...) abort
|
||||
let [s:lightline.llen, s:lightline.rlen] = [len(c.normal.left), len(c.normal.right)]
|
||||
let [s:lightline.tab_llen, s:lightline.tab_rlen] = [len(has_key(get(c, 'tabline', {}), 'left') ? c.tabline.left : c.normal.left), len(has_key(get(c, 'tabline', {}), 'right') ? c.tabline.right : c.normal.right)]
|
||||
let types = map(s:uniq(sort(filter(values(s:lightline.component_type), 'v:val !=# "raw"'))), '[v:val, 1]')
|
||||
let modes = a:0 ? [a:1] : extend(['normal', 'insert', 'replace', 'visual', 'inactive', 'command', 'select', 'tabline'], has('nvim') ? ['terminal'] : [])
|
||||
let modes = a:0 ? [a:1] : extend(['normal', 'insert', 'replace', 'visual', 'inactive', 'command', 'select', 'tabline'], exists(':terminal') == 2 ? ['terminal'] : [])
|
||||
for mode in modes
|
||||
let s:highlight[mode] = 1
|
||||
let d = has_key(c, mode) ? mode : has_key(f, mode) && has_key(c, f[mode]) ? f[mode] : 'normal'
|
||||
@ -450,7 +450,7 @@ function! lightline#tabs() abort
|
||||
let nr = tabpagenr()
|
||||
let cnt = tabpagenr('$')
|
||||
for i in range(1, cnt)
|
||||
call add(i < nr ? x : i == nr ? y : z, '%'. i . 'T%{lightline#onetab(' . i . ',' . (i == nr) . ')}' . (i == cnt ? '%T' : ''))
|
||||
call add(i < nr ? x : i == nr ? y : z, (i > nr + 3 ? '%<' : '') . '%'. i . 'T%{lightline#onetab(' . i . ',' . (i == nr) . ')}' . (i == cnt ? '%T' : ''))
|
||||
endfor
|
||||
let abbr = '...'
|
||||
let n = min([max([s:lightline.winwidth / 40, 2]), 8])
|
||||
|
@ -4,7 +4,7 @@ Version: 0.1
|
||||
Author: itchyny (https://github.com/itchyny)
|
||||
License: MIT License
|
||||
Repository: https://github.com/itchyny/lightline.vim
|
||||
Last Change: 2017/08/21 08:33:12.
|
||||
Last Change: 2017/11/18 20:07:05.
|
||||
|
||||
CONTENTS *lightline-contents*
|
||||
|
||||
@ -109,8 +109,9 @@ OPTIONS *lightline-option*
|
||||
\ 'spell': '%{&spell?&spelllang:""}',
|
||||
\ 'lineinfo': '%3l:%-2v',
|
||||
\ 'line': '%l',
|
||||
\ 'column': '%c'
|
||||
\ 'close': '%999X X ' }
|
||||
\ 'column': '%c',
|
||||
\ 'close': '%999X X ',
|
||||
\ 'winnr': '%{winnr()}' }
|
||||
<
|
||||
g:lightline.component_visible_condition
|
||||
*g:lightline.component_visible_condition*
|
||||
@ -228,7 +229,7 @@ OPTIONS *lightline-option*
|
||||
Currently, wombat, solarized, powerline, jellybeans, Tomorrow,
|
||||
Tomorrow_Night, Tomorrow_Night_Blue, Tomorrow_Night_Eighties,
|
||||
PaperColor, seoul256, landscape, one, Dracula, darcula,
|
||||
Molokai and 16color are available.
|
||||
molokai, materia, material, OldHope, nord and 16color are available.
|
||||
The default value is:
|
||||
>
|
||||
let g:lightline.colorscheme = 'default'
|
||||
@ -1223,7 +1224,9 @@ Problem 12: *lightline-problem-12*
|
||||
Problem 13: *lightline-problem-13*
|
||||
How to change the lightline colorscheme on the fly.
|
||||
|
||||
Add the following settings to your .vimrc(_vimrc).
|
||||
To update your lightline colorscheme in sync with your vim
|
||||
colorscheme (only for select colorschemes which exist for
|
||||
both), add the following settings to your .vimrc(_vimrc).
|
||||
>
|
||||
augroup LightlineColorscheme
|
||||
autocmd!
|
||||
@ -1244,6 +1247,27 @@ Problem 13: *lightline-problem-13*
|
||||
catch
|
||||
endtry
|
||||
endfunction
|
||||
<
|
||||
If you have not settled on a single lightline colorscheme, you
|
||||
can easily switch between lightline colorschemes by adding the
|
||||
following LightlineColorscheme command to your .vimrc(_vimrc).
|
||||
>
|
||||
function! s:set_lightline_colorscheme(name) abort
|
||||
let g:lightline.colorscheme = a:name
|
||||
call lightline#init()
|
||||
call lightline#colorscheme()
|
||||
call lightline#update()
|
||||
endfunction
|
||||
|
||||
function! s:lightline_colorschemes(...) abort
|
||||
return join(map(
|
||||
\ globpath(&rtp,"autoload/lightline/colorscheme/*.vim",1,1),
|
||||
\ "fnamemodify(v:val,':t:r')"),
|
||||
\ "\n")
|
||||
endfunction
|
||||
|
||||
command! -nargs=1 -complete=custom,s:lightline_colorschemes LightlineColorscheme
|
||||
\ call s:set_lightline_colorscheme(<q-args>)
|
||||
<
|
||||
Problem 14: *lightline-problem-14*
|
||||
The 'E541' warning appears on the right hand side.
|
||||
|
@ -61,7 +61,7 @@ function! s:suite.tabnew_20_tabfirst()
|
||||
tabnew
|
||||
endfor
|
||||
tabfirst
|
||||
call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2), s:tab(3), s:tab(4), s:tab(5), '...', s:tab(17), s:tab(18), s:tab(19), s:tab(20, 0, 1)]])
|
||||
call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2), s:tab(3), s:tab(4), '%<' . s:tab(5), '...', '%<' . s:tab(17), '%<' . s:tab(18), '%<' . s:tab(19), '%<' . s:tab(20, 0, 1)]])
|
||||
endfunction
|
||||
|
||||
function! s:suite.tabnew_20_tabfirst_tabnext()
|
||||
@ -70,7 +70,7 @@ function! s:suite.tabnew_20_tabfirst_tabnext()
|
||||
endfor
|
||||
tabfirst
|
||||
tabnext
|
||||
call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1)], [s:tab(3), s:tab(4), s:tab(5), s:tab(6), '...', s:tab(18), s:tab(19), s:tab(20, 0, 1)]])
|
||||
call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1)], [s:tab(3), s:tab(4), s:tab(5), '%<' . s:tab(6), '...', '%<' . s:tab(18), '%<' . s:tab(19), '%<' . s:tab(20, 0, 1)]])
|
||||
endfunction
|
||||
|
||||
function! s:suite.tabnew_20_tabnext_10()
|
||||
@ -78,7 +78,7 @@ function! s:suite.tabnew_20_tabnext_10()
|
||||
tabnew
|
||||
endfor
|
||||
tabnext 10
|
||||
call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), '...', s:tab(8), s:tab(9)], [s:tab(10, 1)], [s:tab(11), s:tab(12), '...', s:tab(19), s:tab(20, 0, 1)]])
|
||||
call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), '...', s:tab(8), s:tab(9)], [s:tab(10, 1)], [s:tab(11), s:tab(12), '...', '%<' . s:tab(19), '%<' . s:tab(20, 0, 1)]])
|
||||
endfunction
|
||||
|
||||
function! s:suite.tabnew_20_tabprevious()
|
||||
|
Reference in New Issue
Block a user