diff options
Diffstat (limited to 'config/essentials/shell/functions.sh')
-rw-r--r-- | config/essentials/shell/functions.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index 2a21655..d18a188 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -340,13 +340,18 @@ ffconcat () { ffmpeg -y -f concat -safe 0 -i $tmp -c copy "$1" rm $tmp } -nvim_bindings() { "$(tmp="$(mktemp)"; nvim +":set nomore | :redir! > $tmp | :map | :redir END | :q" ; fzf < "$tmp"; rm "$tmp")"; } +nvim_bindings() { + tmp="$(mktemp)" + nvim +":set nomore | :redir! > $tmp | :map | :redir END | :q" > /dev/null + eval "nvim $(fzf < "$tmp" | awk '{print $NF}' | cut -f1 -d'>' | sed 's/:/ +/')" + rm "$tmp" +} prj () { pfx="$HOME/proj" - d="$(find "$pfx" -mindepth 1 -maxdepth 1 -type d | sed "s@$pfx@@" |fzf)" - [ -d "$d" ] || exit 1 - cd "$pfx"/"$d" + d="$(find "$pfx" -mindepth 1 -maxdepth 1 -type d | sed "s@$pfx/@@" |fzf)" + [ -d "$pfx/$d" ] || exit 1 + cd "$pfx/$d" } edit_git_file () { |