Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated docs #6

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 67 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,65 +13,55 @@ A minimal Neovim statusline written in Lua.
Do we need another statusline? Probably not, do we have one? Yep

It started with doing my own statusline implementation.
Therefore, configuration options are quite limited and the design is very
opinionated at this moment.
Reason for writing it was mainly just 4 fun and having exactly what I want, function and aesthetic wise.

Currently only those components are available that cannot be reordered or switched off.
Configuration options are mainly about changing the style:
Those components are available out of the box:

- Mode
- Filename + Path
- Git Branch + File added, modified and removed lines (requires [gitsigns](https://github.com/lewis6991/gitsigns.nvim))
- Diagnostics
- Filetype and attached LSPs
- File progress and overall number of lines
- `mode`, well, you know what it is
- `path`, shows the filename and the relative path + modified / read-only info
- `git`, shows the git branch + file diff infos (added, modified and removed lines) (requires [gitsigns](https://github.com/lewis6991/gitsigns.nvim))
- `diagnostics`, shows `vim.diagnostic` infos
- `filetype_lsp`, shows the filetype and attached LSPs
- `progress`, shows the file progress in % and the overall number of lines

Regarding some wording: Some components have a `primary` and a `secondary` part. The primary part contains the main
information of interest (e.g. the filename of the `path` component). The secondary
part additional infos (e.g. the path to the file of the `path` component).
Those are the colors that are currently configurable through the config.

Which components to show in which section (`left`, `right`, `center`) can be configured.
Components can be configured more than once if desired.
The components configuration accepts function calls and strings so that you can hook custom content into the line.

## Highlights

Slimline creates highlight groups from given highlight groups in the config.
The default configuration uses highlight groups that are set by every colorscheme out there.
Therefore it supports every colorscheme out of the box and should look quite good with defaults.
That means that the colorscheme does not need to support this line explicitly.
Of course you can tweak that however you want using the `hl` part of the config options.
If you want to write custom components you probably want to use the created highlight groups.
You can find them e.g. by running `:hi` in your nvim session that has slimline loaded and searching for `Slimline`.

## Screenshots

Here are some screenshots and their options changed
Here are some screenshots and their options changed. See [recipes](#recipes) for config examples.

Normal mode (rose-pine moon), `bold=true`, `verbose_mode=true`
![s1](./doc/screenshots/s1.png)
Normal mode (rose-pine moon), triangle seps, `bold=true`
![s2](./doc/screenshots/s2.png)
Insert Mode (rose-pine moon), default
![s3](./doc/screenshots/s3.png)
Command Mode (kanagawa), default
![s4](./doc/screenshots/s4.png)
Normal Mode (tokyonight moon), `spaces.components = "─"` + `vim.opt.fillchars.stl = "─"`
![s5](./doc/screenshots/s5.png)
Normal Mode (tokyonight moon), `bold=true`, `verbose_mode=true`, `style="fg"`
![s11](./doc/screenshots/s11.png)
![s12](./doc/screenshots/s12.png)
![s13](./doc/screenshots/s13.png)
![s9](./doc/screenshots/s9.png)
![s10](./doc/screenshots/s10.png)
![s14](./doc/screenshots/s14.png)
![s15](./doc/screenshots/s15.png)
![s16](./doc/screenshots/s16.png)
![s6](./doc/screenshots/s6.png)
Normal Mode (tokyonight day), `bold=true`, `verbose_mode=true`
![s7](./doc/screenshots/s7.png)
Insert Mode (rose-pine dawn),

```lua
opts = {
bold = true,
verbose_mode = true,
spaces = {
components = "",
left = "",
right = ""
},
sep = {
hide = {
first = true,
last = true,
},
left = "",
right = ""
}
},
```

![s8](./doc/screenshots/s8.png)

## Contributing
Expand Down Expand Up @@ -106,6 +96,19 @@ require('slimline').setup {
bold = false, -- makes primary parts and mode bold
verbose_mode = false, -- Mode as single letter or as a word
style = 'bg', -- or "fg". Whether highlights should be applied to bg or fg of components
components = { -- Choose components and their location
left = {
"mode",
"path",
"git"
},
center = {},
right = {
"diagnostics",
"filetype_lsp",
"progress"
}
},
spaces = {
components = ' ', -- string between components
left = ' ', -- string at the start of the line
Expand Down Expand Up @@ -146,3 +149,27 @@ require('slimline').setup {
},
}
```

## Recipes

### Slashes

![s11](./doc/screenshots/s11.png)

```lua
opts = {
spaces = {
components = "",
left = "",
right = "",
},
sep = {
hide = {
first = true,
last = true,
},
left = "",
right = "",
},
}
```
Binary file modified doc/screenshots/s1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/s10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/s11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/s12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/s13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/s14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/s15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/s16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/screenshots/s2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/screenshots/s3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/screenshots/s4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/screenshots/s5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/screenshots/s6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/screenshots/s7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/screenshots/s8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/screenshots/s9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.