Fixed vim and zsh
This commit is contained in:
5
zsh/tools/zim_build_cache
Normal file
5
zsh/tools/zim_build_cache
Normal file
@ -0,0 +1,5 @@
|
||||
#
|
||||
# zim_build_cache - rebuilds the zim cache
|
||||
#
|
||||
|
||||
source ${ZDOTDIR:-${HOME}}/.zim/templates/zlogin
|
8
zsh/tools/zim_clean_cache
Normal file
8
zsh/tools/zim_clean_cache
Normal file
@ -0,0 +1,8 @@
|
||||
#
|
||||
# zim_clean_cache - removes all zcompiled files
|
||||
#
|
||||
|
||||
find ${ZDOTDIR:-${HOME}}/.zim/ -iname '*.zwc' | xargs rm
|
||||
rm -f ${ZDOTDIR:-${HOME}}/.{zshrc.zwc,zcompdump,zcompdump.zwc}
|
||||
|
||||
print 'To rebuild the completion cache, please restart your terminal'
|
9
zsh/tools/zim_info
Normal file
9
zsh/tools/zim_info
Normal file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# zim_info - prints zim and system info
|
||||
#
|
||||
|
||||
cd ${ZDOTDIR:-${HOME}}/.zim
|
||||
|
||||
print "Zim commit ref: $(command git rev-parse --short HEAD)"
|
||||
print "Zsh version: $(command zsh --version)"
|
||||
print "System info: $(command uname -a)"
|
80
zsh/tools/zim_issue
Normal file
80
zsh/tools/zim_issue
Normal file
@ -0,0 +1,80 @@
|
||||
#
|
||||
# zim_info - easily create an issue template
|
||||
#
|
||||
|
||||
# create our 'pause' function
|
||||
waiter_func() {
|
||||
local input_key
|
||||
read -sk \?"Press [Enter] to continue; anything else to quit." input_key
|
||||
if [[ ${input_key} == $'\n' ]]; then
|
||||
print "\r "
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# print init dialog
|
||||
print "Please check the existing issues to make sure you\'re not duplicating a report"
|
||||
print "https://github.com/Eriner/zim/issues"
|
||||
|
||||
# if they don't accept, bail
|
||||
if ! waiter_func; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# for convenience, this is our new home
|
||||
cd ${ZDOTDIR:-${HOME}}/.zim
|
||||
|
||||
# collect sys info
|
||||
git_dirty=$(command git status --porcelain 2>/dev/null | tail -n1)
|
||||
git_ref=$(command git rev-parse --short HEAD)
|
||||
zsh_version=$(zsh --version)
|
||||
operating_sys=$(uname -a)
|
||||
|
||||
|
||||
|
||||
# we're going to template and build the issue here (as an array for convenience)
|
||||
|
||||
issue_md=("Environment Info"
|
||||
"----------------"
|
||||
"- Zim commit ref: ${git_ref}"
|
||||
"- Zsh version: ${zsh_version}"
|
||||
"- Operating System Info: ${operating_sys}"
|
||||
""
|
||||
"Description"
|
||||
"-----------"
|
||||
"${user_desc}"
|
||||
""
|
||||
"Steps to Reproduce"
|
||||
"------------------"
|
||||
"${user_reproduce}"
|
||||
""
|
||||
"Images or other Information"
|
||||
"---------------------------"
|
||||
""
|
||||
)
|
||||
|
||||
|
||||
# print the output:
|
||||
# hack: we need to iterate over the elements to capture the blank spaces (to print newlines)
|
||||
for (( i=0; i < ${#issue_md[@]}; i++ )); do
|
||||
printf '%s\n' ${issue_md[i]}
|
||||
done
|
||||
|
||||
# if we have a dirty git, report it
|
||||
if [[ -n ${git_dirty} ]]; then
|
||||
print "${ZDOTDIR:-${HOME}}/.zim has a dirty git working tree."
|
||||
print "here is the diff:"
|
||||
print '```'
|
||||
print $(command git diff)
|
||||
print '```'
|
||||
fi
|
||||
|
||||
|
||||
print '\n\n'
|
||||
print 'Please copy the above and use this when reporting the issue\n'
|
||||
|
||||
# optionally, now we can produce debug info
|
||||
print 'If you would like to produce some helpful logs about your environment, run:'
|
||||
print '$ zmanage debug'
|
13
zsh/tools/zim_remove
Normal file
13
zsh/tools/zim_remove
Normal file
@ -0,0 +1,13 @@
|
||||
#
|
||||
# zim_remove - removes zim from the system
|
||||
#
|
||||
# Note: this doesn't remove _everything_. It removes as much as
|
||||
# possible while maintaining safety (don't delete custom user content).
|
||||
#
|
||||
|
||||
sed '/# Source zim/,/fi/d' ${ZDOTDIR:-${HOME}}/.zshrc
|
||||
sed '/# The following code helps/,/) &!/d' ${ZDOTDIR:-${HOME}}/.zlogin
|
||||
rm -f ${ZDOTDIR:-${HOME}}/.zimrc
|
||||
|
||||
# not forcing this one, as it is recursive. It's possible something went wrong.
|
||||
rm -r ${ZDOTDIR:-${HOME}}/.zim/
|
6
zsh/tools/zim_reset
Normal file
6
zsh/tools/zim_reset
Normal file
@ -0,0 +1,6 @@
|
||||
#
|
||||
# zim_reset - resets the zim repository to latest commit
|
||||
#
|
||||
|
||||
cd ${ZDOTDIR:-${HOME}}/.zim
|
||||
git reset --hard
|
11
zsh/tools/zim_update
Normal file
11
zsh/tools/zim_update
Normal file
@ -0,0 +1,11 @@
|
||||
#
|
||||
# zim_update - update the zim repository
|
||||
#
|
||||
|
||||
cd ${ZDOTDIR:-${HOME}/.zim}
|
||||
|
||||
# this is the cleanest way I know how to update a repository
|
||||
git remote update -p
|
||||
git merge --ff-only @\{u\}
|
||||
# and update the submodules
|
||||
git submodule update --init --recursive
|
Reference in New Issue
Block a user