Quantcast
Channel: Commands using vi
Viewing all articles
Browse latest Browse all 21

Setup Vim environment for USACO coding

$
0
0
$ 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  |

|            |                |

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

commandlinefu.com

by David Winterbottom (codeinthehole.com)


Viewing all articles
Browse latest Browse all 21

Trending Articles