--- Personal lua config files for NeoVim. -- Last Changed: 2019-01-27 -- Author: Federico Igne -- License: This file is placed in the public domain. -- Override default `foldtext` with something like: -- -- »···[42l]···Title·················································· -- local foldtext = function() local start = "»" local middots = "···" local foldstart = vim.v.foldstart local foldend = vim.v.foldend local lines = string.format("[%3dl]", foldend - foldstart + 1) local indent = middots:rep(vim.v.foldlevel) local title = vim.api.nvim_buf_get_lines(0, foldstart - 1, foldstart, false)[1]:gsub("^.*{{{%d+ ", "") return start .. middots .. lines .. indent .. title end return foldtext