-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
local right = "" | ||
local l = "ℓ" | ||
|
||
-- [9ℓ]: text_from_the_first_line | ||
|
||
local M = {} | ||
|
||
function M.foldtext() | ||
local foldstart, foldend = vim.v.foldstart, vim.v.foldend | ||
local fold_length = foldend - foldstart + 1 | ||
|
||
local first_line = vim.fn.getline(foldstart) | ||
local sanitized_first_line = string.gsub(first_line, "^%s*(.*)[{[]$", "%1") | ||
|
||
return string.format("%s [%i%s]: %s %s ", right, fold_length, l, sanitized_first_line, right) | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
local M = {} | ||
|
||
function M.setup() | ||
vim.notify("hello") | ||
vim.opt.foldtext = 'v:lua.require("better-folds.folds").foldtext()' | ||
end | ||
|
||
return M |