Advertisement
D0cEvil

Подсветка синтаксиса nano

Sep 23rd, 2022
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.43 KB | Software | 0 0
  1. $ nano -w ~/.nanorc
  2. #----------------------------------------------------------------------------
  3. # ~/.nanorc: executed by nano for user settings
  4. # $Revision: 2.10 (CentOS Edition by Wakko Warner) $
  5. # $Comment: Any comments please send to wakko@acmelabs.spb.ru $
  6. #----------------------------------------------------------------------------
  7.  
  8. ## Constantly display the cursor position in the status bar.
  9.   set const
  10.  
  11. ## Enable mouse support, so that mouse clicks can be used to set the
  12. ## mark and run shortcuts.
  13.   set mouse
  14.  
  15. ## Don't wrap text at all.
  16.   set nowrap
  17.  
  18. ## Use smooth scrolling as the default.
  19.   set smooth
  20.  
  21. ## -----------------------------------------------------------------------------
  22. ## *conf-files
  23. #
  24.   syntax "configfiles" "\/etc" "(\.|/|)ini$" "(\.|/|)cf$" "(\.|/|)conf$" "(\.|/|)cnf$" "(\.|/|)include$" "(\.|/|)ample$" "(\.|/|)globals$" "xfce.*$" "syslog-ng" "sudoers" "(\.|/|)config$" "(\.|/|)COLORS$" "(\.|/|)colors$"
  25.   color red "/.*$" "TERM" "\..*$" "=.*$" "\*.*$"
  26.   color brightgreen ":unscaled" "[0-9]"
  27.   color brightwhite "setenv|export" "\;"
  28.   color brightwhite "\<(alias)\>"
  29.   color brightgreen "<(\\.|[^'])*>"
  30.   color magenta "[a-zA-Z_0-9\-\ \   ]+( | |)+="
  31.   color brightwhite ">(\\.|[^'><])*" "\<(logfile)\>" "\<(driftfile)\>" "\<(restrict)\>"
  32.   color brightwhite ":unscaled" "http\:\/\/" "ftp\:\/\/" "rsync\:\/\/"
  33.   color magenta "'(\\.|[^'])*'"
  34.   color brightwhite "[0-9]"
  35.   color brightwhite "[<>]"
  36.   color brightgreen "\[[a-zA-Z_0-9\ \-]+\]"
  37.   color magenta "Section" "EndSection" "SubSection" "EndSubSection"
  38.   color red "\<(root)\>"
  39.   color brightred,blue "^.*-->" start="<!--.*" end="$"
  40. ## strings
  41.   color brightyellow "\"(\\.|[^\"])*\"" "'(\\.|[^'])*'" "`(\\.|[^'])*`" "\{(\\.|[^'])*\}"
  42. ## comments
  43.   color green "^( *|    *)#.*$" start="<!--" end="-->"
  44.   color green ";.*$"
  45. ## header
  46.   color brightgreen "^( *|  *)[#;]+ *\/etc\/[a-zA-Z_0-9]+.*$"
  47.   color brightgreen "^( *|  *)[#;]+ *\$[a-zA-Z_0-9]+:.*$"
  48.  
  49. ## -----------------------------------------------------------------------------
  50. ## /etc/group, /etc/passwd, /etc/shadow
  51. #
  52.   syntax "passwd" "(\.|/|)group(.*)$" "(\.|/|)passwd(.*)$" "(\.|/|)shadow(.*)$"
  53.   color white ".*$"
  54.   color green "\:.*$"
  55.   color yellow "\:*\:"
  56.   color cyan "/.*$"
  57.   color red "/bin/false"
  58.   color red "/sbin/nologin"
  59.   color brightred "root"
  60.   color brightgreen "/bin/.*sh"
  61.   color white "[0-9]"
  62.   color magenta "\:\/.*\:"
  63.  
  64. ## -----------------------------------------------------------------------------
  65. ## *tab-files ( e.g. fstab, crontab, inittab )
  66. #
  67.   syntax "fstab" "(\.|/|)tab$"
  68.   color brightwhite "[0-9,\*]"
  69.   color yellow "-([a-z])\>"
  70.   color magenta "\<(none)\>.*$" "\<(wait)\>" "\<(respawn)\>"
  71.   color red "/dev/hd.*$" "\<(ctrlaltdel)\>" "\<(initdefault)\>"
  72.   color brightgreen "/dev/sr.*$" "/dev/cd.*$" "\/sbin.*$"
  73.   color cyan "/dev/sd.*$"
  74.   color brightcyan "^.*(nfs|smbfs|tmpfs).*$"
  75.   color yellow "/dev/fd.*$"
  76.   color red "root"
  77.   color cyan "\<(rm|test)\>"
  78.   color cyan "((\/|\/usr\/|\/usr\/local\/)(bin\/|sbin\/)[a-zA-Z_0-9,-]+)"
  79.   color magenta "(\$|)[a-zA-Z_0-9]+( |)="
  80.   color red "\$\{?[a-zA-Z_0-9]+\}?"
  81. ## comments
  82.   color green "^( *|    *)#.*$"
  83. ## header
  84.   color brightgreen "^( *|  *)[#]+ *\$[a-zA-Z_0-9]+:.*$"
  85.  
  86. ## Color setup
  87.   include "/usr/share/nano/asm.nanorc"
  88.   include "/usr/share/nano/awk.nanorc"
  89.   include "/usr/share/nano/cmake.nanorc"
  90.   include "/usr/share/nano/c.nanorc"
  91.   include "/usr/share/nano/css.nanorc"
  92.   include "/usr/share/nano/debian.nanorc"
  93.   include "/usr/share/nano/fortran.nanorc"
  94.   include "/usr/share/nano/gentoo.nanorc"
  95.   include "/usr/share/nano/groff.nanorc"
  96.   include "/usr/share/nano/html.nanorc"
  97.   include "/usr/share/nano/java.nanorc"
  98.   include "/usr/share/nano/lua.nanorc"
  99.   include "/usr/share/nano/makefile.nanorc"
  100.   include "/usr/share/nano/man.nanorc"
  101.   include "/usr/share/nano/mgp.nanorc"
  102.   include "/usr/share/nano/mutt.nanorc"
  103.   include "/usr/share/nano/nanorc.nanorc"
  104.   include "/usr/share/nano/objc.nanorc"
  105.   include "/usr/share/nano/ocaml.nanorc"
  106.   include "/usr/share/nano/patch.nanorc"
  107.   include "/usr/share/nano/perl.nanorc"
  108.   include "/usr/share/nano/php.nanorc"
  109.   include "/usr/share/nano/pov.nanorc"
  110.   include "/usr/share/nano/python.nanorc"
  111.   include "/usr/share/nano/ruby.nanorc"
  112.   include "/usr/share/nano/sh.nanorc"
  113.   include "/usr/share/nano/spec.nanorc"
  114.   include "/usr/share/nano/tcl.nanorc"
  115.   include "/usr/share/nano/tex.nanorc"
  116.   include "/usr/share/nano/xml.nanorc"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement