Browse Source

bash: ++aliases, ++bat, ++cheat.sh

master
Maxim Likhachev 6 years ago
parent
commit
17928b32f9
  1. 6
      etc/shell/bash/aliases
  2. 1
      etc/shell/bash/aliases_macos
  3. 22
      etc/shell/bash/bash_completion_custom
  4. 5
      etc/soft/bat/bat.conf

6
etc/shell/bash/aliases

@ -327,6 +327,9 @@ toread() {
ln -s "`realpath "$1"`" "$BASEDIR/${2:-.}/$1" ln -s "`realpath "$1"`" "$BASEDIR/${2:-.}/$1"
} }
#- Просмотр файла с подсветкой синтаксиса
alias vcat='BAT_CONFIG_PATH="$SHELLRC/etc/soft/bat/bat.conf" bat' #noindex
#- ++less noindex #- ++less noindex
src() { vcat "$1" | less -R; } src() { vcat "$1" | less -R; }
@ -512,5 +515,8 @@ alias qr="curl -F-=\\<- qrenco.de"
#- Преобразование списка в строку #- Преобразование списка в строку
alias flat="tr '\n' ' '; echo" alias flat="tr '\n' ' '; echo"
#- Справка по языкам программирования
alias tip='CHTSH_QUERY_OPTIONS="style=borland" cheat.sh'
#}}} ########################################################################### #}}} ###########################################################################

1
etc/shell/bash/aliases_macos

@ -2,5 +2,4 @@
alias ls='ls -lGhpv --color=always --group-directories-first' #noindex alias ls='ls -lGhpv --color=always --group-directories-first' #noindex
alias lsl='ls -L' #noindex alias lsl='ls -L' #noindex
alias lst='ls -al --time-style=+%D | grep $(\date +%D)' #noindex alias lst='ls -al --time-style=+%D | grep $(\date +%D)' #noindex
alias vcat='bat --theme GitHub -style="changes,numbers"' #noindex

22
etc/shell/bash/bash_completion_custom

@ -1,6 +1,6 @@
#!/bin/bash ######################### #!/bin/bash #########################
# #
# Изменён: Пт 16 авг 2013 23:03:31 # Изменён: Пт 31 мая 2019 02:19:02
# #
#complete <что дополнять> <программа> #complete <что дополнять> <программа>
@ -109,5 +109,25 @@ _slapt-r () {
complete -F _slapt-r slapt-get 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 [ -f $BASHRC/bash_completion_surfraw ] && . $BASHRC/bash_completion_surfraw

5
etc/soft/bat/bat.conf

@ -0,0 +1,5 @@
--color=always
--paging=never
--theme GitHub
--italic-text=always
--style="changes,numbers"
Loading…
Cancel
Save