From fc5d5b3e19a666192442320de8e2adeb20b8150e Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Mon, 14 Apr 2014 22:13:35 +0600 Subject: [PATCH] =?UTF-8?q?bash:=20vimcat=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BD=D0=B0=20source-highlight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/shell/bash/aliases | 12 ++++++- etc/soft/source-hl/default.style | 72 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 etc/soft/source-hl/default.style diff --git a/etc/shell/bash/aliases b/etc/shell/bash/aliases index 38704ab..824a864 100755 --- a/etc/shell/bash/aliases +++ b/etc/shell/bash/aliases @@ -41,7 +41,6 @@ alias pstree="pstree -U -h" #noindex alias mkdir="mkdir -p -v" #noindex alias j="jobs -l" #noindex alias dirs="dirs -v" #noindex -alias vcat=vimcat #noindex alias src=vimcat #noindex #- Замена стандартных путей для конфигурационных файлов @@ -344,6 +343,17 @@ fucheck() { } | xargs -0 -n2 mv -v } +#- Вывод файлов с подсветкой синтаксиса +vcat() { + source-highlight \ + -f esc \ + -i "$1" \ + -o STDOUT \ + --line-number=' ' \ + --style-file=$SHELLRC/etc/soft/source-hl/default.style + echo +} + #- Поиск пути к исполняемому файлу, просмотр кода функций и псевдонимов which() { #noindex (alias; declare -f) \ diff --git a/etc/soft/source-hl/default.style b/etc/soft/source-hl/default.style new file mode 100644 index 0000000..b85541a --- /dev/null +++ b/etc/soft/source-hl/default.style @@ -0,0 +1,72 @@ +bgcolor "white"; // the background color for documents +context gray; // the color for context lines (when specified with line ranges) + +keyword blue b ; // for language keywords +type darkgreen ; // for basic types +usertype teal ; // for user defined types +string pink; // for strings and chars +regexp orange f ; // for strings and chars +specialchar pink f ; // for special chars, e.g., \n, \t, \\ +comment black b; // for comments +number purple; // for literal numbers +preproc darkblue b ; // for preproc directives (e.g. #include, import) +symbol blue b; // for simbols (e.g. <, >, +) +function cyan b; // for function calls and declarations +cbracket blue b; // for block brackets (e.g. {, }) +todo cyan b; // for TODO and FIXME +code brightgreen b; // for code snippets + +//Predefined variables and functions (for instance glsl) +predef_var darkblue ; +predef_func darkblue b ; + +// for OOP +classname teal ; // for class names, e.g., in Java and C++ + +// line numbers +linenum yellow f; + +// Internet related +url blue u, f; + +// other elements for ChangeLog and Log files +date blue b ; +time, file darkblue b ; +ip, name darkgreen ; + +// for Prolog, Perl... +variable green; + +// explicit for Latex +italics darkgreen i; +bold darkgreen b; +underline darkgreen u; +fixed green f; +argument darkgreen; +optionalargument purple; +math orange; +bibtex blue; + +// for diffs +oldfile orange; +newfile darkgreen; +difflines blue; + +// for css +selector purple; +property blue; +value darkgreen i; + +// for oz +atom orange; +meta i; + +// for file system +path orange; + +// for C (or other language) labels +label teal b; + +// for errors +error purple; +warning darkgreen;