zsh: Delete unused parts and bits
Delete: - transfer.zsh - zsh-async - telegram helper functions + completion - TERM hack for kitty terminal
This commit is contained in:
@@ -136,11 +136,7 @@ if [[ -e "$ZSH_CONF/stderred/build/libstderred.so" ]]; then
|
||||
fi
|
||||
comp-source "$ZSH_CONF/alias.zsh"
|
||||
comp-source "$ZSH_CONF/functions.zsh"
|
||||
comp-source "$ZSH_CONF/transfer.zsh"
|
||||
comp-source "$ZSH_CONF/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
comp-source "$ZSH_CONF/completion.zsh"
|
||||
# comp-source "$ZSH_CONF/zsh-async/async.zsh"
|
||||
# async_init
|
||||
### syntax-highlight > keys
|
||||
# syntax highlighting
|
||||
if [[ -e "$ZSH_CONF/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]]; then
|
||||
@@ -163,11 +159,6 @@ elif command -v nano >/dev/null 2>&1; then
|
||||
export EDITOR=nano
|
||||
fi
|
||||
|
||||
# `sudo nano` won't work without this (?)
|
||||
if [[ "$TERM" = "xterm-kitty" ]]; then
|
||||
export TERM=xterm-256color
|
||||
fi
|
||||
|
||||
## https://www.tecmint.com/view-colored-man-pages-in-linux/
|
||||
## First seen in Fox Kiesters dotfiles
|
||||
export LESS_TERMCAP_mb=$'\e[1;32m'
|
||||
@@ -188,10 +179,6 @@ export LESSHISTFILE=-
|
||||
export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android"
|
||||
export VIMINIT="let \$MYVIMRC=\"${XDG_CONFIG_HOME:-$HOME/.config}/vim/xdg.vim\" | source \$MYVIMRC"
|
||||
|
||||
## Setup asynchronous jobs
|
||||
# async_start_worker msg_completion
|
||||
# async_job msg_completion tg-completion
|
||||
|
||||
## Setup zle
|
||||
zle_highlight=('paste:none')
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
## Author: druckdev
|
||||
## Created: 2019-08-18
|
||||
|
||||
## TelegramCLI msg completion
|
||||
function tg-completion() {
|
||||
contactList=( $(telegram-cli -W -C -e "contact_list" | tail -n +9 | head -n -2 | grep -vE "(>>>|<<<|»»»|«««)" | sed 's/ /_/g; s/.*\[K//; s/(/\\(/g; s/)/\\)/g; s/"/\\"/g') )
|
||||
echo '#compdef msg' >! $ZSH_CONF/completion/_msg
|
||||
echo >> $ZSH_CONF/completion/_msg
|
||||
echo '_arguments "1:<Recipient>:('"$contactList[*]"')"' >> $ZSH_CONF/completion/_msg
|
||||
}
|
||||
@@ -34,27 +34,6 @@ function mkcd () {
|
||||
fi
|
||||
}
|
||||
|
||||
## Send a message over telegram by using the -e flag
|
||||
function msg() {
|
||||
if [[ $# -ge 2 ]]; then
|
||||
telegram-cli -W -e "msg $*" | grep -E "${${*/ /.*}//_/ }"
|
||||
# | grep -E "$(echo "$*" | sed 's/ /.*/; s/_/ /g')"
|
||||
else
|
||||
printf "\033[1;31mPlease specify a contact and a message.\n\033[0m" >&2
|
||||
fi
|
||||
}
|
||||
|
||||
## Execute tg -e command but cuts of the uninteresting parts
|
||||
function tg() {
|
||||
tg="telegram-cli"
|
||||
if [[ "$1" = "-e" ]]; then
|
||||
shift
|
||||
$tg -N -W -e "$@" | tail -n +9 | head -n -2
|
||||
else
|
||||
$tg -N -W "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
## Encode and decode qr-codes
|
||||
function qr() {
|
||||
if [[ $# -eq 1 && -r "$1" ]]; then
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
#
|
||||
# Defines transfer alias and provides easy command line file and folder sharing.
|
||||
#
|
||||
# Authors:
|
||||
# Remco Verhoef <remco@dutchcoders.io>
|
||||
#
|
||||
|
||||
curl --version 2>&1 > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Could not find curl."
|
||||
return 1
|
||||
fi
|
||||
|
||||
transfer() {
|
||||
# check arguments
|
||||
if [ $# -eq 0 ];
|
||||
then
|
||||
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# get temporarily filename, output is written to this file show progress can be showed
|
||||
tmpfile=$( mktemp -t transferXXX )
|
||||
|
||||
# upload stdin or file
|
||||
file=$1
|
||||
|
||||
if tty -s;
|
||||
then
|
||||
basefile=$(basename "$file" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
|
||||
|
||||
if [ ! -e $file ];
|
||||
then
|
||||
echo "File $file doesn't exists."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -d $file ];
|
||||
then
|
||||
# zip directory and transfer
|
||||
zipfile=$( mktemp -t transferXXX.zip )
|
||||
cd $(dirname $file) && zip -r -q - $(basename $file) >> $zipfile
|
||||
curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >> $tmpfile
|
||||
rm -f $zipfile
|
||||
else
|
||||
# transfer file
|
||||
curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >> $tmpfile
|
||||
fi
|
||||
else
|
||||
# transfer pipe
|
||||
curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >> $tmpfile
|
||||
fi
|
||||
|
||||
# cat output link
|
||||
cat $tmpfile
|
||||
|
||||
# cleanup
|
||||
rm -f $tmpfile
|
||||
}
|
||||
|
||||
|
||||
Submodule .config/zsh/plugins/zsh-async deleted from 490167c4aa
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,7 +17,6 @@
|
||||
/.config/vim/.netrwhist
|
||||
|
||||
/.config/zsh/.zcompdump
|
||||
/.config/zsh/plugins/completion/_msg
|
||||
|
||||
/.config/ranger/bookmarks
|
||||
/.config/ranger/history
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -40,9 +40,6 @@
|
||||
[submodule ".config/zsh/plugins/stderred"]
|
||||
path = .config/zsh/plugins/stderred
|
||||
url = https://github.com/sickill/stderred
|
||||
[submodule ".config/zsh/plugins/zsh-async"]
|
||||
path = .config/zsh/plugins/zsh-async
|
||||
url = https://github.com/mafredri/zsh-async
|
||||
[submodule ".config/zsh/plugins/zsh-autosuggestions"]
|
||||
path = .config/zsh/plugins/zsh-autosuggestions
|
||||
url = https://github.com/zsh-users/zsh-autosuggestions
|
||||
|
||||
Reference in New Issue
Block a user