summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ar/.config/shell/bm-files6
-rw-r--r--ar/.config/vim/vimrc3
-rwxr-xr-xar/.local/bin/shortcuts22
-rw-r--r--fedora/.config/bash/bash_profile4
-rw-r--r--fedora/.config/bash/bashrc5
-rw-r--r--fedora/.config/shell/aliasrc11
-rw-r--r--fedora/.config/shell/bm-files4
-rw-r--r--fedora/.config/shell/git-aliasrc415
-rw-r--r--fedora/.config/shell/inputrc31
-rw-r--r--fedora/.config/vim/vimrc3
-rwxr-xr-xfedora/.local/bin/bmshortcuts18
-rw-r--r--mac/.config/shell/bm-files6
-rw-r--r--mac/.config/vim/vimrc3
-rwxr-xr-xmac/.local/bin/bmshortcuts20
14 files changed, 60 insertions, 491 deletions
diff --git a/ar/.config/shell/bm-files b/ar/.config/shell/bm-files
index 200cedd..fc8bce1 100644
--- a/ar/.config/shell/bm-files
+++ b/ar/.config/shell/bm-files
@@ -26,10 +26,12 @@ vns ${XDG_CONFIG_HOME:-${HOME}/.config}/newsboat/config
vnu ${XDG_CONFIG_HOME:-${HOME}/.config}/newsboat/urls # Newsboat url (RSS reader)
vqt ${XDG_CONFIG_HOME:-${HOME}/.config}/qutebrowser/config.py # Qutebrowser config
Vsm /etc/samba/smb.conf # Samba config
+vsa ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by shell (and potentially other shells)
vse ${XDG_CONFIG_HOME:-${HOME}/.config}/sesh/sesh.toml # Sesh config
vsf ${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless/surf/config.def.h # Surf: a simple browser
vsl ${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless/slock/config.def.h # Slock: lock screen
-vsp ${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/snippets # Snippets
+vsn ${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/snippets # Snippets
+vsp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Shell profile used for system
vss ${XDG_CONFIG_HOME:-${HOME}/.config}/starship/starship.toml # Starship
vst ${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless/st/config.def.h # St: a simple terminal
vsx ${XDG_CONFIG_HOME:-${HOME}/.config}/nsxiv/exec/key-handler # Nsxiv (image viewer) key/script handler
@@ -47,8 +49,6 @@ vxp ${XDG_CONFIG_HOME:-${HOME}/.config}/x11/xprofile
vxr ${XDG_CONFIG_HOME:-${HOME}/.config}/x11/xresources # Colors, themes and variables for X11
vyk ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap-default.toml # Yazi keymap
vyz ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/yazi.toml # Yazi config
-vza ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by zsh (and potentially other shells)
vzc ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/.zshrc # Zsh config
vzk ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/keymaps.zsh # Zsh keymaps
-vzp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Zsh profile used for system
vzs ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/scripts.zsh # Zsh scripts
diff --git a/ar/.config/vim/vimrc b/ar/.config/vim/vimrc
index 0535aec..0a76953 100644
--- a/ar/.config/vim/vimrc
+++ b/ar/.config/vim/vimrc
@@ -367,9 +367,6 @@ set title
set timeoutlen=300 " Time (in milliseconds) to wait for a mapping
set ttimeoutlen=10 " Time (in milliseconds) to wait for terminal key codes
-" Esc
-set noesckeys
-
" Set the commands to save in history default number is 20.
set history=1000
diff --git a/ar/.local/bin/shortcuts b/ar/.local/bin/shortcuts
index ab5e69d..af4ad58 100755
--- a/ar/.local/bin/shortcuts
+++ b/ar/.local/bin/shortcuts
@@ -10,9 +10,15 @@ zsh_named_dirs="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc"
command -v lf && lf_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/lf/shortcutrc" || lf_shortcuts="/dev/null"
command -v vim && vim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/vim/shortcuts.vim" || vim_shortcuts="/dev/null"
command -v nvim && nvim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/shortcuts.lua" || nvim_shortcuts="/dev/null"
-command -v yazi && yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml" || yazi_shortcuts="/dev/null"
+if command -v yazi; then
+ yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml"
+ yazi_shortcuts_tmp="$yazi_shortcuts.tmp"
+else
+ yazi_shortcuts="/dev/null"
+ yazi_shortcuts_tmp="/dev/null"
+fi
command -v ranger && ranger_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/ranger/shortcuts.conf" || ranger_shortcuts="/dev/null"
-command -v qutebrowser && qute_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/qutebrowser/shortcuts.py" || qute_shortcuts="/dev/null"
+command -v qutebrowser && qute_shortcuts="$HOME/.qutebrowser/shortcuts.py" || qute_shortcuts="/dev/null"
command -v fish && fish_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/fish/shortcuts.fish" || fish_shortcuts="/dev/null"
command -v vifm && vifm_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/vifm/shortcuts.rc" || vifm_shortcuts="/dev/null"
@@ -22,7 +28,7 @@ printf "# vim: filetype=sh\\n" >"$fish_shortcuts"
printf "# vim: filetype=sh\\nalias " >"$shell_shortcuts"
printf "# vim: filetype=sh\\n" >"$shell_env_shortcuts"
printf "\" vim: filetype=vim\\n" >"$vifm_shortcuts"
-cp "$HOME/.config/yazi/keymap-default.toml" "$yazi_shortcuts"
+[ -f "$HOME/.config/yazi/keymap-default.toml" ] && cp "$HOME/.config/yazi/keymap-default.toml" "$yazi_shortcuts"
# Format the `directories` file in the correct syntax and sent it to all three configs.
eval "echo \"$(cat "$bmdirs")\"" |
@@ -43,7 +49,7 @@ eval "echo \"$(cat "$bmdirs")\"" |
printf(\"vim.keymap.set('n', '<localleader><localleader>%s', function() require('mini.files').open('%s') end, { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" }
- printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts.tmp\"}"
+ printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts_tmp\"}"
# Format the `files` file in the correct syntax and sent it to both configs.
eval "echo \"$(cat "$bmfiles")\"" |
@@ -66,10 +72,10 @@ eval "echo \"$(cat "$bmfiles")\"" |
printf(\"vim.keymap.set('n', '<localleader><localleader>%s', '<cmd>e %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" }
- printf(\"\\t{ on = [ %s ], run = [ 'reveal %s', 'open' ], desc = \\\"Open %s\\\" },\\n\", key_array, \$2, desc_path) >> \"$yazi_shortcuts.tmp\" }"
+ printf(\"\\t{ on = [ %s ], run = [ 'reveal %s', 'open' ], desc = \\\"Open %s\\\" },\\n\", key_array, \$2, desc_path) >> \"$yazi_shortcuts_tmp\" }"
# Merge bookmarks into keymap-default.toml
-if [ -f "$yazi_shortcuts.tmp" ]; then
+if [ -f "$yazi_shortcuts_tmp" ]; then
# Find the line with the closing bracket in the [mgr] section
line_num=$(grep -n "^]" "$yazi_shortcuts" | head -1 | cut -d: -f1)
@@ -77,11 +83,11 @@ if [ -f "$yazi_shortcuts.tmp" ]; then
head -n $((line_num - 1)) "$yazi_shortcuts" >"$yazi_shortcuts.new"
echo "" >>"$yazi_shortcuts.new"
echo " # Custom bookmarks" >>"$yazi_shortcuts.new"
- cat "$yazi_shortcuts.tmp" >>"$yazi_shortcuts.new"
+ cat "$yazi_shortcuts_tmp" >>"$yazi_shortcuts.new"
echo "]" >>"$yazi_shortcuts.new"
tail -n +$((line_num + 1)) "$yazi_shortcuts" >>"$yazi_shortcuts.new"
# Replace the original file
mv "$yazi_shortcuts.new" "$yazi_shortcuts"
- rm -f "$yazi_shortcuts.tmp"
+ rm -f "$yazi_shortcuts_tmp"
fi
diff --git a/fedora/.config/bash/bash_profile b/fedora/.config/bash/bash_profile
index 2e8eab7..4938bb5 100644
--- a/fedora/.config/bash/bash_profile
+++ b/fedora/.config/bash/bash_profile
@@ -29,8 +29,8 @@ export SUDO_EDITOR=$EDITOR
export TERM="xterm-256color"
export VISUAL=$EDITOR
export TERM="xterm-256color"
-export GVIMINIT='let $MYGVIMRC="$XDG_CONFIG_HOME/vim/gvimrc" | source $MYGVIMRC'
-export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'
+export GVIMINIT='let $MYGVIMRC="$XDG_CONFIG_HOME/vim/gvimrc" | . $MYGVIMRC'
+export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | . $MYVIMRC'
###################################################
### --- XDG ENV PATHES --- ###
diff --git a/fedora/.config/bash/bashrc b/fedora/.config/bash/bashrc
index 9343b1a..95a1c38 100644
--- a/fedora/.config/bash/bashrc
+++ b/fedora/.config/bash/bashrc
@@ -163,6 +163,11 @@ bind '"\C-g":"lfcd\n"'
eval "$(dircolors)"
+[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc"
+[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc"
+[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc"
+[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc"
+[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc"
[ -f "${XDG_SCRIPTS_HOME:-${HOME}/.local/bin}/bash-preexec" ] && . "${XDG_SCRIPTS_HOME:-${HOME}/.local/bin}/bash-preexec"
[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/rootshortcutrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/rootshortcutrc"
[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/rootzshnameddirrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/rootzshnameddirrc"
diff --git a/fedora/.config/shell/aliasrc b/fedora/.config/shell/aliasrc
index fd86d34..a219759 100644
--- a/fedora/.config/shell/aliasrc
+++ b/fedora/.config/shell/aliasrc
@@ -4,7 +4,7 @@
if [ -n "$BASH_VERSION" ]; then
# ------------------------------
- # Bash-compatible aliases & functions
+ # BASH-compatible aliases & functions
# ------------------------------
# helper: safe alias creation
@@ -260,7 +260,7 @@ if [ -n "$BASH_VERSION" ]; then
alias shck='shellcheck --color=always'
# ref/shortcut loader (keep as in original)
- ref() { shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc; }
+ ref() { bmshortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc; }
# sudo helpers
alias su='sudo su -l root'
@@ -363,9 +363,10 @@ if [ -n "$BASH_VERSION" ]; then
# zsh sourcing helpers (just source config)
sps() { source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile; }
szs() { source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc; }
-
- # -------- done bash branch ----------
else
+ # ------------------------------
+ # ZSH-compatible aliases & functions
+ # ------------------------------
# sudo not required for some system commands
for command in blkid lsblk mount umount dnf poweroff reboot shutdown su updatedb; do
alias $command="sudo $command"
@@ -648,7 +649,7 @@ else
alias shck='shellcheck --color=always'
# shortcut
- alias ref='shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc'
+ alias ref='bmshortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc'
# sudo
alias su='sudo su -l root'
diff --git a/fedora/.config/shell/bm-files b/fedora/.config/shell/bm-files
index 0be00a6..a7ee21d 100644
--- a/fedora/.config/shell/bm-files
+++ b/fedora/.config/shell/bm-files
@@ -8,12 +8,12 @@ vga ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc
vgc ${XDG_CONFIG_HOME:-${HOME}/.config}/git/config # Git config
vgi ${XDG_CONFIG_HOME:-${HOME}/.config}/git/ignore # Git ignore
Vsm /etc/samba/smb.conf # Samba config
+vsa ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by shell (and potentially other shells)
+vsp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Shell profile used for system
vtm ${XDG_CONFIG_HOME:-${HOME}/.config}/tmux/tmux.conf # Tmux config
vvc ${XDG_CONFIG_HOME:-${HOME}/.config}/vim/vimrc # Vim config
vvi ${XDG_CONFIG_HOME:-${HOME}/.config}/vim/init.vim # Vim init
vvp ${XDG_CONFIG_HOME:-${HOME}/.config}/vim/plugins.vim # Vim plugins
-vza ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by zsh (and potentially other shells)
vzc ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/.zshrc # Zsh config
vzk ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/keymaps.zsh # Zsh keymaps
-vzp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Zsh profile used for system
vzs ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/scripts.zsh # Zsh scripts
diff --git a/fedora/.config/shell/git-aliasrc b/fedora/.config/shell/git-aliasrc
deleted file mode 100644
index f87a556..0000000
--- a/fedora/.config/shell/git-aliasrc
+++ /dev/null
@@ -1,415 +0,0 @@
-# Git version checking
-autoload -Uz is-at-least
-git_version="${${(As: :)$(git version 2>/dev/null)}[3]}"
-
-#
-# Functions Current
-# (sorted alphabetically by function name)
-# (order should follow README)
-#
-
-# The name of the current branch
-# Back-compatibility wrapper for when this function was defined here in
-# the plugin, before being pulled in to core lib/git.zsh as git_current_branch()
-# to fix the core -> git plugin dependency.
-current_branch() {
- git_current_branch
-}
-
-# Check for develop and similarly named branches
-git_develop_branch() {
- command git rev-parse --git-dir &>/dev/null || return
- local branch
- for branch in dev devel develop development; do
- if command git show-ref -q --verify refs/heads/$branch; then
- echo $branch
- return 0
- fi
- done
-
- echo develop
- return 1
-}
-
-# Check if main exists and use instead of master
-git_main_branch() {
- command git rev-parse --git-dir &>/dev/null || return
- local ref
- for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}; do
- if command git show-ref -q --verify $ref; then
- echo ${ref:t}
- return 0
- fi
- done
-
- # If no main branch was found, fall back to master but return error
- echo master
- return 1
-}
-
-grename() {
- if [[ -z "$1" || -z "$2" ]]; then
- echo "Usage: $0 old_branch new_branch"
- return 1
- fi
-
- # Rename branch locally
- git branch -m "$1" "$2"
- # Rename branch in origin remote
- if git push origin :"$1"; then
- git push --set-upstream origin "$2"
- fi
-}
-
-#
-# Functions Work in Progress (WIP)
-# (sorted alphabetically by function name)
-# (order should follow README)
-#
-
-# Similar to `gunwip` but recursive "Unwips" all recent `--wip--` commits not just the last one
-gunwipall() {
- local _commit=$(git log --grep='--wip--' --invert-grep --max-count=1 --format=format:%H)
-
- # Check if a commit without "--wip--" was found and it's not the same as HEAD
- if [[ "$_commit" != "$(git rev-parse HEAD)" ]]; then
- git reset $_commit || return 1
- fi
-}
-
-# Warn if the current branch is a WIP
-work_in_progress() {
- command git -c log.showSignature=false log -n 1 2>/dev/null | grep -q -- "--wip--" && echo "WIP!!"
-}
-
-#
-# Aliases
-# (sorted alphabetically by command)
-# (order should follow README)
-# (in some cases force the alisas order to match README, like for example gke and gk)
-#
-
-alias grt='cd "$(git rev-parse --show-toplevel || echo .)"'
-
-ggpnp() {
- if [[ "$#" == 0 ]]; then
- ggl && ggp
- else
- ggl "${*}" && ggp "${*}"
- fi
-}
-compdef _git ggpnp=git-checkout
-
-alias ggpur='ggu'
-alias g='git'
-! pidof transmission-daemon >/dev/null && alias gaa='git add --all' || alias gaa='echo "Turn off transmission-daemon first!"'
-alias gapa='git add --patch'
-alias gau='git add --update'
-alias gav='git add --verbose'
-alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign --message "--wip-- [skip ci]"'
-alias gam='git am'
-alias gama='git am --abort'
-alias gamc='git am --continue'
-alias gamscp='git am --show-current-patch'
-alias gams='git am --skip'
-alias gap='git apply'
-alias gapt='git apply --3way'
-alias gbs='git bisect'
-alias gbsb='git bisect bad'
-alias gbsg='git bisect good'
-alias gbsn='git bisect new'
-alias gbso='git bisect old'
-alias gbsr='git bisect reset'
-alias gbss='git bisect start'
-alias gb='git branch'
-alias gba='git branch --all'
-alias gbD='git branch --delete --force'
-
-gbda() {
- git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch --delete 2>/dev/null
-}
-
-# Copied and modified from James Roeder (jmaroeder) under MIT License
-# https://github.com/jmaroeder/plugin-git/blob/216723ef4f9e8dde399661c39c80bdf73f4076c4/functions/gbda.fish
-gbds() {
- local default_branch=$(git_main_branch)
- (( ! $? )) || default_branch=$(git_develop_branch)
-
- git for-each-ref refs/heads/ "--format=%(refname:short)" | \
- while read branch; do
- local merge_base=$(git merge-base $default_branch $branch)
- if [[ $(git cherry $default_branch $(git commit-tree $(git rev-parse $branch\^{tree}) -p $merge_base -m _)) = -* ]]; then
- git branch -D $branch
- fi
- done
-}
-
-alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -d'
-alias gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -D'
-alias gbm='git branch --move'
-alias gbnm='git branch --no-merged'
-alias gbr='git branch --remote'
-alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
-alias gbg='LANG=C git branch -vv | grep ": gone\]"'
-alias gcor='git checkout --recurse-submodules'
-alias gcB='git checkout -B'
-alias gcd='git checkout $(git_develop_branch)'
-alias gcm='git checkout $(git_main_branch)'
-alias gcpa='git cherry-pick --abort'
-alias gcpc='git cherry-pick --continue'
-alias gcl='git clone --recurse-submodules'
-
-gccd() {
- setopt localoptions extendedglob
-
- # get repo URI from args based on valid formats: https://git-scm.com/docs/git-clone#URLS
- local repo='${${@[(r)(ssh://*|git://*|ftp(s)#://*|http(s)#://*|*@*)(.git/#)#]}:-$_}'
-
- # clone repository and exit if it fails
- command git clone --recurse-submodules "$@" || return
-
- # if last arg passed was a directory, that's where the repo was cloned
- # otherwise parse the repo URI and use the last part as the directory
- [[ -d "$_" ]] && cd '$_' || cd '${${repo:t}%.git/#}'
-}
-compdef _git gccd=git-clone
-
-alias gcam='git commit --all --message'
-alias gcas='git commit --all --signoff'
-alias gcasm='git commit --all --signoff --message'
-alias gcs='git commit --gpg-sign'
-alias gcss='git commit --gpg-sign --signoff'
-alias gcssm='git commit --gpg-sign --signoff --message'
-alias gcmsg='git commit --message'
-alias gcsm='git commit --signoff --message'
-alias gc='git commit --verbose'
-alias gca='git commit --verbose --all'
-alias gca!='git commit --verbose --all --amend'
-alias gcan!='git commit --verbose --all --no-edit --amend'
-alias gcans!='git commit --verbose --all --signoff --no-edit --amend'
-alias gc!='git commit --verbose --amend'
-alias gcn!='git commit --verbose --no-edit --amend'
-alias gdct='git describe --tags $(git rev-list --tags --max-count=1)'
-alias gdca='git diff --cached'
-alias gdcw='git diff --cached --word-diff'
-alias gds='git diff --staged'
-alias gdw='git diff --word-diff'
-
-gdv() { git diff -w "$@" | view - }
-compdef _git gdv=git-diff
-
-alias gdup='git diff @{upstream}'
-
-gdnolock() {
- git diff "$@" ":(exclude)package-lock.json" ":(exclude)*.lock"
-}
-compdef _git gdnolock=git-diff
-
-alias gdt='git diff-tree --no-commit-id --name-only -r'
-alias gf='git fetch'
-# --jobs=<n> was added in git 2.8
-is-at-least 2.8 "$git_version" \
- && alias gfa='git fetch --all --prune --jobs=10' \
- || alias gfa='git fetch --all --prune'
-alias gfo='git fetch origin'
-alias gg='git gui citool'
-alias gga='git gui citool --amend'
-alias ghh='git help'
-alias glgg='git log --graph'
-alias glggp='git log --graph --parents'
-alias glgga='git log --graph --decorate --all'
-alias glggpa='git log --graph --decorate --parents --all'
-alias glgm='git log --graph --max-count=10'
-alias glgpm='git log --graph --parents --max-count=10'
-alias gloac='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%ae>%Creset" --abbrev-commit --all'
-alias glods='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --date=short'
-alias glopds='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --parents --date=short'
-alias glod='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset"'
-alias glopd='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --parents'
-alias glola='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --all'
-alias glolpa='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --parents --all'
-alias glols='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --stat'
-alias glolps='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --parents --stat'
-alias glol='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset"'
-alias glolp='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --parents'
-alias glog='git log --oneline --decorate --graph'
-alias glogp='git log --oneline --decorate --graph --parents'
-alias gloga='git log --oneline --decorate --graph --all'
-alias glogpa='git log --oneline --decorate --graph --parents --all'
-
-# Pretty log messages
-_git_log_prettily(){
- if ! [ -z $1 ]; then
- git log --pretty=$1
- fi
-}
-compdef _git _git_log_prettily=git-log
-
-alias glp='_git_log_prettily'
-alias glg='git log --stat'
-alias glgp='git log --stat --patch'
-alias gignored='git ls-files -v | grep "^[[:lower:]]"'
-alias gfg='git ls-files | grep'
-alias gm='git merge'
-alias gma='git merge --abort'
-alias gms="git merge --squash"
-alias gmom='git merge origin/$(git_main_branch)'
-alias gmum='git merge upstream/$(git_main_branch)'
-alias gmtl='git mergetool --no-prompt'
-alias gmtlvim='git mergetool --no-prompt --tool=vimdiff'
-
-alias gl='git pull'
-alias gprb='git pull --rebase'
-alias gprbv='git pull --rebase -v'
-alias gpra='git pull --rebase --autostash'
-alias gprav='git pull --rebase --autostash -v'
-
-ggu() {
- [[ "$#" != 1 ]] && local b="$(git_current_branch)"
- git pull --rebase origin "${b:=$1}"
-}
-compdef _git ggu=git-checkout
-
-alias gprom='git pull --rebase origin $(git_main_branch)'
-alias gpromi='git pull --rebase=interactive origin $(git_main_branch)'
-alias ggpull='git pull origin "$(git_current_branch)"'
-
-ggl() {
- if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
- git pull origin "${*}"
- else
- [[ "$#" == 0 ]] && local b="$(git_current_branch)"
- git pull origin "${b:=$1}"
- fi
-}
-compdef _git ggl=git-checkout
-
-alias gluc='git pull upstream $(git_current_branch)'
-alias glum='git pull upstream $(git_main_branch)'
-# alias gp='git push'
-alias gpd='git push --dry-run'
-
-ggf() {
- [[ "$#" != 1 ]] && local b="$(git_current_branch)"
- git push --force origin "${b:=$1}"
-}
-compdef _git ggf=git-checkout
-
-alias gpf!='git push --force'
-is-at-least 2.30 "$git_version" \
- && alias gpf='git push --force-with-lease --force-if-includes' \
- || alias gpf='git push --force-with-lease'
-
-ggfl() {
- [[ "$#" != 1 ]] && local b="$(git_current_branch)"
- git push --force-with-lease origin "${b:=$1}"
-}
-compdef _git ggfl=git-checkout
-
-alias gpsup='git push --set-upstream origin $(git_current_branch)'
-is-at-least 2.30 "$git_version" \
- && alias gpsupf='git push --set-upstream origin $(git_current_branch) --force-with-lease --force-if-includes' \
- || alias gpsupf='git push --set-upstream origin $(git_current_branch) --force-with-lease'
-alias gpvb='git push --verbose'
-alias gpoat='git push origin --all && git push origin --tags'
-alias gpod='git push origin --delete'
-alias ggpush='git push origin "$(git_current_branch)"'
-
-ggp() {
- if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
- git push origin "${*}"
- else
- [[ "$#" == 0 ]] && local b="$(git_current_branch)"
- git push origin "${b:=$1}"
- fi
-}
-compdef _git ggp=git-checkout
-
-alias gpu='git push upstream'
-alias grba='git rebase --abort'
-alias grbc='git rebase --continue'
-alias grbi='git rebase --interactive'
-alias grbo='git rebase --onto'
-alias grbs='git rebase --skip'
-alias grbd='git rebase $(git_develop_branch)'
-alias grbm='git rebase $(git_main_branch)'
-alias grbom='git rebase origin/$(git_main_branch)'
-alias gr='git remote'
-alias grv='git remote --verbose'
-alias gra='git remote add'
-alias grrm='git remote remove'
-alias grmv='git remote rename'
-alias grset='git remote set-url'
-alias grup='git remote update'
-alias gru='git reset --'
-alias grhh='git reset --hard'
-alias grhk='git reset --keep'
-alias grhs='git reset --soft'
-alias gpristine='git reset --hard && git clean --force -dfx'
-alias groh='git reset origin/$(git_current_branch) --hard'
-alias grs='git restore'
-alias grss='git restore --source'
-alias grst='git restore --staged'
-alias gunwip='git rev-list --max-count=1 --format="%s" HEAD | grep -q "\--wip--" && git reset HEAD~1'
-alias grev='git revert'
-alias grm='git rm'
-alias grmc='git rm --cached'
-alias gcount='git shortlog --summary --numbered'
-alias gsh='git show'
-alias gsps='git show --pretty=short --show-signature'
-alias gstall='git stash --all'
-alias gstaa='git stash apply'
-alias gstc='git stash clear'
-alias gstd='git stash drop'
-alias gstl='git stash list'
-alias gstp='git stash pop'
-# use the default stash push on git 2.13 and newer
-is-at-least 2.13 "$git_version" \
- && alias gsta='git stash push' \
- || alias gsta='git stash save'
-alias gsts='git stash show --patch'
-alias gst='git status'
-alias gsb='git status --short --branch'
-alias gsi='git submodule init'
-alias gsu='git submodule update'
-alias gsd='git svn dcommit'
-alias git-svn-dcommit-push='git svn dcommit && git push github $(git_main_branch):svntrunk'
-alias gsr='git svn rebase'
-alias gsw='git switch'
-alias gswc='git switch --create'
-alias gswd='git switch $(git_develop_branch)'
-alias gswm='git switch $(git_main_branch)'
-alias gtan='git tag --annotate'
-alias gtsn='git tag --sign'
-alias gtv='git tag | sort -V'
-alias gignore='git update-index --assume-unchanged'
-alias gunignore='git update-index --no-assume-unchanged'
-alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
-alias gwt='git worktree'
-alias gwta='git worktree add'
-alias gwtls='git worktree list'
-alias gwtmv='git worktree move'
-alias gwtrm='git worktree remove'
-alias gstu='gsta --include-untracked'
-alias gtl='gtl(){ git tag --sort=-v:refname -n --list "${1}*" }; noglob gtl'
-alias gk='\gitk --all --branches &!'
-alias gke='\gitk --all $(git log --walk-reflogs --pretty=%h) &!'
-
-unset git_version
-
-# Logic for adding warnings on deprecated aliases
-local old_alias new_alias
-for old_alias new_alias (
- # TODO(2023-10-19): remove deprecated `git pull --rebase` aliases
- gup gpr
- gupv gprv
- gupa gpra
- gupav gprav
- gupom gprom
- gupomi gpromi
-); do
- aliases[$old_alias]='
- print -Pu2 \"%F{yellow}[oh-my-zsh] '%F{red}${old_alias}%F{yellow}' is a deprecated alias, using '%F{green}${new_alias}%F{yellow}' instead.%f\"
- $new_alias'
-done
-unset old_alias new_alias
diff --git a/fedora/.config/shell/inputrc b/fedora/.config/shell/inputrc
deleted file mode 100644
index 81cdf85..0000000
--- a/fedora/.config/shell/inputrc
+++ /dev/null
@@ -1,31 +0,0 @@
-$include /etc/inputrc
-
-set completion-display-width 0
-set completion-query-items 1000
-
-# Prettyfi
-set colored-stats on
-set colored-completion-prefix on
-
-# ^C no longer shows on C-c keypress
-set echo-control-characters off
-
-# Map tab to cycle through all the possible completions.
-TAB: menu-complete
-
-# vi mode
-set editing-mode vi
-
-$if mode=vi
-set show-mode-in-prompt on
-set vi-ins-mode-string \1\e[6 q\2
-set vi-cmd-mode-string \1\e[2 q\2
-set keymap vi-command
-
-# these are for vi-command mode
-Control-l: clear-screen
-
-set keymap vi-insert
-# these are for vi-insert mode
-Control-l: clear-screen
-$endif
diff --git a/fedora/.config/vim/vimrc b/fedora/.config/vim/vimrc
index 0535aec..0a76953 100644
--- a/fedora/.config/vim/vimrc
+++ b/fedora/.config/vim/vimrc
@@ -367,9 +367,6 @@ set title
set timeoutlen=300 " Time (in milliseconds) to wait for a mapping
set ttimeoutlen=10 " Time (in milliseconds) to wait for terminal key codes
-" Esc
-set noesckeys
-
" Set the commands to save in history default number is 20.
set history=1000
diff --git a/fedora/.local/bin/bmshortcuts b/fedora/.local/bin/bmshortcuts
index c425b2f..af4ad58 100755
--- a/fedora/.local/bin/bmshortcuts
+++ b/fedora/.local/bin/bmshortcuts
@@ -10,7 +10,13 @@ zsh_named_dirs="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc"
command -v lf && lf_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/lf/shortcutrc" || lf_shortcuts="/dev/null"
command -v vim && vim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/vim/shortcuts.vim" || vim_shortcuts="/dev/null"
command -v nvim && nvim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/shortcuts.lua" || nvim_shortcuts="/dev/null"
-command -v yazi && yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml" || yazi_shortcuts="/dev/null"
+if command -v yazi; then
+ yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml"
+ yazi_shortcuts_tmp="$yazi_shortcuts.tmp"
+else
+ yazi_shortcuts="/dev/null"
+ yazi_shortcuts_tmp="/dev/null"
+fi
command -v ranger && ranger_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/ranger/shortcuts.conf" || ranger_shortcuts="/dev/null"
command -v qutebrowser && qute_shortcuts="$HOME/.qutebrowser/shortcuts.py" || qute_shortcuts="/dev/null"
command -v fish && fish_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/fish/shortcuts.fish" || fish_shortcuts="/dev/null"
@@ -43,7 +49,7 @@ eval "echo \"$(cat "$bmdirs")\"" |
printf(\"vim.keymap.set('n', '<localleader><localleader>%s', function() require('mini.files').open('%s') end, { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" }
- printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts.tmp\"}"
+ printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts_tmp\"}"
# Format the `files` file in the correct syntax and sent it to both configs.
eval "echo \"$(cat "$bmfiles")\"" |
@@ -66,10 +72,10 @@ eval "echo \"$(cat "$bmfiles")\"" |
printf(\"vim.keymap.set('n', '<localleader><localleader>%s', '<cmd>e %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" }
- printf(\"\\t{ on = [ %s ], run = [ 'reveal %s', 'open' ], desc = \\\"Open %s\\\" },\\n\", key_array, \$2, desc_path) >> \"$yazi_shortcuts.tmp\" }"
+ printf(\"\\t{ on = [ %s ], run = [ 'reveal %s', 'open' ], desc = \\\"Open %s\\\" },\\n\", key_array, \$2, desc_path) >> \"$yazi_shortcuts_tmp\" }"
# Merge bookmarks into keymap-default.toml
-if [ -f "$yazi_shortcuts.tmp" ]; then
+if [ -f "$yazi_shortcuts_tmp" ]; then
# Find the line with the closing bracket in the [mgr] section
line_num=$(grep -n "^]" "$yazi_shortcuts" | head -1 | cut -d: -f1)
@@ -77,11 +83,11 @@ if [ -f "$yazi_shortcuts.tmp" ]; then
head -n $((line_num - 1)) "$yazi_shortcuts" >"$yazi_shortcuts.new"
echo "" >>"$yazi_shortcuts.new"
echo " # Custom bookmarks" >>"$yazi_shortcuts.new"
- cat "$yazi_shortcuts.tmp" >>"$yazi_shortcuts.new"
+ cat "$yazi_shortcuts_tmp" >>"$yazi_shortcuts.new"
echo "]" >>"$yazi_shortcuts.new"
tail -n +$((line_num + 1)) "$yazi_shortcuts" >>"$yazi_shortcuts.new"
# Replace the original file
mv "$yazi_shortcuts.new" "$yazi_shortcuts"
- rm -f "$yazi_shortcuts.tmp"
+ rm -f "$yazi_shortcuts_tmp"
fi
diff --git a/mac/.config/shell/bm-files b/mac/.config/shell/bm-files
index 17aefce..aabc278 100644
--- a/mac/.config/shell/bm-files
+++ b/mac/.config/shell/bm-files
@@ -25,10 +25,12 @@ vnp ${XDG_CONFIG_HOME:-${HOME}/.config}/ncmpcpp/config
vns ${XDG_CONFIG_HOME:-${HOME}/.config}/newsboat/config # Newsboat config (RSS reader)
vnu ${XDG_CONFIG_HOME:-${HOME}/.config}/newsboat/urls # Newsboat url (RSS reader)
vqt $HOME/.qutebrowser/config.py # Qutebrowser config
+vsa ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by shell (and potentially other shells)
vse ${XDG_CONFIG_HOME:-${HOME}/.config}/sesh/sesh.toml # Sesh config
vsh $HOME/.ssh/config # SSH config
vsk ${XDG_CONFIG_HOME:-${HOME}/.config}/sketchybar/sketchybarrc # Sketchybar config
-vsp ${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/snippets # Snippets
+vsn ${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/snippets # Snippets
+vsp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Shell profile used for system
vss ${XDG_CONFIG_HOME:-${HOME}/.config}/starship/starship.toml # Starship
vsx ${XDG_CONFIG_HOME:-${HOME}/.config}/nsxiv/exec/key-handler # Nsxiv (image viewer) key/script handler
vtc ${XDG_CONFIG_HOME:-${HOME}/.config}/task/taskrc # Task config
@@ -43,8 +45,6 @@ vvw ${XDG_DATA_HOME:-${HOME}/.local/share}/vimwiki/index.md
vyc ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/yazi.toml # Yazi config
vyi ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/init.lua # Yazi init for plugins
vyk ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap-default.toml # Yazi key config
-vza ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by zsh (and potentially other shells)
vzc ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/.zshrc # Zsh config
vzk ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/keymaps.zsh # Zsh keymaps
-vzp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Zsh profile used for system
vzs ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/scripts.zsh # Zsh scripts
diff --git a/mac/.config/vim/vimrc b/mac/.config/vim/vimrc
index 0535aec..0a76953 100644
--- a/mac/.config/vim/vimrc
+++ b/mac/.config/vim/vimrc
@@ -367,9 +367,6 @@ set title
set timeoutlen=300 " Time (in milliseconds) to wait for a mapping
set ttimeoutlen=10 " Time (in milliseconds) to wait for terminal key codes
-" Esc
-set noesckeys
-
" Set the commands to save in history default number is 20.
set history=1000
diff --git a/mac/.local/bin/bmshortcuts b/mac/.local/bin/bmshortcuts
index 2a8d3fa..af4ad58 100755
--- a/mac/.local/bin/bmshortcuts
+++ b/mac/.local/bin/bmshortcuts
@@ -10,7 +10,13 @@ zsh_named_dirs="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc"
command -v lf && lf_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/lf/shortcutrc" || lf_shortcuts="/dev/null"
command -v vim && vim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/vim/shortcuts.vim" || vim_shortcuts="/dev/null"
command -v nvim && nvim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/shortcuts.lua" || nvim_shortcuts="/dev/null"
-command -v yazi && yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml" || yazi_shortcuts="/dev/null"
+if command -v yazi; then
+ yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml"
+ yazi_shortcuts_tmp="$yazi_shortcuts.tmp"
+else
+ yazi_shortcuts="/dev/null"
+ yazi_shortcuts_tmp="/dev/null"
+fi
command -v ranger && ranger_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/ranger/shortcuts.conf" || ranger_shortcuts="/dev/null"
command -v qutebrowser && qute_shortcuts="$HOME/.qutebrowser/shortcuts.py" || qute_shortcuts="/dev/null"
command -v fish && fish_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/fish/shortcuts.fish" || fish_shortcuts="/dev/null"
@@ -22,7 +28,7 @@ printf "# vim: filetype=sh\\n" >"$fish_shortcuts"
printf "# vim: filetype=sh\\nalias " >"$shell_shortcuts"
printf "# vim: filetype=sh\\n" >"$shell_env_shortcuts"
printf "\" vim: filetype=vim\\n" >"$vifm_shortcuts"
-cp "$HOME/.config/yazi/keymap-default.toml" "$yazi_shortcuts"
+[ -f "$HOME/.config/yazi/keymap-default.toml" ] && cp "$HOME/.config/yazi/keymap-default.toml" "$yazi_shortcuts"
# Format the `directories` file in the correct syntax and sent it to all three configs.
eval "echo \"$(cat "$bmdirs")\"" |
@@ -43,7 +49,7 @@ eval "echo \"$(cat "$bmdirs")\"" |
printf(\"vim.keymap.set('n', '<localleader><localleader>%s', function() require('mini.files').open('%s') end, { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" }
- printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts.tmp\"}"
+ printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts_tmp\"}"
# Format the `files` file in the correct syntax and sent it to both configs.
eval "echo \"$(cat "$bmfiles")\"" |
@@ -66,10 +72,10 @@ eval "echo \"$(cat "$bmfiles")\"" |
printf(\"vim.keymap.set('n', '<localleader><localleader>%s', '<cmd>e %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" }
- printf(\"\\t{ on = [ %s ], run = [ 'reveal %s', 'open' ], desc = \\\"Open %s\\\" },\\n\", key_array, \$2, desc_path) >> \"$yazi_shortcuts.tmp\" }"
+ printf(\"\\t{ on = [ %s ], run = [ 'reveal %s', 'open' ], desc = \\\"Open %s\\\" },\\n\", key_array, \$2, desc_path) >> \"$yazi_shortcuts_tmp\" }"
# Merge bookmarks into keymap-default.toml
-if [ -f "$yazi_shortcuts.tmp" ]; then
+if [ -f "$yazi_shortcuts_tmp" ]; then
# Find the line with the closing bracket in the [mgr] section
line_num=$(grep -n "^]" "$yazi_shortcuts" | head -1 | cut -d: -f1)
@@ -77,11 +83,11 @@ if [ -f "$yazi_shortcuts.tmp" ]; then
head -n $((line_num - 1)) "$yazi_shortcuts" >"$yazi_shortcuts.new"
echo "" >>"$yazi_shortcuts.new"
echo " # Custom bookmarks" >>"$yazi_shortcuts.new"
- cat "$yazi_shortcuts.tmp" >>"$yazi_shortcuts.new"
+ cat "$yazi_shortcuts_tmp" >>"$yazi_shortcuts.new"
echo "]" >>"$yazi_shortcuts.new"
tail -n +$((line_num + 1)) "$yazi_shortcuts" >>"$yazi_shortcuts.new"
# Replace the original file
mv "$yazi_shortcuts.new" "$yazi_shortcuts"
- rm -f "$yazi_shortcuts.tmp"
+ rm -f "$yazi_shortcuts_tmp"
fi