Quantcast
Viewing latest article 11
Browse Latest Browse All 21

Setup Vim environment for USACO coding

$ alias viaco='task="$(basename "$(pwd)")"; if [ -f "$task.c" ]; then vi -c "set mouse=n" -c "set autoread" -c "vsplit $task.out" -c "split $task.in" -c "wincmd l" -c "wincmd H" $task.c; fi'

1. Get name of task by task=$(basename "$(pwd)")

2. Check whether "$task.c" exists as a file

3. open "$task.c", "$task.in", "task.out" in vim with such layout.

-------------------------------

|            | $task.in    |

|            |                |

|$task.c  |-----------------|

|            | $task.out  |

|            |                |

-------------------------------

Image may be NSFW.
Clik here to view.
commandlinefu.com

by David Winterbottom (codeinthehole.com)


Viewing latest article 11
Browse Latest Browse All 21

Trending Articles