aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: c6bd2fe451da8b60e2f88dfe6c857ce697b500fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# minitab.nvim

Minitab is a minimal lua reimplementaion of the tabline render function with
some improvements.
It consists of only ~80 lines of code.

Minitab started as a fork of
[`alvarosevilla95/luatab.nvim`](https://github.com/alvarosevilla95/luatab.nvim)

## Features
* Hackable text-only rendering
* Size/position of tabs doesn't change while switching tabs
* Minimal file paths are shown
* Smart handling of module files (e.g. `init.lua` => `module/init.lua`)

## Example bar
` +2 README.md | minitab/init.lua | + [No Name] | ~/docs/src/ | newrw | zsh | TelescopePrompt | help:builtin `

The above text demonstrates more or less what to expect from this plugin's
default tabline rendering.
This example also shows how several special cases for various buffer types are
handled.

## Install
Using a [`lazy.nvim`](https://github.com/folke/lazy.nvim) module
```lua
return { url = 'https://git.tjkeller.xyz/minitab.nvim', config = true }
```

## Configuration
The plugin calls the `helpers.tabline` function to render the line.
It uses the other functions and constants defined in `helpers`.
You can pass overrides for any of these in `setup`.
See `lua/minitab.lua` for details.

Example:
```lua
require("minitab").setup{
    modifiedC = "*",
    separator = function(index)
        local sepC = "><"
        if index == 0 then
            sepC = "<"
        elseif index == vim.fn.tabpagenr('$')
            sepC = ">"
        end
        return '%#TabLine#' .. sepC
    end,
}
```