thinca / vim-quickrun

Run commands quickly.
zlib License
769 stars 102 forks source link

How to read user input values ? #174

Closed bpRsh closed 4 years ago

bpRsh commented 6 years ago

Let's say we have a python script to read two numbers from terminal:

#!python
# -*- coding: utf-8 -*-#
"""
Date   : May 23, 2018
"""
# Imports
import sys

print('Please enter two integers, separated by space')
x, y = list(map(int, sys.stdin.readline().split()))

How to run this command in vim-quickrun ?

TornaxO7 commented 4 years ago

You have to use the -input flag. I have this shortcut:

:QuickRun -outputter loclist -hook/tim/enable 1 -input "="

If you want to put something into stdin, than you can add them behind the = like this:

:QuickRun -outputter loclist -hook/tim/enable 1 -input "=First Second Third"

and so on.

For more information type: :h quickrun-options

thinca commented 4 years ago

@TornaxO7 Thank you 😃

@bpRsh Closing. Please reopen if your question is not solved.