mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 09:22:53 +08:00
add more documentation about accents. resolves #299.
This commit is contained in:
parent
491091706f
commit
9e53c2c155
|
@ -76,9 +76,13 @@ let g:airline#themes#dark#palette.inactive_modified = {
|
|||
\ }
|
||||
|
||||
|
||||
" Accents are used to give parts within a section a slightly different look.
|
||||
" Here we are defining a "red" accent, which is used by the 'readonly' part by
|
||||
" default.
|
||||
" Accents are used to give parts within a section a slightly different look or
|
||||
" color. Here we are defining a "red" accent, which is used by the 'readonly'
|
||||
" part by default. Only the foreground colors are specified, so the background
|
||||
" colors are automatically extracted from the underlying section colors. What
|
||||
" this means is that regardless of which section the part is defined in, it
|
||||
" will be red instead of the section's foreground color. You can also have
|
||||
" multiple parts with accents within a section.
|
||||
let g:airline#themes#dark#palette.accents = {
|
||||
\ 'red': [ '#ff0000' , '' , 160 , '' ]
|
||||
\ }
|
||||
|
|
|
@ -438,6 +438,22 @@ And the following are defined for their respective extensions:
|
|||
|
||||
`hunks`, `branch`, `tagbar`, `syntastic`, `whitespace`
|
||||
|
||||
------------------------------------- *airline-accents*
|
||||
Accents can be defined on any part, like so: >
|
||||
call airline#parts#define_accent('foo', 'red')
|
||||
<
|
||||
This will override the colors of that part by using what is defined in that
|
||||
particular accent. In the above example, the `red` accent is used, which means
|
||||
regardless of which section the part is used in, it will have red foreground
|
||||
colors instead of the section's default foreground color.
|
||||
|
||||
The following accents are defined by default. Themes can define their variants
|
||||
of the colors, but defaults will be provided if missing. >
|
||||
bold, italic, red, green, blue, yellow, orange, purple
|
||||
<
|
||||
The defaults configure the mode and line number parts to be bold, and the
|
||||
readonly part to be red.
|
||||
|
||||
------------------------------------- *airline-sections*
|
||||
Once a part is defined, you can use helper functions to generate the
|
||||
statuslines for each section. For example, to use the part above, we could
|
||||
|
|
Loading…
Reference in New Issue
Block a user