store_api.d.elv 1018 B

12345678910111213141516171819202122232425262728293031323334
  1. #elvdoc:fn command-history
  2. #
  3. # ```elvish
  4. # edit:command-history &cmd-only=$false &dedup=$false &newest-first
  5. # ```
  6. #
  7. # Outputs the command history.
  8. #
  9. # By default, each entry is represented as a map, with an `id` key key for the
  10. # sequence number of the command, and a `cmd` key for the text of the command.
  11. # If `&cmd-only` is `$true`, only the text of each command is output.
  12. #
  13. # All entries are output by default. If `&dedup` is `$true`, only the most
  14. # recent instance of each command (when comparing just the `cmd` key) is
  15. # output.
  16. #
  17. # Commands are are output in oldest to newest order by default. If
  18. # `&newest-first` is `$true` the output is in newest to oldest order instead.
  19. #
  20. # As an example, either of the following extracts the text of the most recent
  21. # command:
  22. #
  23. # ```elvish
  24. # edit:command-history | put [(all)][-1][cmd]
  25. # edit:command-history &cmd-only &newest-first | take 1
  26. # ```
  27. #elvdoc:fn insert-last-word
  28. #
  29. # ```elvish
  30. # edit:insert-last-word
  31. # ```
  32. #
  33. # Inserts the last word of the last command.