diff options
| author | Kristijan Husak <kristijan.husak@saturized.com> | 2020-10-09 13:43:34 +0200 |
|---|---|---|
| committer | Kiyan Yazdani <yazdani.kiyan@protonmail.com> | 2020-10-11 13:35:18 +0200 |
| commit | 62df1143da1e7c1d02a883f5ead2479ec17729ed (patch) | |
| tree | 904e4f082c856a8a844d4a7e3d0abf417356b3dc /doc | |
| parent | [docgen] Update README.md (diff) | |
| download | nvim-treesitter-62df1143da1e7c1d02a883f5ead2479ec17729ed.tar nvim-treesitter-62df1143da1e7c1d02a883f5ead2479ec17729ed.tar.gz nvim-treesitter-62df1143da1e7c1d02a883f5ead2479ec17729ed.tar.bz2 nvim-treesitter-62df1143da1e7c1d02a883f5ead2479ec17729ed.tar.lz nvim-treesitter-62df1143da1e7c1d02a883f5ead2479ec17729ed.tar.xz nvim-treesitter-62df1143da1e7c1d02a883f5ead2479ec17729ed.tar.zst nvim-treesitter-62df1143da1e7c1d02a883f5ead2479ec17729ed.zip | |
Add implementation for improved statusline. Closes #545.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/nvim-treesitter.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 1bf5ef310..86250736b 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -423,6 +423,27 @@ could be used as a statusline indicator. Note: The `size` argument is optional. When specified, the string will not be longer than `size`. + *nvim_treesitter#named_statusline()* +nvim_treesitter#named_statusline(opts)~ + +Returns a string describing the current position in the file. This +could be used as a statusline indicator. +Default options (lua syntax): +> + { + indicator_size = 100, + type_patterns = {'class', 'function', 'method'}, + transform_fn = function(line) return line:gsub('[%[%(%{]*%s*$', '') end, + separator = ' -> ' + } +< +- `indicator_size` - How long should the string be. If longer, it is cut from + the beginning. +- `type_patterns` - Which node type patterns to match. +- `transform_fn` - Function used to transform the single item in line. By + default removes opening brackets and spaces from end. +- `separator` - Separator between nodes. + *nvim_treesitter#foldexpr()* nvim_treesitter#foldexpr()~ |
