aboutsummaryrefslogtreecommitdiff
path: root/kshrc
diff options
context:
space:
mode:
Diffstat (limited to 'kshrc')
-rw-r--r--kshrc27
1 files changed, 24 insertions, 3 deletions
diff --git a/kshrc b/kshrc
index 43a7d0d..59f1bc6 100644
--- a/kshrc
+++ b/kshrc
@@ -30,6 +30,7 @@ alias egiv='grep -Eiv'
alias search='grep -niRIE'
alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'"
alias setxkbmap-list="man xkeyboard-config"
+alias csi="rlwrap chicken-csi"
# docker-getip $container_id
[ -x "$(command -v docker)" ] && \
alias docker-getip="docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'"
@@ -208,6 +209,7 @@ set_ksh_competion() {
show copy type list ls mv cp rm edit otp fnd find insert \
&& set -A complete_dpw_2 -- $(dpw list)
+
#shellcheck disable=SC2046
set -A complete_passenv -- \
$(showPasswordStore ~/.password-store)
@@ -218,6 +220,9 @@ set_ksh_competion() {
set -A complete_ssh -- -L -D -A -X \
$(showsshhosts | awk '{print $1}')
+ #shellcheck disable=SC2046
+ set -A complete_rsync -- $(showsshhosts | awk '{print $1}')
+
set -A complete_setPrompt -- date time basic
}
@@ -316,7 +321,7 @@ _passDir="$1" ; shift
find "$_passDir" -type f -iname '*.gpg' \
| while read -r _line; do
- _line="${_line##$_passDir}"
+ _line="${_line##"$_passDir"}"
_line="${_line#/}"
_line="${_line%.gpg}"
echo "$_line"
@@ -363,6 +368,7 @@ timestamp() {
date +%m.%d.%y_%H.%M.%S
}
+#shellcheck disable=SC2120
checkSSHAgent() {
if [ "$1" = "-k" ] ; then
pkill -9 ssh-agent
@@ -692,6 +698,20 @@ updateshell() {
#shellcheck disable=SC1090
. "$HOME/.kshrc"
}
+updatenvim() {
+ OLDWD="$(pwd)"
+ #shellcheck disable=SC2164
+ cd "$HOME"
+ nvimDest="$HOME/.config/nvim"
+ if ! [ -d "$nvimDest" ] ; then
+ mkdir -p "$nvimDest"
+ git clone "$NVIM_GIT_URL" "$nvimDest"
+ else
+ cd "$nvimDest" || { echo failed to cd "$nvimDest" ; return ; }
+ git pull --ff-only origin master
+ fi
+ cd "$OLDWD"
+}
updatevimrc() {
OLDWD="$(pwd)"
#shellcheck disable=SC2164
@@ -718,6 +738,7 @@ path_preappend "$HOME/bin"
UPDATE_URL="https://git.riedstra.dev/mitch/dotfiles/plain/"
VIM_GIT_URL="https://git.riedstra.dev/mitch/vim-cfg"
+NVIM_GIT_URL="https://git.riedstra.dev/mitch/nvim-config"
VIM_BASIC_URL="https://git.riedstra.dev/mitch/dotfiles/plain/vimrc"
PRELOAD="$HOME/${SHELL_CONFIG}.pre"
@@ -764,7 +785,7 @@ elif [ -n "$KSH_VERSION" ] ; then
# export PS1='`nzret`\u@\h \$PWD \$ '
export PS1='`nzret`\u@\h\$ '
- if [ $(id -u) -eq 0 ] ; then
+ if [ "$(id -u)" -eq 0 ] ; then
export PS1='`nzret`\h\$ '
fi
@@ -783,7 +804,7 @@ elif [ -n "$BASH" ] ; then
# export PS1='\u@\h \$PWD \$ '
export PS1='\u@\h\$ '
- if [ $(id -u) -eq 0 ] ; then
+ if [ "$(id -u)" -eq 0 ] ; then
export PS1='\h\$ '
fi
fi