I have moved from emacs to vim, so I have decided to port gnull's cfparser to vimscript. The result is here.
As gnull's plugin, cfparser.vim can:
- Submit solutions
- Download tests
- Run solution with sample tests
- Keep your login through cookies
- Open problem statements
- Only dependency is
curl
(andbash
,diff
andgcc
for testing solution)
You can install it with your favorite vim plugin manager, and setup as explained at the project repository:
Auto comment: topic has been updated by gabrielsimoes (previous revision, new revision, compare).
What is a "diff"?
diff
is a linux utility to compare two files. It is included in most linux distros by default. Incfparser.vim
,diff
is used to compare the expected output and the program output.Thanks.
I installed the cfparser.vim plugin. Can you please elaborate on its usage?For eg.What commands to use? When and where should I type the commands(cfi, cfp etc) mentioned in the project repository.I'm a newbie.
First, you have to setup your leader key (http://usevim.com/2012/07/20/vim101-leader/) to use the keybindings (note they start with
<leader>
).Some commands can be used anywhere, such as login, and list submissions. Others may be used while writing your solution.
Suppose you are writing your solution for problem
342D
, name your file or fold hierarchy as mentioned in the repo README, eg:342D.cpp
. Thencfparser.vim
will recognize the problem your dealing with when you run the commands to download tests, test your solution, read problem statement and submit your solution.To run the command that submits your solution, for example, you must be logged in and press the
<leader>
key, followed byc
,f
ands
.I couldn't understand the procedure to setup "leader" key for codeforces :(.
Does your plugin work during off-contest?
I wrote the following lines in my .vimrc file:-
Edit-
I figured out the procedure of setting up the
<leader>
key.are working fine for me.But,
<leader>cfd
shows the following error:-<leader>cfs
shows the following error:-What is going wrong here?Please help.
I think this would be better discussed at the issues page on the github repository.
However, which version of VIM are you using, the function
matchstrpos
should be native, it looks like your VIM version is lacking it.I just fixed the second error, sorry for this. Please update and check if it is working.
You actually don't need to setup the keybindings, they are already configured by the plugin.
EDIT: I tried replacing the function that was missing on the first error, please update and check if it is working.
Now,I'm getting the following error on using
:CFLastSubmissions<CR>
command:-How can it be fixed?
Ansewered you on GitHub, seems an error on CF API.