Vim gets the current vml foldmarker value

How do you find the value of vim variables that are set with a single command word

such as: set foldmarker = {,}

I am writing a simple custom function for foldtext () to set a custom summary of one line of a folded area

it works fine, but it looks funny when I open documents with any marker token other than what I hard-coded in 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

what does it do:

function myAwsomeFunction()
{
    // awsomeness here
    // awsomeness here
    // awsomeness here
}

folded becomes:

function myAwsomeFunction()
{ (+) 5 lines... }

It's great until I edit the document with another slogan.

I am trying to determine foldClose dynamically from foldmarker

+5
source share
3 answers

Use &before the option name:

:let g:foo = &foldmarker
:echo g:foo
+7
source

: ; vim

+2
:set foldmarker?

, :set xxxxx?
xxxxx - , .

+1

All Articles