update and clean

This commit is contained in:
Jeff Lance 2021-02-19 23:23:31 +01:00
parent 26353475af
commit 22551e79fe
8 changed files with 103 additions and 32 deletions

View File

@ -0,0 +1,34 @@
[[ -z $BUFFER ]] && LBUFFER="$(fc -ln -1)"
# Save beginning space
local WHITESPACE=""
if [[ ${LBUFFER:0:1} == " " ]] ; then
WHITESPACE=" "
LBUFFER="${LBUFFER:1}"
fi
if [[ -n $EDITOR && $BUFFER == $EDITOR\ * ]]; then
if [[ ${#LBUFFER} -le ${#EDITOR} ]]; then
RBUFFER=" ${BUFFER#$EDITOR }"
LBUFFER="sudoedit"
else
LBUFFER="sudoedit ${LBUFFER#$EDITOR }"
fi
elif [[ $BUFFER == sudoedit\ * ]]; then
if [[ ${#LBUFFER} -le 8 ]]; then
RBUFFER=" ${BUFFER#sudoedit }"
LBUFFER="$EDITOR"
else
LBUFFER="$EDITOR ${LBUFFER#sudoedit }"
fi
elif [[ $BUFFER == sudo\ * ]]; then
if [[ ${#LBUFFER} -le 4 ]]; then
RBUFFER="${BUFFER#sudo }"
LBUFFER=""
else
LBUFFER="${LBUFFER#sudo }"
fi
else
LBUFFER="sudo $LBUFFER"
fi

View File

@ -0,0 +1,6 @@
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
bindkey -M emacs '\e\e' sudo-command-line
bindkey -M vicmd '\e\e' sudo-command-line
bindkey -M viins '\e\e' sudo-command-line

Binary file not shown.

33
helpers/install_zsh.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
ZIMDIR=${HOME}/.zim
ZIMFILES="zimrc zshenv zlogin zshrc"
echo "Creating directory"
[[ ! -d ${ZIMDIR} ]] && mkdir ${ZIMDIR}
echo "Getting Zim Framework"
curl -fsSL https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh -o ${ZIMDIR}/zimfw.zsh
echo "Treating links"
for FILE in ${ZIMFILES}
do
[[ -L ~/.${FILE} ]] && unlink ~/.${FILE}
ln -s ${PWD}/conf.d/zim/${FILE} ~/.${FILE}
done
echo "Making modules directory"
[[ ! -d ${ZIMDIR}/modules ]] && mkdir ${ZIMDIR}/modules
echo "Populating modules"
for MOD in conf.d/zim/modules/*
do
DIR=$(basename ${MOD})
[[ -L ${ZIMDIR}/modules/${DIR} ]] && unlink ${ZIMDIR}/modules/${DIR}
ln -s ${PWD}/conf.d/zim/modules/${DIR} ${ZIMDIR}/modules/${DIR}
done
echo "Installing Zim Framework"
$(which zsh) ${ZIMDIR}/zimfw.zsh install
exit 0

View File

@ -1,13 +1,13 @@
- shell:
-
command: '[[ ! -d ${HOME}/.config/aacs ]] && mkdir ${HOME}/.config/aacs'
stdout: true
stderr: true
description: Testing directory
command: '[[ ! -d ${HOME}/.config/aacs ]] && mkdir ${HOME}/.config/aacs || true'
#stdout: true
#stderr: true
description: Creating directory
-
command: '[[ ! -f ${HOME}/.config/aacs/KEYDB.cfg ]] && /bin/bash -c "curl -fsSL http://vlc-bluray.whoknowsmy.name/files/KEYDB.cfg -o ${HOME}/.config/aacs/KEYDB.cfg"'
stdout: true
stderr: true
command: '[[ ! -e ${HOME}/.config/aacs/KEYDB.cfg ]] && /bin/bash -c "curl -kfsSL https://vlc-bluray.whoknowsmy.name/files/KEYDB.cfg -o ${HOME}/.config/aacs/KEYDB.cfg" || true'
#stdout: true
#stderr: true
description: Downloading AACS db keys

View File

@ -7,5 +7,5 @@
- command: '/bin/bash -c "$(which nvim) -es -u ${HOME}/.config/nvim/init.vim -i NONE -c PlugInstall -c qa || true"'
stdout: true
stdin: true
stderre: true
stderr: true
description: Installing Nvim plugins

View File

@ -1,26 +1,6 @@
- defaults:
link:
relink: true
- shell:
#- command: '/bin/bash -c "curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/src/templates/zshenv https://raw.githubusercontent.com/zimfw/install/master/src/templates/zshrc https://raw.githubusercontent.com/zimfw/install/master/src/templates/zlogin https://raw.githubusercontent.com/zimfw/install/master/src/templates/zimrc -o $HOME/.zshenv -o $HOME/.zshrc -o $HOME/.zlogin -o $HOME/.zimrc"'
# description: Getting dotfiles for Zsh IMproved FrameWork
- command: '[[ ! -d "${HOME}/.zim" ]] && mkdir "${HOME}/.zim" ; /bin/bash -c "curl -fsSL https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh -o ${HOME}/.zim/zimfw.zsh"'
description: Creating and getting zim dir and installation file
- command: '/bin/bash -c helpers/install_zsh.sh'
description: Create latex personal directory
stderr: true
stdout: true
- link:
${HOME}/.zimrc:
path: conf.d/zim/zimrc
${HOME}/.zshenv:
path: conf.d/zim/zshenv
${HOME}/.zlogin:
path: conf.d/zim/zlogin
${HOME}/.zshrc:
path: conf.d/zim/zshrc
${HOME}/.zim/modules/:
glob: true
path: conf.d/zim/modules/*
- shell:
- command: '/bin/bash -c "$(which zsh) ${HOME}/.zim/zimfw.zsh install"'
description: Installing the Zsh IMproved FrameWork

18
meta/tasks/zim.yaml.old Normal file
View File

@ -0,0 +1,18 @@
- defaults:
link:
relink: true
- shell:
#- command: '/bin/bash -c "curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/src/templates/zshenv https://raw.githubusercontent.com/zimfw/install/master/src/templates/zshrc https://raw.githubusercontent.com/zimfw/install/master/src/templates/zlogin https://raw.githubusercontent.com/zimfw/install/master/src/templates/zimrc -o $HOME/.zshenv -o $HOME/.zshrc -o $HOME/.zlogin -o $HOME/.zimrc"'
# description: Getting dotfiles for Zsh IMproved FrameWork
-
command: '[[ ! -d "${HOME}/.zim" ]] && mkdir "${HOME}/.zim" ; /bin/bash -c "curl -fsSL https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh -o ${HOME}/.zim/zimfw.zsh"'
description: Creating and getting zim dir and installation file
-
command: ''
description: Linking zsh and zim configuration files
- shell:
-
command: '/bin/bash -c "$(which zsh) ${HOME}/.zim/zimfw.zsh install"'
description: Installing the Zsh IMproved FrameWork