diff options
| author | Mike Vink <ivi@vinkies.net> | 2025-09-10 17:41:37 +0200 |
|---|---|---|
| committer | Mike Vink <ivi@vinkies.net> | 2025-09-10 17:41:37 +0200 |
| commit | bafbb701cb2b01a62933e039946266779159f5a4 (patch) | |
| tree | fdcbbbae788844753e8adae512ee3958da991a9b /.local/bin | |
| parent | b220fc1dd52298a3acc98f157c333e8ee44dcecb (diff) | |
update kak config
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/shortcuts | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 692e95d..b756754 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -9,6 +9,7 @@ shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" shell_env_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc" +yazi_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/yazi/shortcutrc" vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim" qute_shortcuts="/dev/null" fish_shortcuts="/dev/null" @@ -21,9 +22,12 @@ printf "alias " > "$shell_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. eval "echo \"$(cat "$bmdirs"; for i in "$bmdirs_dir"/*; do cat $i; done)\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); - printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; - printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ; - printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; }" + printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; + printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ; + printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; + printf(\"{ on = [\42C\42,\",\$1) > \"$yazi_shortcuts\" ; + for(i = 0; ++i <= length(\$1);) printf(\"\42%s\42,\", substr(\$0, i, 1)) > \"$yazi_shortcuts\" ; + printf(\"\42<Enter>\42], run = \42cd %s\42 },\\\\\n\",\$2) > \"$yazi_shortcuts\" ; }" # " printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; # printf(\"abbr %s \42cd %s; and ls -A\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; # printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; @@ -31,13 +35,14 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); # printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" " -# Format the `files` file in the correct syntax and sent it to both configs. -# eval "echo \"$(cat "$bmfiles")\"" | \ -# awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); -# printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; -# printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" }" -# " printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; -# printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; -# printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; -# printf(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; -# printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }" +sed '/^append_keymap.*\[$/,/^\]$/ { +/^append_keymap.*\[[[:space:]]*/b +/^\]$/b +/.*/d +}' ~/.config/yazi/keymap.toml | sed '/^append_keymap.*\[$/,/^\]$/ { +/^append_keymap.*\[[[:space:]]*/b +/^\]$/c\ +'"$(cat ~/.config/yazi/shortcutrc)"' +] +}' > ~/.config/yazi/keymap.toml.sed +mv ~/.config/yazi/keymap.toml.sed ~/.config/yazi/keymap.toml |
