diff --git a/etc/shell/bash/aliases b/etc/shell/bash/aliases index 6506931..12631e5 100755 --- a/etc/shell/bash/aliases +++ b/etc/shell/bash/aliases @@ -327,6 +327,9 @@ toread() { ln -s "`realpath "$1"`" "$BASEDIR/${2:-.}/$1" } +#- Просмотр файла с подсветкой синтаксиса +alias vcat='BAT_CONFIG_PATH="$SHELLRC/etc/soft/bat/bat.conf" bat' #noindex + #- ++less noindex src() { vcat "$1" | less -R; } @@ -512,5 +515,8 @@ alias qr="curl -F-=\\<- qrenco.de" #- Преобразование списка в строку alias flat="tr '\n' ' '; echo" +#- Справка по языкам программирования +alias tip='CHTSH_QUERY_OPTIONS="style=borland" cheat.sh' + #}}} ########################################################################### diff --git a/etc/shell/bash/aliases_macos b/etc/shell/bash/aliases_macos index cf228a7..9fd53db 100644 --- a/etc/shell/bash/aliases_macos +++ b/etc/shell/bash/aliases_macos @@ -2,5 +2,4 @@ alias ls='ls -lGhpv --color=always --group-directories-first' #noindex alias lsl='ls -L' #noindex alias lst='ls -al --time-style=+%D | grep $(\date +%D)' #noindex -alias vcat='bat --theme GitHub -style="changes,numbers"' #noindex diff --git a/etc/shell/bash/bash_completion_custom b/etc/shell/bash/bash_completion_custom old mode 100644 new mode 100755 index 2b06d07..ac9df2c --- a/etc/shell/bash/bash_completion_custom +++ b/etc/shell/bash/bash_completion_custom @@ -1,6 +1,6 @@ #!/bin/bash ######################### # -# Изменён: Пт 16 авг 2013 23:03:31 +# Изменён: Пт 31 мая 2019 02:19:02 # #complete <что дополнять> <программа> @@ -109,5 +109,25 @@ _slapt-r () { complete -F _slapt-r slapt-get +# cheat.sh +_cht_complete() +{ + local cur prev opts + _get_comp_words_by_ref -n : cur + + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="$(curl -s cheat.sh/:list)" + + if [ ${COMP_CWORD} = 1 ]; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + __ltrim_colon_completions "$cur" + fi + return 0 +} + +complete -F _cht_complete cheat.sh + [ -f $BASHRC/bash_completion_surfraw ] && . $BASHRC/bash_completion_surfraw diff --git a/etc/soft/bat/bat.conf b/etc/soft/bat/bat.conf new file mode 100644 index 0000000..a4a7f10 --- /dev/null +++ b/etc/soft/bat/bat.conf @@ -0,0 +1,5 @@ +--color=always +--paging=never +--theme GitHub +--italic-text=always +--style="changes,numbers"