How do you find the value of vim variables that are set with one word commands
such as :set foldmarker={,}
I'm writing a simple custom function for foldtext() to set a custom one line summary of the folded region
it works great but looks funny when I open a documents with any fold marker other than what I've hard coded into the function
here is the function
set foldtext=GetCustomFoldText()
function GetCustomFoldText()
let foldClose = '}'
let foldTtl = v:foldend - v:foldstart
return getline(v:foldstart) . ' (+) ' . foldTtl . ' lines... ' . foldClose
endfunction
which makes this:
function myAwsomeFunction()
{
// awsomeness here
// awsomeness here
// awsomeness here
}
folded becomes this:
function myAwsomeFunction()
{ (+) 5 lines... }
Which is great until I edit a document with a different foldmarker
I'm trying to determine foldClose dynamically from the foldmarker
Use &
before the option name:
:let g:foo = &foldmarker
:echo g:foo
:set all ; will print all vim settings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With