Skip to content

Commit

Permalink
Improve mode example comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rbong committed Sep 2, 2023
1 parent 437126f commit bf5cd61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ Using mode colors manually:
function! g:CrystallineStatuslineFn(winnr)
let l:s = ''
" Start highlighting section A with mode colors
" In different modes, this will be 'NormalModeA', 'InsertModeA', etc.
let l:s .= crystalline#ModeHiItem('A')
let l:s .= ' %f%h%w%m%r '
" Generate a separator with mode colors
" The mode prefix is added to all separator groups
let l:s .= crystalline#Sep(0, crystalline#ModeGroup('A'), crystalline#ModeGroup('Fill'))
return l:s
Expand All @@ -296,19 +296,21 @@ Using mode colors automatically:
function! g:CrystallineStatuslineFn(winnr)
let l:s = ''
" The mode colors for section A will automatically be added
" In different modes, this will be 'NormalModeA', 'InsertModeA', etc.
" In inactive windows, this will be 'InactiveA'
let l:s .= crystalline#HiItem('A')
let l:s .= ' %f%h%w%m%r '
" A separator with mode colors for both groups will automatically be generated
" The prefix will automatically be added to separator groups
let l:s .= crystalline#Sep(0, 'A', 'Fill')
return l:s
endfunction
function! g:CrystallineTablineFn()
" auto_prefix_groups will default to true
" 'Inactive*' groups will not be used in the tabline
return crystalline#DefaultTabline()
endfunction
Expand Down
10 changes: 6 additions & 4 deletions examples/neovim_lua_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ function vim.g.CrystallineStatuslineFn(winnr)
local cl = require("crystalline")
local s = ""

-- Start highlighting section A with mode colors
-- In different modes, this will be 'NormalModeA', 'InsertModeA', etc.
s = s .. cl.ModeHiItem("A")

s = s .. " %f%h%w%m%r "

-- Generate a separator with mode colors
-- The mode prefix is added to all separator groups
s = s .. cl.Sep(0, cl.ModeGroup("A"), cl.ModeGroup("Fill"))

return s
Expand All @@ -175,12 +175,13 @@ function vim.g.CrystallineStatuslineFn(winnr)
local cl = require("crystalline")
local s = ""

-- The mode colors for section A will automatically be added
-- In different modes, this will be 'NormalModeA', 'InsertModeA', etc.
-- In inactive windows, this will be 'InactiveA'
s = s .. cl.HiItem("A")

s = s .. " %f%h%w%m%r "

-- A separator with mode colors for both groups will automatically be generated
-- The prefix will automatically be added to separator groups
s = s .. cl.Sep(0, "A", "Fill")

return s
Expand All @@ -189,6 +190,7 @@ end
function vim.g.CrystallineTablineFn()
local cl = require("crystalline")
-- auto_prefix_groups will default to true
-- 'Inactive*' groups will not be used in the tabline
return cl.DefaultTabline()
end

Expand Down

0 comments on commit bf5cd61

Please sign in to comment.