From f915f49c4bb4ad95c75a80ca1ba26349a4d16470 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Tue, 23 Feb 2016 20:57:00 +0500 Subject: [PATCH] =?UTF-8?q?bash:=20aliases:=20vcat/src=20=D1=81=20=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=BE=D0=B9=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D0=B4=D0=B0=D1=80=D1=82=D0=BD=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D1=8F=D0=B7=D1=8B=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/shell/bash/aliases | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/etc/shell/bash/aliases b/etc/shell/bash/aliases index 859e709..fd5389b 100755 --- a/etc/shell/bash/aliases +++ b/etc/shell/bash/aliases @@ -44,7 +44,6 @@ alias pstree="pstree -U -h" #noindex alias mkdir="mkdir -p -v" #noindex alias j="jobs -l" #noindex alias dirs="dirs -v" #noindex -alias src=vcat #noindex alias ping="pingp --nolegend" #noindex alias gq="geeqie . &" #noindex alias emerge="emerge --ask" #noindex @@ -347,17 +346,22 @@ toread() { ln -s "`realpath "$1"`" "$BASEDIR/${2:-.}/$1" } +alias srchl="source-highlight -f esc --line-number=' ' --style-file=$SHELLRC/etc/soft/source-hl/default.style" #noindex + #- Вывод файлов с подсветкой синтаксиса vcat() { - source-highlight \ - -f esc \ - -i "$1" \ - -o STDOUT \ - --line-number=' ' \ - --style-file=$SHELLRC/etc/soft/source-hl/default.style + if [[ "${1##*/}" == .* ]]; then + srchl -i "$1" --src-lang=sh + else + srchl -i "$1" + fi 2> /dev/null || srchl -i "$1" --src-lang=lisp + echo } +#- ++less noindex +src() { vcat "$1" | less -R; } + #- Поиск пути к исполняемому файлу, просмотр кода функций и псевдонимов which() { #noindex (alias; declare -f) \