VimPlugin: lightline: Difference between revisions
From wikinotes
No edit summary |
|||
Line 12: | Line 12: | ||
= Configuration = | = Configuration = | ||
<blockquote> | <blockquote> | ||
Information that is presented in the line is encapsulated into a | |||
== Statusline Configuration == | |||
<blockquote> | |||
* sublists have separators between them | |||
* each left/right element is a component (see below) | |||
<source lang="vim"> | |||
let g:lightline = { | |||
\ 'active': { | |||
\ 'left': [ ['filename'], ['modified', 'readonly'] ], | |||
\ 'right': [ ['fileencoding'] ], | |||
\} | |||
</source> | |||
</blockquote><!-- statusline configuration --> | |||
== Components == | |||
<blockquote> | |||
Information that is presented in the line is encapsulated into a '''component''' | |||
<source lang="vim"> | <source lang="vim"> | ||
Line 20: | Line 37: | ||
\ }, | \ }, | ||
\ 'component': { | \ 'component': { | ||
\ 'helloworld': 'Hello, world!' | \ 'helloworld': 'Hello, world!', | ||
\ }, | \ }, | ||
\ 'component_function': { | |||
\ 'git_branch': 'FugitiveHead', | |||
\ } | |||
\ } | \ } | ||
" now this will show 'Hello, world' | |||
echo &statusline | |||
</source> | </source> | ||
component text can be: | |||
<source lang="vim"> | |||
"regular text" " regular text | |||
'0x%B' " statusline formatter syntax | |||
vim functions " vim functions | |||
</source> | |||
</blockquote><!-- components --> | |||
</blockquote><!-- configuration --> | </blockquote><!-- configuration --> |
Revision as of 17:10, 10 February 2024
lightweight viml powerline clone w/ api for hooking other plugin info.
Documentation
github https://github.com/itchyny/lightline.vim
Configuration
Statusline Configuration
- sublists have separators between them
- each left/right element is a component (see below)
let g:lightline = { \ 'active': { \ 'left': [ ['filename'], ['modified', 'readonly'] ], \ 'right': [ ['fileencoding'] ], \}Components
Information that is presented in the line is encapsulated into a component
let g:lightline = { \ 'active': { \ 'left': [ 'filename', 'modified', 'helloworld' ] \ }, \ 'component': { \ 'helloworld': 'Hello, world!', \ }, \ 'component_function': { \ 'git_branch': 'FugitiveHead', \ } \ } " now this will show 'Hello, world' echo &statuslinecomponent text can be:
"regular text" " regular text '0x%B' " statusline formatter syntax vim functions " vim functions