11 августа
2019
Настройка редактора nano
nano – отличный маленький редактор. Но многие его почему-то незаслуженно не любят. Это зря. С небольшими до настройками nano умеет даже подсветку синтаксиса. Не так круто как тот же vim, но в целом всё равно получается лучше чем чёрно-белый.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
$ nano -w ~/.nanorc #---------------------------------------------------------------------------- # ~/.nanorc: executed by nano for user settings #---------------------------------------------------------------------------- ## Enable mouse support, so that mouse clicks can be used to set the ## mark and run shortcuts. # set mouse ## Don't wrap text at all. set nowrap ## Use smooth scrolling as the default. set smooth ## ----------------------------------------------------------------------------- ## *conf-files # syntax "configfiles" "\/etc" "(\.|/|)ini$" "(\.|/|)cf$" "(\.|/|)conf$" "(\.|/|)cnf$" "(\.|/|)include$" "(\.|/|)ample$" "(\.|/|)globals$" "xfce.*$" "syslog-ng" "sudoers" "(\.|/|)config$" "(\.|/|)COLORS$" "(\.|/|)colors$" color red "/.*$" "TERM" "\..*$" "=.*$" "\*.*$" color brightgreen ":unscaled" "[0-9]" color brightwhite "setenv|export" "\;" color brightwhite "\<(alias)\>" color brightgreen "<(\\.|[^'])*>" color magenta "[a-zA-Z_0-9\-\ \ ]+( | |)+=" color brightwhite ">(\\.|[^'><])*" "\<(logfile)\>" "\<(driftfile)\>" "\<(restrict)\>" color brightwhite ":unscaled" "http\:\/\/" "ftp\:\/\/" "rsync\:\/\/" color magenta "'(\\.|[^'])*'" color brightwhite "[0-9]" color brightwhite "[<>]" color brightgreen "\[[a-zA-Z_0-9\ \-]+\]" color magenta "Section" "EndSection" "SubSection" "EndSubSection" color red "\<(root)\>" color brightred,blue "^.*-->" start="<!--.*" end="$" ## strings color brightyellow "\"(\\.|[^\"])*\"" "'(\\.|[^'])*'" "`(\\.|[^'])*`" "\{(\\.|[^'])*\}" ## comments color green "^( *| *)#.*$" start="<!--" end="-->" color green ";.*$" ## header color brightgreen "^( *| *)[#;]+ *\/etc\/[a-zA-Z_0-9]+.*$" color brightgreen "^( *| *)[#;]+ *\$[a-zA-Z_0-9]+:.*$" ## ----------------------------------------------------------------------------- ## /etc/group, /etc/passwd, /etc/shadow # syntax "passwd" "(\.|/|)group(.*)$" "(\.|/|)passwd(.*)$" "(\.|/|)shadow(.*)$" color white ".*$" color green "\:.*$" color yellow "\:*\:" color cyan "/.*$" color red "/bin/false" color red "/sbin/nologin" color brightred "root" color brightgreen "/bin/.*sh" color white "[0-9]" color magenta "\:\/.*\:" ## ----------------------------------------------------------------------------- ## *tab-files ( e.g. fstab, crontab, inittab ) # syntax "fstab" "(\.|/|)tab$" color brightwhite "[0-9,\*]" color yellow "-([a-z])\>" color magenta "\<(none)\>.*$" "\<(wait)\>" "\<(respawn)\>" color red "/dev/hd.*$" "\<(ctrlaltdel)\>" "\<(initdefault)\>" color brightgreen "/dev/sr.*$" "/dev/cd.*$" "\/sbin.*$" color cyan "/dev/sd.*$" color brightcyan "^.*(nfs|smbfs|tmpfs).*$" color yellow "/dev/fd.*$" color red "root" color cyan "\<(rm|test)\>" color cyan "((\/|\/usr\/|\/usr\/local\/)(bin\/|sbin\/)[a-zA-Z_0-9,-]+)" color magenta "(\$|)[a-zA-Z_0-9]+( |)=" color red "\$\{?[a-zA-Z_0-9]+\}?" ## comments color green "^( *| *)#.*$" ## header color brightgreen "^( *| *)[#]+ *\$[a-zA-Z_0-9]+:.*$" ## Color setup include "/usr/share/nano/asm.nanorc" include "/usr/share/nano/awk.nanorc" include "/usr/share/nano/cmake.nanorc" include "/usr/share/nano/c.nanorc" include "/usr/share/nano/css.nanorc" include "/usr/share/nano/debian.nanorc" include "/usr/share/nano/fortran.nanorc" include "/usr/share/nano/gentoo.nanorc" include "/usr/share/nano/groff.nanorc" include "/usr/share/nano/html.nanorc" include "/usr/share/nano/java.nanorc" include "/usr/share/nano/lua.nanorc" include "/usr/share/nano/makefile.nanorc" include "/usr/share/nano/man.nanorc" include "/usr/share/nano/mgp.nanorc" include "/usr/share/nano/mutt.nanorc" include "/usr/share/nano/nanorc.nanorc" include "/usr/share/nano/objc.nanorc" include "/usr/share/nano/ocaml.nanorc" include "/usr/share/nano/patch.nanorc" include "/usr/share/nano/perl.nanorc" include "/usr/share/nano/php.nanorc" include "/usr/share/nano/pov.nanorc" include "/usr/share/nano/python.nanorc" include "/usr/share/nano/ruby.nanorc" include "/usr/share/nano/sh.nanorc" include "/usr/share/nano/spec.nanorc" include "/usr/share/nano/tcl.nanorc" include "/usr/share/nano/tex.nanorc" include "/usr/share/nano/xml.nanorc" |