Skip to content

Commit 61d899c

Browse files
authored
Update README
Line width limited to 80 chars. Remove g:leetcode_categories which is not used any more.
1 parent 95d3cd1 commit 61d899c

File tree

1 file changed

+37
-31
lines changed

1 file changed

+37
-31
lines changed

README.md

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
# leetcode.vim
22

3-
[![asciicast](https://asciinema.org/a/200004.png)](https://asciinema.org/a/200004)
3+
[![asciicast][thumbnail]][asciicast]
44

55
Solve LeetCode problems in Vim!
66

7-
This Vim plugin is inspired by [skygragon/leetcode-cli](https://github.com/skygragon/leetcode-cli).
7+
This Vim plugin is inspired by [skygragon/leetcode-cli][leetcode-cli].
88

99
## Installation
1010

11-
1. Vim with Python3 support is **required**. If you are using Neovim, you probably need to install the Neovim Python API:
12-
```
13-
pip3 install neovim --user
14-
```
15-
2. To install the plugin, you only need to place the following line in your vimrc if you are using vim-plugged (or similar code for other plugin managers):
11+
1. Vim with `+python3` feature is **required**. Install the **pynvim** package
12+
for Neovim:
13+
```sh
14+
pip3 install pynvim --user
1615
```
16+
2. Install the plugin:
17+
```vim
1718
Plug 'ianding1/leetcode.vim'
1819
```
1920

2021
## Quick Start
2122

22-
1. Run `:LeetCodeList` to browse the problems (you may need to enter username and password to sign in, see Customization if you want to skip this step).
23-
2. Press Enter on the line of a problem to open a file to write your solution.
24-
3. Run `:LeetCodeTest` in your solution file to test the solution with a simple test case (you may need to press `ctrl-w z` to close the result window).
25-
4. Run `:LeetCodeSubmit` in your solution file to submit it to LeetCode and receive the result (you may need to press `ctrl-w z` to close the result window).
26-
5. To manually sign in or switch an account, run `:LeetCodeSignIn`.
23+
- `:LeetCodeList`: browse the problems.
24+
- `:LeetCodeTest`: run the code with the default test case.
25+
- `:LeetCodeSubmit`: submit the code.
26+
- `:LeetCodeSignIn`: manually sign in.
2727

28-
Or you can simply put the following lines in your vimrc to bind these commands to shortcuts:
28+
## Key mappings
2929

30-
```
30+
**leetcode.vim** doesn't bind any key mappings by default. Put the following
31+
lines to your **.vimrc** to set up the key mappings.
32+
33+
```vim
3134
nnoremap <leader>ll :LeetCodeList<cr>
3235
nnoremap <leader>lt :LeetCodeTest<cr>
3336
nnoremap <leader>ls :LeetCodeSubmit<cr>
@@ -36,40 +39,43 @@ nnoremap <leader>li :LeetCodeSignIn<cr>
3639

3740
## Customization
3841

39-
### g:leetcode\_solution\_filetype
42+
### `g:leetcode_solution_filetype`
4043

41-
The language that you use to solve the problem. It can be one of the following values: `'cpp'`, `'java'`, `'python'`, `'python3'`, `'csharp'`, `'javascript'`, `'ruby'`, `'swift'`, `'golang'`, `'scala'`, `'kotlin'`, ``'rust'``.
44+
The preferred programming language.
4245

43-
Default value is `'cpp'`.
44-
45-
### g:leetcode\_categories
46+
Values: `'cpp'`, `'java'`, `'python'`, `'python3'`, `'csharp'`, `'javascript'`,
47+
`'ruby'`, `'swift'`, `'golang'`, `'scala'`, `'kotlin'`, ``'rust'``.
4648

47-
The problem categories that you want to browse. It can be a list of the following values: `'algorithms'`, `'database'`, `'shell'`.
48-
49-
Default value is `['algorithms']`.
49+
Default value is `'cpp'`.
5050

51-
### g:leetcode\_username
51+
### `g:leetcode_username`
5252

53-
If you want to automatically login to LeetCode, put your LeetCode username here.
53+
Set to the LeetCode username or email for auto login.
5454

5555
Default value is `''`.
5656

57-
### g:leetcode\_password
57+
### `g:leetcode_password`
5858

59-
If you want to automatically login to LeetCode, put your LeetCode password here.
59+
Set to the LeetCode password for auto login.
6060

61-
WARNING: the password is stored in disk in plain text. So make sure it won't be leaked.
61+
**WARNING: the password is stored in plain text.**
6262

6363
Default value is `''`.
6464

6565
## FAQ
6666

67-
### [PLEASE READ THIS] Why can't I test the problem/submit the problem/list the problems?
67+
### Why can't I test the problem/submit the problem/list the problems?
6868

69-
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.
69+
~~Once you sign in on your browser in LeetCode website, the LeetCode session in
70+
Vim get expired immediatelly. Then you need to sign in again in Vim before
71+
doing other things.~~ (No longer having this problem)
7072

7173
### Why can't I test and submit solutions?
7274

73-
According to issue [#5](https://github.com/ianding1/leetcode.vim/issues/5), **if your email address is not active, you can login and download problems, but you cannot test and submit solutions.**
75+
According to issue [#5][#5], **if the email address is not active, then you can
76+
only login and download problems, but cannot test and submit any code.**
7477

75-
Please check if your email is active if you find that you cannot test and submit.
78+
[thumbnail]: https://asciinema.org/a/200004.png
79+
[asciicast]: https://asciinema.org/a/200004
80+
[leetcode-cli]: https://github.com/skygragon/leetcode-cli
81+
[#5]: https://github.com/ianding1/leetcode.vim/issues/5

0 commit comments

Comments
 (0)