Jump to content
Xander

GNU nano syntax hightlight PHP

Recommended Posts

Posted

nanod.th.png

1.in primul rand:

daca exista /etc/nanorc si nu contine deja


include "/usr/share/nano/php.nanorc"

treceti voi la sfarsit , daca nu exista creati ~/.nanorc si treceti acolo include-ul

2. mkdir -p /usr/share/nano (in caz ca nu exista folderul)

3. copiati de mai jos in /usr/share/nano/php.nanorc si salvati


syntax "php" "\.php[2345s~]?$"
## types
color green "\<(var|float|global|double|bool|char|int|enum|const)\>"
## integers
color green "[^a-zA-Z]+"
## strings
color brightyellow "<[^= ]*>" ""(\.|[^"])*"" "'(\.|[^'])*'"
## escaped " in commends
color brightyellow "\\"(\.|[^"])*\\"" "\\'(\.|[^'])*\\'"
## inline php echo
color magenta start="<\?=" end="\?>"
## php markings
color brightgreen "(<\?(php)?|\?>)"
## functions
color brightblack "\<[[a-zA-Z0-9_]+\(" "\<[[a-zA-Z_]*\(\)"
## variables
color cyan "\$[a-zA-Z_]+"
## structure
color brightyellow "\<(class|new|private|public|function|for|foreach|if|while|do|else|elseif|case|default|switch)\>"
## control flow
color magenta "\<(goto|continue|break|return)\>"
## comments
color brightblue "//.*"
color brightblue start="/\*" end="\*/"
#color blue start="<" end=">"
#color red "&[^;[[:space:]]]*;"
## acolade frate
color blue,white "\{" "\}"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...