docs: keep the same style across documentation & fix some typos (#515)

* docs: keep same style across docs and fix several typos

* docs: better formatting
This commit is contained in:
Aziz Ben Ali 2021-12-31 13:06:08 +01:00 committed by GitHub
parent 9e26823ea6
commit 9fcdafebd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 96 additions and 79 deletions

159
README.md
View File

@ -178,7 +178,7 @@ Please create a pr if you managed to port a popular theme before me, [here is ho
```lua ```lua
local custom_gruvbox = require'lualine.themes.gruvbox' local custom_gruvbox = require'lualine.themes.gruvbox'
-- Change the background of lualine_c section for normal mode -- Change the background of lualine_c section for normal mode
custom_gruvbox.normal.c.bg = '#112233' -- rgb colors are supported custom_gruvbox.normal.c.bg = '#112233' -- RGB colors are supported
require'lualine'.setup{ require'lualine'.setup{
options = { theme = custom_gruvbox }, options = { theme = custom_gruvbox },
... ...
@ -331,10 +331,10 @@ options = {
theme = 'auto', -- lualine theme theme = 'auto', -- lualine theme
component_separators = {left = '', right = ''}, component_separators = {left = '', right = ''},
section_separators = {left = '', right = ''}, section_separators = {left = '', right = ''},
disabled_filetypes = {}, -- filetypes to disable lualine on disabled_filetypes = {}, -- Filetypes to disable lualine for.
always_divide_middle = true, -- When true left_sections (a,b,c) can't always_divide_middle = true, -- When set to true, left sections i.e. 'a','b' and 'c'
-- take over entiee statusline even -- can't take over the entire statusline even
-- when none of section x, y, z is present. -- if neither of 'x', 'y' or 'z' are present.
} }
``` ```
@ -348,40 +348,51 @@ sections = {
lualine_a = { lualine_a = {
{ {
'mode', 'mode',
icons_enabled = true, -- displays icons in alongside component icons_enabled = true, -- Enables the display of icons alongside the component.
icon = nil, -- displays icon in front of the component icon = nil, -- Defines the icon to be displayed in front of the component.
separator = nil, -- Determines what separator to use for the component. separator = nil, -- Determines what separator to use for the component.
-- when a string is given it's treated as component_separator. -- When a string is provided it's treated as component_separator.
-- When a table is given it's treated as section_separator. -- When a table is provided it's treated as section_separator.
-- This options can be used to set colored separators -- These options can be used to set colored separators
-- arround component. Option need to be set like -- around a component.
-- `separator = { left = '', right = ''}`. --
-- Where left will be placed in left side of component -- The options need to be set like:
-- and right will be placed in right side of component -- separator = { left = '', right = ''}
-- Passing empty string disables that separator --
cond = nil, -- condition function, component is loaded when function returns true -- Where left will be placed on left side of component,
-- custom color for the component in format -- and right will be placed on its right.
-- here '|' refers to or meaning a different acceptable format for that placeholder -- Passing an empty string disables the separator.
cond = nil, -- Condition function, the component is loaded when the function returns `true`.
-- Custom color for the component in format
-- here, '|' refers to 'or', meaning a different acceptable format for that placeholder e.g.:
-- 'highlight_group_name' | {fg = '#rrggbb'|cterm_value(0-255)|'color_name(red)', bg= '#rrggbb', gui='style'} -- 'highlight_group_name' | {fg = '#rrggbb'|cterm_value(0-255)|'color_name(red)', bg= '#rrggbb', gui='style'}
-- Note: all other color options including themes accept like diff_color same color values --
-- Example -- Note: all other color options like diff_color including themes accept same color values
--
-- example:
-- color = {fg = '#ffaa88', bg = 'grey', gui='italic,bold'}, -- color = {fg = '#ffaa88', bg = 'grey', gui='italic,bold'},
-- color = {fg = 204} -- when fg/bg is skiped they default to themes fg/bg -- color = {fg = 204} -- when fg/bg is skiped they default to themes fg/bg
-- color = 'WarningMsg' -- color = 'WarningMsg' -- highlight groups can also be used
-- or highlight group --
-- color = "WarningMsg"
color = nil, -- default is themes color for that section and mode color = nil, -- default is themes color for that section and mode
-- Type option specifies what type a component is.
-- When type is omitted lualine will guess it. -- This option specifies what type a component is.
-- Available types [format: type_name(example)] -- When it's omitted lualine will guess it for you.
-- mod(branch/filename), stl(%f/%m), var(g:coc_status/bo:modifiable), --
-- Available types are:
-- [format: type_name(example)], mod(branch/filename),
-- stl(%f/%m), var(g:coc_status/bo:modifiable),
-- lua_expr(lua expressions), vim_fun(viml function name) -- lua_expr(lua expressions), vim_fun(viml function name)
--
-- lua_expr is short for lua-expression and vim_fun is short fror vim-function -- lua_expr is short for lua-expression and vim_fun is short fror vim-function
type = nil, type = nil,
padding = 1, -- adds padding to the left and right of components padding = 1, -- Adds padding to the left and right of components.
-- padding can be specified to left or right separately like -- Padding can be specified to left or right independently, e.g.:
-- padding = { left = left_padding, right = right_padding } -- padding = { left = left_padding, right = right_padding }
fmt = nil, -- format function, formats component's output fmt = nil, -- Format function, formats the component's output.
} }
} }
} }
@ -400,24 +411,25 @@ sections = {
lualine_a = { lualine_a = {
{ {
'buffers', 'buffers',
show_filename_only = true, -- shows shortened relative path when false show_filename_only = true, -- Shows shortened relative path when set to false
show_modified_status = true, -- shows indicator then buffer is modified show_modified_status = true, -- Shows indicator then buffer is modified
mode = 0, -- 0 shows buffer name mode = 0, -- 0: Shows buffer name
-- 1 buffer index (bufnr) -- 1: Shows buffer index (bufnr)
-- 2 shows buffer name + buffer index (bufnr) -- 2: Shows buffer name + buffer index (bufnr)
max_length = vim.o.columns * 2 / 3, -- maximum width of buffers component max_length = vim.o.columns * 2 / 3, -- Maximum width of buffers component,
-- can also be a function that returns value of max_length dynamicaly -- it can also be a function that returns
-- the value of `max_length` dynamically.
filetype_names = { filetype_names = {
TelescopePrompt = 'Telescope', TelescopePrompt = 'Telescope',
dashboard = 'Dashboard', dashboard = 'Dashboard',
packer = 'Packer', packer = 'Packer',
fzf = 'FZF', fzf = 'FZF',
alpha = 'Alpha' alpha = 'Alpha'
}, -- shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } ) }, -- Shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } )
buffers_color = { buffers_color = {
-- Same values like general color option can be used here. -- Same values like general color option can be used here.
active = 'lualine_{section}_normal', -- color for active buffer active = 'lualine_{section}_normal', -- Color for active buffer
inactive = 'lualine_{section}_inactive', -- color for inactive buffer inactive = 'lualine_{section}_inactive', -- Color for inactive buffer
}, },
} }
} }
@ -431,24 +443,24 @@ sections = {
lualine_a = { lualine_a = {
{ {
'diagnostics', 'diagnostics',
-- table of diagnostic sources, available sources: -- Table of diagnostic sources, available sources are:
-- 'nvim_lsp', 'nvim_diagnostic', 'coc', 'ale', 'vim_lsp' -- 'nvim_lsp', 'nvim_diagnostic', 'coc', 'ale', 'vim_lsp'.
-- Or a function that returns a table like -- or a function that returns a table like:
-- {error=error_cnt, warn=warn_cnt, info=info_cnt, hint=hint_cnt} -- {error=error_cnt, warn=warn_cnt, info=info_cnt, hint=hint_cnt}
sources = {'nvim_diagnostic', 'coc'}, sources = {'nvim_diagnostic', 'coc'},
-- displays diagnostics from defined severity -- displays diagnostics from defined severity
sections = {'error', 'warn', 'info', 'hint'}, sections = {'error', 'warn', 'info', 'hint'},
diagnostics_color = { diagnostics_color = {
-- Same values like general color option can be used here. -- Same values like general color option can be used here.
error = 'DiagnosticError', -- changes diagnostic's error color error = 'DiagnosticError', -- Changes diagnostics' error color
warn = 'DiagnosticWarn', -- changes diagnostic's warn color warn = 'DiagnosticWarn', -- Changes diagnostics' warn color
info = 'DiagnosticInfo', -- changes diagnostic's info color info = 'DiagnosticInfo', -- Changes diagnostics' info color
hint = 'DiagnosticHint', -- changes diagnostic's hint color hint = 'DiagnosticHint', -- Changes diagnostics' hint color
}, },
symbols = {error = 'E', warn = 'W', info = 'I', hint = 'H'}, symbols = {error = 'E', warn = 'W', info = 'I', hint = 'H'},
colored = true, -- displays diagnostics status in color if set to true colored = true, -- Displays diagnostics status in color if set to true
update_in_insert = false, -- Update diagnostics in insert mode update_in_insert = false, -- Update diagnostics in insert mode
always_visible = false, -- Show diagnostics even if count is 0, boolean or function returning boolean always_visible = false, -- Show diagnostics even if there are none
} }
} }
} }
@ -461,19 +473,18 @@ sections = {
lualine_a = { lualine_a = {
{ {
'diff', 'diff',
colored = true, -- displays diff status in color if set to true colored = true, -- Displays diff status in color if set to true
-- all colors are in format #rrggbb
diff_color = { diff_color = {
-- Same values like general color option can be used here. -- Same values like general color option can be used here.
added = 'DiffAdd', -- changes diff's added color added = 'DiffAdd', -- Changes the diff's added color
modified = 'DiffChange', -- changes diff's modified color modified = 'DiffChange', -- Changes the diff's modified color
removed = 'DiffDelete', -- changes diff's removed color you removed = 'DiffDelete', -- Changes the diff's removed color you
}, },
symbols = {added = '+', modified = '~', removed = '-'}, -- changes diff symbols symbols = {added = '+', modified = '~', removed = '-'}, -- Changes the symbols used by the diff
source = nil, -- A function that works as a data source for diff. source = nil, -- A function that works as a data source for diff.
-- it must return a table like -- It must return a table like:
-- {added = add_count, modified = modified_count, removed = removed_count } -- {added = add_count, modified = modified_count, removed = removed_count }
-- Or nil on failure. Count <= 0 won't be displayed. -- or nil on failure. count <= 0 won't be displayed.
} }
} }
} }
@ -503,14 +514,18 @@ sections = {
lualine_a = { lualine_a = {
{ {
'filename', 'filename',
file_status = true, -- displays file status (readonly status, modified status) file_status = true, -- Displays file status (readonly status, modified status)
path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path path = 0, -- 0: Just the filename
shorting_target = 40, -- Shortens path to leave 40 space in the window -- 1: Relative path
-- for other components. Terrible name any suggestions? -- 2: Absolute path
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
-- for other components. (terrible name, any suggestions?)
symbols = { symbols = {
modified = '[+]', -- when the file was modified modified = '[+]', -- Text to show when the file is modified
readonly = '[-]', -- if the file is not modifiable or readonly readonly = '[-]', -- Text to show when the file is non-modifiable or readonly
unnamed = '[No Name]', -- default display name for unnamed buffers unnamed = '[No Name]', -- Text to show for unnamed buffers
} }
} }
} }
@ -524,8 +539,8 @@ sections = {
lualine_a = { lualine_a = {
{ {
'filetype', 'filetype',
colored = true, -- displays filetype icon in color if set to `true colored = true, -- Displays filetype icon in color if set to true
icon_only = false -- Display only icon for filetype icon_only = false -- Display only an icon for filetype
} }
} }
} }
@ -538,11 +553,13 @@ sections = {
lualine_a = { lualine_a = {
{ {
'tabs', 'tabs',
max_length = vim.o.columns / 3, -- maximum width of tabs component max_length = vim.o.columns / 3, -- Maximum width of tabs component,
-- can also be a function that returns value of max_length dynamicaly -- it can also be a function that returns
mode = 0, -- 0 shows tab_nr -- the value of `max_length` dynamically.
-- 1 shows tab_name mode = 0, -- 0: Shows tab_nr
-- 2 shows tab_nr + tab_name -- 1: Shows tab_name
-- 2: Shows tab_nr + tab_name
tabs_color = { tabs_color = {
-- Same values like general color option can be used here. -- Same values like general color option can be used here.
active = 'lualine_{section}_normal', -- color for active tab active = 'lualine_{section}_normal', -- color for active tab