thinca / vim-quickrun

Run commands quickly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to read user input values ?

bpRsh opened this issue · comments

commented

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 ?

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

@TornaxO7 Thank you 😃

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