Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read from stdin and write to stdout to preserve ^I tabs #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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