Skip to content

Commit

Permalink
fix: lspname background color
Browse files Browse the repository at this point in the history
refactor: readme.md
  • Loading branch information
maxmx03 committed Feb 4, 2024
1 parent 012b184 commit 325ad14
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Minimal statusline

## Requirements

- [lsp](neovim/nvim-lspconfig)
- [gitsign](https://github.com/lewis6991/gitsigns.nvim)

## Setup

### lazy
Expand All @@ -21,15 +26,15 @@ return {
## Configuration

To customize layout you need to create a function that will return a string,
this string will represent the section of your statusline
this string will be the section of your statusline

```lua
require('roseline').setup {
theme = 'rose-pine',
layout = {
a = section_a,
b = section_b,
c = '',
c = section_c,
d = section_d,
e = section_e,
},
Expand Down
14 changes: 10 additions & 4 deletions lua/roseline/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
vim.opt.statusline = "%!v:lua.require('roseline').load()"

local M = {}

M.config = nil
Expand All @@ -10,6 +11,7 @@ local function color(item, group_name)
return '%#' .. group_name .. '#' .. item .. '%*'
end

--- roseline highlight groups
---@param theme string
local function set_highlight(theme)
local group = 'St'
Expand Down Expand Up @@ -48,13 +50,13 @@ local function set_highlight(theme)
hl(0, group .. 'DiagnosticWarnLspClient', { fg = colors.yellow, bg = colors.background })
hl(0, group .. 'DiagnosticHintLspClient', { fg = colors.purple, bg = colors.background })
hl(0, group .. 'DiagnosticInfoLspClient', { fg = colors.cyan, bg = colors.background })
hl(0, group .. 'Lsp', { fg = colors.cyan, bg = colors.base })
hl(0, group .. 'Lsp', { fg = colors.cyan, bg = colors.background })
hl(0, group .. 'LspReverse', { fg = colors.cyan, reverse = true })
hl(0, group .. 'Info', { fg = colors.cyan, bg = colors.background })
hl(0, group .. 'InfoReverse', { fg = colors.cyan, reverse = true })
end

--- mode
--- section for modes
---@return string
local function section_a()
local icons = M.config.icons
Expand Down Expand Up @@ -107,7 +109,7 @@ local function section_a()
return string.format('%s%s%s%s%s', block, neovim, block, mode, default_right)
end

--- git sign
--- section for gitsigns
---@return string
local function section_b()
local icons = M.config.icons
Expand Down Expand Up @@ -139,7 +141,7 @@ local function section_b()
return string.format('%s %s %s %s', head, added, changed, removed)
end

--- lsp and diagnostic
--- section for lsp and diagnostics
---@return string
local function section_d()
local icons = M.config.icons
Expand Down Expand Up @@ -213,6 +215,8 @@ local function section_d()
)
end

--- section for line and total line
---@return string
local function section_e()
local icons = M.config.icons
return string.format(
Expand All @@ -224,6 +228,8 @@ local function section_e()
)
end

--- roseline default config
---@return table
local function default_config()
local layout = {
a = section_a,
Expand Down

0 comments on commit 325ad14

Please sign in to comment.