many updates
This commit is contained in:
parent
d938676e9f
commit
c1ead62c03
@ -1,7 +1,7 @@
|
|||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
case $- in
|
case $- in
|
||||||
*i*) ;;
|
*i*) ;;
|
||||||
*) return;;
|
*) return ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
export PATH=$PATH:$HOME/.local/bin
|
export PATH=$PATH:$HOME/.local/bin
|
||||||
@ -27,11 +27,30 @@ shopt -s checkwinsize
|
|||||||
# colored GCC warnings and errors
|
# colored GCC warnings and errors
|
||||||
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||||
|
|
||||||
# some more ls aliases
|
# use lf to switch directories and bind it to ctrl-o
|
||||||
alias lsa='ls -lah'
|
function lfcd() {
|
||||||
alias ll='ls -alF'
|
tmp="$(mktemp -uq)"
|
||||||
alias la='ls -A'
|
trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT
|
||||||
alias l='ls -CF'
|
lf -last-dir-path="$tmp" "$@"
|
||||||
|
if [ -f "$tmp" ]; then
|
||||||
|
dir="$(cat "$tmp")"
|
||||||
|
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function pomo() {
|
||||||
|
arg1=$1
|
||||||
|
shift
|
||||||
|
args="$*"
|
||||||
|
|
||||||
|
min=${arg1:?Example: pomo 25 Take a break}
|
||||||
|
sec=$((min * 60))
|
||||||
|
msg="${args:?Example: pomo 25 Take a break}"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
date '+%H:%M' && sleep "${sec:?}" && notify-send -u critical -t 0 -a pomo "${msg:?}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# Alias definitions.
|
# Alias definitions.
|
||||||
# You may want to put all your additions into a separate file like
|
# You may want to put all your additions into a separate file like
|
||||||
@ -46,32 +65,32 @@ fi
|
|||||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||||
# sources /etc/bash.bashrc).
|
# sources /etc/bash.bashrc).
|
||||||
if ! shopt -oq posix; then
|
if ! shopt -oq posix; then
|
||||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
. /usr/share/bash-completion/bash_completion
|
. /usr/share/bash-completion/bash_completion
|
||||||
elif [ -f /etc/bash_completion ]; then
|
elif [ -f /etc/bash_completion ]; then
|
||||||
. /etc/bash_completion
|
. /etc/bash_completion
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_exit_code() {
|
set_exit_code() {
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
[[ $exit_code -eq 0 ]] || printf "$(tput setaf 1) $exit_code $(tput sgr0)"
|
[[ $exit_code -eq 0 ]] || printf "$(tput setaf 1) $exit_code $(tput sgr0)"
|
||||||
}
|
}
|
||||||
|
|
||||||
set_prompt() {
|
set_prompt() {
|
||||||
PS1_BAT="$(bash-status-bat)"
|
PS1_BAT="$(bash-status-bat)"
|
||||||
PS1_GIT="$(bash-status-git)"
|
PS1_GIT="$(bash-status-git)"
|
||||||
|
|
||||||
dir_perm=$(ls -ld | awk '{ print $3 }')
|
dir_perm=$(ls -ld | awk '{ print $3 }')
|
||||||
if [[ "$dir_perm" == "$USER" ]]; then
|
if [[ "$dir_perm" == "$USER" ]]; then
|
||||||
dir="\[\033[00;36m\]\w"
|
dir="\[\033[00;36m\]\w"
|
||||||
else
|
else
|
||||||
dir="\[\033[00;31m\]\w"
|
dir="\[\033[00;31m\]\w"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PS1L="\[\033[00;32m\]\u\[\033[00;34m\]@\[\033[01;32m\]\h \[\033[00m\]\$PS1_BAT $dir\[\033[00m\] $PS1_GIT"
|
PS1L="\[\033[00;32m\]\u\[\033[00;34m\]@\[\033[01;32m\]\h \[\033[00m\]\$PS1_BAT $dir\[\033[00m\] $PS1_GIT"
|
||||||
PS1R=$(date +"%R:%S")
|
PS1R=$(date +"%R:%S")
|
||||||
PS1=$(printf "%*s\r%s\n\[\033[00m\]\$(set_exit_code)-[ " "$(tput cols)" "$PS1R" "$PS1L")
|
PS1=$(printf "%*s\r%s\n\[\033[00m\]\$(set_exit_code)-[ " "$(tput cols)" "$PS1R" "$PS1L")
|
||||||
}
|
}
|
||||||
|
|
||||||
PROMPT_COMMAND=set_prompt
|
PROMPT_COMMAND=set_prompt
|
||||||
|
|||||||
@ -179,10 +179,10 @@ map gcs cd ~/.config/shell
|
|||||||
map gcz cd ~/.config/zsh
|
map gcz cd ~/.config/zsh
|
||||||
map gcx1 cd ~/.config/x11
|
map gcx1 cd ~/.config/x11
|
||||||
map gw cd ~/work
|
map gw cd ~/work
|
||||||
map gNN cd ~/notes/zk/
|
map gNN cd ~/notes/
|
||||||
map gNi cd ~/notes/zk/inbox/
|
|
||||||
map gNw cd ~/notes/zk/work/
|
map gNw cd ~/notes/zk/work/
|
||||||
map gNn cd ~/notes/zk/notes/
|
map gNz cd ~/notes/zk/zettel/
|
||||||
|
map gNZ cd ~/notes/zk/zet/
|
||||||
map gNj cd ~/notes/zk/journal/
|
map gNj cd ~/notes/zk/journal/
|
||||||
|
|
||||||
map A rename # at the very end
|
map A rename # at the very end
|
||||||
|
|||||||
@ -131,13 +131,16 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"echasnovski/mini.pairs",
|
"windwp/nvim-autopairs",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||||
|
ignored_next_char = "[%w%.*]", -- don't place autopairs when cursor sits infront of any character.
|
||||||
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("mini.pairs").setup(opts)
|
require("nvim-autopairs").setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"preservim/vim-markdown",
|
"preservim/vim-markdown",
|
||||||
},
|
},
|
||||||
|
|||||||
@ -28,6 +28,11 @@ alias \
|
|||||||
ccat="highlight --out-format=ansi" \
|
ccat="highlight --out-format=ansi" \
|
||||||
ip="ip -color=auto"
|
ip="ip -color=auto"
|
||||||
|
|
||||||
|
alias \
|
||||||
|
l="ls" \
|
||||||
|
ll="ls -l" \
|
||||||
|
lsa="ls -la"
|
||||||
|
|
||||||
# These common commands are just too long! Abbreviate them.
|
# These common commands are just too long! Abbreviate them.
|
||||||
alias \
|
alias \
|
||||||
ka="killall" \
|
ka="killall" \
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
$include /etc/inputrc
|
$include /etc/inputrc
|
||||||
|
|
||||||
|
Control-o: lfcd
|
||||||
|
Control-t: tms
|
||||||
|
Control-n: zk edit --interactive --sort modified-
|
||||||
|
|
||||||
set editing-mode vi
|
set editing-mode vi
|
||||||
$if mode=vi
|
$if mode=vi
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ bindkey -M menuselect 'l' vi-forward-char
|
|||||||
bindkey -M menuselect 'j' vi-down-line-or-history
|
bindkey -M menuselect 'j' vi-down-line-or-history
|
||||||
bindkey -v '^?' backward-delete-char
|
bindkey -v '^?' backward-delete-char
|
||||||
|
|
||||||
# use lf to switch directories and bind it to ctrl-l
|
# use lf to switch directories and bind it to ctrl-o
|
||||||
lfcd() {
|
lfcd() {
|
||||||
tmp="$(mktemp -uq)"
|
tmp="$(mktemp -uq)"
|
||||||
trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT
|
trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT
|
||||||
@ -96,18 +96,19 @@ bindkey -s '^t' '^utms\n'
|
|||||||
# zk related things
|
# zk related things
|
||||||
bindkey -s '^n' '^uzk edit --interactive --sort modified-\n'
|
bindkey -s '^n' '^uzk edit --interactive --sort modified-\n'
|
||||||
|
|
||||||
|
function pomo() {
|
||||||
|
arg1=$1
|
||||||
|
shift
|
||||||
|
args="$*"
|
||||||
|
|
||||||
if [ -f /etc/hostname ]; then
|
min=${arg1:?Example: pomo 25 Take a break}
|
||||||
HOST=$(cat /etc/hostname)
|
sec=$((min * 60))
|
||||||
else
|
msg="${args:?Example: pomo 25 Take a break}"
|
||||||
HOST=$(hostname)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$HOST" = "holocene" ] ; then
|
while true; do
|
||||||
source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh
|
date '+%H:%M' && sleep "${sec:?}" && notify-send -u critical -t 0 -a pomo "${msg:?}"
|
||||||
else
|
done
|
||||||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
}
|
||||||
fi
|
|
||||||
|
|
||||||
# Dracula Theme (for zsh-syntax-highlighting)
|
# Dracula Theme (for zsh-syntax-highlighting)
|
||||||
#
|
#
|
||||||
@ -200,6 +201,20 @@ ZSH_HIGHLIGHT_STYLES[arg0]='fg=#F8F8F2'
|
|||||||
ZSH_HIGHLIGHT_STYLES[default]='fg=#F8F8F2'
|
ZSH_HIGHLIGHT_STYLES[default]='fg=#F8F8F2'
|
||||||
ZSH_HIGHLIGHT_STYLES[cursor]='standout'
|
ZSH_HIGHLIGHT_STYLES[cursor]='standout'
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f /etc/hostname ]; then
|
||||||
|
HOST=$(cat /etc/hostname)
|
||||||
|
else
|
||||||
|
HOST=$(hostname)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$HOST" = "holocene" ] ; then
|
||||||
|
source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh
|
||||||
|
else
|
||||||
|
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
|
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
|
||||||
export SDKMAN_DIR="$HOME/.sdkman"
|
export SDKMAN_DIR="$HOME/.sdkman"
|
||||||
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user