Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: colours for syntax highlighting

by stevieb (Canon)
on Nov 20, 2019 at 14:31 UTC ( [id://11108942]=note: print w/replies, xml ) Need Help??


in reply to colours for syntax highlighting

I use the default colours, but I enable subroutine folding:

" allow folding of Perl subs "let perl_fold = 1 function GetPerlFold() if getline(v:lnum) =~ '^\s*sub\s' return ">1" elseif getline(v:lnum) =~ '\}\s*$' let my_perlnum = v:lnum let my_perlmax = line("$") while (1) let my_perlnum = my_perlnum + 1 if my_perlnum > my_perlmax return "<1" endif let my_perldata = getline(my_perlnum) if my_perldata =~ '^\s*\(\#.*\)\?$' " do nothing elseif my_perldata =~ '^\s*sub\s' return "<1" else return "=" endif endwhile else return "=" endif endfunction setlocal foldexpr=GetPerlFold() setlocal foldmethod=expr

Here's an example of what it looks like. Use zo to open a fold, and zc to close it back up.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108942]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-28 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found