Skip to content

Conversation

joshuali925
Copy link

hey i was doing something similar and came up with

ex -sn "${@/#/+}" +'%write! /dev/stdout | quit!' /dev/stdin

I found your project while searching for the 10 commands limit. This PR changes the following and tests passed on my end

  1. use %w! /dev/stdout to preserve tabs, because %p will change tabs to spaces (https://vi.stackexchange.com/a/23203)
  2. merge print and quit commands to save a -c argument
  3. read from /dev/stdin instead of - with tail -n +2 (I assume tail is to get rid of Vim: Reading from stdin...)

@MilesCranmer
Copy link
Owner

Nice!! Thanks so much. Will have a look soon but sounds like a great idea.

Note to self: might be a good idea to run multiple vim commands in succession (automatically splitting them) if number of commands is greater than 10. However it would disable certain things like any registers the user had used in previous commands…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants