Timeline for How to print an option's value to standard output?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 9, 2018 at 13:33 | comment | added | liberforce |
Yeah, I tried running both on Linux + bash (vim 7.4) and Windows + cmd.exe (vim 8.0). vim -e -s myfile < script.vim works on Linux but freezes on Windows. But the 1p was tested on Linux, on Windows I just can't get reading the script from stdin to work, so there may be something I'm doing wrong.
|
|
Jul 9, 2018 at 13:00 | history | edited | Rich | CC BY-SA 4.0 |
Windows quotes and notes
|
Jul 9, 2018 at 12:55 | comment | added | Rich |
@liberforce There's several different environments you can run Vim in on Windows. Are you running in the standard Windows Command Prompt cmd.exe ? Is that what you were using when you wrote your question? I can't get your original command to work at all in cmd.exe , but if it's printing out output from 1p , I'd be surprised if it doesn't print out the output of :set . Might be worth reporting to the Vim developers if that's the case.
|
|
Jul 9, 2018 at 12:40 | vote | accept | liberforce | ||
Jul 9, 2018 at 12:38 | comment | added | Rich |
@liberforce That's because writing the output of set commands to stdout is specifically a feature of silent mode. Reading from a script :h -s is an entirely different mode of operation, which does not have that feature.
|
|
Jul 9, 2018 at 12:37 | comment | added | liberforce |
One of my constraints is to have it run with vim on Windows. This works: vim -e -s -c "set ff?" -c "quit" myfile , i.e one must use double quotes. I couldn't get vim -e -s myfile < script.vim to work.
|
|
Jul 9, 2018 at 12:31 | comment | added | liberforce |
This is strange, set ff? is the first thing I tried, but a that time I had tried it with the syntax vim -s ../script.vim myfile , and in that mode :set ff? doesn't work as intended.
|
|
Jul 9, 2018 at 11:08 | history | edited | Rich | CC BY-SA 4.0 |
edited body
|
Jul 9, 2018 at 11:03 | history | edited | Rich | CC BY-SA 4.0 |
added 358 characters in body
|
Jul 9, 2018 at 10:58 | history | edited | Rich | CC BY-SA 4.0 |
added 358 characters in body
|
Jul 9, 2018 at 10:47 | history | answered | Rich | CC BY-SA 4.0 |