-
-
Save koturn/32bc7c679b909b872125 to your computer and use it in GitHub Desktop.
Vim Scriptをコマンドラインで実行して,結果を見たいときのためのシェルスクリプトとバッチファイル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $# -lt 1 ]; then | |
echo 'Invalid arguments' 1>&2 | |
echo '[USAGE]' | |
echo ' vs [FILE]' | |
exit 1 | |
fi | |
for file in $@; do | |
\vim -X -N -u NONE -i NONE -V1 -e --cmd "source $file | qall!" 2>&1 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if "%~1" == "" goto error | |
:LOOPSTART | |
if "%~1" == "" ( | |
goto LOOPEND | |
) | |
for %%i in (%1) do ( | |
if exist %%i ( | |
vim -X -N -u NONE -i NONE -e --cmd "source %%i | qall!" 2>&1 | |
echo. | |
) else ( | |
echo not exist: %%i 2>&1 | |
) | |
) | |
shift | |
goto LOOPSTART | |
:LOOPEND | |
goto END | |
:ERROR | |
echo Invalid arguments 1>&2 | |
echo [USAGE] | |
echo vs [FILE] | |
goto END | |
:END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment