My build of nnn with minor changes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

fzhist 766 B

il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env sh
  2. # Description: Fuzzy find a command from history, edit in $EDITOR and run as a command
  3. # Currently supports only bash and fish history
  4. #
  5. # Shell: POSIX compliant
  6. # Author: Arun Prakash Jana
  7. shellname="$(basename "$SHELL")"
  8. if [ "$shellname" = "bash" ]; then
  9. hist_file="$HOME/.bash_history"
  10. entry="$(fzy < "$hist_file")"
  11. elif [ "$shellname" = "fish" ]; then
  12. hist_file="$HOME/.config/fish/fish_history"
  13. entry="$(grep "\- cmd: " "$hist_file" | cut -c 8- | fzy)"
  14. fi
  15. if ! [ -z "$entry" ]; then
  16. tmpfile=$(mktemp)
  17. echo "$entry" >> "$tmpfile"
  18. $EDITOR "$tmpfile"
  19. if [ -s "$tmpfile" ]; then
  20. $SHELL -c "$(cat "$tmpfile")"
  21. fi
  22. rm "$tmpfile"
  23. printf "Press any key to exit"
  24. read -r _
  25. fi