tags:

views:

213

answers:

2

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

+3  A: 

Use & before the option name:

:let g:foo = &foldmarker
:echo g:foo
too much php
awsome that's perfect
Fire Crow
+1  A: 

:set all ; will print all vim settings

kogut