aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlvaro Sevilla <alvaro@chainalysis.com>2021-07-05 11:11:23 +0100
committerAlvaro Sevilla <alvaro@chainalysis.com>2021-07-05 11:11:23 +0100
commit7641a0d3e4339e981eed1980e538eb5f2fe0acd8 (patch)
tree5c14feadee45182fe64285971042a6636702114a /README.md
parent3f16ab28d6bd9ed7bb23d35118fcaebce4ad2b0f (diff)
downloadminitab.nvim-7641a0d3e4339e981eed1980e538eb5f2fe0acd8.tar.xz
minitab.nvim-7641a0d3e4339e981eed1980e538eb5f2fe0acd8.zip
Update README
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/README.md b/README.md
index 8a0fcd1..087577e 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,27 @@
# luatab.nvim
+
+## Usage
+Add this to your init.lua:
+
+```
+Tabline = require'tabline'.tabline
+vim.cmd[[ set tabline=%!luaeval('Tabline()') ]]
+```
+
+Note: `require'tabline'.tabline` must be assigned to a global variable for it to be picked up by `luaeval`
+
+You can also define your own tabline function using the provided functions for help. The default tabline is equivalent to:
+```
+local formatTab = require'luatab'.formatTab
+Tabline = function()
+ local i = 1
+ local line = ''
+ while i <= vim.fn.tabpagenr('$') do
+ line = line .. formatTab(i)
+ i = i + 1
+ end
+ return line .. '%T%#TabLineFill#%='
+end
+```
+
+