Created
July 12, 2017 20:38
-
-
Save shollingsworth/6213cbd96d024757e4c7362286944d59 to your computer and use it in GitHub Desktop.
my vimrc script editing environment wrappers
This file contains 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
autocmd FileType * exe('let comp_cmd="!~/.vim/bin/build_' . &filetype . '.sh ' . expand("%:p") . '"') | |
autocmd FileType * exe('let run_cmd="!~/.vim/bin/build_' . &filetype . '.sh ' . expand("%:p") . ' \|less -cN"') | |
map z :exec comp_cmd<enter><enter> | |
map R :exec run_cmd<enter><enter> |
This file contains 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/bash | |
export PYTHONDONTWRITEBYTECODE=1 | |
file=$(readlink -e $1) | |
test -x "${file}" || chmod +x "${file}" | |
if grep '#!.*python3' ${file}; then | |
#-B is to disable bycode / pyc files | |
pver="python3 -B" | |
else | |
pver="python -B" | |
fi | |
if python -m py_compile ${file} &>/dev/stdout; then | |
echo "Executing" | |
echo "BEGIN OUTPUT" | |
${pver} ${file} &>/dev/stdout | |
echo "END OUTPUT" | |
else | |
echo "Error executing" | |
fi |
This file contains 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/bash | |
file=$(readlink -e $1) | |
if [[ ! -x ${file} ]]; then | |
chmod +x ${file} | |
echo "Making File Executable ${file}" | |
fi | |
echo "Executing" | |
echo "BEGIN" | |
${file} &> /dev/stdout | |
echo "END" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment