1
0
Fork 0

shortcuts update

This commit is contained in:
Luca Bilke 2022-10-21 17:52:11 +02:00
parent 1f8b09a894
commit 2420c048b2
5 changed files with 55 additions and 9 deletions

View File

@ -182,3 +182,6 @@ map gh
# Kitty Specific
map W $setsid -f $TERMINAL -e lf
# Load bookmark shortcuts
source "~/.config/lf/shortcutrc"

13
.config/lf/shortcutrc Normal file
View File

@ -0,0 +1,13 @@
map gh cd "/home/luca"
map gch cd "/home/luca/.cache"
map gcf cd "/home/luca/.config"
map gdt cd "/home/luca/.local/share"
map grr cd "/home/luca/.local/src"
map gsc cd "/home/luca/.local/bin"
map gmn cd "/mnt"
map gdl cd "/home/luca/Downloads"
map gdm cd "/home/luca/Documents"
map gms cd "/home/luca/Music"
map gpc cd "/home/luca/Pictures"
map gvd cd "/home/luca/Videos"
map gdot cd "/home/luca/.local/share/dotfiles"

View File

@ -0,0 +1,26 @@
cmap ;h /home/luca
cmap ;ch /home/luca/.cache
cmap ;cf /home/luca/.config
cmap ;dt /home/luca/.local/share
cmap ;rr /home/luca/.local/src
cmap ;sc /home/luca/.local/bin
cmap ;mn /mnt
cmap ;dl /home/luca/Downloads
cmap ;dm /home/luca/Documents
cmap ;ms /home/luca/Music
cmap ;pc /home/luca/Pictures
cmap ;vd /home/luca/Videos
cmap ;dot /home/luca/.local/share/dotfiles
cmap ;bf /home/luca/.config/shell/bm-files
cmap ;bd /home/luca/.config/shell/bm-dirs
cmap ;cfx /home/luca/.config/x11/xresources
cmap ;cfX /home/luca/.config/x11/xprofile
cmap ;cfb /home/luca/.local/src/dwmblocks/config.h
cmap ;cfk /home/luca/.config/kitty/kitty.conf
cmap ;cfK /home/luca/.config/kitty/kittyfullscreen.conf
cmap ;cfv /home/luca/.config/lvim/config.lua
cmap ;cfz /home/luca/.config/zsh/.zshrc
cmap ;cfa /home/luca/.config/shell/aliasrc
cmap ;cfp /home/luca/.config/shell/profile
cmap ;cfl /home/luca/.config/lf/lfrc
cmap ;cfL /home/luca/.config/lf/preview

View File

@ -43,9 +43,9 @@ export WEECHAT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/weechat"
export MBSYNCRC="${XDG_CONFIG_HOME:-$HOME/.config}/mbsync/config"
export ELECTRUMDIR="${XDG_DATA_HOME:-$HOME/.local/share}/electrum"
export XCURSOR_PATH="${XDG_DATA_HOME:-$HOME/.local/share}/icons"
export GRADLE_USER_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/gradle"
# Other program settings:
export DICS="/usr/share/stardict/dic/"
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R

View File

@ -3,26 +3,30 @@
bmdirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs"
bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files"
# Output locations. Unactivated progs should go to /dev/null.
# Output locations
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
lf_files="${XDG_DATA_HOME:-$HOME/.local/share}/lf/shortcut-files"
lf_dirs="${XDG_DATA_HOME:-$HOME/.local/share}/lf/shortcut-dirs"
lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc"
vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim"
# Remove, prepare files
rm -f "$shell_shortcuts" "$lf_files" "$lf_dirs" "$zsh_named_dirs" 2>/dev/null
rm -f "$shell_shortcuts" "$lf_files" "$lf_dirs" "$lf_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
# Format the `directories` file in the correct syntax and sent it to all three configs.
eval "echo \"$(cat "$bmdirs")\"" | \
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
eval "echo \"$(cat "$bmdirs")\"" | awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"%s=\42cd %s && tput cuu1;tput el\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
printf(\"%s\n\",\$2) >> \"$lf_dirs\" }"
printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" ;
printf(\"map g%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ;
printf(\"%s\n\",\$2) >> \"$lf_dirs\" }"
# Format the `files` file in the correct syntax and sent it to both configs.
eval "echo \"$(cat "$bmfiles")\"" | \
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
eval "echo \"$(cat "$bmfiles")\"" | awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
printf(\"%s\n\",\$2) >> \"$lf_files\" }"
printf(\"%s\n\",\$2) >> \"$lf_files\" ;
# printf(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ;
printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }"