Skip to content

Commit 3a61a25

Browse files
committed
doc: Updated statusline guide
1 parent 59d21c5 commit 3a61a25

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

guides/Statusline.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
>[!NOTE]
44
> It is assumed that you have read [the basics]().
55
6+
## 🧭 Structure
7+
8+
```mermaid
9+
flowchart LR
10+
vim.o.statusline --> r
11+
12+
subgraph bars.statusline
13+
r["bars.render()"]
14+
r --> c["components.get()"]
15+
16+
subgraph components
17+
c --> Mode
18+
c --> Bufname
19+
c --> Diagnostics
20+
c --> Empty
21+
c --> Ruler
22+
end
23+
end
24+
```
25+
26+
## 🧭 Basic setup
27+
628
To use a lua function for the `statusline`, we can make use of `v:lua` & `:!` like this,
729

830
```lua
@@ -25,10 +47,6 @@ In `bars.nvim`, this is used for the statusline.
2547
vim.o.statusline = "%!v:lua.require('bars.statusline').render()"
2648
```
2749

28-
## 🧭 Structure
29-
30-
🛑 WIP
31-
3250
## 🧩 Rendering
3351

3452
The `render()` function returns a string that will be used as the text. It can also contain `statusline item`s in it, which makes things easier for us.

0 commit comments

Comments
 (0)