Solve LeetCode problems in Vim!
This Vim plugin is inspired by skygragon/leetcode-cli.
- Vim with
+python3feature is required. Install the pynvim package for Neovim:
pip3 install pynvim --user- Install the plugin:
Plug 'ianding1/leetcode.vim':LeetCodeList: browse the problems.:LeetCodeTest: run the code with the default test case.:LeetCodeSubmit: submit the code.:LeetCodeSignIn: manually sign in.
leetcode.vim doesn't bind any key mappings by default. Put the following lines to your .vimrc to set up the key mappings.
nnoremap <leader>ll :LeetCodeList<cr>
nnoremap <leader>lt :LeetCodeTest<cr>
nnoremap <leader>ls :LeetCodeSubmit<cr>
nnoremap <leader>li :LeetCodeSignIn<cr>The preferred programming language.
Values: 'cpp', 'java', 'python', 'python3', 'csharp', 'javascript',
'ruby', 'swift', 'golang', 'scala', 'kotlin', 'rust'.
Default value is 'cpp'.
Set to the LeetCode username or email for auto login.
Default value is ''.
Set to the LeetCode password for auto login.
WARNING: the password is stored in plain text.
Default value is ''.
Once you sign in on your browser in LeetCode website, the LeetCode session in
Vim get expired immediatelly. Then you need to sign in again in Vim before
doing other things. (No longer having this problem)
According to issue #5, if the email address is not active, then you can only login and download problems, but cannot test and submit any code.
