diff --git a/.config/bash/.bashrc b/.config/bash/.bashrc index 4da2596..976db85 100644 --- a/.config/bash/.bashrc +++ b/.config/bash/.bashrc @@ -1,7 +1,7 @@ # If not running interactively, don't do anything case $- in *i*) ;; - *) return;; + *) return ;; esac export PATH=$PATH:$HOME/.local/bin @@ -27,11 +27,30 @@ shopt -s checkwinsize # colored GCC warnings and errors export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' -# some more ls aliases -alias lsa='ls -lah' -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' +# use lf to switch directories and bind it to ctrl-o +function lfcd() { + tmp="$(mktemp -uq)" + trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT + 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. # 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 # sources /etc/bash.bashrc). if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi fi set_exit_code() { - exit_code=$? - [[ $exit_code -eq 0 ]] || printf "$(tput setaf 1) $exit_code $(tput sgr0)" + exit_code=$? + [[ $exit_code -eq 0 ]] || printf "$(tput setaf 1) $exit_code $(tput sgr0)" } set_prompt() { - PS1_BAT="$(bash-status-bat)" - PS1_GIT="$(bash-status-git)" + PS1_BAT="$(bash-status-bat)" + PS1_GIT="$(bash-status-git)" - dir_perm=$(ls -ld | awk '{ print $3 }') - if [[ "$dir_perm" == "$USER" ]]; then - dir="\[\033[00;36m\]\w" - else - dir="\[\033[00;31m\]\w" - fi + dir_perm=$(ls -ld | awk '{ print $3 }') + if [[ "$dir_perm" == "$USER" ]]; then + dir="\[\033[00;36m\]\w" + else + dir="\[\033[00;31m\]\w" + fi - 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") - PS1=$(printf "%*s\r%s\n\[\033[00m\]\$(set_exit_code)-[ " "$(tput cols)" "$PS1R" "$PS1L") + 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") + PS1=$(printf "%*s\r%s\n\[\033[00m\]\$(set_exit_code)-[ " "$(tput cols)" "$PS1R" "$PS1L") } PROMPT_COMMAND=set_prompt diff --git a/.config/lf/lfrc b/.config/lf/lfrc index f170bf7..c86c120 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -179,10 +179,10 @@ map gcs cd ~/.config/shell map gcz cd ~/.config/zsh map gcx1 cd ~/.config/x11 map gw cd ~/work -map gNN cd ~/notes/zk/ -map gNi cd ~/notes/zk/inbox/ +map gNN cd ~/notes/ 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 A rename # at the very end diff --git a/.config/nvim/lua/lazyvim/plugins/utility.lua b/.config/nvim/lua/lazyvim/plugins/utility.lua index 1527dc9..f4c155e 100644 --- a/.config/nvim/lua/lazyvim/plugins/utility.lua +++ b/.config/nvim/lua/lazyvim/plugins/utility.lua @@ -131,13 +131,16 @@ return { end, }, { - "echasnovski/mini.pairs", + "windwp/nvim-autopairs", 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) - require("mini.pairs").setup(opts) + require("nvim-autopairs").setup(opts) end, }, - { "preservim/vim-markdown", }, diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index aeb3f63..cb5165d 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -28,6 +28,11 @@ alias \ ccat="highlight --out-format=ansi" \ ip="ip -color=auto" +alias \ + l="ls" \ + ll="ls -l" \ + lsa="ls -la" + # These common commands are just too long! Abbreviate them. alias \ ka="killall" \ diff --git a/.config/shell/inputrc b/.config/shell/inputrc index f9b94dd..c77f394 100644 --- a/.config/shell/inputrc +++ b/.config/shell/inputrc @@ -1,4 +1,9 @@ $include /etc/inputrc + +Control-o: lfcd +Control-t: tms +Control-n: zk edit --interactive --sort modified- + set editing-mode vi $if mode=vi diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index e44f988..75be72d 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -76,7 +76,7 @@ bindkey -M menuselect 'l' vi-forward-char bindkey -M menuselect 'j' vi-down-line-or-history 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() { tmp="$(mktemp -uq)" 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 bindkey -s '^n' '^uzk edit --interactive --sort modified-\n' +function pomo() { + arg1=$1 + shift + args="$*" -if [ -f /etc/hostname ]; then - HOST=$(cat /etc/hostname) -else - HOST=$(hostname) -fi + min=${arg1:?Example: pomo 25 Take a break} + sec=$((min * 60)) + msg="${args:?Example: pomo 25 Take a break}" -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 + while true; do + date '+%H:%M' && sleep "${sec:?}" && notify-send -u critical -t 0 -a pomo "${msg:?}" + done +} # 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[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!!! export SDKMAN_DIR="$HOME/.sdkman" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"