Add VIM_LEVEL which works just like RANGER_LEVEL

This commit is contained in:
Talia 2020-09-09 10:41:24 +02:00
parent d48569d499
commit 895cf58cca
2 changed files with 20 additions and 7 deletions

22
bashrc
View file

@ -35,13 +35,21 @@ set -o vi
rlevel() {
if [ -n "$RANGER_LEVEL" ]
then if [ "$RANGER_LEVEL" -gt 1 ] && [ ! -z "$2" ]
then if [ "$RANGER_LEVEL" -gt 1 ] && [ ! -z "$3" ]
then
/bin/echo -ne "$1$2$RANGER_LEVEL "
/bin/echo -ne "$1$3$RANGER_LEVEL "
else
/bin/echo -ne "$1 "
fi
fi
if [ -n "$VIM_LEVEL" ]
then if [ "$VIM_LEVEL" -gt 1 ] && [ ! -z "$3" ]
then
/bin/echo -ne "$2$3$VIM_LEVEL "
else
/bin/echo -ne "$2 "
fi
fi
}
numjobs() {
@ -53,21 +61,21 @@ numjobs() {
fi
}
export PS1full='\[\033[00;34m\]┌─╼ \[\033[00;30m\]$(numjobs ⚒ " ×")\033[00;36m$(rlevel 🥆 ·)\[\033[01;35m\]\u\[\033[00;34m\]@\[\033[01;35m\]\h \[\033[00;33m\]\$ \[\033[01;35m\]\w \[\033[01;34m\]`find -mindepth 1 -maxdepth 1 -type d | wc -l`\[\033[00;34m\]d \[\033[01;32m\]`find -maxdepth 1 -type f | wc -l`\[\033[00;32m\]f\[\033[00;34m\] $(gitprompt)
export PS1full='\[\033[00;34m\]┌─╼ \[\033[00;30m\]$(numjobs ⚒ " ×")\033[00;36m$(rlevel 🥆 📓 ·)\[\033[01;35m\]\u\[\033[00;34m\]@\[\033[01;35m\]\h \[\033[00;33m\]\$ \[\033[01;35m\]\w \[\033[01;34m\]`find -mindepth 1 -maxdepth 1 -type d | wc -l`\[\033[00;34m\]d \[\033[01;32m\]`find -maxdepth 1 -type f | wc -l`\[\033[00;32m\]f\[\033[00;34m\] $(gitprompt)
\[\033[00;34m\]└╼ \[\033[00m\]'
export PS1tiny='\[\033[00;30m\]$(numjobs ⚒)\[\033[00;30m\]$(dirs +0 | sed -e "s/.*\\(\\(\\/.*\\)\\{2\\}\\)$/…\\1/") \[\033[00;36m\]$(rlevel 🥆 ·)\[\033[00;34m\]‣ \[\033[00m\]'
export PS1tiny='\[\033[00;30m\]$(numjobs ⚒)\[\033[00;30m\]$(dirs +0 | sed -e "s/.*\\(\\(\\/.*\\)\\{2\\}\\)$/…\\1/") \[\033[00;36m\]$(rlevel 🥆 📓 ·)\[\033[00;34m\]‣ \[\033[00m\]'
export PS1nano='\[\033[02;31m\]‣ \[\033[00m\]'
export PS1nogit='\[\033[00;34m\]┌─╼ \033[00;31m$(rlevel)\[\033[01;35m\]\u\[\033[00;34m\]@\[\033[01;35m\]\h \[\033[00;33m\]\$ \[\033[01;35m\]\w \[\033[01;34m\]`find -mindepth 1 -maxdepth 1 -type d | wc -l`\[\033[00;34m\]d \[\033[01;32m\]`find -maxdepth 1 -type f | wc -l`\[\033[00;32m\]f\[\033[00m\]
export PS1nogit='\[\033[00;34m\]┌─╼ \033[00;31m$(rlevel 🥆 📓)\[\033[01;35m\]\u\[\033[00;34m\]@\[\033[01;35m\]\h \[\033[00;33m\]\$ \[\033[01;35m\]\w \[\033[01;34m\]`find -mindepth 1 -maxdepth 1 -type d | wc -l`\[\033[00;34m\]d \[\033[01;32m\]`find -maxdepth 1 -type f | wc -l`\[\033[00;32m\]f\[\033[00m\]
\[\033[00;34m\]└╼ \[\033[00m\]'
export PS1git='\[\033[00;30m\]$(numjobs ⚒)\[\033[00;30m\]$(gitprompt || dirs +0) \[\033[00;36m\]$(gitpath) \[\033[00;36m\]$(rlevel 🥆 ·)
export PS1git='\[\033[00;30m\]$(numjobs ⚒)\[\033[00;30m\]$(gitprompt || dirs +0) \[\033[00;36m\]$(gitpath) \[\033[00;36m\]$(rlevel 🥆 📖 ·)
\[\033[00;34m\]\[\033[00m\]'
export PS1gitlong='\[\033[00;30m\]$(numjobs ⚒ ·)\[\033[00;30m\]$(gitprompt || dirs +0) \[\033[00;30m\]$(git log --oneline --no-decorate -1 2>/dev/null)
\[\033[00;36m\]$(rlevel 🥆 ·)\[\033[00;36m\]$(gitpath)\[\033[00;31m\]» \[\033[00m\]'
\[\033[00;36m\]$(rlevel 🥆 📓 ·)\[\033[00;36m\]$(gitpath)\[\033[00;31m\]» \[\033[00m\]'
vimswitch() {
if [ -z "$EXPANDTAB" ]

5
vim/plugin/vimlevel.vim Normal file
View file

@ -0,0 +1,5 @@
if exists("$VIM_LEVEL")
let $VIM_LEVEL=$VIM_LEVEL+1
else
let $VIM_LEVEL=1
end