1. Frank Fischer
  2. evil
  3. Issues
Issue #52 resolved

:r should do read

Anonymous created an issue

:r command will show register content in evil, but in vi it behaves totaly different.

:r is multifunctional command doing either read and append file content or read output from some comment

Comments (8)

  1. Frank Fischer repo owner

    The reason is simply that :read is not implemented in evil (nobody asked for and I never used it). Because :register is the only evil ex command starting with "r", :r executes this one. Therefore your "bug" is essentially a "feature request" for the :read command, am I right?

  2. Anonymous

    Yes you are correct :)

    Is it possible to implement full :read feature (appending file content and reading shell output, like: ":r !ls -la")?

  3. Frank Fischer repo owner

    Well, in theory anything is possible. But some features are hard to implement or may not have a direct Emacs equivalent, e.g., the "alternate file" is something Emacs does not have (afaik). Furthermore several of those "read options" [++opt] may or may not have a straight forward Emacs equivalent (or may not be useful in Emacs anyway, because Emacs usually has its own way to deal with, e.g., file formats, encodings, ...) So, yes, it is possible to read the output of commands as well as of files but the other options may be more tricky.

  4. Anonymous

    Cool; IMHO these two options (append file and slurp command output) could be enough. Honestly, those [++opt] I never used before and never had need for it.

  5. Frank Fischer repo owner

    Add `evil-read' command bound to :read (addresses #52)

    Note that completion of shell-commands does not work, yet. This would require a better completion handling in ex-state, probably not using `completing-read'. Furthermore the placement of point after the command has finished does not correspond to ViM's but is currently unavoidable.

    Wiki macro error: Changeset 325481e4c4dc not found.

  6. Log in to comment